summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
Commit message (Collapse)AuthorAgeFilesLines
* promote ExpectedHashes to a pkgAcquire::Item memberDavid Kalnischkies2014-05-091-26/+23
| | | | | | Beside being another big API break with hopefully zero fallout in reality it avoids having the same member and helper code in each and every subclass.
* use HashStringList in the acquire systemDavid Kalnischkies2014-05-091-107/+95
| | | | | | | | | | | | | It is not very extensible to have the supported Hashes hardcoded everywhere and especially if it is part of virtual method names. It is also possible that a method does not support the 'best' hash (yet), so we might end up not being able to verify a file even though we have a common subset of supported hashes. And those are just two of the cases in which it is handy to have a more dynamic selection. The downside is that this is a MAJOR API break, but the HashStringList has a string constructor for compatibility, so with a bit of luck the few frontends playing with the acquire system directly are okay.
* Merge remote-tracking branch 'mvo/bugfix/update-progress-reporting' into ↵Michael Vogt2014-05-081-0/+2
|\ | | | | | | debian/experimental
| * Merge remote-tracking branch 'upstream/debian/sid' into ↵Michael Vogt2014-05-081-0/+2
| |\ | | | | | | | | | bugfix/update-progress-reporting
| | * initialize Verify in second pkgAcqIndex constructorDavid Kalnischkies2014-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc reports in testcase ./test-bug-596498-trusted-unsigned-repo: apt-pkg/acquire-item.cc:1059:7: runtime error: load of value 234, which is not a valid value for type 'bool' This happens as the bool Verify is initialized only in one of the two constructors of the pkgAcqIndex class. It isn't a problem through as the verification controlled by this flag is optional and used to fail early on garbage files (like network portal pages) instead of later on in the hashsum verification or while parsing (the then untrusted) file. Reported-By: gcc-4.9 -fsanitize=undefined
* | | Merge remote-tracking branch 'mvo/bugfix/update-progress-reporting' into ↵Michael Vogt2014-05-071-20/+70
|\| | | | | | | | | | | debian/experimental
| * | pass Target/MetaIndexParser around into pkgAcqDiffIndex so that this can be ↵Michael Vogt2014-04-171-20/+26
| | | | | | | | | | | | used to create a proper pkgAcqIndex() with size information
| * | use correct compression extension when loading the size of the size into the ↵Michael Vogt2014-04-161-7/+18
| | | | | | | | | | | | fetcher
| * | add Debug::acquire::progress debug option and fixme for index file loading ↵Michael Vogt2014-04-161-0/+1
| | | | | | | | | | | | with the correct extension
| * | load the size from the metaindex into the fetcher to have even more accurate ↵Michael Vogt2014-04-161-3/+12
| | | | | | | | | | | | progress information
| * | make the TotalFiles more reliable in apt-get updateMichael Vogt2014-04-161-1/+24
| |/
* | Merge remote-tracking branch 'mvo/feature/apt-install-deb' into ↵Michael Vogt2014-05-071-1/+2
|\ \ | | | | | | | | | debian/experimental
| * | WIP local deb installMichael Vogt2014-04-281-1/+2
| |/
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-05-071-27/+32
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
| * use the pretty fullname of a pkg as download desciptionDavid Kalnischkies2014-03-131-6/+2
| | | | | | | | | | | | Otherwise the "WARNING: The following packages cannot be authenticated!" messages does not include the architecture of the package, so it would be slightly misinformative.
| * follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-1/+1
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
| * cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-3/+12
| | | | | | | | | | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
| * warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-10/+10
| | | | | | | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
| * warning: useless cast to type A [-Wuseless-cast]David Kalnischkies2014-03-131-6/+6
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wuseless-cast
| * initial version of apt-helperMichael Vogt2014-02-271-1/+1
| |
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-02-271-68/+238
|\| | | | | | | | | | | | | | | Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
| * Fix typos in documentation (codespell)Michael Vogt2014-02-221-10/+10
| |
| * always cleanup patchfiles at the end of rred callDavid Kalnischkies2014-02-101-0/+9
| | | | | | | | | | | | | | | | | | With APT::Get::List-Cleanup disabled the ed-style patch files are lingering in the lists/ directory otherwise. That was kinda okay in the old none-client-merge as the filename was always the same so it was constantly overridden, but now with different names for client-merge quiet a few could pill up on the system and are used by the next call as it picks them up based on the filename.
| * integrate Anthonys rred with POC for client-side mergeDavid Kalnischkies2014-01-151-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Providing the benefits of both without the downsides :) (ABI breaks or external dependencies) For this Anthonys rred is equipped with: - magic-filename-pickup of patches rather than explicit messages - use of FileFd instead of FILE* to get on-the-fly uncompress of the gzip compressed pdiff patches The acquire code in turn stops checking for apt-file's helper as our own rred is now clever enough for our needs.
| * reenable unlimited pdiff files downloadDavid Kalnischkies2014-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In 51fc6def77edfb1f429a48e5169519e9e05a759b we limited the amount of pdiff to be downloaded per index to 20. This was a compromise between not letting it go overboard (becoming even slower) and not using bandwidth needlessly. Now that with the POC the speed reason is gone it makes sense again to download as much files as we possible can via pdiff to save bandwidth (and possibly even time). It also avoids problems with the limit in cases we were we deal with a server merged archieve as this limit assumes a strict patch progression.
| * correct IndexDiff vs DiffIndex in Debug outputAnthony Towns2014-01-151-6/+6
| |
| * implement POC client-side merging of pdiffs via apt-fileDavid Kalnischkies2013-12-131-3/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of pdiffs is to avoid downloading the hole file by patching the existing index. This works very well, but becomes slow if a lot of patches needs to be applied to reconstruct an up-to-date index and in recent years more and more dinstall (or similar) runs are executed creating more and more pdiffs in the same amount of time, so pdiffs became less useful. The solution is simple: Reduce the amount of patches (which are very small) which need to be applied on top of the index we have available (which is usually pretty big). This can be done in two ways: Either merge the patches on the server-side so that the client has to download only one patch or the patches are all downloaded and merged on the client-side. The first needs a client who is doing one step at a time who can also skip patches if it needs (APT supports this for a long time now). The later is implemented by this commit, but depends on the server NOT merging the patches and the patches being in a strict order in which no patch is skipped. This is traditionally the case for dak, but other repository creators support merging – e.g. reprepro (which helpfully adds a flag indicating that the patches are merged). To support both or even mixes a client needs more information which isn't available for now. This POC uses the external diffindex-rred included in apt-file to do the heavy lifting of merging & applying all patches in one pass, hence to test this feature apt-file needs to be installed.
| * query an empty pkgAcqIndexDiffs if index is up-to-dateDavid Kalnischkies2013-12-131-7/+9
| | | | | | | | | | | | | | The previous code already did this, this is just being a hell of a lot more obvious, so that it isn't that easy to break in the future. Git-Dch: Ignore
| * Merge remote-tracking branch 'mvo/feature/limit-default-pdiffs' into debian/sidMichael Vogt2013-10-091-1/+1
| |\
| | * set Acquire::PDiffs::FileLimit to 20 to avoid needless huge fetchesMichael Vogt2013-08-261-1/+1
| | |
| * | use pkgAcqArchive in 'download' for proper errorsDavid Kalnischkies2013-10-031-3/+2
| | | | | | | | | | | | | | | | | | | | | With a bit of trickery we can reuse the usual infrastructure we have in place to acquire deb files for the 'download' operation as well, which gains us authentification check & display, error messages, correct filenames and "downloads" from the root-owned archives.
| * | refactor onError relabeling of DestFile as '.FAILED'David Kalnischkies2013-10-031-32/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps ensure three things: - each error is reported via ReportMirrorFailure - if DestFile doesn't exist, do not attempt rename - renames happen for every error The last one wasn't the case for Size mismatches, which isn't nice, but not a exploitable problem per-se as the file isn't picked up and remains in partial/ where the following download-try will at most take it for a partial request which fails the hashsum verification later on Git-Dch: Ignore
| * | pkg from only trusted sources keeps being trustedDavid Kalnischkies2013-09-261-8/+15
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --allow-unauthenticated switches the download to a pre-0.6 system in which a package can come from any source, rather than that trusted packages can only come from trusted sources. To allow this the flag used to set all packages as untrusted, which is a bit much, so we check now if the package can be acquired via an untrusted source and only if this is the case set it as untrusted. As APT nowadays supports setting sources as trusted via a flag in the sources.list this mode shouldn't be used that much anymore though. [Note that this is not the patch from the BTS] Closes: 617690
| * Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt2013-08-221-0/+2
| |\ | | | | | | | | | | | | Conflicts: apt-pkg/tagfile.h
| | * some more coverity fixesMichael Vogt2013-08-121-0/+2
| | |
* | | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2013-08-151-8/+53
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/contrib/strutl.cc apt-pkg/deb/dpkgpm.cc configure.ac debian/changelog doc/po/apt-doc.pot po/apt-all.pot po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/framework test/integration/test-bug-602412-dequote-redirect test/integration/test-ubuntu-bug-346386-apt-get-update-paywall test/interactive-helper/aptwebserver.cc test/interactive-helper/makefile
| * | fix: --print-uris removes authenticationDavid Kalnischkies2013-08-121-4/+27
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constructors of our (clear)sign-acquire-items move a pre-existent file for error-recovery away, which gets restored or discarded later as the acquire progresses, but --print-uris never really starts the acquire process, so the files aren't restored (as they should). To fix this both get a destructor which checks for signs of acquire doing anything and if it hasn't the file is restored. Note that these virtual destructors theoretically break the API, but only with classes extending the sign-acquire-items and nobody does this, as it would be insane for library users to fiddle with Acquire internals – and these classes are internals. Closes: 719263
| * pick up Translation-* even if only compressed availableDavid Kalnischkies2013-07-251-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On CD-ROMs Translation-* files are only in compressed form included in the Release file. This used to work while we had no record of Translation-* files in the Release file at all as APT would have just guessed the (compressed) filename and accepted it (unchecked), but now that it checks for the presents of entries and if it finds records it expects the uncompressed to be verifiable. This commit relaxes this requirement again to fix the regression. We are still secure "enough" as we can validate the compressed file we have downloaded, so we don't loose anything by not requiring a hashsum for the uncompressed files to double-check them. Closes: 717665
| * do not redownload unchanged InRelease filesDavid Kalnischkies2013-06-201-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Before we download the 'new' InRelease file the old file will be moved out of the way with the name 'foobar_InRelease.reverify', so if no partial file for the 'new' file exists take the modification time from this reverify file, so that if we get an IMS hit for the InRelease file we can move back the reverify file as new file rather than downloading the 'new' file even though we already have it. We do the same for Release files and this happened to work until the reverify renaming was corrected for InRelease files.
| * Fix English spelling error in a message ('A error'). Unfuzzybubulle@debian.org2013-04-101-1/+1
| | | | | | translations. Closes: #705087
* | merged debian-sid branch and resolved conflictsMichael Vogt2013-04-231-12/+18
|\|
| * merged bundle from davidMichael Vogt2013-04-081-2/+2
| |\
| | * various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-2/+2
| | |
| * | merged lp:~mvo/apt/fix-inrelease5Michael Vogt2013-04-021-10/+16
| |\ \ | | |/ | |/|
| | * * apt-pkg/acquire-item.cc:David Kalnischkies2013-03-151-10/+16
| | | | | | | | | | | | - keep the last good InRelease file around just as we do it with Release.gpg in case the new one we download isn't good for us
* | | merged lp:~mvo/apt/hash-orderMichael Vogt2013-03-011-1/+1
|\| |
| * | ensure sha512 is really used when available (thanks to Tyler Hicks )Michael Vogt2013-01-141-1/+1
| |/
* | cherry pick -r1847 from bzr+ssh://bazaar.launchpad.net/~mvo/apt/lp346386/Michael Vogt2012-07-101-2/+1
| |
* | update comments and add one FIXME for the next ABI breakMichael Vogt2012-06-211-1/+5
| |
* | check when finished downloading the InRelease file if it has the expected ↵Michael Vogt2012-06-211-1/+9
|/ | | | gpg clearsign signature and if not download Release/Release.gpg instead