]> git.saurik.com Git - apt.git/commitdiff
add support for Enabled: no in deb822 sources.list
authorMichael Vogt <mvo@debian.org>
Mon, 20 Jan 2014 06:59:11 +0000 (07:59 +0100)
committerMichael Vogt <mvo@debian.org>
Mon, 20 Jan 2014 06:59:11 +0000 (07:59 +0100)
apt-pkg/sourcelist.cc
doc/sources.list.5.xml
test/integration/test-apt-sources-deb822

index 4e580ba04f97a515396d9581505fe14366ebf7d8..5d41fb00eeeeed71d544ac143260e52b615c165b 100644 (file)
@@ -84,6 +84,10 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &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[] = { 
index b2b682292242cf2b40cf7ad277ceb93363eeb187..a2f6e985eb8dfac45e855368bd8529ceeb256c88 100644 (file)
@@ -85,7 +85,7 @@
    <literallayout>
      Type: deb
      URI: http://example.com
-     Suites: stable
+     Suites: stable testing
      Sections: component1 component2
      Description: short
       long long long
      URI: http://example.com
      Suites: stable
      Sections: component1 component2
-     [option1]: [option1-value]
+     Enabled: no
      Description: short
       long long long
+     [option1]: [option1-value]
    </literallayout>
    </para>
 
index 34708d2d166ec2f22a0b25873175c47bfd5eb33d..f461314e6ef7952f810e1ad95959225ec90ff7ba 100755 (executable)
@@ -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