aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package-metadata.pl
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2017-06-13 17:03:38 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2017-06-18 10:39:35 +0800
commit80d9ec5d3dbc1e393f377ede51e16d5c267475bd (patch)
treebc5f4a9581c170254c59d61eaeafad7ef31808ef /scripts/package-metadata.pl
parentf334a0cdb8498dfd2bbb780245e4e0ed0d103ece (diff)
downloadupstream-80d9ec5d3dbc1e393f377ede51e16d5c267475bd.tar.gz
upstream-80d9ec5d3dbc1e393f377ede51e16d5c267475bd.tar.bz2
upstream-80d9ec5d3dbc1e393f377ede51e16d5c267475bd.zip
scripts/package-metadata.pl: parse and validate field Require-User
The script will now detect uid/gid collision and can generate a table of current allocation ./scripts/package-metadata.pl usergroup tmp/.packageinfo \ | sort -k 1,1r -k 3,3n \ | column -t This should ensure that no collision will happen for each single build Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'scripts/package-metadata.pl')
-rwxr-xr-xscripts/package-metadata.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 2da32c770e..d4100c1726 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -632,6 +632,16 @@ sub gen_version_filtered_list() {
}
}
+sub gen_usergroup_list() {
+ parse_package_metadata($ARGV[0]) or exit 1;
+ for my $name (keys %usernames) {
+ print "user $name $usernames{$name}{id} $usernames{$name}{makefile}\n";
+ }
+ for my $name (keys %groupnames) {
+ print "group $name $groupnames{$name}{id} $groupnames{$name}{makefile}\n";
+ }
+}
+
sub parse_command() {
GetOptions("ignore=s", \@ignore);
my $cmd = shift @ARGV;
@@ -643,6 +653,7 @@ sub parse_command() {
/^subdirs$/ and return gen_package_subdirs();
/^license$/ and return gen_package_license(0);
/^licensefull$/ and return gen_package_license(1);
+ /^usergroup$/ and return gen_usergroup_list();
/^version_filter$/ and return gen_version_filtered_list();
}
die <<EOF
@@ -654,6 +665,7 @@ Available Commands:
$0 subdirs [file] Package subdir information in makefile format
$0 license [file] Package license information
$0 licensefull [file] Package license information (full list)
+ $0 usergroup [file] Package usergroup allocation list
$0 version_filter [patchver] [list...] Filter list of version tagged strings
Options: