Correct bugs in flat URL suport

git-svn-id: http://emdebian.org/svn/current@7390 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
wookey 2010-08-27 13:09:34 +00:00
parent 7712ce145e
commit 1e58141beb

View file

@ -247,9 +247,9 @@ foreach my $aptsrc (@debootstrap) {
open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list") open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list")
or die _g("Cannot open sources list"). $!; or die _g("Cannot open sources list"). $!;
$mirror = $sources{$aptsrc}; $mirror = $sources{$aptsrc};
$suite = (exists $flatfile{$aptsrc}) ? $suites{$aptsrc} : ""; $suite = (exists $flatfile{$aptsrc}) ? "" : $suites{$aptsrc};
$component = (defined $components{$aptsrc}) ? $components{$aptsrc} $component = (exists $flatfile{$aptsrc}) ? ""
: (exists $flatfile{$aptsrc}) ? "" : "main"; : (defined $components{$aptsrc}) ? $components{$aptsrc} : "main";
if (defined $mirror and defined $suite) { if (defined $mirror and defined $suite) {
print SOURCES "deb $mirror $suite $component\n"; print SOURCES "deb $mirror $suite $component\n";
print SOURCES "deb-src $mirror $suite $component\n" if (not defined $omitdebsrc{$aptsrc}); print SOURCES "deb-src $mirror $suite $component\n" if (not defined $omitdebsrc{$aptsrc});
@ -285,8 +285,10 @@ $config_str .= " -o Apt::Get::Download-Only=true";
$config_str .= " -o Apt::Install-Recommends=false"; $config_str .= " -o Apt::Install-Recommends=false";
$config_str .= " -o Dir=$dir"; $config_str .= " -o Dir=$dir";
$config_str .= " -o Dir::Etc=${dir}${etcdir}"; $config_str .= " -o Dir::Etc=${dir}${etcdir}";
$sourcesname = "sources.list.d/multistrap.sources.list"; if (defined $deflist) {
$config_str .= " -o Dir::Etc::SourceList=${dir}${etcdir}$sourcesname"; $sourcesname = "sources.list.d/multistrap.sources.list";
$config_str .= " -o Dir::Etc::SourceList=${dir}${etcdir}$sourcesname";
}
$config_str .= " -o Dir::State=${dir}${libdir}"; $config_str .= " -o Dir::State=${dir}${libdir}";
$config_str .= " -o Dir::State::Status=${dir}${dpkgdir}status"; $config_str .= " -o Dir::State::Status=${dir}${dpkgdir}status";
$config_str .= " -o Dir::Cache=${dir}${cachedir}"; $config_str .= " -o Dir::Cache=${dir}${cachedir}";
@ -311,7 +313,7 @@ foreach my $sect (sort keys %packages) {
my @long=split (/ /, $packages{$sect}); my @long=split (/ /, $packages{$sect});
foreach my $l (@long) { foreach my $l (@long) {
chomp ($l); chomp ($l);
if (defined $explicit_suite) { if (defined $explicit_suite and $suites{$sect}) {
# instruct apt to get packages from the specified # instruct apt to get packages from the specified
# suites (when the package exists in more than one). # suites (when the package exists in more than one).
$str .= " $l/$suites{$sect}" if ((defined $l) and ($l !~ /^\s*$/)); $str .= " $l/$suites{$sect}" if ((defined $l) and ($l !~ /^\s*$/));
@ -373,7 +375,7 @@ foreach my $aptsrc (@aptsources) {
open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list") open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list")
or die _g("Cannot open sources list"). $!; or die _g("Cannot open sources list"). $!;
$mirror = $sources{$aptsrc}; $mirror = $sources{$aptsrc};
$suite = (exists $flatfile{$aptsrc}) ? $suites{$aptsrc} : ""; $suite = (exists $flatfile{$aptsrc}) ? "" : $suites{$aptsrc};
$component = (defined $components{$aptsrc}) ? $components{$aptsrc} $component = (defined $components{$aptsrc}) ? $components{$aptsrc}
: (exists $flatfile{$aptsrc}) ? "" : "main"; : (exists $flatfile{$aptsrc}) ? "" : "main";
if (defined $mirror and defined $suite) { if (defined $mirror and defined $suite) {
@ -852,7 +854,8 @@ sub cascade {
} else { } else {
$sources{$section}=$keys{$section}{'source'} if (not exists $source{$section}); $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 # don't set suite or component if URL is of apt-ftparchive trailing-slash form
$flatfile{$section}++ if (($sources{$section} =~ /.* .*\/$/)); # regexp is: optional string in '[]', string without '[' or ']', string ending in '/'
$flatfile{$section}++ if (($sources{$section} =~ /^(\[.*\] )*[^\[\]]+ .+\/$/));
$packages{$section}=$keys{$section}{'packages'} if (not exists $packages{$section}); $packages{$section}=$keys{$section}{'packages'} if (not exists $packages{$section});
$suites{$section}=$keys{$section}{'suite'} $suites{$section}=$keys{$section}{'suite'}
if (not exists $suites{$section} and not exists $flatfile{$section}); if (not exists $suites{$section} and not exists $flatfile{$section});