Avoid force/rebuild of squashfs images if already updated.
Check if there are any modification of files/directories inside the target directory for squashfs image. Implements in some way this item in TODO: * Add 'needsupdate' function to check if a squashfs image in the iso dir is up to date, if so, skip it; else rebuild it. No more need for the -f flag Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
3f1ee07d84
commit
f32a5c5b20
@ -159,13 +159,13 @@ _mksquash () {
|
|||||||
sqimg="${work_dir}/iso/$(basename ${1}).sqfs"
|
sqimg="${work_dir}/iso/$(basename ${1}).sqfs"
|
||||||
echo "====> Generating SquashFS image for '${1}'"
|
echo "====> Generating SquashFS image for '${1}'"
|
||||||
if [ -e "${sqimg}" ]; then
|
if [ -e "${sqimg}" ]; then
|
||||||
if [ "${FORCE}" = "y" ]; then
|
dirhaschanged=$(find ${1} -newer ${sqimg})
|
||||||
echo -n "Removing old SquashFS image..."
|
if [ "${dirhaschanged}" != "" ]; then
|
||||||
|
echo "SquashFS image '${sqimg}' is not up to date, rebuilding..."
|
||||||
rm "${sqimg}"
|
rm "${sqimg}"
|
||||||
echo "done."
|
|
||||||
else
|
else
|
||||||
echo "error: SquashFS image '${sqimg}' already exists, aborting."
|
echo "SquashFS image '${sqimg}' is up to date, skipping."
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user