DragonFly BSD
DragonFly submit List (threaded) for 2004-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

mergemaster "de-perl"ify patch


From: Dheeraj Reddy <dheerajr@xxxxxxxxxxx>
Date: 14 Mar 2004 01:33:23 -0500

Straight lift off freebsd

--- src/usr.sbin/mergemaster/mergemaster.sh	Sun Mar 14 02:30:11 2004
+++ src/usr.sbin/mergemaster/mergemaster.sh.orig	Tue Dec 16 15:03:51 2003
@@ -670,10 +670,10 @@
 
 # 4095 = "obase=10;ibase=8;07777" | bc
 find_mode () {
-  local OCTAL
-  OCTAL=$(( ~$(echo "obase=10;ibase=8; ${CONFIRMED_UMASK}" | bc) & 4095 &
-          $(echo "obase=10; ibase=8; $(stat -f "%OMp%OLp" ${1})" | bc) ))
-  printf "%04o\n" ${OCTAL}
+local OCTAL
+  OCTAL=`perl -e 'printf "%04o\n", (((stat("$ARGV[0]"))[2] & 07777) &~ \
+    oct("$ARGV[1]"))' "${1}" "${CONFIRMED_UMASK}"`
+  echo "${OCTAL}"
 }
 
 mm_install () {
-- 
dheeraj


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]