diff --git a/multistrap b/multistrap index 137658c..189baaa 100755 --- a/multistrap +++ b/multistrap @@ -915,6 +915,7 @@ sub tidy_apt { my $libdir = shift; print _g("I: Tidying up apt cache and list data.\n"); if ($unpack eq "true") { + # FIXME: use apt-get clean instead opendir (DEBS, "${dir}${cachedir}/archives/") or die (_g("Cannot read apt archives directory.\n")); my @files=grep(!m:\.\.?$:, readdir DEBS); @@ -930,6 +931,7 @@ sub tidy_apt { } $sourcedir=undef; } + # FIXME: use apt-get update -o Dir::Etc::SourceList= -o Dir::Etc::SourceParts= unlink ("${dir}etc/apt/sources.list") if (-f "${dir}etc/apt/sources.list"); opendir (DEBS, "${dir}${libdir}lists/") @@ -940,6 +942,7 @@ sub tidy_apt { next if (-d $file); unlink ("${dir}${libdir}lists/$file"); } + # FIXME: why are there .bin files in /var/cache/apt? opendir (DEBS, "${dir}${cachedir}/") or die (_g("Cannot read apt cache directory.\n")); my @files=grep(!m:\.\.?$:, readdir DEBS); @@ -1015,6 +1018,7 @@ sub get_required_debs { # Packages files exist my %required=(); 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/") or die sprintf(_g("Cannot open %s directory. %s\n"), "${dir}${libdir}lists/", $!); @@ -1027,6 +1031,8 @@ sub get_required_debs { } } 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 $parser = Parse::Debian::Packages->new( $fh ); while (my %package = $parser->next) {