Annotation of /trunk/mage/patches/mage-0.4.22-busybox-system-group-support.patch
Parent Directory | Revision Log
Revision 1243 -
(hide annotations)
(download)
Mon Dec 27 16:07:38 2010 UTC (13 years, 9 months ago) by niro
File size: 1238 byte(s)
Mon Dec 27 16:07:38 2010 UTC (13 years, 9 months ago) by niro
File size: 1238 byte(s)
-fixed -r system user/group switch for busybox
1 | niro | 1243 | diff -Naur mage-0.4.22/usr/lib/mage/mgroupadd mage-0.4.22-mcore/usr/lib/mage/mgroupadd |
2 | --- mage-0.4.22/usr/lib/mage/mgroupadd 2010-12-27 17:15:05.000000000 +0100 | ||
3 | +++ mage-0.4.22-mcore/usr/lib/mage/mgroupadd 2010-12-27 17:18:32.000000000 +0100 | ||
4 | @@ -39,7 +39,25 @@ | ||
5 | |||
6 | GROUP_TO_ADD="$1" | ||
7 | |||
8 | +fix_group_opts() | ||
9 | +{ | ||
10 | + local i | ||
11 | + local FIXED_GROUP_OPTS | ||
12 | + | ||
13 | + for i in $* | ||
14 | + do | ||
15 | + case $1 in | ||
16 | + -s) FIXED_GROUP_OPTS+=" -S" ;; | ||
17 | + *) FIXED_GROUP_OPTS+=" $1" ;; | ||
18 | + esac | ||
19 | + shift | ||
20 | + done | ||
21 | + | ||
22 | + echo "${FIXED_GROUP_OPTS}" | ||
23 | +} | ||
24 | + | ||
25 | + | ||
26 | # if above entries are empty the user/group does not exist | ||
27 | echo " Adding group '${GROUP_TO_ADD}' ..." | ||
28 | -addgroup ${GROUP_OPTS} "${GROUP_TO_ADD}" | ||
29 | +addgroup $(fix_group_opts ${GROUP_OPTS}) "${GROUP_TO_ADD}" | ||
30 | |||
31 | diff -Naur mage-0.4.22/usr/lib/mage/museradd mage-0.4.22-mcore/usr/lib/mage/museradd | ||
32 | --- mage-0.4.22/usr/lib/mage/museradd 2010-12-27 17:15:05.000000000 +0100 | ||
33 | +++ mage-0.4.22-mcore/usr/lib/mage/museradd 2010-12-27 17:15:51.000000000 +0100 | ||
34 | @@ -51,6 +51,7 @@ | ||
35 | -g) shift; FIXED_USER_OPTS+=" -G $1" ;; | ||
36 | -G) shift; shift; continue;; # will be parsed through fix_group_opts | ||
37 | -u) shift; [[ $1 -lt 100 ]] && FIXED_USER_OPTS+=" -S" ;; | ||
38 | + -s) FIXED_USER_OPTS+=" -S" ;; | ||
39 | *) FIXED_USER_OPTS+=" $1" ;; | ||
40 | esac | ||
41 | shift |