From 7712ce145e69eca3e6495f660eecbae3efda5950 Mon Sep 17 00:00:00 2001 From: codehelp Date: Thu, 26 Aug 2010 06:21:00 +0000 Subject: [PATCH] untested flatfile experiment git-svn-id: http://emdebian.org/svn/current@7388 563faec7-e20c-0410-992a-a66f704d0ccd --- multistrap | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/multistrap b/multistrap index fbfbbc2..6192906 100755 --- a/multistrap +++ b/multistrap @@ -247,8 +247,9 @@ foreach my $aptsrc (@debootstrap) { open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list") or die _g("Cannot open sources list"). $!; $mirror = $sources{$aptsrc}; - $suite = $suites{$aptsrc}; - $component = (defined $components{$aptsrc}) ? $components{$aptsrc} : "main"; + $suite = (exists $flatfile{$aptsrc}) ? $suites{$aptsrc} : ""; + $component = (defined $components{$aptsrc}) ? $components{$aptsrc} + : (exists $flatfile{$aptsrc}) ? "" : "main"; if (defined $mirror and defined $suite) { print SOURCES "deb $mirror $suite $component\n"; print SOURCES "deb-src $mirror $suite $component\n" if (not defined $omitdebsrc{$aptsrc}); @@ -372,8 +373,9 @@ foreach my $aptsrc (@aptsources) { open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list") or die _g("Cannot open sources list"). $!; $mirror = $sources{$aptsrc}; - $suite = $suites{$aptsrc}; - $component = (defined $components{$aptsrc}) ? $components{$aptsrc} : "main"; + $suite = (exists $flatfile{$aptsrc}) ? $suites{$aptsrc} : ""; + $component = (defined $components{$aptsrc}) ? $components{$aptsrc} + : (exists $flatfile{$aptsrc}) ? "" : "main"; if (defined $mirror and defined $suite) { print SOURCES "deb $mirror $suite $component\n"; print SOURCES "deb-src $mirror $suite $component\n" if (not defined $omitdebsrc{$aptsrc}); @@ -849,9 +851,13 @@ sub cascade { push @includes, @i; } else { $sources{$section}=$keys{$section}{'source'} if (not exists $source{$section}); + # don't set suite or component if URL is of apt-ftparchive trailing-slash form + $flatfile{$section}++ if (($sources{$section} =~ /.* .*\/$/)); $packages{$section}=$keys{$section}{'packages'} if (not exists $packages{$section}); - $suites{$section}=$keys{$section}{'suite'} if (not exists $suites{$section}); - $components{$section}=$keys{$section}{'components'} if (not exists $components{$section}); + $suites{$section}=$keys{$section}{'suite'} + if (not exists $suites{$section} and not exists $flatfile{$section}); + $components{$section}=$keys{$section}{'components'} + if (not exists $components{$section} and not exists $flatfile{$section}); $omitdebsrc{$section}=$section if ((defined $keys{$section}{'omitdebsrc'}) and ($keys{$section}{'omitdebsrc'} eq "true")); push @reinstall, split (/ /, lc($keys{$section}{'reinstall'})); @@ -931,8 +937,8 @@ sub dump_config { } @sorted = sort keys %uniq; %uniq=(); - print "\tsuite: \t$suites{$sect_name}\n"; - print "\tcomponents:\t$components{$sect_name}\n"; + print "\tsuite: \t$suites{$sect_name}\n" if (not exists $flatfile{$sect_name}); + print "\tcomponents:\t$components{$sect_name}\n" if (not exists $flatfile{$sect_name}); # only packages can have a list next if (not grep(/^$sect_name$/i, @debootstrap)); print "\tBootstrap:\tpackages: ".join(" ", @sorted)."\n";