]> git.saurik.com Git - apt.git/commitdiff
avoid building dependency tree in 'source' command
authorDavid Kalnischkies <david@kalnischkies.de>
Wed, 3 Feb 2016 13:56:49 +0000 (14:56 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 3 Feb 2016 13:56:49 +0000 (14:56 +0100)
We don't need the dependencies for obvious reasons and we don't need the
candidate version either, so building a pkgDepCache is wasted effort,
which we can stop doing now that build-dep cleared the path.

apt-private/private-source.cc
test/integration/test-apt-get-source-arch
test/integration/test-apt-get-source-multisources
test/integration/test-apt-source-and-build-dep
test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum

index c2f5f5d3a0897d69ff6fef86cb3b6a43b7695052..7126feb7825f91096924706cc27f91ceed1dc8fa 100644 (file)
@@ -317,13 +317,10 @@ struct DscFile
 };
 bool DoSource(CommandLine &CmdL)
 {
-   CacheFile Cache;
-   if (Cache.Open(false) == false)
-      return false;
-
    if (CmdL.FileSize() <= 1)
       return _error->Error(_("Must specify at least one package to fetch source for"));
 
+   CacheFile Cache;
    // Read the source list
    if (Cache.BuildSourceList() == false)
       return false;
index 4958fda0674d749f4d72723c33ee9be7991b4d3d..ca586f46a01bac334bca19bb3e86516c7531df30 100755 (executable)
@@ -26,8 +26,7 @@ setupaptarchive
 
 APTARCHIVE=$(readlink -f ./aptarchive)
 
-HEADER="Reading package lists...
-Building dependency tree..."
+HEADER='Reading package lists...'
 DOWNLOAD10="Need to get 0 B/25 B of source archives.
 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 SHA256:ed7c25c832596339bee13e4e7c45cf49f869b60d2bf57252f18191d75866c2a7
 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 SHA256:f3da8c6ebc62c8ef2dae439a498dddcdacc1a07f45ff67ad12f44b6e2353c239"
index 136867ead0225f6a6275bb89457d86844e84e712..06fe19641fb09959b30d46f2c10b7161156ba518 100755 (executable)
@@ -17,8 +17,7 @@ setupaptarchive
 
 APTARCHIVE=$(readlink -f ./aptarchive)
 
-HEADER="Reading package lists...
-Building dependency tree..."
+HEADER='Reading package lists...'
 testsuccessequal "$HEADER
 Need to get 0 B/43 B of source archives.
 'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 22 SHA256:19cc1abe85063976bf71c033f62f3e6bf6621647fe44a6ee31ed687e3fa5cbb7
index a813cfe39961dc96ea386d704f7d20df176fe626..5fa87d57d267b46ac2d03366f5771cdbf8ee2cdd 100755 (executable)
@@ -55,8 +55,7 @@ setupaptarchive
 APTARCHIVE=$(readlink -f ./aptarchive)
 
 # normal operation gets highest version number
-HEADER="Reading package lists...
-Building dependency tree..."
+HEADER='Reading package lists...'
 DOWNLOAD1="Need to get 0 B/25 B of source archives.
 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 SHA256:ed7c25c832596339bee13e4e7c45cf49f869b60d2bf57252f18191d75866c2a7
 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 SHA256:f3da8c6ebc62c8ef2dae439a498dddcdacc1a07f45ff67ad12f44b6e2353c239"
@@ -161,13 +160,10 @@ Need to get 0 B/25 B of source archives.
 Fetch source foo" apt source -q -s foo
 testsuccessequal "$(getbuilddep 'foo')" apt build-dep foo -s
 
-testfailureequal 'Reading package lists...
-Building dependency tree...
-E: Must specify at least one package to fetch source for' apt source
+testfailureequal 'E: Must specify at least one package to fetch source for' apt source
 testfailureequal 'E: Must specify at least one package to check builddeps for' apt build-dep
 
 testsuccessequal "Reading package lists...
-Building dependency tree...
 NOTICE: 'bar' packaging is maintained in the 'Git' version control system at:
 git://anonscm.debian.org/bar/bar.git -b debian/experimental
 Please use:
index f030a03dc78ca8cc9586588f6bf423d3c2d1d606..015a803bc66a19b74dac5b2844c800ed9d8ab1a0 100755 (executable)
@@ -156,7 +156,6 @@ cd downloaded
 testok() {
        rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
        testsuccessequal "Reading package lists...
-Building dependency tree...
 Need to get 6 B of source archives.
 Get:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc) [3 B]
 Get:2 http://localhost:${APTHTTPPORT}  $1 1.0 (tar) [3 B]
@@ -170,7 +169,6 @@ testkeep() {
        echo -n 'dsc' > ${1}_1.0.dsc
        echo -n 'tar' > ${1}_1.0.tar.gz
        testsuccessequal "Reading package lists...
-Building dependency tree...
 Skipping already downloaded file '${1}_1.0.dsc'
 Skipping already downloaded file '${1}_1.0.tar.gz'
 Need to get 0 B of source archives.
@@ -184,7 +182,6 @@ testnohash() {
        #FIXME: Maybe we should fail in this case instead of skipping
        rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
        testsuccessequal "Reading package lists...
-Building dependency tree...
 Skipping download of file '${1}_1.0.dsc' as requested hashsum is not available for authentication
 Skipping download of file '${1}_1.0.tar.gz' as requested hashsum is not available for authentication
 Need to get 0 B of source archives.
@@ -196,7 +193,6 @@ Download complete and in download only mode" aptget source -d "$@"
 testmismatch() {
        rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
        testfailureequal "Reading package lists...
-Building dependency tree...
 Need to get 6 B of source archives.
 Get:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc) [3 B]
 Err:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc)
@@ -215,7 +211,6 @@ E: Failed to fetch some archives." aptget source -d "$@"
        if [ "$2" != '--allow-unauthenticated' ]; then
                rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
                testsuccessequal "Reading package lists...
-Building dependency tree...
 Skipping download of file '${1}_1.0.dsc' as requested hashsum is not available for authentication
 Skipping download of file '${1}_1.0.tar.gz' as requested hashsum is not available for authentication
 Need to get 0 B of source archives.
@@ -226,7 +221,6 @@ Download complete and in download only mode" aptget source -d "$@" -o Acquire::F
 
        rm -f ${1}_1.0.dsc ${1}_1.0.tar.gz
        testsuccessequal "Reading package lists...
-Building dependency tree...
 Need to get 6 B of source archives.
 Get:1 http://localhost:${APTHTTPPORT}  $1 1.0 (dsc) [3 B]
 Get:2 http://localhost:${APTHTTPPORT}  $1 1.0 (tar) [3 B]
@@ -252,7 +246,6 @@ testmismatch pkg-md5-bad --allow-unauthenticated
 testok pkg-no-md5
 testok pkg-no-md5 -o Acquire::ForceHash=SHA256
 testsuccessequal "Reading package lists...
-Building dependency tree...
 Skipping download of file 'pkg-no-md5_1.0.dsc' as requested hashsum is not available for authentication
 Skipping download of file 'pkg-no-md5_1.0.tar.gz' as requested hashsum is not available for authentication
 Need to get 0 B of source archives.
@@ -264,7 +257,6 @@ testfailure --nomsg test -e pkg-no-md5_1.0.dsc -a -e pkg-no-md5_1.0.tar.gz
 # mostly pathologic as this shouldn't happen, but just to be sure
 testok pkg-mixed-ok
 testfailureequal "Reading package lists...
-Building dependency tree...
 Need to get 6 B of source archives.
 Get:1 http://localhost:${APTHTTPPORT}  pkg-mixed-sha1-bad 1.0 (tar) [3 B]
 Get:2 http://localhost:${APTHTTPPORT}  pkg-mixed-sha1-bad 1.0 (dsc) [3 B]
@@ -276,7 +268,6 @@ E: Failed to fetch some archives." aptget source -d pkg-mixed-sha1-bad
 msgtest 'Only tar file is downloaded as the dsc has hashsum mismatch' 'pkg-mixed-sha1-bad'
 testsuccess --nomsg test ! -e pkg-mixed-sha1-bad_1.0.dsc -a -e pkg-mixed-sha1-bad_1.0.tar.gz
 testfailureequal "Reading package lists...
-Building dependency tree...
 Need to get 6 B of source archives.
 Get:1 http://localhost:${APTHTTPPORT}  pkg-mixed-sha2-bad 1.0 (tar) [3 B]
 Err:1 http://localhost:${APTHTTPPORT}  pkg-mixed-sha2-bad 1.0 (tar)
@@ -291,8 +282,6 @@ testsuccess --nomsg test -e pkg-mixed-sha2-bad_1.0.dsc -a ! -e pkg-mixed-sha2-ba
 # it gets even more pathologic: multiple entries for one file, some even disagreeing!
 testnohash pkg-md5-agree
 testfailureequal 'Reading package lists...
-Building dependency tree...
 E: Error parsing checksum in Files of source package pkg-md5-disagree' aptget source -d pkg-md5-disagree
 testfailureequal 'Reading package lists...
-Building dependency tree...
 E: Error parsing checksum in Checksums-SHA256 of source package pkg-sha256-disagree' aptget source -d pkg-sha256-disagree