aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2002-07-12 15:23:50 +0000
committerMystery Man <unknown@mandriva.org>2002-07-12 15:23:50 +0000
commite86b6a1e3b64bdf1f96c572f7a824b3dd74c71b8 (patch)
tree33a04fe5e4b674d437146992d11bb52dd20804ba
parentb570e96e55cab1c0d1ee546f1601939f190e9697 (diff)
downloadrpm-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--ChangeLog34
-rw-r--r--Makefile2
-rwxr-xr-xadd-user19
-rwxr-xr-xcreate-file31
-rw-r--r--rpm-helper.spec8
5 files changed, 89 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e69de29..eb6a530 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
+
diff --git a/Makefile b/Makefile
index 9d34753..e7b2712 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/add-user b/add-user
index 0a44fc8..f2d1126 100755
--- a/add-user
+++ b/add-user
@@ -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