diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-09-14 17:58:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-09-14 17:58:07 +0000 |
commit | 176b024d1f8d42d0c5b791847f46ad58be14387a (patch) | |
tree | bef6d09c4135d04dd2185458eb9653eaaad9b62e /perl-install/share | |
parent | 3dc12f70ed9bc6200452e74348240db1985cb8c2 (diff) | |
download | drakx-176b024d1f8d42d0c5b791847f46ad58be14387a.tar drakx-176b024d1f8d42d0c5b791847f46ad58be14387a.tar.gz drakx-176b024d1f8d42d0c5b791847f46ad58be14387a.tar.bz2 drakx-176b024d1f8d42d0c5b791847f46ad58be14387a.tar.xz drakx-176b024d1f8d42d0c5b791847f46ad58be14387a.zip |
add upgrade script for conectiva
Diffstat (limited to 'perl-install/share')
-rw-r--r-- | perl-install/share/list.xml | 2 | ||||
-rw-r--r-- | perl-install/share/upgrade/conectiva.10/map (renamed from perl-install/share/upgrade-map.conectiva.10) | 0 | ||||
-rwxr-xr-x | perl-install/share/upgrade/conectiva.10/pre.merge-groups.sh | 87 | ||||
-rwxr-xr-x | perl-install/share/upgrade/conectiva.10/pre.remove-conflicting-files.sh | 3 |
4 files changed, 91 insertions, 1 deletions
diff --git a/perl-install/share/list.xml b/perl-install/share/list.xml index 77836ead1..2f58e672d 100644 --- a/perl-install/share/list.xml +++ b/perl-install/share/list.xml @@ -344,7 +344,7 @@ <to dir="/usr/share"> consolefonts devices - upgrade-map.conectiva.10 + upgrade <from expand="glob"> *.png diff --git a/perl-install/share/upgrade-map.conectiva.10 b/perl-install/share/upgrade/conectiva.10/map index 8594168cd..8594168cd 100644 --- a/perl-install/share/upgrade-map.conectiva.10 +++ b/perl-install/share/upgrade/conectiva.10/map diff --git a/perl-install/share/upgrade/conectiva.10/pre.merge-groups.sh b/perl-install/share/upgrade/conectiva.10/pre.merge-groups.sh new file mode 100755 index 000000000..b735d2bbe --- /dev/null +++ b/perl-install/share/upgrade/conectiva.10/pre.merge-groups.sh @@ -0,0 +1,87 @@ +#!/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 diff --git a/perl-install/share/upgrade/conectiva.10/pre.remove-conflicting-files.sh b/perl-install/share/upgrade/conectiva.10/pre.remove-conflicting-files.sh new file mode 100755 index 000000000..3db2fee4f --- /dev/null +++ b/perl-install/share/upgrade/conectiva.10/pre.remove-conflicting-files.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +rm -f /usr/share/apps/kdm |