浏览代码

scripts/metadata.pm: allow group-only Require-User specs

/lib/functions.sh can deal with Require-User specifications that only
contain a group, but no user. Adjust metadata.pm to allow such
specifications as well.

Signed-off-by: Matthias Schiffer <[email protected]>
Matthias Schiffer 7 年之前
父节点
当前提交
884c9575e1
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      scripts/metadata.pm

+ 4 - 2
scripts/metadata.pm

@@ -283,8 +283,10 @@ sub parse_package_metadata($) {
 
 			for my $ugspec (@ugspecs) {
 				my @ugspec = split /:/, $ugspec, 2;
-				parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0;
-				if (@ugspec > 1) {
+				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;
 				}
 			}