Przeglądaj źródła

simplify sort and tmpdir hacking; fix su(1) usage under non-Linux systems

Ralf S. Engelschall 21 lat temu
rodzic
commit
918d334b44
3 zmienionych plików z 45 dodań i 5 usunięć
  1. 39 0
      findutils/findutils.patch
  2. 5 5
      findutils/findutils.spec
  3. 1 0
      findutils/rc.findutils

+ 39 - 0
findutils/findutils.patch

@@ -0,0 +1,39 @@
+Index: locate/updatedb.sh
+--- locate/updatedb.sh.orig	2005-02-11 08:51:54 +0100
++++ locate/updatedb.sh	2005-02-11 08:52:57 +0100
+@@ -166,7 +166,7 @@
+ if test -n "$SEARCHPATHS"; then
+   if [ "$LOCALUSER" != "" ]; then
+     # : A1
+-    su $LOCALUSER -s $SHELL -c \
++    su $LOCALUSER -c \
+     "$find $SEARCHPATHS $FINDOPTIONS \
+      \\( $prunefs_exp \
+      -type d -regex '$PRUNEREGEX' \\) -prune -o $print_option"
+@@ -182,7 +182,7 @@
+ myuid=`getuid` 
+ if [ "$myuid" = 0 ]; then
+     # : A3
+-    su $NETUSER -s $SHELL -c \
++    su $NETUSER -c \
+      "$find $NETPATHS $FINDOPTIONS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o $print_option" ||
+     exit $?
+   else
+@@ -236,7 +236,7 @@
+ if test -n "$SEARCHPATHS"; then
+   if [ "$LOCALUSER" != "" ]; then
+     # : A5
+-    su $LOCALUSER -s $SHELL -c \
++    su $LOCALUSER -c \
+     "$find $SEARCHPATHS $FINDOPTIONS \
+      \( $prunefs_exp \
+      -type d -regex '$PRUNEREGEX' \) -prune -o $print_option" || exit $?
+@@ -252,7 +252,7 @@
+   myuid=`getuid`
+   if [ "$myuid" = 0 ]; then
+     # : A7
+-    su $NETUSER -s $SHELL -c \
++    su $NETUSER -c \
+      "$find $NETPATHS $FINDOPTIONS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o $print_option" ||
+     exit $?
+   else

+ 5 - 5
findutils/findutils.spec

@@ -34,11 +34,12 @@ Class:        BASE
 Group:        Utility
 License:      GPL
 Version:      4.2.17
-Release:      20050208
+Release:      20050211
 
 #   list of sources
 Source0:      ftp://alpha.gnu.org/gnu/findutils/findutils-%{version}.tar.gz
 Source1:      rc.findutils
+Patch0:       findutils.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -60,9 +61,7 @@ AutoReqProv:  no
 
 %prep
     %setup -q
-    %{l_shtool} subst \
-        -e 's;| sort ;| %{l_prefix}/bin/gsort -T `%{l_rc} --query findutils_tmpdir` ;g' \
-        locate/updatedb.sh
+    %patch -p0
 
 %build
     CC="%{l_cc}"
@@ -71,7 +70,8 @@ AutoReqProv:  no
     case "%{l_platform -t}" in
         *-freebsd* ) CPPFLAGS="-DHAVE_F_FSTYPENAME_IN_STATFS" ;;
     esac
-    export CC CFLAGS CPPFLAGS
+    SORT="%{l_prefix}/bin/gsort"
+    export CC CFLAGS CPPFLAGS SORT
     ./configure \
         --prefix=%{l_prefix} \
         --libexecdir=%{l_prefix}/libexec/findutils \

+ 1 - 0
findutils/rc.findutils

@@ -15,6 +15,7 @@
 
 %daily -u @l_susr@
     rcService findutils enable yes || exit 0
+    TMPDIR="$findutils_tmpdir" \
     @l_prefix@/bin/updatedb \
         --localpaths="${findutils_localpaths}" \
         --netpaths="${findutils_netpaths}" \