From 6d29417ef1c46fbb70aec9d79190fa4e9c149ce4 Mon Sep 17 00:00:00 2001 From: codehelp Date: Mon, 31 May 2010 19:18:16 +0000 Subject: [PATCH] Download source packages for all binaries, if a source directory is set. git-svn-id: http://emdebian.org/svn/current@7261 563faec7-e20c-0410-992a-a66f704d0ccd --- debian/changelog | 4 +++- multistrap | 42 ++++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index ec6ea75..9461ccc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,8 +14,10 @@ multistrap (2.1.5) unstable; urgency=low * Handle fakeroot with native architectures. * Extend device table format to support creating symlinks and hardlinks. + * Download source packages for all binaries, if a source directory is + set. - -- Neil Williams Mon, 31 May 2010 18:15:06 +0100 + -- Neil Williams Mon, 31 May 2010 20:15:56 +0100 multistrap (2.1.4) unstable; urgency=low diff --git a/multistrap b/multistrap index b5ad119..72d7801 100755 --- a/multistrap +++ b/multistrap @@ -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.