Add some FIXME comments

This commit is contained in:
Johannes 'josch' Schauer 2016-12-24 14:37:54 +01:00
parent 17d528a5c9
commit 3f77f992e5

View file

@ -915,6 +915,7 @@ sub tidy_apt {
my $libdir = shift; my $libdir = shift;
print _g("I: Tidying up apt cache and list data.\n"); print _g("I: Tidying up apt cache and list data.\n");
if ($unpack eq "true") { if ($unpack eq "true") {
# FIXME: use apt-get clean instead
opendir (DEBS, "${dir}${cachedir}/archives/") opendir (DEBS, "${dir}${cachedir}/archives/")
or die (_g("Cannot read apt archives directory.\n")); or die (_g("Cannot read apt archives directory.\n"));
my @files=grep(!m:\.\.?$:, readdir DEBS); my @files=grep(!m:\.\.?$:, readdir DEBS);
@ -930,6 +931,7 @@ sub tidy_apt {
} }
$sourcedir=undef; $sourcedir=undef;
} }
# FIXME: use apt-get update -o Dir::Etc::SourceList= -o Dir::Etc::SourceParts=
unlink ("${dir}etc/apt/sources.list") unlink ("${dir}etc/apt/sources.list")
if (-f "${dir}etc/apt/sources.list"); if (-f "${dir}etc/apt/sources.list");
opendir (DEBS, "${dir}${libdir}lists/") opendir (DEBS, "${dir}${libdir}lists/")
@ -940,6 +942,7 @@ sub tidy_apt {
next if (-d $file); next if (-d $file);
unlink ("${dir}${libdir}lists/$file"); unlink ("${dir}${libdir}lists/$file");
} }
# FIXME: why are there .bin files in /var/cache/apt?
opendir (DEBS, "${dir}${cachedir}/") opendir (DEBS, "${dir}${cachedir}/")
or die (_g("Cannot read apt cache directory.\n")); or die (_g("Cannot read apt cache directory.\n"));
my @files=grep(!m:\.\.?$:, readdir DEBS); my @files=grep(!m:\.\.?$:, readdir DEBS);
@ -1015,6 +1018,7 @@ sub get_required_debs {
# Packages files exist # Packages files exist
my %required=(); my %required=();
my %listfiles=(); my %listfiles=();
# FIXME: use apt-get indextargets --format '$(FILENAME)' "Created-By: Packages" | xargs --delimiter=\\\\n /usr/lib/apt/apt-helper cat-file
opendir (PKGS, "${dir}${libdir}lists/") opendir (PKGS, "${dir}${libdir}lists/")
or die sprintf(_g("Cannot open %s directory. %s\n"), or die sprintf(_g("Cannot open %s directory. %s\n"),
"${dir}${libdir}lists/", $!); "${dir}${libdir}lists/", $!);
@ -1027,6 +1031,8 @@ sub get_required_debs {
} }
} }
foreach my $file (keys %listfiles) { foreach my $file (keys %listfiles) {
# FIXME: instead of requiring libparse-debian-packages-perl, use
# Dpkg::Index
my $fh = IO::File->new("${dir}${libdir}lists/$file"); my $fh = IO::File->new("${dir}${libdir}lists/$file");
my $parser = Parse::Debian::Packages->new( $fh ); my $parser = Parse::Debian::Packages->new( $fh );
while (my %package = $parser->next) { while (my %package = $parser->next) {