X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-sources;h=5a9073a4620c17342060496a78631fcdddad1cba;hb=11fd4b5f87f668eeb33922c6f64823e40828d137;hp=732112658e74f236c6d8e4d9d459b5a67d277c8d;hpb=a3e6aa1e34000d0a7faa1773bd6bc32c32cfa625;p=deb%2Fpackages.git diff --git a/bin/parse-sources b/bin/parse-sources index 7321126..5a9073a 100755 --- a/bin/parse-sources +++ b/bin/parse-sources @@ -29,6 +29,7 @@ my $what = $ARGV[0] ? "non-free" : "*"; my $MAX_SOURCE_POSTFIXES = 100; use DB_File; +use File::Path; use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES ); &Packages::Config::init( './' ); my %sources_small = (); @@ -37,6 +38,8 @@ my %source_postfixes = (); $/ = ""; +-d $DBDIR || mkpath( $DBDIR ); + for my $archive (@ARCHIVES) { for my $suite (@SUITES) { @@ -46,6 +49,10 @@ for my $archive (@ARCHIVES) { tie %sources_all_db, "DB_File", "$DBDIR/sources_all_$suite.db.new", O_RDWR|O_CREAT, 0666, $DB_BTREE or die "Error creating DB: $!"; + if (!-d "$TOPDIR/archive/$archive/$suite/") { + print "\tseems not to exist, skipping...\n"; + next; + } open PKG, "zcat $TOPDIR/archive/$archive/$suite/$what/source/Sources.gz|"; while () { next if /^\s*$/; @@ -70,8 +77,6 @@ for my $archive (@ARCHIVES) { my $subsection = $data{section} || '-'; if ($data{section} && ($data{section} =~ m=/=o)) { ($section, $subsection) = split m=/=o, $data{section}, 2; - ($subsection, $section) = split m=/=o, $data{section}, 2 - if $section eq 'non-US'; } $data{'section'} = $section; $data{'subsection'} = $subsection;