Bladeren bron

fix determination of building user/group (think about Solaris and su)

Ralf S. Engelschall 24 jaren geleden
bovenliggende
commit
fda7fd703d
1 gewijzigde bestanden met toevoegingen van 3 en 9 verwijderingen
  1. 3 9
      inn/inn.spec

+ 3 - 9
inn/inn.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [REL]
 Group:        News
 License:      ISC
 Version:      2.3.3
-Release:      20020508
+Release:      20020611
 
 #   list of sources
 Source0:      ftp://ftp.isc.org/isc/inn/inn-%{version}.tar.gz
@@ -121,14 +121,8 @@ AutoReqProv:  no
     cd inn-%{version}
 
     #   determine current user and group
-    thisuser=`(id -un) 2>/dev/null ||\
-              (whoami) 2>/dev/null ||\
-              (who am i | cut "-d " -f1) 2>/dev/null ||\
-              echo $LOGNAME`
-    thisgroup=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
-               grep "^${thisuser}:" | awk -F: '{ print $4; }' | head -1`
-    thisgroup=`(cat /etc/group; ypcat group) 2>/dev/null |\
-               grep ":${thisgroup}:" | awk -F: '{ print $1; }' | head -1`
+    thisuser=`%{l_shtool} echo -e '%u'`
+    thisgroup=`%{l_shtool} echo -e '%g'`
     if [ ".$thisgroup" = . ]; then
         thisgroup="$thisuser"
     fi