summaryrefslogtreecommitdiffstats
path: root/bin/etc-update
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-03-01 22:07:25 +0000
committerZac Medico <zmedico@gentoo.org>2007-03-01 22:07:25 +0000
commit21ee05ad60cc90fdae20c1492252bd32fe90a090 (patch)
treeef0b1e967a886338fa012b7c49ef7962bd5e9ee1 /bin/etc-update
parentdf370f634d8a2deec3a1650b1a8aa267fde25849 (diff)
downloadportage-21ee05ad60cc90fdae20c1492252bd32fe90a090.tar.gz
portage-21ee05ad60cc90fdae20c1492252bd32fe90a090.tar.bz2
portage-21ee05ad60cc90fdae20c1492252bd32fe90a090.zip
Add compatibility code to avoid the GNU specific --reference option of chmod. Thanks to Timothy Redaelli <drizzt@gentoo.org>. (trunk r6114:6115)
svn path=/main/branches/2.1.2/; revision=6116
Diffstat (limited to 'bin/etc-update')
-rwxr-xr-xbin/etc-update8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 858a6b98c..c1569ff12 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -386,7 +386,11 @@ Please select from the menu above (-1 to exit, losing this merge): "
my_input=$(read_int)
case ${my_input} in
1) echo "Replacing ${ofile} with ${mfile}"
- chmod --reference=${ofile} ${mfile}
+ if [[ ${USERLAND} == GNU ]]; then
+ chmod --reference="${ofile}" "${mfile}"
+ else
+ chmod $(stat -f %Mp%Lp "${ofile}") "${mfile}"
+ fi
mv ${mv_opts} ${mfile} ${ofile}
rm ${rm_opts} ${file}
return 255
@@ -437,7 +441,7 @@ trap die term
eval $(/usr/lib/portage/bin/portageq envvar -v CONFIG_PROTECT \
- CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT)
+ CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT USERLAND)
export PORTAGE_TMPDIR
[ -w ${PORTAGE_CONFIGROOT}etc ] || die "Need write access to ${PORTAGE_CONFIGROOT}etc" 1