/usr/sbin/debfoster2aptitude is in debfoster 2.7-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #! /usr/bin/perl -w
use strict;
use utf8;
system qw(debfoster
-o MaxPriority=required
-o UseHold=no
-o UsePreDepends=yes
-o UseRecommends=no
-o UseSuggests=no
-o UseEssential=no
-o UseTasks=no
-o KeepSections=
-o NokeepSections=
-o GuessDepends=no) and die;
my %debfoster;
open KEEPERS, '<', '/var/lib/debfoster/keepers'
or die "/var/lib/debfoster/keepers: $!";
while(<KEEPERS>) {
next if /^-/;
chomp;
undef $debfoster{$_}
}
close KEEPERS or die $!;
open PKG, '<', '/var/lib/aptitude/pkgstates'
or die "/var/lib/aptitude/pkgstates: $!";
open NEW, '>', '/var/lib/aptitude/pkgstates.new'
or die "/var/lib/aptitude/pkgstates.new: $!";
my $name;
while(<PKG>) {
$name = $1 if /^Package:\s+(\S+)/;
if(/Last-Change:/) {
$_ = 'Last-Change: '.(exists $debfoster{$name} ? 0 : 1)."\n"
}
print NEW
or die "/var/lib/aptitude/pkgstates.new: $!";
}
close NEW or die $!;
close PKG or die $!;
rename '/var/lib/aptitude/pkgstates.new', '/var/lib/aptitude/pkgstates'
or die "rename(/var/lib/aptitude/pkgstates): $!"
|