From: Kevin Day Date: Thu, 28 Feb 2013 19:39:14 +0000 (-0600) Subject: Bugfix: don't perform multiple identical installs for an individual install X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=68b4d1ff38db595a1ac1458156e27b8ffe84170c;p=kit-legacy Bugfix: don't perform multiple identical installs for an individual install When calling kit_package_individual() with the W-H-O arguments, the 'O' part may end up being called multiple times. This happens because some packages, like linux.package, define multiple 'H' parts. For example, the linux.package defines the following: 'W' = runtime 'W' = runtime 'W' = runtime 'H' = kernel 'H' = modules 'H' = firmware 'O' = main 'O' = main 'O' = main The 'main' would get called 3 times. This means that "kit install linux" compiles and installs linux 3 times in a row. The solution is to remember if an existing 'O' has been processed and skipping already processed 'O's. --- diff --git a/sources/sh/kit-package b/sources/sh/kit-package index 20a1b11..59f7a61 100755 --- a/sources/sh/kit-package +++ b/sources/sh/kit-package @@ -637,6 +637,7 @@ kit_package() { local p1= local p2= local p3= + local processed= kit_log_section @@ -795,6 +796,7 @@ kit_package() { return fi + processed= # operate on individual package parts (what + huh + oh) for w in $package_what ; do @@ -806,9 +808,12 @@ kit_package() { p2=$(fss_extended_write -p -s "$h" | sed -e 's|[[:space:]]*$||') p3=$(fss_extended_write -p -s "$o" | sed -e 's|[[:space:]]*$||') - if [[ ! -f "$resume_path$resume_file" || $(fss_basic_read -n processed $resume_path$resume_file | grep -s -o "^[[:space:]]*$p1[[:space:]]*$p2[[:space:]]*$p3[[:space:]]*$") == "" ]] ; then - kit_package_individual $w $h $o - echo "$(fss_extended_write -s processed)$p1 $p2 $p3" >> "$resume_path$resume_file" + if [[ $(echo $processed | grep -s -i "\<$o\>") == "" ]] ; then + if [[ ! -f "$resume_path$resume_file" || $(fss_basic_read -n processed $resume_path$resume_file | grep -s -o "^[[:space:]]*$p1[[:space:]]*$p2[[:space:]]*$p3[[:space:]]*$") == "" ]] ; then + kit_package_individual $w $h $o + echo "$(fss_extended_write -s processed)$p1 $p2 $p3" >> "$resume_path$resume_file" + processed="${processed}$o " + fi fi let c++