Permalink
...
Comparing changes
Open a pull request
14
contributors
Commits on Aug 31, 2016
Commits on Oct 05, 2016
Commits on Oct 31, 2016
Commits on Nov 14, 2016
Commits on Nov 15, 2016
Commits on Nov 23, 2016
Commits on Dec 08, 2016
Commits on Jan 17, 2017
Commits on Feb 22, 2017
Commits on Feb 27, 2017
Commits on Apr 25, 2017
Commits on May 05, 2017
Commits on May 19, 2017
Commits on Jun 19, 2017
Commits on Sep 13, 2017
Unified
Split
Showing
with
2,876 additions
and 1,423 deletions.
- +6 −2 .travis.yml
- +21 −22 COPYING.GPL
- +1 −1 apt-inst/deb/debfile.cc
- +43 −25 apt-pkg/acquire-item.cc
- +14 −3 apt-pkg/acquire-method.cc
- +28 −3 apt-pkg/acquire.cc
- +10 −9 apt-pkg/algorithms.cc
- +1 −1 apt-pkg/aptconfiguration.cc
- +2 −2 apt-pkg/cacheiterators.h
- +10 −4 apt-pkg/contrib/cmndline.cc
- +16 −18 apt-pkg/contrib/error.cc
- +58 −20 apt-pkg/contrib/fileutl.cc
- +4 −1 apt-pkg/contrib/fileutl.h
- +32 −5 apt-pkg/contrib/gpgv.cc
- +2 −0 apt-pkg/contrib/hashes.cc
- +4 −4 apt-pkg/contrib/hashes.h
- +6 −6 apt-pkg/contrib/hashsum_template.h
- +2 −0 apt-pkg/contrib/md5.cc
- +1 −1 apt-pkg/contrib/md5.h
- +1 −1 apt-pkg/contrib/proxy.cc
- +2 −0 apt-pkg/contrib/sha1.cc
- +1 −1 apt-pkg/contrib/sha1.h
- +3 −3 apt-pkg/contrib/sha2.h
- +111 −39 apt-pkg/contrib/strutl.cc
- +15 −0 apt-pkg/contrib/strutl.h
- +22 −7 apt-pkg/deb/deblistparser.cc
- +5 −2 apt-pkg/deb/debmetaindex.cc
- +17 −4 apt-pkg/deb/debsrcrecords.cc
- +28 −6 apt-pkg/deb/dpkgpm.cc
- +136 −136 apt-pkg/depcache.cc
- +1 −0 apt-pkg/depcache.h
- +1 −1 apt-pkg/edsp.cc
- +1 −0 apt-pkg/init.cc
- +39 −34 apt-pkg/install-progress.cc
- +1 −1 apt-pkg/install-progress.h
- +19 −18 apt-pkg/packagemanager.cc
- +5 −1 apt-pkg/pkgcache.cc
- +46 −30 apt-pkg/pkgcachegen.cc
- +4 −5 apt-pkg/policy.cc
- +56 −0 apt-pkg/prettyprinters.cc
- +37 −0 apt-pkg/prettyprinters.h
- +2 −2 apt-pkg/tagfile.cc
- +2 −2 apt-private/acqprogress.cc
- +1 −0 apt-private/private-cmndline.cc
- +1 −1 apt-private/private-download.cc
- +24 −8 apt-private/private-install.cc
- +3 −7 apt-private/private-source.cc
- +7 −7 apt-private/private-update.cc
- +10 −2 cmdline/apt-config.cc
- +3 −3 cmdline/apt-get.cc
- +39 −26 cmdline/apt-key.in
- +4 −2 completions/bash/apt
- +1 −1 configure.ac
- +11 −0 debian/NEWS
- +11 −0 debian/apt-daily-upgrade.service
- +11 −0 debian/apt-daily-upgrade.timer
- +5 −2 debian/apt-daily.service
- +1 −2 debian/apt-daily.timer
- +23 −1 debian/apt.apt-compat.cron.daily
- +1 −1 debian/apt.auto-removal.sh
- +102 −95 debian/apt.systemd.daily
- +201 −1 debian/changelog
- +2 −2 debian/rules
- +1 −1 debian/tests/run-tests
- +2 −2 doc/apt-get.8.xml
- +1 −1 doc/apt-verbatim.ent
- +2 −2 doc/po/apt-doc.pot
- +1 −1 doc/po/de.po
- +1 −1 doc/po/es.po
- +1 −1 doc/po/fr.po
- +1 −1 doc/po/it.po
- +1 −1 doc/po/ja.po
- +1 −1 doc/po/nl.po
- +1 −1 doc/po/pl.po
- +1 −1 doc/po/pt.po
- +1 −1 doc/po/pt_BR.po
- +13 −18 ftparchive/writer.cc
- +31 −0 methods/aptmethod.h
- +37 −9 methods/connect.cc
- +2 −7 methods/copy.cc
- +15 −2 methods/ftp.cc
- +3 −0 methods/gpgv.cc
- +10 −8 methods/http.cc
- +1 −1 methods/http.h
- +16 −1 methods/https.cc
- +1 −1 methods/https.h
- +52 −23 methods/rred.cc
- +36 −26 methods/server.cc
- +1 −1 methods/server.h
- +2 −14 methods/store.cc
- +10 −9 po/apt-all.pot
- +13 −12 po/ar.po
- +13 −12 po/ast.po
- +13 −12 po/bg.po
- +9 −8 po/bs.po
- +13 −12 po/ca.po
- +11 −10 po/cs.po
- +13 −12 po/cy.po
- +13 −12 po/da.po
- +13 −12 po/de.po
- +13 −12 po/dz.po
- +13 −12 po/el.po
- +11 −10 po/es.po
- +13 −12 po/eu.po
- +13 −12 po/fi.po
- +13 −12 po/fr.po
- +13 −12 po/gl.po
- +11 −10 po/hu.po
- +13 −12 po/it.po
- +12 −11 po/ja.po
- +13 −12 po/km.po
- +13 −12 po/ko.po
- +11 −10 po/ku.po
- +11 −10 po/lt.po
- +13 −12 po/mr.po
- +14 −13 po/nb.po
- +13 −12 po/ne.po
- +11 −10 po/nl.po
- +13 −12 po/nn.po
- +13 −12 po/pl.po
- +13 −12 po/pt.po
- +13 −12 po/pt_BR.po
- +13 −12 po/ro.po
- +13 −12 po/ru.po
- +13 −12 po/sk.po
- +14 −13 po/sl.po
- +13 −12 po/sv.po
- +13 −12 po/th.po
- +13 −12 po/tl.po
- +110 −77 po/tr.po
- +13 −12 po/uk.po
- +13 −12 po/vi.po
- +19 −18 po/zh_CN.po
- +12 −11 po/zh_TW.po
- +13 −0 shippable.yml
- +0 −68 test/integration/Packages-bug-604222-new-and-autoremove
- +17 −0 test/integration/Packages-github-23-too-long-dependency-line
- +12 −3 test/integration/framework
- +32 −0 test/integration/skip-apt-dropprivs
- +0 −10 test/integration/status-bug-604222-new-and-autoremove
- +12 −0 test/integration/status-github-23-too-long-dependency-line
- +1 −1 test/integration/test-apt-cdrom
- +1 −0 test/integration/test-apt-cli-update
- +36 −0 test/integration/test-apt-get-autoremove
- +12 −7 test/integration/test-apt-get-build-dep-file
- +3 −3 test/integration/test-apt-get-changelog
- +26 −8 test/integration/test-apt-get-install-deb
- +26 −0 test/integration/test-apt-key
- +4 −0 test/integration/test-apt-update-expected-size
- +5 −1 test/integration/test-apt-update-file
- +9 −2 test/integration/test-apt-update-ims
- +44 −20 test/integration/test-bug-604222-new-and-autoremove
- +1 −1 test/integration/test-bug-738785-switch-protocol
- +1 −0 test/integration/test-bug-778375-server-has-no-reason-phrase
- +27 −0 test/integration/test-bug-829651
- +46 −0 test/integration/test-bug-838779-untrusted-to-trusted-Release-hit
- +58 −0 test/integration/test-bug-lp1694697-build-dep-architecture-limited-alternative
- +3 −0 test/integration/test-essential-force-loopbreak
- +17 −0 test/integration/test-github-23-too-long-dependency-line
- +9 −3 test/integration/test-kernel-helper-autoremove
- +3 −0 test/integration/test-method-rred
- +15 −5 test/integration/test-pdiff-usage
- +15 −1 test/integration/test-releasefile-verification
- +2 −2 test/integration/test-sourceslist-trusted-options
- +35 −0 test/integration/test-srcrecord
- +19 −0 test/integration/test-ubuntu-bug-1651923-requote-https-uri
- +4 −0 test/integration/test-ubuntu-bug-761175-remove-purge
- +27 −0 test/interactive-helper/aptdropprivs.cc
- +3 −0 test/interactive-helper/aptwebserver.cc
- +6 −0 test/interactive-helper/makefile
- +9 −0 test/libapt/apt-proxy-script
- +9 −1 test/libapt/commandline_test.cc
- +35 −0 test/libapt/fileutl_test.cc
- +73 −0 test/libapt/strutil_test.cc
- +38 −0 test/libapt/uri_test.cc
View
8
.travis.yml
| @@ -1,17 +1,21 @@ | ||
| language: cpp | ||
| sudo: required | ||
| dist: trusty | ||
| +env: | ||
| + - TEST_SUITE=user | ||
| + - TEST_SUITE=root | ||
| before_install: | ||
| - sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ wily main universe' -y | ||
| - | | ||
| sudo sh -c '/bin/echo -e "Package: *\nPin: release n=wily\nPin-Priority: 1" > /etc/apt/preferences.d/wily' | ||
| - sudo apt-get update -qq | ||
| install: | ||
| + - sudo apt-get -qq -y -t wily install libstdc++-5-dev g++ | ||
| - sudo ./prepare-release travis-ci | ||
| - sudo apt-get -qq -y -t wily install gettext liblz4-dev python3-apt | ||
| - make | ||
| script: | ||
| - make test | ||
| - - ./test/integration/run-tests -q | ||
| + - test "$TEST_SUITE" != "user" || ./test/integration/run-tests -q | ||
| - sudo adduser --force-badname --system --home /nonexistent --no-create-home --quiet _apt || true | ||
| - - sudo ./test/integration/run-tests -q | ||
| + - test "$TEST_SUITE" != "root" || sudo ./test/integration/run-tests -q |
View
43
COPYING.GPL
| @@ -1,12 +1,12 @@ | ||
| - GNU GENERAL PUBLIC LICENSE | ||
| - Version 2, June 1991 | ||
| + GNU GENERAL PUBLIC LICENSE | ||
| + Version 2, June 1991 | ||
| - Copyright (C) 1989, 1991 Free Software Foundation, Inc. | ||
| - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| + Copyright (C) 1989, 1991 Free Software Foundation, Inc., | ||
| + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| Everyone is permitted to copy and distribute verbatim copies | ||
| of this license document, but changing it is not allowed. | ||
| - Preamble | ||
| + Preamble | ||
| The licenses for most software are designed to take away your | ||
| freedom to share and change it. By contrast, the GNU General Public | ||
| @@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This | ||
| General Public License applies to most of the Free Software | ||
| Foundation's software and to any other program whose authors commit to | ||
| using it. (Some other Free Software Foundation software is covered by | ||
| -the GNU Library General Public License instead.) You can apply it to | ||
| +the GNU Lesser General Public License instead.) You can apply it to | ||
| your programs, too. | ||
| When we speak of free software, we are referring to freedom, not | ||
| @@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. | ||
| The precise terms and conditions for copying, distribution and | ||
| modification follow. | ||
| - | ||
| - GNU GENERAL PUBLIC LICENSE | ||
| + | ||
| + GNU GENERAL PUBLIC LICENSE | ||
| TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
| 0. This License applies to any program or other work which contains | ||
| @@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: | ||
| License. (Exception: if the Program itself is interactive but | ||
| does not normally print such an announcement, your work based on | ||
| the Program is not required to print an announcement.) | ||
| - | ||
| + | ||
| These requirements apply to the modified work as a whole. If | ||
| identifiable sections of that work are not derived from the Program, | ||
| and can be reasonably considered independent and separate works in | ||
| @@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent | ||
| access to copy the source code from the same place counts as | ||
| distribution of the source code, even though third parties are not | ||
| compelled to copy the source along with the object code. | ||
| - | ||
| + | ||
| 4. You may not copy, modify, sublicense, or distribute the Program | ||
| except as expressly provided under this License. Any attempt | ||
| otherwise to copy, modify, sublicense or distribute the Program is | ||
| @@ -225,7 +225,7 @@ impose that choice. | ||
| This section is intended to make thoroughly clear what is believed to | ||
| be a consequence of the rest of this License. | ||
| - | ||
| + | ||
| 8. If the distribution and/or use of the Program is restricted in | ||
| certain countries either by patents or by copyrighted interfaces, the | ||
| original copyright holder who places the Program under this License | ||
| @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals | ||
| of preserving the free status of all derivatives of our free software and | ||
| of promoting the sharing and reuse of software generally. | ||
| - NO WARRANTY | ||
| + NO WARRANTY | ||
| 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||
| FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
| @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | ||
| PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | ||
| POSSIBILITY OF SUCH DAMAGES. | ||
| - END OF TERMS AND CONDITIONS | ||
| - | ||
| - How to Apply These Terms to Your New Programs | ||
| + END OF TERMS AND CONDITIONS | ||
| + | ||
| + How to Apply These Terms to Your New Programs | ||
| If you develop a new program, and you want it to be of the greatest | ||
| possible use to the public, the best way to achieve this is to make it | ||
| @@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least | ||
| the "copyright" line and a pointer to where the full notice is found. | ||
| <one line to give the program's name and a brief idea of what it does.> | ||
| - Copyright (C) 19yy <name of author> | ||
| + Copyright (C) <year> <name of author> | ||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| @@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found. | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
| - You should have received a copy of the GNU General Public License | ||
| - along with this program; if not, write to the Free Software | ||
| - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| - | ||
| + You should have received a copy of the GNU General Public License along | ||
| + with this program; if not, write to the Free Software Foundation, Inc., | ||
| + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| Also add information on how to contact you by electronic and paper mail. | ||
| If the program is interactive, make it output a short notice like this | ||
| when it starts in an interactive mode: | ||
| - Gnomovision version 69, Copyright (C) 19yy name of author | ||
| + Gnomovision version 69, Copyright (C) year name of author | ||
| Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | ||
| This is free software, and you are welcome to redistribute it | ||
| under certain conditions; type `show c' for details. | ||
| @@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names: | ||
| This General Public License does not permit incorporating your program into | ||
| proprietary programs. If your program is a subroutine library, you may | ||
| consider it more useful to permit linking proprietary applications with the | ||
| -library. If this is what you want to do, use the GNU Library General | ||
| +library. If this is what you want to do, use the GNU Lesser General | ||
| Public License instead of this License. | ||
View
2
apt-inst/deb/debfile.cc
| @@ -113,7 +113,7 @@ bool debDebFile::ExtractTarMember(pkgDirStream &Stream,const char *Name) | ||
| Member = AR.FindMember(std::string(Name).append(c->Extension).c_str()); | ||
| if (Member == NULL) | ||
| continue; | ||
| - Compressor = c->Binary; | ||
| + Compressor = c->Name; | ||
| break; | ||
| } | ||
View
68
apt-pkg/acquire-item.cc
| @@ -1666,10 +1666,16 @@ void pkgAcqMetaSig::Done(string const &Message, HashStringList const &Hashes, | ||
| } | ||
| else if(MetaIndex->CheckAuthDone(Message) == true) | ||
| { | ||
| - if (TransactionManager->IMSHit == false) | ||
| + auto const Releasegpg = GetFinalFilename(); | ||
| + auto const Release = MetaIndex->GetFinalFilename(); | ||
| + // if this is an IMS-Hit on Release ensure we also have the the Release.gpg file stored | ||
| + // (previously an unknown pubkey) – but only if the Release file exists locally (unlikely | ||
| + // event of InRelease removed from the mirror causing fallback but still an IMS-Hit) | ||
| + if (TransactionManager->IMSHit == false || | ||
| + (FileExists(Releasegpg) == false && FileExists(Release) == true)) | ||
| { | ||
| - TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); | ||
| - TransactionManager->TransactionStageCopy(MetaIndex, MetaIndex->DestFile, MetaIndex->GetFinalFilename()); | ||
| + TransactionManager->TransactionStageCopy(this, DestFile, Releasegpg); | ||
| + TransactionManager->TransactionStageCopy(MetaIndex, MetaIndex->DestFile, Release); | ||
| } | ||
| } | ||
| } | ||
| @@ -1804,6 +1810,18 @@ void pkgAcqDiffIndex::QueueOnIMSHit() const /*{{{*/ | ||
| new pkgAcqIndexDiffs(Owner, TransactionManager, Target); | ||
| } | ||
| /*}}}*/ | ||
| +static bool RemoveFileForBootstrapLinking(bool const Debug, std::string const &For, std::string const &Boot)/*{{{*/ | ||
| +{ | ||
| + if (FileExists(Boot) && RemoveFile("Bootstrap-linking", Boot) == false) | ||
| + { | ||
| + if (Debug) | ||
| + std::clog << "Bootstrap-linking for patching " << For | ||
| + << " by removing stale " << Boot << " failed!" << std::endl; | ||
| + return false; | ||
| + } | ||
| + return true; | ||
| +} | ||
| + /*}}}*/ | ||
| bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| { | ||
| // failing here is fine: our caller will take care of trying to | ||
| @@ -1824,6 +1842,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| HashStringList ServerHashes; | ||
| unsigned long long ServerSize = 0; | ||
| + auto const &posix = std::locale::classic(); | ||
| for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) | ||
| { | ||
| std::string tagname = *type; | ||
| @@ -1835,6 +1854,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| string hash; | ||
| unsigned long long size; | ||
| std::stringstream ss(tmp); | ||
| + ss.imbue(posix); | ||
| ss >> hash >> size; | ||
| if (unlikely(hash.empty() == true)) | ||
| continue; | ||
| @@ -1913,6 +1933,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| string hash, filename; | ||
| unsigned long long size; | ||
| std::stringstream ss(tmp); | ||
| + ss.imbue(posix); | ||
| while (ss >> hash >> size >> filename) | ||
| { | ||
| @@ -1971,6 +1992,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| string hash, filename; | ||
| unsigned long long size; | ||
| std::stringstream ss(tmp); | ||
| + ss.imbue(posix); | ||
| while (ss >> hash >> size >> filename) | ||
| { | ||
| @@ -2008,6 +2030,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| string hash, filename; | ||
| unsigned long long size; | ||
| std::stringstream ss(tmp); | ||
| + ss.imbue(posix); | ||
| // FIXME: all of pdiff supports only .gz compressed patches | ||
| while (ss >> hash >> size >> filename) | ||
| @@ -2138,23 +2161,15 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ | ||
| if (unlikely(Final.empty())) // because we wouldn't be called in such a case | ||
| return false; | ||
| std::string const PartialFile = GetPartialFileNameFromURI(Target.URI); | ||
| - if (FileExists(PartialFile) && RemoveFile("Bootstrap-linking", PartialFile) == false) | ||
| - { | ||
| - if (Debug) | ||
| - std::clog << "Bootstrap-linking for patching " << CurrentPackagesFile | ||
| - << " by removing stale " << PartialFile << " failed!" << std::endl; | ||
| + std::string const PatchedFile = GetKeepCompressedFileName(PartialFile + "-patched", Target); | ||
| + if (RemoveFileForBootstrapLinking(Debug, CurrentPackagesFile, PartialFile) == false || | ||
| + RemoveFileForBootstrapLinking(Debug, CurrentPackagesFile, PatchedFile) == false) | ||
| return false; | ||
| - } | ||
| for (auto const &ext : APT::Configuration::getCompressorExtensions()) | ||
| { | ||
| - std::string const Partial = PartialFile + ext; | ||
| - if (FileExists(Partial) && RemoveFile("Bootstrap-linking", Partial) == false) | ||
| - { | ||
| - if (Debug) | ||
| - std::clog << "Bootstrap-linking for patching " << CurrentPackagesFile | ||
| - << " by removing stale " << Partial << " failed!" << std::endl; | ||
| + if (RemoveFileForBootstrapLinking(Debug, CurrentPackagesFile, PartialFile + ext) == false || | ||
| + RemoveFileForBootstrapLinking(Debug, CurrentPackagesFile, PatchedFile + ext) == false) | ||
| return false; | ||
| - } | ||
| } | ||
| std::string const Ext = Final.substr(CurrentPackagesFile.length()); | ||
| std::string const Partial = PartialFile + Ext; | ||
| @@ -2435,9 +2450,10 @@ std::string pkgAcqIndexDiffs::Custom600Headers() const /*{{{*/ | ||
| if(State != StateApplyDiff) | ||
| return pkgAcqBaseIndex::Custom600Headers(); | ||
| std::ostringstream patchhashes; | ||
| - HashStringList const ExpectedHashes = available_patches[0].patch_hashes; | ||
| - for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) | ||
| - patchhashes << "\nPatch-0-" << hs->HashType() << "-Hash: " << hs->HashValue(); | ||
| + for (auto && hs : available_patches[0].result_hashes) | ||
| + patchhashes << "\nStart-" << hs.HashType() << "-Hash: " << hs.HashValue(); | ||
| + for (auto && hs : available_patches[0].patch_hashes) | ||
| + patchhashes << "\nPatch-0-" << hs.HashType() << "-Hash: " << hs.HashValue(); | ||
| patchhashes << pkgAcqBaseIndex::Custom600Headers(); | ||
| return patchhashes.str(); | ||
| } | ||
| @@ -2584,12 +2600,14 @@ std::string pkgAcqIndexMergeDiffs::Custom600Headers() const /*{{{*/ | ||
| return pkgAcqBaseIndex::Custom600Headers(); | ||
| std::ostringstream patchhashes; | ||
| unsigned int seen_patches = 0; | ||
| + for (auto && hs : (*allPatches)[0]->patch.result_hashes) | ||
| + patchhashes << "\nStart-" << hs.HashType() << "-Hash: " << hs.HashValue(); | ||
| for (std::vector<pkgAcqIndexMergeDiffs *>::const_iterator I = allPatches->begin(); | ||
| I != allPatches->end(); ++I) | ||
| { | ||
| HashStringList const ExpectedHashes = (*I)->patch.patch_hashes; | ||
| for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) | ||
| - patchhashes << "\nPatch-" << seen_patches << "-" << hs->HashType() << "-Hash: " << hs->HashValue(); | ||
| + patchhashes << "\nPatch-" << std::to_string(seen_patches) << "-" << hs->HashType() << "-Hash: " << hs->HashValue(); | ||
| ++seen_patches; | ||
| } | ||
| patchhashes << pkgAcqBaseIndex::Custom600Headers(); | ||
| @@ -2637,10 +2655,6 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc, | ||
| DestFile = GetPartialFileNameFromURI(URI); | ||
| NextCompressionExtension(CurrentCompressionExtension, CompressionExtensions, false); | ||
| - // store file size of the download to ensure the fetcher gives | ||
| - // accurate progress reporting | ||
| - FileSize = GetExpectedHashes().FileSize(); | ||
| - | ||
| if (CurrentCompressionExtension == "uncompressed") | ||
| { | ||
| Desc.URI = URI; | ||
| @@ -2677,6 +2691,9 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc, | ||
| DestFile = DestFile + '.' + CurrentCompressionExtension; | ||
| } | ||
| + // store file size of the download to ensure the fetcher gives | ||
| + // accurate progress reporting | ||
| + FileSize = GetExpectedHashes().FileSize(); | ||
| Desc.Description = URIDesc; | ||
| Desc.Owner = this; | ||
| @@ -3239,7 +3256,8 @@ std::string pkgAcqChangelog::URI(pkgCache::VerIterator const &Ver) /*{{{*/ | ||
| pkgCache::PkgIterator const Pkg = Ver.ParentPkg(); | ||
| if (Pkg->CurrentVer != 0 && Pkg.CurrentVer() == Ver) | ||
| { | ||
| - std::string const basename = std::string("/usr/share/doc/") + Pkg.Name() + "/changelog"; | ||
| + std::string const root = _config->FindDir("Dir"); | ||
| + std::string const basename = root + std::string("usr/share/doc/") + Pkg.Name() + "/changelog"; | ||
| std::string const debianname = basename + ".Debian"; | ||
| if (FileExists(debianname)) | ||
| return "copy://" + debianname; | ||
View
17
apt-pkg/acquire-method.cc
| @@ -80,9 +80,20 @@ void pkgAcqMethod::Fail(bool Transient) | ||
| { | ||
| string Err = "Undetermined Error"; | ||
| if (_error->empty() == false) | ||
| - _error->PopMessage(Err); | ||
| - _error->Discard(); | ||
| - Fail(Err,Transient); | ||
| + { | ||
| + Err.clear(); | ||
| + while (_error->empty() == false) | ||
| + { | ||
| + std::string msg; | ||
| + if (_error->PopMessage(msg)) | ||
| + { | ||
| + if (Err.empty() == false) | ||
| + Err.append("\n"); | ||
| + Err.append(msg); | ||
| + } | ||
| + } | ||
| + } | ||
| + Fail(Err, Transient); | ||
| } | ||
| /*}}}*/ | ||
| // AcqMethod::Fail - A fetch has failed /*{{{*/ | ||
Oops, something went wrong.