aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-10-26 13:02:37 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-10-28 16:27:21 +0100
commitb2aca61360c33ad3161f8ef35a1c28ebb2507600 (patch)
tree8e90b642ae1038f94085ad53531ab9467524ab90 /scripts
parentdb639238f202ef7a71ad7f85693463fd8a3810cd (diff)
downloadupstream-b2aca61360c33ad3161f8ef35a1c28ebb2507600.tar.gz
upstream-b2aca61360c33ad3161f8ef35a1c28ebb2507600.tar.bz2
upstream-b2aca61360c33ad3161f8ef35a1c28ebb2507600.zip
base-files, metadata: support additional group membership
Some packages may require additional group membership for the system user added by that package. Allow defining additional groups as third member of the ':'-separated tuple, allowing to specify multiple ','-separated groups with optional GID. Example: USERID:=foouser=1000:foogroup=1000:addg1=1001,addg2=1002,addg3 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/metadata.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index f252c5309c..ee5a2945ca 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -295,13 +295,19 @@ sub parse_package_metadata($) {
my @ugspecs = split /\s+/, $1;
for my $ugspec (@ugspecs) {
- my @ugspec = split /:/, $ugspec, 2;
+ my @ugspec = split /:/, $ugspec, 3;
if ($ugspec[0]) {
parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
}
if ($ugspec[1]) {
parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0;
}
+ if ($ugspec[2]) {
+ my @addngroups = split /,/, $ugspec[2];
+ for my $addngroup (@addngroups) {
+ parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $addngroup) or return 0;
+ }
+ }
}
};
}