]> git.deb.at Git - deb/packages.git/commitdiff
Put $architecture loop in the inner, and ensure all kind of suite-specific
authorJeroen van Wolffelaar <jeroen@wolffelaar.nl>
Thu, 23 Feb 2006 10:35:38 +0000 (10:35 +0000)
committerJeroen van Wolffelaar <jeroen@wolffelaar.nl>
Thu, 23 Feb 2006 10:35:38 +0000 (10:35 +0000)
databases are really suite-specific, and not just have info of the last
processed $archive

bin/parse-packages

index e441515c8708bbfcb59939630c611c69a07caab8..f252a2992f717be433d68c50c9c5fb78e63b1df0 100755 (executable)
@@ -50,15 +50,15 @@ my %priorities = ();
 
 $/ = "";
 
-for my $archive (@ARCHIVES) {
-    for my $suite (@SUITES) {
+for my $suite (@SUITES) {
+    my %package_names_suite = ();
+    my %packages_all_db;
+    tie %packages_all_db, "DB_File", "$DBDIR/packages_all_$suite.db.new",
+           O_RDWR|O_CREAT, 0666, $DB_BTREE
+           or die "Error creating DB: $!";
 
-       my %package_names_suite = ();
+    for my $archive (@ARCHIVES) {
        print "Reading $archive/$suite...\n";
-       my %packages_all_db;
-       tie %packages_all_db, "DB_File", "$DBDIR/packages_all_$suite.db.new",
-               O_RDWR|O_CREAT, 0666, $DB_BTREE
-               or die "Error creating DB: $!";
        open PKG, "zcat $TOPDIR/archive/$archive/$suite/$what/{,debian-installer/}binary-*/Packages.gz|";
        while (<PKG>) {
                next if /^\s*$/;
@@ -141,16 +141,16 @@ for my $archive (@ARCHIVES) {
                $packages_all_db{"$data{'package'} $data{'architecture'} $data{'version'}"}
                        = $data;
        }
+    }
 
-       open NAMES, '>>', "$DBDIR/package_names_$suite.txt.new"
-           or die "Error creating package names list: $!";
-       foreach (sort keys %package_names_suite) {
-           print NAMES "$_\n";
-       }
-       close NAMES;
-
-       untie %packages_all_db;
+    open NAMES, '>>', "$DBDIR/package_names_$suite.txt.new"
+       or die "Error creating package names list: $!";
+    foreach (sort keys %package_names_suite) {
+       print NAMES "$_\n";
     }
+    close NAMES;
+
+    untie %packages_all_db;
 }
 
 print "Writing databases...\n";