Fix detection of the volatile flag when other flags are present.

Otherwise flags fields like "volatile,ignore-other" will be ignored
by the Debian and BSD back ends.
This commit is contained in:
Todd C. Miller
2021-05-03 13:51:21 -06:00
parent 51cbc626f8
commit b5542f8b26

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright 2021 One Identity LLC. ALL RIGHTS RESERVED # Copyright 2021 One Identity LLC. ALL RIGHTS RESERVED
pp_revision="20210310" pp_revision="20210503"
# Copyright 2018 One Identity LLC. ALL RIGHTS RESERVED. # Copyright 2018 One Identity LLC. ALL RIGHTS RESERVED.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -4203,13 +4203,15 @@ pp_deb_make_data() {
case "$t" in case "$t" in
f) # Files f) # Files
pp_deb_fakeroot install -D -o $o -g $g -m ${m} $pp_destdir/$p $data/$p; pp_deb_fakeroot install -D -o $o -g $g -m ${m} $pp_destdir/$p $data/$p;
if [ x"$f" = x"v" ] case "$f" in
then *v*)
# File marked as "volatile". Assume this means it's a conffile # File marked as "volatile". Assume this means it's a conffile
# TODO: check this as admins like modified conffiles to be left # TODO: check this as admins like modified conffiles to be left
# behind # behind
echo "$p" >> $pp_wrkdir/%conffiles.$cmp echo "$p" >> $pp_wrkdir/%conffiles.$cmp
fi;; ;;
esac
;;
d) # Directories d) # Directories
pp_deb_fakeroot install -m ${m} -o $o -g $g -d $data/$p;; pp_deb_fakeroot install -m ${m} -o $o -g $g -d $data/$p;;
@@ -4222,7 +4224,7 @@ pp_deb_make_data() {
# the debian policy of relative links when in the same top-level # the debian policy of relative links when in the same top-level
# directory # directory
(cd $data; ln -sf $st $rel_p);; (cd $data; ln -sf $st $rel_p);;
*) pp_error "Unsupported data file type: $t";; *) pp_error "Unsupported data file type: $t";;
esac esac
done done
@@ -8172,20 +8174,24 @@ pp_bsd_make_data() {
path=$p path=$p
case "$t" in case "$t" in
f) # Files f) # Files
# For now just skip the file if it is volatile, we will need to remove it in the pre uninstall script case "$f" in
if [ x"$f" != x"v" ]; then *v*)
# If the directory doesn't exist where we are going to copy this file, then create it first # For now just skip the file if it is volatile, we
if [ ! -d `dirname "$datadir$path"` ]; then # will need to remove it in the pre uninstall script
pp_debug "creating directory `dirname "$datadir$path"`" pp_warn "file $path was marked as volatile, skipping"
mkdir -p `dirname "$datadir$path"` ;;
fi *)
# If the directory doesn't exist where we are going to copy this file, then create it first
if [ ! -d `dirname "$datadir$path"` ]; then
pp_debug "creating directory `dirname "$datadir$path"`"
mkdir -p `dirname "$datadir$path"`
fi
pp_debug "install -D $datadir -o $o -g $g -h sha256 -m ${m} -v $pp_destdir$p $datadir$path"; pp_debug "install -D $datadir -o $o -g $g -h sha256 -m ${m} -v $pp_destdir$p $datadir$path"
pp_bsd_fakeroot install -D $datadir -o $o -g $g -h sha256 -m ${m} -v $pp_destdir$p $datadir$path; pp_bsd_fakeroot install -D $datadir -o $o -g $g -h sha256 -m ${m} -v $pp_destdir$p $datadir$path
echo " \"$path\": \"-\", \"$path\": {uname: $o, gname: $g, perm: ${m}}" >> $outfilelist; echo " \"$path\": \"-\", \"$path\": {uname: $o, gname: $g, perm: ${m}}" >> $outfilelist
else ;;
pp_warn "file $f was marked as volatile, skipping" esac
fi;
;; ;;
d) # Directories d) # Directories
pp_debug "install -D $datadir -o $o -g $g -m ${m} -d -v $datadir$path"; pp_debug "install -D $datadir -o $o -g $g -m ${m} -d -v $datadir$path";