Browse Source

avoid building dependency tree in 'source' command

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.
tags/debian/1.2.2
David Kalnischkies 5 years ago
parent
commit
d603afd970
5 changed files with 5 additions and 25 deletions
  1. +1
    -4
      apt-private/private-source.cc
  2. +1
    -2
      test/integration/test-apt-get-source-arch
  3. +1
    -2
      test/integration/test-apt-get-source-multisources
  4. +2
    -6
      test/integration/test-apt-source-and-build-dep
  5. +0
    -11
      test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum

+ 1
- 4
apt-private/private-source.cc View 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;


+ 1
- 2
test/integration/test-apt-get-source-arch View File

@@ -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"


+ 1
- 2
test/integration/test-apt-get-source-multisources View File

@@ -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


+ 2
- 6
test/integration/test-apt-source-and-build-dep View File

@@ -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:


+ 0
- 11
test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum View File

@@ -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

Loading…
Cancel
Save