scripts: metadata: use the new "Repository" field
authorJo-Philipp Wich <jo@mein.io>
Wed, 13 Apr 2016 13:33:53 +0000 (15:33 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Apr 2016 13:33:53 +0000 (15:33 +0200)
Switch to the new "Repository" metadata field to populate tmp/.packagesubdirs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
scripts/metadata.pl
scripts/metadata.pm

index 6ad3c39f003854e1c85a5422e8b24e070ad37765..a55b7990f71d8bdd9d1a4859f0bf90bd5619ef91 100755 (executable)
@@ -849,8 +849,8 @@ sub gen_package_subdirs() {
        parse_package_metadata($ARGV[0]) or exit 1;
        foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
                my $pkg = $package{$name};
        parse_package_metadata($ARGV[0]) or exit 1;
        foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
                my $pkg = $package{$name};
-               if ($pkg->{name} && $pkg->{package_subdir}) {
-                       print "Package/$name/subdir = $pkg->{package_subdir}\n";
+               if ($pkg->{name} && $pkg->{repository}) {
+                       print "Package/$name/subdir = $pkg->{repository}\n";
                }
        }
 }
                }
        }
 }
index 8e285e53a8f2cb4de4fb420f704f7b52f6d3916b..e00f4e97cfb3385c36d1507dd80f0eebdf1971d9 100644 (file)
@@ -223,6 +223,7 @@ sub parse_package_metadata($) {
                /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
                /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ];
                /^Package-Subdir:\s*(.+?)\s*$/ and $pkg->{package_subdir} = $1;
                /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
                /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ];
                /^Package-Subdir:\s*(.+?)\s*$/ and $pkg->{package_subdir} = $1;
+               /^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1;
                /^Category: \s*(.+)\s*$/ and do {
                        $pkg->{category} = $1;
                        defined $category{$1} or $category{$1} = {};
                /^Category: \s*(.+)\s*$/ and do {
                        $pkg->{category} = $1;
                        defined $category{$1} or $category{$1} = {};