From 7dd62ea93413a73b4ec394b16ff4e0367d226395 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 20 Jan 2014 07:59:11 +0100 Subject: add support for Enabled: no in deb822 sources.list --- apt-pkg/sourcelist.cc | 4 ++++ doc/sources.list.5.xml | 5 +++-- test/integration/test-apt-sources-deb822 | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 4e580ba04..5d41fb00e 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -84,6 +84,10 @@ bool pkgSourceList::Type::ParseStanza(vector &List, _error->Error(_("Malformed stanza %u in source list %s (URI parse)"),i,Fd.Name().c_str()); return false; } + + string Enabled = Tags.FindS("Enabled"); + if (Enabled.size() > 0 && StringToBool(Enabled) == false) + return true; // Define external/internal options const char* option_deb822[] = { diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index b2b682292..a2f6e985e 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -85,7 +85,7 @@ Type: deb URI: http://example.com - Suites: stable + Suites: stable testing Sections: component1 component2 Description: short long long long @@ -95,9 +95,10 @@ URI: http://example.com Suites: stable Sections: component1 component2 - [option1]: [option1-value] + Enabled: no Description: short long long long + [option1]: [option1-value] diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822 index 34708d2d1..f461314e6 100755 --- a/test/integration/test-apt-sources-deb822 +++ b/test/integration/test-apt-sources-deb822 @@ -75,3 +75,7 @@ Suites: stable testequalwithmsg "Invalid deb822 sources.list file gives proper error" "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse) E: The list of sources could not be read." aptget update --print-uris +# with Enabled: false +echo "$BASE" > $SOURCES +echo "Enabled: no" >> $SOURCES +testempty aptget update --print-uris -- cgit v1.2.3