OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src openpkg-web Date: 22-Feb-2003 13:46:02
Branch: HEAD Handle: 2003022212455803
Modified files:
openpkg-src/openpkg aux.usrgrp.sh aux.wrapsrc.sh openpkg.spec shtool
openpkg-web news.txt
Log:
add Solaris/Linux 'getent' based support for passwd/group fiddling,
too.
Summary:
Revision Changes Path
1.6 +10 -10 openpkg-src/openpkg/aux.usrgrp.sh
1.6 +2 -2 openpkg-src/openpkg/aux.wrapsrc.sh
1.136 +10 -10 openpkg-src/openpkg/openpkg.spec
1.7 +27 -14 openpkg-src/openpkg/shtool
1.3408 +1 -0 openpkg-web/news.txt
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/aux.usrgrp.sh
============================================================================
$ cvs diff -u -r1.5 -r1.6 aux.usrgrp.sh
--- openpkg-src/openpkg/aux.usrgrp.sh 21 Feb 2003 19:44:46 -0000 1.5
+++ openpkg-src/openpkg/aux.usrgrp.sh 22 Feb 2003 12:46:00 -0000 1.6
@@ -68,10 +68,10 @@
(who am i | cut "-d " -f1) 2>/dev/null ||\
echo $LOGNAME`
cgid=`(id -g $cusr) 2>/dev/null ||\
- ((cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ ((getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${cusr}:" | sed -n -e '1p' | awk -F: '{ print $4; }')`
cgrp=`(id -gn $cusr) 2>/dev/null ||\
- ((cat /etc/group; ypcat group) 2>/dev/null |\
+ ((getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep ":${cgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }')`
[ ".$cgrp" = . ] && cgrp="$cusr"
@@ -82,10 +82,10 @@
if [ ".$sgrp" = . ]; then
sgrp=`(id -gn $susr) 2>/dev/null`
if [ ".$sgrp" = . ]; then
- sgid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ sgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${susr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
if [ ".$sgid" != . ]; then
- sgrp=`(cat /etc/group; ypcat group) 2>/dev/null |\
+ sgrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep ":${sgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
fi
if [ ".$sgrp" = . ]; then
@@ -104,10 +104,10 @@
if [ ".$mgrp" = . ]; then
mgrp=`(id -gn $musr) 2>/dev/null`
if [ ".$mgrp" = . ]; then
- mgid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ mgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${musr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
if [ ".$mgid" != . ]; then
- mgrp=`(cat /etc/group; ypcat group) 2>/dev/null |\
+ mgrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep ":${mgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
fi
if [ ".$mgrp" = . ]; then
@@ -129,10 +129,10 @@
if [ ".$rgrp" = . ]; then
rgrp=`(id -gn $rusr) 2>/dev/null`
if [ ".$rgrp" = . ]; then
- rgid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ rgid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${rusr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
if [ ".$rgid" != . ]; then
- rgrp=`(cat /etc/group; ypcat group) 2>/dev/null |\
+ rgrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep ":${rgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
fi
if [ ".$rgrp" = . ]; then
@@ -154,10 +154,10 @@
if [ ".$ngrp" = . ]; then
ngrp=`(id -gn $nusr) 2>/dev/null`
if [ ".$ngrp" = . ]; then
- ngid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ ngid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${nusr}:" | sed -n -e '1p' | awk -F: '{ print $4; }'`
if [ ".$ngid" != . ]; then
- ngrp=`(cat /etc/group; ypcat group) 2>/dev/null |\
+ ngrp=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep ":${ngid}:" | sed -n -e '1p' | awk -F: '{ print $1; }'`
fi
if [ ".$ngrp" = . ]; then
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/aux.wrapsrc.sh
============================================================================
$ cvs diff -u -r1.5 -r1.6 aux.wrapsrc.sh
--- openpkg-src/openpkg/aux.wrapsrc.sh 21 Feb 2003 19:44:46 -0000 1.5
+++ openpkg-src/openpkg/aux.wrapsrc.sh 22 Feb 2003 12:46:00 -0000 1.6
@@ -67,10 +67,10 @@
(who am i | cut "-d " -f1) 2>/dev/null ||\
echo $LOGNAME`
cgid=`(id -g $cusr) 2>/dev/null ||\
- ((cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ ((getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${cusr}:" | sed -n -e '1p' | awk -F: '{ print $4; }')`
cgrp=`(id -gn $cusr) 2>/dev/null ||\
- ((cat /etc/group; ypcat group) 2>/dev/null |\
+ ((getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep ":${cgid}:" | sed -n -e '1p' | awk -F: '{ print $1; }')`
if [ ".$cgrp" = . ]; then
cgrp="$cusr"
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/openpkg.spec
============================================================================
$ cvs diff -u -r1.135 -r1.136 openpkg.spec
--- openpkg-src/openpkg/openpkg.spec 21 Feb 2003 19:44:46 -0000 1.135
+++ openpkg-src/openpkg/openpkg.spec 22 Feb 2003 12:46:00 -0000 1.136
@@ -39,8 +39,8 @@
# o any cc(1)
# the package version and release
-%define V_openpkg 20030221
-%define R_openpkg 20030221
+%define V_openpkg 20030222
+%define R_openpkg 20030222
# the used software versions
%define V_rpm 4.0.2
@@ -881,7 +881,7 @@
eval "xuid=\"\$${class}uid\""
eval "xgid=\"\$${class}gid\""
if [ ".$xuid" = . ]; then
- xuid=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |\
+ xuid=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null |\
grep "^${xusr}:" | awk -F: '{ print $3; }'`
if [ ".$xuid" = . ]; then
# seek for a reasonably uid/gid pair
@@ -890,11 +890,11 @@
while [ ".$ok" = .0 ]; do
eval "u_exists=\$u_exists_$xuid"
if [ ".$u_exists" = . ]; then
- u_exists=`(cat /etc/passwd; ypcat passwd) 2>/dev/null |
grep "^[^:]*:[^:]*:$xuid:"`
+ u_exists=`(getent passwd; cat /etc/passwd; ypcat passwd)
2>/dev/null | grep "^[^:]*:[^:]*:$xuid:"`
fi
eval "g_exists=\$g_exists_$xuid"
if [ ".$g_exists" = . ]; then
- g_exists=`(cat /etc/group; ypcat group) 2>/dev/null |
grep "^[^:]*:[^:]*:$xuid:"`
+ g_exists=`(getent group; cat /etc/group; ypcat group)
2>/dev/null | grep "^[^:]*:[^:]*:$xuid:"`
fi
if [ ".$u_exists" = . -a ".$g_exists" = . ]; then
ok=1
@@ -907,7 +907,7 @@
fi
fi
if [ ".$xgid" = . ]; then
- xgid=`(cat /etc/group; ypcat group) 2>/dev/null |\
+ xgid=`(getent group; cat /etc/group; ypcat group) 2>/dev/null |\
grep "^${xgrp}:" | awk -F: '{ print $3; }'`
if [ ".$xgid" = . ]; then
xgid="$xuid"
@@ -944,7 +944,7 @@
class="$1"; usr="$2"; uid="$3"; grp="$4"; gid="$5"
# check whether user already exists
- exists=`(cat /etc/passwd; ypcat passwd) 2>/dev/null | grep "^$usr:"`
+ exists=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null | grep
"^$usr:"`
if [ ".$exists" = . ]; then
if [ ".$cusr" != ".root" ]; then
echo "openpkg:WARNING: skipping creation of OpenPKG $class user
$usr" 1>&2
@@ -987,7 +987,7 @@
fi
# check whether group already exists
- exists=`(cat /etc/group; ypcat group) 2>/dev/null | grep "^$grp:"`
+ exists=`(getent group; cat /etc/group; ypcat group) 2>/dev/null | grep
"^$grp:"`
if [ ".$exists" = . ]; then
if [ ".$cusr" != ".root" ]; then
echo "openpkg:WARNING: skipping creation of OpenPKG $class group
$grp" 1>&2
@@ -1312,7 +1312,7 @@
class="$1"; usr="$2"; uid="$3"; grp="$4"; gid="$5"
# check whether user already exists
- exists=`(cat /etc/passwd; ypcat passwd) 2>/dev/null | grep "^$usr:"`
+ exists=`(getent passwd; cat /etc/passwd; ypcat passwd) 2>/dev/null | grep
"^$usr:"`
if [ ".$exists" != . ]; then
if [ ".$cusr" != ".root" ]; then
echo "openpkg:WARNING: skipping deletion of OpenPKG $class user
$usr" 1>&2
@@ -1346,7 +1346,7 @@
fi
# check whether group already exists
- exists=`(cat /etc/group; ypcat group) 2>/dev/null | grep "^$grp:"`
+ exists=`(getent group; cat /etc/group; ypcat group) 2>/dev/null | grep
"^$grp:"`
if [ ".$exists" = . ]; then
if [ ".$cusr" != ".root" ]; then
echo "openpkg:WARNING: skipping deletion of OpenPKG $class group
$grp" 1>&2
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/shtool
============================================================================
$ cvs diff -u -r1.6 -r1.7 shtool
--- openpkg-src/openpkg/shtool 21 Feb 2003 19:44:46 -0000 1.6
+++ openpkg-src/openpkg/shtool 22 Feb 2003 12:46:01 -0000 1.7
@@ -6,7 +6,7 @@
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
-## Version: 2.0b0 (21-Feb-2003)
+## Version: 2.0b0 (22-Feb-2003)
## Contents: all available modules
##
@@ -65,7 +65,7 @@
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
- echo "This is GNU shtool, version 2.0b0 (21-Feb-2003)"
+ echo "This is GNU shtool, version 2.0b0 (22-Feb-2003)"
echo "Copyright (c) 1994-2003 Ralf S. Engelschall <[EMAIL PROTECTED]>"
echo "Report bugs to <[EMAIL PROTECTED]>"
echo ''
@@ -128,7 +128,7 @@
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
- echo "GNU shtool 2.0b0 (21-Feb-2003)"
+ echo "GNU shtool 2.0b0 (22-Feb-2003)"
exit 0
fi
if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then
@@ -701,14 +701,18 @@
userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e
's/(.*$//'`
fi
if [ ".$userid" = . ]; then
- userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+ userid=`(getent passwd ${username}) 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
- userid=`(ypcat passwd) 2>/dev/null |
- egrep "^${username}:" | \
+ userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
- userid='?'
+ userid=`(ypcat passwd) 2>/dev/null |
+ egrep "^${username}:" | \
+ sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$userid" = . ]; then
+ userid='?'
+ fi
fi
fi
fi
@@ -726,13 +730,17 @@
groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e
's/(.*$//'`
fi
if [ ".$groupid" = . ]; then
- groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
+ groupid=`(getent passwd ${username}) 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
- groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
+ groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
- groupid='?'
+ groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:"
| \
+ sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+ if [ ".$groupid" = . ]; then
+ groupid='?'
+ fi
fi
fi
fi
@@ -749,14 +757,19 @@
groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//'
-e 's/).*$//'`
fi
if [ ".$groupname" = . ]; then
- groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null
| \
+ groupname=`(getent group) 2>/dev/null | \
+ egrep "^[^:]*:[^:]*:${groupid}:" | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
- groupname=`(ypcat group) 2>/dev/null | \
- egrep "^[^:]*:[^:]*:${groupid}:" | \
+ groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group
2>/dev/null | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
- groupname='?'
+ groupname=`(ypcat group) 2>/dev/null | \
+ egrep "^[^:]*:[^:]*:${groupid}:" | \
+ sed -e 's/:.*$//'`
+ if [ ".$groupname" = . ]; then
+ groupname='?'
+ fi
fi
fi
fi
@@ .
patch -p0 <<'@@ .'
Index: openpkg-web/news.txt
============================================================================
$ cvs diff -u -r1.3407 -r1.3408 news.txt
--- openpkg-web/news.txt 22 Feb 2003 11:05:26 -0000 1.3407
+++ openpkg-web/news.txt 22 Feb 2003 12:45:58 -0000 1.3408
@@ -1,3 +1,4 @@
+22-Feb-2003: Upgraded package: P<openpkg-20030222-20030222>
22-Feb-2003: Upgraded package: P<subversion-0.18.0-20030222>
22-Feb-2003: Upgraded package: P<honeyd-0.5-20030222>
22-Feb-2003: Upgraded package: P<vim-6.1.351-20030222>
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]