summaryrefslogtreecommitdiffstats
path: root/perl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh
diff options
context:
space:
mode:
authorMageia SVN-Git Migration <svn-git-migration@mageia.org>2011-02-06 22:37:08 +0000
committerMageia SVN-Git Migration <svn-git-migration@mageia.org>2011-02-06 22:37:08 +0000
commitfd8bbba2f02b8bccd69e67c326fd320c0827941d (patch)
treeade69986b2f99e113c95009736399966d4a3d511 /perl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh
parent368f416649ed34557702a946ec8c0cec2fd45294 (diff)
downloaddrakx-fd8bbba2f02b8bccd69e67c326fd320c0827941d.tar
drakx-fd8bbba2f02b8bccd69e67c326fd320c0827941d.tar.gz
drakx-fd8bbba2f02b8bccd69e67c326fd320c0827941d.tar.bz2
drakx-fd8bbba2f02b8bccd69e67c326fd320c0827941d.tar.xz
drakx-fd8bbba2f02b8bccd69e67c326fd320c0827941d.zip
Synthesized commit during git-svn import combining previous Mandriva history with Mageia.
This commit consitsts of the following subversion commits: ------------------------------------------------------------------------ r431 | dmorgan | 2011-02-06 01:58:02 +0000 (Sun, 06 Feb 2011) | 1 line Add drakx structure on the SVN ------------------------------------------------------------------------ r432 | dmorgan | 2011-02-06 01:59:38 +0000 (Sun, 06 Feb 2011) | 1 line Import cleaned advertising ------------------------------------------------------------------------ r446 | dmorgan | 2011-02-06 22:37:08 +0000 (Sun, 06 Feb 2011) | 1 line Import Clean perl-install ------------------------------------------------------------------------ r448 | dmorgan | 2011-02-06 23:02:36 +0000 (Sun, 06 Feb 2011) | 1 line Add cleaned files ------------------------------------------------------------------------ r449 | dmorgan | 2011-02-06 23:03:52 +0000 (Sun, 06 Feb 2011) | 1 line Import cleaned kernel ------------------------------------------------------------------------ r450 | dmorgan | 2011-02-06 23:23:30 +0000 (Sun, 06 Feb 2011) | 1 line Import cleaned tools ------------------------------------------------------------------------ r451 | dmorgan | 2011-02-07 00:01:56 +0000 (Mon, 07 Feb 2011) | 1 line Import stage1 ------------------------------------------------------------------------ r473 | dmorgan | 2011-02-07 11:20:50 +0000 (Mon, 07 Feb 2011) | 1 line Import images ------------------------------------------------------------------------ r497 | ennael | 2011-02-09 21:02:06 +0000 (Wed, 09 Feb 2011) | 2 lines readd missing file ------------------------------------------------------------------------ r502 | pterjan | 2011-02-09 23:30:32 +0000 (Wed, 09 Feb 2011) | 1 line Import rescue ------------------------------------------------------------------------ r603 | ennael | 2011-02-24 13:32:54 +0000 (Thu, 24 Feb 2011) | 2 lines import cleaned rescue for Mageia ------------------------------------------------------------------------ r2061 | tv | 2011-10-20 20:32:19 +0100 (Thu, 20 Oct 2011) | 1 line import (cleaned) doc ------------------------------------------------------------------------
Diffstat (limited to 'perl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh')
-rwxr-xr-xperl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh87
1 files changed, 0 insertions, 87 deletions
diff --git a/perl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh b/perl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh
deleted file mode 100755
index b735d2bbe..000000000
--- a/perl-install/install/share/upgrade/conectiva.10/pre.merge-groups.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-#
-# cnc2mdv /etc/group file merger
-#
-# What it does:
-#
-# - Adds three new groups:
-# - Check if these groups or its gids already exists;
-# - Remove root from the wheel group.
-#
-
-destfile=${destfile:-/etc/group}
-backupfile=${destfile}.cnc2mdv
-
-# these are the new groups that are introduced by Mandriva
-groups=( usb 43 tape 21 nogroup 65534 )
-
-# error codes
-group_already_exists_=8
-group_already_exists=9
-gid_not_unique=4
-
-sort_groups_by_gid()
-{
- sort -nt: +2 -3 -o $destfile $destfile #wow
-
- return 0
-}
-
-
-add_new_groups()
-{
- for (( i=0; i < ${#groups[@]}; i += 2)); do
- n=$[$i+1]
- gid=${groups[$n]}
- gname=${groups[$i]}
-
- errors=yes
- while [ $errors = "yes" ]; do
- groupadd -g $gid $gname
- case $? in
- 0)
- # ok, no errors, group really added
- errors=no
- ;;
-
- $group_already_exists | $group_already_exists_ )
- # ok, no problem at all
- errors=no
- ;;
-
- $gid_not_unique)
- # bleh, increment gid and try again
- # hum, but if ... 65534?
- gid=$[$gid+1]
- ;;
-
- *)
- echo "unexpected error during groupadd ($?)"
- return 1;
- ;;
- esac
- done # while errors
- done # for
-
- return 0
-}
-
-
-remove_root_from_wheel()
-{
- sed -i 's/\(wheel:[^:]*:[^:]*:\)root,*\(.*\)/\1\2/' ${destfile}
-
- return 0
-}
-
-
-main()
-{
- add_new_groups &&
- sort_groups_by_gid &&
- remove_root_from_wheel
-}
-
-main
-
-# vim:ts=4:sw=4:ai