summaryrefslogtreecommitdiff
path: root/ucf
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2007-04-17 23:45:05 +0000
committerManoj Srivastava <srivasta@debian.org>2007-04-17 23:45:05 +0000
commite07f22d0072e7d6ab04846d3d80aa3b36436db1c (patch)
treef48bc492b93923b6675cac75302a6d2f1dfb6f91 /ucf
parentd26af1fcd89fd76f3c69df146d6ee728fa4518d7 (diff)
Preserve file ownership and permissions
* ucf: As far as possible, preserve file attributes like ownership and permission by using cp -pf instead of just cp -f. * ucf.1: Document that ucf now tries to preserve owner/permission bits for the file. * ucfq.1: Typo fix postinst-->postrm * examples/postrm: Now ucf creates .ucf-new, .ucf-old, and .ucf-dist suffixes, so the example is updated to clean the new names. git-archimport-id: srivasta@debian.org--lenny/ucf--devel--2.0--patch-1
Diffstat (limited to 'ucf')
-rwxr-xr-xucf34
1 files changed, 17 insertions, 17 deletions
diff --git a/ucf b/ucf
index f73223b..e0b3ee2 100755
--- a/ucf
+++ b/ucf
@@ -186,19 +186,19 @@ purge_md5sum () {
for i in $(/usr/bin/seq 6 -1 0); do
if [ -e "${statedir}/hashfile.${i}" ]; then
if [ "X$docmd" = "XYES" ]; then
- cp -f "${statedir}/hashfile.${i}" \
+ cp -pf "${statedir}/hashfile.${i}" \
"${statedir}/hashfile.$(($i+1))"
else
- echo cp -f "${statedir}/hashfile.${i}" \
+ echo cp -pf "${statedir}/hashfile.${i}" \
"${statedir}/hashfile.$(($i+1))"
fi
fi
done
if [ -e "$statedir/hashfile" ]; then
if [ "X$docmd" = "XYES" ]; then
- cp -f "$statedir/hashfile" "$statedir/hashfile.0"
+ cp -pf "$statedir/hashfile" "$statedir/hashfile.0"
else
- echo cp -f "$statedir/hashfile" "$statedir/hashfile.0"
+ echo cp -pf "$statedir/hashfile" "$statedir/hashfile.0"
fi
if [ "X$docmd" = "XYES" ]; then
set +e
@@ -228,19 +228,19 @@ replace_md5sum () {
for i in $(/usr/bin/seq 6 -1 0); do
if [ -e "${statedir}/hashfile.${i}" ]; then
if [ "X$docmd" = "XYES" ]; then
- cp -f "${statedir}/hashfile.${i}" \
+ cp -pf "${statedir}/hashfile.${i}" \
"${statedir}/hashfile.$(($i+1))"
else
- echo cp -f "${statedir}/hashfile.${i}" \
+ echo cp -pf "${statedir}/hashfile.${i}" \
"${statedir}/hashfile.$(($i+1))"
fi
fi
done
if [ -e "$statedir/hashfile" ]; then
if [ "X$docmd" = "XYES" ]; then
- cp -f "$statedir/hashfile" "$statedir/hashfile.0"
+ cp -pf "$statedir/hashfile" "$statedir/hashfile.0"
else
- echo cp -f "$statedir/hashfile" "$statedir/hashfile.0"
+ echo cp -pf "$statedir/hashfile" "$statedir/hashfile.0"
fi
if [ "X$docmd" = "XYES" ]; then
set +e
@@ -270,9 +270,9 @@ replace_md5sum () {
fi
fi
if [ "X$THREEWAY" != "X" ]; then
- $action cp -f "$orig_new_file" "$statedir/cache/$cached_file"
+ $action cp -pf "$orig_new_file" "$statedir/cache/$cached_file"
fi
- # cp -f "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
+ # cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
}
replace_conf_file () {
@@ -294,10 +294,10 @@ replace_conf_file () {
echo >&2 "Not saving ${real_file}, since it was unmodified"
fi
else
- $action cp -f "${real_file}" "${real_file}.${OLD_SUFFIX}"
+ $action cp -pf "${real_file}" "${real_file}.${OLD_SUFFIX}"
fi
fi
- $action cp -f "$new_file" "${real_file}"
+ $action cp -pf "$new_file" "${real_file}"
replace_md5sum;
}
@@ -636,7 +636,7 @@ if [ -e "$dest_file" ]; then
exit 0;
else
replace_md5sum;
- cp -f "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
+ cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
exit 0;
fi
fi
@@ -654,7 +654,7 @@ if [ -e "$dest_file" ]; then
exit 0;
else
replace_md5sum;
- cp -f "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
+ cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
exit 0;
fi
fi
@@ -775,7 +775,7 @@ if [ "$destsum" = "$lastsum" ]; then
exit 0;
else
replace_md5sum;
- cp -f "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
+ cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
exit 0;
fi
else
@@ -789,7 +789,7 @@ else
fi
if [ "X$force_conffold" != "X" ]; then
replace_md5sum;
- cp -f "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
+ cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
exit 0;
fi
# c: If the destination file is the same as the new maintianer provided one,
@@ -955,7 +955,7 @@ EOPEND
$choice_keep_current|n|N|o|O|'')
replace_md5sum;
- cp -f "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
+ cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"
exit 0;
;;
*)