Stuart Henderson <[email protected]> wrote:
> Ah, perhaps the change to disk behaviour wasn't reflected in calculations
> then..
I got it figured out.
In the checkfs function, the 'eval $(stat...)' command stores a list of disk
devices and creates a variable named for each device to store the size of the
files in the patch to be installed there. It uses :+ to accumulate the sizes of
multiple files. But since ksh creates variales as global by default, these are
not cleared between patches and :+ takes an existing value if the variable
already
exists. So the value stored in these variables will continue to accumulate.
A simple solution seems to be to mark these variables local. Ksh will clean
them
up between calls to checkfs.
Tim.
Index: syspatch.sh
===================================================================
RCS file: /cvs/src/usr.sbin/syspatch/syspatch.sh,v
retrieving revision 1.120
diff -u -p -r1.120 syspatch.sh
--- syspatch.sh 2 Aug 2017 05:58:29 -0000 1.120
+++ syspatch.sh 3 Aug 2017 21:59:13 -0000
@@ -91,7 +91,7 @@ checkfs()
# - nonexistent files (i.e. syspatch is installing new files)
# - broken interpolation due to bogus devices like remote filesystems
eval $(cd / &&
- stat -qf "_dev=\"\${_dev} %Sd\" %Sd=\"\${%Sd:+\${%Sd}\+}%Uz\"" \
+ stat -qf "_dev=\"\${_dev} %Sd\"; local
%Sd=\"\${%Sd:+\${%Sd}\+}%Uz\"" \
${_files}) 2>/dev/null || _ret=$?
set -e
[[ ${_ret} == 127 ]] && sp_err "Remote filesystem, aborting"