]> git.saurik.com Git - apt.git/commitdiff
let {dsc,tar,diff}-only implicitly enable download-only
authorDavid Kalnischkies <david@kalnischkies.de>
Fri, 25 Nov 2016 14:51:21 +0000 (15:51 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 16 Dec 2016 12:50:00 +0000 (13:50 +0100)
That was the case already for tar-only and diff-only, but in a more
confusing way and without a message while dsc "worked" before resulting
in a dpkg-source error shortly after as tar/diff files aren't available…

apt-private/private-source.cc
test/integration/test-apt-cdrom
test/integration/test-sourceslist-trusted-options

index 1e819a6683c86bca3b1c1e0a4651534442f053c2..fa9d36af3e1a1f1e897ceef21d2a55c7c8cc75f4 100644 (file)
@@ -495,7 +495,7 @@ bool DoSource(CommandLine &CmdL)
       return _error->Error(_("Failed to fetch some archives."));
    }
 
-   if (_config->FindB("APT::Get::Download-only",false) == true)
+   if (diffOnly || tarOnly || dscOnly || _config->FindB("APT::Get::Download-only",false) == true)
    {
       c1out << _("Download complete and in download only mode") << std::endl;
       return true;
@@ -509,13 +509,9 @@ bool DoSource(CommandLine &CmdL)
       bool const fixBroken = _config->FindB("APT::Get::Fix-Broken", false);
       for (unsigned I = 0; I != J; ++I)
       {
-        std::string Dir = Dsc[I].Package + '-' + Cache.GetPkgCache()->VS->UpstreamVersion(Dsc[I].Version.c_str());
-
-        // Diff only mode only fetches .diff files
-        if (_config->FindB("APT::Get::Diff-Only",false) == true ||
-              _config->FindB("APT::Get::Tar-Only",false) == true ||
-              Dsc[I].Dsc.empty() == true)
+        if (unlikely(Dsc[I].Dsc.empty() == true))
            continue;
+        std::string const Dir = Dsc[I].Package + '-' + Cache.GetPkgCache()->VS->UpstreamVersion(Dsc[I].Version.c_str());
 
         // See if the package is already unpacked
         struct stat Stat;
index 212f0baa44b192d1af24ae2753920af886b05781..01680c461fb6357ab33ddfb1166239515ab0ee64 100755 (executable)
@@ -112,7 +112,7 @@ Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
        rm -f testing_0.8.15_amd64.deb
 
        rm -f testing_0.8.15.dsc
-       testsuccess aptget source testing --dsc-only -d
+       testsuccess aptget source testing --dsc-only
        testsuccess test -s testing_0.8.15.dsc
        rm -f testing_0.8.15.dsc
        cd - >/dev/null
index 94de11ef76988aa0e637438c220db01bfb562e5e..1eee3b09aafa877759475a0acfca816469124d10 100755 (executable)
@@ -26,7 +26,7 @@ foo/stable 1 amd64
        testsuccess test -s foo_1_amd64.deb -o -s foo_2_amd64.deb
 
        rm -f foo_1.dsc foo_2.dsc
-       testsuccess aptget source foo --dsc-only -d "$@"
+       testsuccess aptget source foo --dsc-only "$@"
        testsuccess test -s foo_1.dsc -o -s foo_2.dsc
        cd - >/dev/null
 }
@@ -48,7 +48,7 @@ E: Some packages could not be authenticated'
        testfailure test -s foo_1_amd64.deb -o -s foo_2_amd64.deb
 
        rm -f foo_1.dsc foo_2.dsc
-       testfailure aptget source foo --dsc-only -d "$@"
+       testfailure aptget source foo --dsc-only "$@"
        testequal "$WARNING" tail -n 3 ../rootdir/tmp/testfailure.output
        testfailure test -s foo_1.dsc -o -s foo_2.dsc
        cd - >/dev/null