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.
local p1=
local p2=
local p3=
+ local processed=
kit_log_section
return
fi
+ processed=
# operate on individual package parts (what + huh + oh)
for w in $package_what ; do
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++