10 use Packages::Config qw( $TOPDIR $DBDIR );
11 use Packages::Search qw( :all );
12 &Packages::Config::init( './' );
14 my $suite = $ARGV[0] or die "Fatal Error: No suite given";
15 my $start_time = time;
17 tie my %packages, 'DB_File', "$DBDIR/packages_small.db",
18 O_RDONLY, 0666, $DB_BTREE
19 or die "Fatal Error: Couldn't tie DB $DBDIR/packages_small.db: $!\n";
24 my ($day, $month, $year) = (gmtime($start_time - ($age*86_400)))[3..5];
27 return sprintf( "%04s-%02s-%02s", $year, $month, $day );
30 open CHANGES, '>', "$TOPDIR/files/packages/newpkg_info.new"
31 or die "Fatal Error: Couldn't open CHANGES file: $!";
32 for (my $age = 0; $age < 7; $age++) {
34 my $newday = get_iso_date( $age );
35 my $oldday = get_iso_date( $age+1 );
36 open OLD, '<', "$TOPDIR/files/packages/package_names_$suite.$oldday"
38 warn "Warning: Couldn't open OLD file $TOPDIR/files/packages/package_names_$suite.$oldday: $!\n";
41 open NEW, '<', "$TOPDIR/files/packages/package_names_$suite.$newday"
43 warn "Warning: Couldn't open NEW file $TOPDIR/files/packages/package_names_$suite.$newday: $!\n";
54 # we assume here that the input contains no dupes!
65 my %archives = map { $_ => 1 } qw( us security non-US );
66 foreach (sort keys %changes) {
67 my $entry = read_entry_simple( \%packages, $_, \%archives, $suite)
68 or die "Fatal Error: Can't find entry for package $_\n";
69 shift @$entry; # remove virtual pkg info
70 print CHANGES join(" ", $_, $age, @$entry)."\n";
71 print "Wrote entry: ".join(" ", $_, $age, @$entry)."\n";
76 rename("$TOPDIR/files/packages/newpkg_info.new",
77 "$TOPDIR/files/packages/newpkg_info");