From 988b9ab95fbcdb471afe7da620d9912796d90a95 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Sat, 7 May 2011 06:34:07 -0500 Subject: [PATCH] script/gentree: clean up custom config applicator to ignore missing cpios --- script/gentree | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/script/gentree b/script/gentree index 000a2fa..ecda937 100755 --- a/script/gentree +++ b/script/gentree @@ -275,20 +275,23 @@ do_imgall() { do_custom() { log Patch in custom config - ( cd "${cnfd}" && find . | egrep -v '^\./.*\.md_size$' | cpio -p --link "${sconf}/default" ) || chk + ( cd "${cnfd}" && find . -name '*.md_size' -o -print | cpio -p --link "${sconf}/default" ) || chk # Make sure files in default are newer than the tagfile, so they will be caught by saveconfig find "${sconf}/default" -type f -print0 | xargs -0 touch # If there are scavenged cpio.gz confpacks, touch their contents as well. chk mkdir -p "${tree}/pack" - chk rm -Rf "${tree}/pack"/* - for file in "${sconf}/default"/*.cpio.gz - do - pack="$(basename "${file%%.cpio.gz}")" - zcat "${file}" | ( cd "${tree}/pack"; cpio -id ) || chk - find "${tree}/pack" -type f -print0 | xargs -0 touch - ( cd "${tree}/pack"; find . | cpio -o ) | gzip -9 > "${file}" + if ls -1 "${sconf}/default" | grep -q '.cpio.gz' + then chk rm -Rf "${tree}/pack"/* - done + for file in "${sconf}/default"/*.cpio.gz + do + pack="$(basename "${file%%.cpio.gz}")" + zcat "${file}" | ( cd "${tree}/pack"; cpio -id ) || chk + find "${tree}/pack" -type f -print0 | xargs -0 touch + ( cd "${tree}/pack"; find . | cpio -o ) | gzip -9 > "${file}" + chk rm -Rf "${tree}/pack"/* + done + fi } for step in ${sequence} -- 2.42.0