From 9da8725e4a6558d86676ec8a643ab612b60d8a8a Mon Sep 17 00:00:00 2001 From: codehelp Date: Thu, 31 Mar 2011 15:41:39 +0000 Subject: [PATCH] Improve source download method to get packages individually - avoids breakage if the repository is incomplete. git-svn-id: http://emdebian.org/svn/current@7963 563faec7-e20c-0410-992a-a66f704d0ccd --- debian/changelog | 4 +++- multistrap | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc49abc..28c3dc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,10 @@ multistrap (2.1.13) unstable; urgency=low * Use perl realpath support and drop dependency. * [INTL:da] Add Danish translation of multistrap documentation (Closes: #619069) + * Improve source download method to get packages individually - avoids + breakage if the repository is incomplete. - -- Neil Williams Sat, 05 Mar 2011 15:04:33 +0000 + -- Neil Williams Thu, 31 Mar 2011 16:37:48 +0100 multistrap (2.1.12) unstable; urgency=low diff --git a/multistrap b/multistrap index 31bde15..7f80cae 100755 --- a/multistrap +++ b/multistrap @@ -19,7 +19,7 @@ use strict; use warnings; use IO::File; use Config::Auto; -use Cwd qw (realpath); +use Cwd qw (realpath getcwd); use File::Basename; use Parse::Debian::Packages; use POSIX qw(locale_h); @@ -355,7 +355,6 @@ foreach my $a (@s) { $uniq{$a}++; } $str = join (' ', sort keys %uniq); -@dsclist = sort keys %uniq; print "apt-get -y $config_str install $str\n"; $retval = 0; $retval = system ("apt-get -y $config_str install $str"); @@ -524,9 +523,12 @@ sub force_unpack { printf (_g("I: Extracting %s...\n"), $deb); my $ver=`LC_ALL=C dpkg -f ./${cachedir}archives/$deb Version`; my $pkg=`LC_ALL=C dpkg -f ./${cachedir}archives/$deb Package`; + my $src=`LC_ALL=C dpkg -f ./${cachedir}archives/$deb Source`; chomp ($ver); chomp ($pkg); - push @dsclist, $pkg; + chomp ($src); + $src =~ s/ \(.*\)//; + push @dsclist, $src; mkdir ("./tmp"); my $tmpdir = `mktemp -p ./tmp -d -t multistrap.XXXXXX`; chomp ($tmpdir); @@ -732,9 +734,13 @@ sub tidy_apt { foreach my $a (@dsclist) { $uniqdsc{$a}++; } - my $str = join (" ", sort keys %uniqdsc); - print "(cd $sourcedir; apt-get -d $config_str source $str)"; - system ("(cd $sourcedir; apt-get -d $config_str source $str)"); + my $olddir = getcwd(); + chdir ($sourcedir); + print "apt-get -d config_str source " . join (" ", sort keys %uniqdsc) . "\n"; + foreach my $srcpkg (sort keys %uniqdsc) { + system ("apt-get -d $config_str source $srcpkg"); + } + chdir ($olddir); } unlink ("${dir}etc/apt/sources.list") if (-f "${dir}etc/apt/sources.list");