diff options
author | Mystery Man <unknown@mandriva.org> | 2002-07-12 15:23:50 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2002-07-12 15:23:50 +0000 |
commit | e86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8 (patch) | |
tree | 33a04fe5e4b674d437146992d11bb52dd20804ba | |
parent | b570e96e55cab1c0d1ee546f1601939f190e9697 (diff) | |
download | rpm-helper-e86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8.tar rpm-helper-e86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8.tar.gz rpm-helper-e86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8.tar.bz2 rpm-helper-e86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8.tar.xz rpm-helper-e86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8.zip |
This commit was manufactured by cvs2svn to create tag 'V0_3_1mdk'.V0_3_1mdk
-rw-r--r-- | ChangeLog | 34 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | add-user | 19 | ||||
-rwxr-xr-x | create-file | 31 | ||||
-rw-r--r-- | rpm-helper.spec | 8 |
5 files changed, 89 insertions, 5 deletions
@@ -0,0 +1,34 @@ +2002-07-12 17:22 Frederic Lepied <flepied@mandrakesoft.com> + + * rpm-helper.spec: 0.3-1mdk + +2002-07-12 17:20 Frederic Lepied <flepied@mandrakesoft.com> + + * add-user: added missing groupadd call + +2002-07-12 17:19 Frederic Lepied <flepied@mandrakesoft.com> + + * add-user: added support for extended groups + +2002-07-10 15:12 Frederic Lepied <flepied@mandrakesoft.com> + + * rpm-helper.spec: 0.2-1mdk + +2002-07-10 15:10 Frederic Lepied <flepied@mandrakesoft.com> + + * Makefile: added create-file + +2002-07-10 15:08 Frederic Lepied <flepied@mandrakesoft.com> + + * create-file: first version + +2002-07-09 17:04 Frederic Lepied <flepied@mandrakesoft.com> + + * AUTHORS, COPYING, Makefile, README, README.CVS, add-service, + add-user, del-service, del-user, rpm-helper.spec: Initial version + +2002-07-09 17:04 Frederic Lepied <flepied@mandrakesoft.com> + + * AUTHORS, COPYING, Makefile, README, README.CVS, add-service, + add-user, del-service, del-user, rpm-helper.spec: Initial revision + @@ -14,7 +14,7 @@ TAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__') FILES = AUTHORS README README.CVS COPYING ChangeLog Makefile \ $(PACKAGE).spec $(SCRIPTS) -SCRIPTS = add-user del-user add-service del-service +SCRIPTS = add-user del-user add-service del-service create-file LIBDIR=/usr/share/rpm-helper @@ -10,8 +10,8 @@ # system user. #--------------------------------------------------------------- -if [ $# != 5 ]; then - echo "usage: $0 <pkg name> <num installed> <user name> <home dir> <shell>" 1>&2 +if [ $# -lt 5 ]; then + echo "usage: $0 <pkg name> <num installed> <user name> <home dir> <shell> [<group1> <group2>...]" 1>&2 exit 1 fi @@ -20,7 +20,20 @@ num=$2 # number of packages installed name=$3 # name of the user dir=$4 # home directory shell=$5 # shell +shift 5 -/usr/sbin/useradd -r -M -s $shell -d $dir -c "system user for $pkg" $name > /dev/null 2>&1 || : +if [ $# -gt 0 ]; then + garg="-G $1" + /usr/sbin/groupadd -r $1 > /dev/null 2>&1 + shift + for g in $*; do + garg="$garg,$g" + /usr/sbin/groupadd -r $g > /dev/null 2>&1 + done +fi + +/usr/sbin/useradd -r -M -s $shell -d $dir -c "system user for $pkg" $garg $name > /dev/null 2>&1 + +exit 0 # add-user ends here diff --git a/create-file b/create-file new file mode 100755 index 0000000..6dce7c1 --- /dev/null +++ b/create-file @@ -0,0 +1,31 @@ +#!/bin/sh +#--------------------------------------------------------------- +# Project : Mandrake Linux +# Module : rpm-helper +# File : create-file +# Version : $Id$ +# Author : Frederic Lepied +# Created On : Wed Jul 10 15:12:29 2002 +# Purpose : helper script for rpm scriptlets to create +# a non existent file. +#--------------------------------------------------------------- + +if [ $# != 6 ]; then + echo "usage: $0 <pkg name> <num installed> <file> <owner> <group> <mode>" 1>&2 + exit 1 +fi + +pkg=$1 # name of the package +num=$2 # number of packages installed +file=$3 # filename +owner=$4 # owner of the file +group=$5 # group of the file +mode=$6 # mode of the file + +if [ ! -f $file ]; then + touch $file + chown $owner.$group $file + chmod $mode $file +fi + +# create-file ends here diff --git a/rpm-helper.spec b/rpm-helper.spec index 7ae5214..8fea165 100644 --- a/rpm-helper.spec +++ b/rpm-helper.spec @@ -10,7 +10,7 @@ Summary: Helper scripts for rpm scriptlets Name: rpm-helper -Version: 0.1 +Version: 0.3 Release: 1mdk Source0: %{name}-%{version}.tar.bz2 License: GPL @@ -41,6 +41,12 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name} %changelog +* Fri Jul 12 2002 Frederic Lepied <flepied@mandrakesoft.com> 0.3-1mdk +- extend add-user to support extended groups + +* Wed Jul 10 2002 Frederic Lepied <flepied@mandrakesoft.com> 0.2-1mdk +- added create-file + * Tue Jul 9 2002 Frederic Lepied <flepied@mandrakesoft.com> 0.1-1mdk - Initial version |