From 2d49249fd42aafed36856059f4135abb6cf10489 Mon Sep 17 00:00:00 2001 From: codehelp Date: Fri, 8 Jul 2011 19:04:27 +0000 Subject: [PATCH] Allow empty aptsources. git-svn-id: http://emdebian.org/svn/current@8047 563faec7-e20c-0410-992a-a66f704d0ccd --- debian/changelog | 6 ++++++ multistrap | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d76018..2bbeb7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +multistrap (2.1.16) unstable; urgency=low + + * Allow empty aptsources. + + -- Neil Williams Fri, 08 Jul 2011 20:03:27 +0100 + multistrap (2.1.15) unstable; urgency=low * Clean up the retainsources behaviour (Closes: #627179) diff --git a/multistrap b/multistrap index a945274..bddb1d0 100755 --- a/multistrap +++ b/multistrap @@ -136,14 +136,14 @@ if ((not defined $arch) or ($arch eq "")) { printf (_g("Using foreign architecture: %s\n"), $arch); } $foreign++ if ($host ne $arch); - -unless (keys %sources and @aptsources) { +unless (keys %sources) { my $msg = sprintf(_g("No sources defined for a foreign multistrap. Using your existing apt sources. To use different sources, list them with aptsources= in '%s'."), $file); warn ("$progname: $msg\n"); $warn_count++; - $deflist = prepare_sources_list(); + my $l = prepare_sources_list(); + $deflist = join ("", @$l); } # Translators: fields are: programname, architecture, host architecture. @@ -1113,7 +1113,10 @@ sub cascade { my @b = split(' ', lc($keys{$section}{'bootstrap'})) if (defined $keys{$section}{'bootstrap'}); push @debootstrap, @b; - my @a = split (' ', lc($keys{$section}{'aptsources'})); + my @a=(); + if (exists $keys{$section}{'aptsources'}) { + @a = split (' ', lc($keys{$section}{'aptsources'})); + } push @aptsources, @a; my @i = split (' ', $keys{$section}{'include'}) if (defined $keys{$section}{'include'});