|
|
|
@ -652,26 +652,11 @@ sub check_bin_sh
|
|
|
|
|
sub tidy_apt
|
|
|
|
|
{
|
|
|
|
|
print _g("I: Tidying up apt cache and list data.\n");
|
|
|
|
|
if ($unpack eq "true")
|
|
|
|
|
{
|
|
|
|
|
opendir (DEBS, "${dir}${cachedir}/archives/")
|
|
|
|
|
or die (_g("Cannot read apt archives directory.\n"));
|
|
|
|
|
my @files=grep(!m:\.\.?$:, readdir DEBS);
|
|
|
|
|
closedir (DEBS);
|
|
|
|
|
foreach my $file (@files)
|
|
|
|
|
{
|
|
|
|
|
next if (-d $file);
|
|
|
|
|
next unless ($file =~ /\.deb$/);
|
|
|
|
|
if (defined $sourcedir) {
|
|
|
|
|
system ("mv ${dir}${cachedir}archives/$file $sourcedir/$file");
|
|
|
|
|
my $str = join (" ", @dsclist);
|
|
|
|
|
print "$str\n";
|
|
|
|
|
print "(cd $sourcedir; apt-get -d $config_str source $str)";
|
|
|
|
|
system ("(cd $sourcedir; apt-get -d $config_str source $str)");
|
|
|
|
|
} else {
|
|
|
|
|
unlink ("${dir}${cachedir}archives/$file");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (defined $sourcedir) {
|
|
|
|
|
my $str = join (" ", @dsclist);
|
|
|
|
|
print "$str\n";
|
|
|
|
|
print "(cd $sourcedir; apt-get -d $config_str source $str)";
|
|
|
|
|
system ("(cd $sourcedir; apt-get -d $config_str source $str)");
|
|
|
|
|
}
|
|
|
|
|
unlink ("${dir}etc/apt/sources.list")
|
|
|
|
|
if (-f "${dir}etc/apt/sources.list");
|
|
|
|
@ -694,6 +679,23 @@ sub tidy_apt
|
|
|
|
|
next unless ($file =~ /\.bin$/);
|
|
|
|
|
unlink ("${dir}${cachedir}$file");
|
|
|
|
|
}
|
|
|
|
|
if ($unpack eq "true")
|
|
|
|
|
{
|
|
|
|
|
opendir (DEBS, "${dir}${cachedir}/archives/")
|
|
|
|
|
or die (_g("Cannot read apt archives directory.\n"));
|
|
|
|
|
my @files=grep(!m:\.\.?$:, readdir DEBS);
|
|
|
|
|
closedir (DEBS);
|
|
|
|
|
foreach my $file (@files)
|
|
|
|
|
{
|
|
|
|
|
next if (-d $file);
|
|
|
|
|
next unless ($file =~ /\.deb$/);
|
|
|
|
|
if (defined $sourcedir) {
|
|
|
|
|
system ("mv ${dir}${cachedir}archives/$file $sourcedir/$file");
|
|
|
|
|
} else {
|
|
|
|
|
unlink ("${dir}${cachedir}archives/$file");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# if native arch, do a few tasks just because we can and probably should.
|
|
|
|
|