summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.h
Commit message (Collapse)AuthorAgeFilesLines
* apt-pkg: default visibility to hiddenJulian Andres Klode2020-02-261-6/+6
|
* Merge pkgAcquire::RunFdsSane back into RunFdsJulian Andres Klode2020-02-261-6/+1
|
* Run unifdef -DAPT_{8,9,10,15}_CLEANER_HEADERSJulian Andres Klode2019-06-121-7/+0
|
* acq: worker: Move CurrentSize, TotalSize, ResumePoint to CurrentItemJulian Andres Klode2019-04-301-0/+15
| | | | | These status fields belong to the current item, move them there. This prepares us for eventually having multiple current items.
* acquire: Remove deprecated pkgAcquire::Setup() functionJulian Andres Klode2019-02-261-14/+0
|
* acquire: Fold pkgAcquireStatus2 into pkgAcquireStatusJulian Andres Klode2019-02-261-13/+1
| | | | Clean up the code, make it neat, lalala
* require methods to request AuxRequest capability at startupDavid Kalnischkies2018-01-031-2/+6
| | | | | | Allowing a method to request work from other methods is a powerful capability which could be misused or exploited, so to slightly limited the surface let method opt-in into this capability on startup.
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-2/+2
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* allow frontends to override releaseinfo change behaviourDavid Kalnischkies2017-06-281-1/+42
| | | | | | | | Having messages being printed on the error stack and confirm them by commandline flags is an okayish first step, but some frontends will probably want to have a more interactive feeling here with a proper question the user can just press yes/no for as for some frontends a commandline flag makes no sense…
* fix various typos reported by spellintianDavid Kalnischkies2017-01-191-5/+5
| | | | | | | | Most of them in (old) code comments. The two instances of user visible string changes the po files of the manpages are fixed up as well. Gbp-Dch: Ignore Reported-By: spellintian
* acquire: Use priority queues and a 3 stage pipeline designJulian Andres Klode2016-09-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Employ a priority queue instead of a normal queue to hold the items; and only add items to the running pipeline if their priority is the same or higher than the priority of items in the queue. The priorities are designed for a 3 stage pipeline system: In stage 1, all Release files and .diff/Index files are fetched. This allows us to determine what files remain to be fetched, and thus ensures a usable progress reporting. In stage 2, all Pdiff patches are fetched, so we can apply them in parallel with fetching other files in stage 3. In stage 3, all other files are fetched (complete index files such as Contents, Packages). Performance improvements, mainly from fetching the pdiff patches before complete files, so they can be applied in parallel: For the 01 Sep 2016 03:35:23 UTC -> 02 Sep 2016 09:25:37 update of Debian unstable and testing with Contents and appstream for amd64 and i386, update time reduced from 37 seconds to 24-28 seconds. Previously, apt would first download new DEP11 icon tarballs and metadata files, causing the CPU to be idle. By fetching the diffs in stage 2, we can now patch our contents and Packages files while we are downloading the DEP11 stuff.
* add messages to our deprecation warnings in libaptDavid Kalnischkies2015-11-271-1/+1
| | | | Git-Dch: Ignore
* Deal with killed acquire methods properly instead of hangingMichael Vogt2015-11-271-1/+8
| | | | | | | | | | | | This fixes a regression caussed by commit 95278287f4e1eeaf5d96749d6fc9bfc53fb400d0 that moved the error detection of RunFds() later into the loop. However this broke detecting issues like dead acquire methods. Instead of relying on the global error state (which is bad) we now pass a boolean value back from RunFds() and break on false. Closes: #806406
* Revert "Fix select timeout to be 50msec instead of 0.5msec" for acquireJulian Andres Klode2015-10-111-1/+1
| | | | | | | | | | | The acquire system actually uses usec pulse intervals, so the previous value was correct (500ms) whereas the new value is now 5s. It's a bit unfortunate that the two systems use different units for pulse intervals, but probably not much we can do about it. This partially reverts commit eaf21c2144fa8dc4be8581dc69cf88cb38e30ce2.
* Fix select timeout to be 50msec instead of 0.5msecMichael Vogt2015-09-301-1/+1
| | | | Closes: #799857
* if file is inaccessible for _apt, disable privilege drop in acquireDavid Kalnischkies2015-08-311-0/+2
| | | | | | | | | | | | | | | We had a very similar method previously for our own private usage, but with some generalisation we can move this check into the acquire system proper so that all frontends profit from this compatibility change. As we are disabling a security feature here a warning is issued and frontends are advised to consider reworking their download logic if possible. Note that this is implemented as an all or nothing situation: We can't just (not) drop privileges for a subset of the files in a fetcher, so in case you have to download some files with and some without you need to use two fetchers.
* fix various typos reported by codespellDavid Kalnischkies2015-08-271-1/+1
| | | | Reported-By: codespell
* Make QItem a subclass of DescItemJulian Andres Klode2015-08-111-9/+1
| | | | | CurrentItem previously was a DescItem, so let's make QItem a DescItem to not break things.
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-5/+5
| | | | | | | | | | | | | | Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore
* apply various style suggestions by cppcheckDavid Kalnischkies2015-08-101-3/+3
| | | | | | | Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore
* add d-pointer, virtual destructors and de-inline de/constructorsDavid Kalnischkies2015-06-161-9/+1
| | | | | | | | To have a chance to keep the ABI for a while we need all three to team up. One of them missing and we might loose, so ensuring that they are available is a very tedious but needed task once in a while. Git-Dch: Ignore
* deal better with acquiring the same URI multiple timesDavid Kalnischkies2015-06-151-8/+36
| | | | | | | | | | | | | | | This is an unlikely event for indexes and co, but it can happen quiet easily e.g. for changelogs where you want to get the changelogs for multiple binary package(version)s which happen to all be built from a single source. The interesting part is that the Acquire system actually detected this already and set the item requesting the URI again to StatDone - expect that this is hardly sufficient: an Item must be Complete=true as well to be considered truely done and that is only the tip of the ::Done handling iceberg. So instead of this StatDone hack we allow QItems to be owned by multiple items and notify all owners about everything now, so that for the point of each item they got it downloaded just for them.
* a hit on Release files means the indexes will be hits tooDavid Kalnischkies2015-04-191-0/+1
| | | | | | | | | | | | | | | | | | If we get a IMSHit for the Transaction-Manager (= the InRelease file or as its still supported fallback Release + Release.gpg combo) we can assume that every file we would queue based on this manager, but already have locally is current and hence would get an IMSHit, too. We therefore save us and the server the trouble and skip the queuing in this case. Beside speeding up repetative executions of 'apt-get update' this way we also avoid hitting hashsum errors if the indexes are in fact already updated, but the Release file isn't yet as it is the case on well behaving mirrors as Release files is updated last. The implementation is a bit harder than the theory makes it sound as we still have to keep reverifying the Release files (e.g. to detect now expired once to avoid an attacker being able to silently stale us) and have to handle cases in which the Release file hits, but some indexes aren't present (e.g. user added a new foreign architecture).
* chown finished partial files earlierDavid Kalnischkies2014-10-231-0/+2
| | | | | | | | | | | | | | | | | partial files are chowned by the Item baseclass to let the methods work with them. Now, this baseclass is also responsible for chowning the files back to root instead of having various deeper levels do this. The consequence is that all overloaded Failed() methods now call the Item::Failed base as their first step. The same is done for Done(). The effect is that even in partial files usually don't belong to _apt anymore, helping sneakernets and reducing possibilities of a bad method modifying files not belonging to them. The change is supported by the framework not only supporting being run as root, but with proper permission management, too, so that privilege dropping can be tested with them.
* do not inline virtual destructors with d-pointersDavid Kalnischkies2014-10-131-4/+3
| | | | | | | | | | | | | | Reimplementing an inline method is opening a can of worms we don't want to open if we ever want to us a d-pointer in those classes, so we do the only thing which can save us from hell: move the destructors into the cc sources and we are good. Technically not an ABI break as the methods inline or not do the same (nothing), so a program compiled against the old version still works with the new version (beside that this version is still in experimental, so nothing really has been build against this library anyway). Git-Dch: Ignore
* ensure partial dirs are 0700 and owned by _apt:rootDavid Kalnischkies2014-10-071-6/+13
| | | | | | | | | Reworks the API involved in creating and setting up the fetcher to be a bit more pleasent to look at and work with as e.g. an empty string for no lock isn't very nice. With the lock we can also stop creating all our partial directories "just in case". This way we can also be a bit more aggressive with the partial directory itself as with a lock, we know we will gone need it.
* allow fetcher setup without directory creationDavid Kalnischkies2014-09-271-1/+4
| | | | | | | | | | | apt-get download and changelog as well as apt-helper reuse the acquire system for their own proposes without requiring the directories the fetcher wants to create, which is a problem if you run them as non-root and the directories do not exist as it greets you with: E: Archives directory /var/cache/apt/archives/partial is missing. - Acquire (13: Permission denied) Closes: 762898
* fix: Member variable 'X' is not initialized in the constructor.David Kalnischkies2014-09-271-1/+1
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* calculate Percent as part of pkgAcquireStatus to provide a weighted percent ↵Michael Vogt2014-04-161-0/+4
| | | | for both items and bytes
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-2/+2
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-1/+6
| | | | | | | | 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)
* make doxygen more quiet, fix issues and disable latexDavid Kalnischkies2014-03-131-2/+2
| | | | Git-Dch: Ignore
* revert 2184.1.2: do not pollute namespace in headersDavid Kalnischkies2011-12-131-0/+5
| | | | | The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-20/+16
|
* * merged latest fixes from debian-sidMichael Vogt2011-07-281-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * apt-pkg/contrib/sha1.cc: - fix illegally casts of on-stack buffer to a type requiring more alignment than it has resulting in segfaults on sparc (Closes: #634696) * apt-pkg/contrib/cdromutl.cc: - fix escape problem when looking for the mounted devices * apt-pkg/contrib/strutl.{h,cc}, test/libapt/strutil_test.cc: - add new DeEscapeString() similar to DeQuoteString but unescape character escapes like \0XX and \xXX (plus added test) * refresh po/* * cmdline/apt-get.cc: - fix missing download progress in apt-get download - do not require unused partial dirs in 'source' (Closes: #633510) - buildconflicts effect all architectures - implement MultiarchCross for build-dep and source (Closes: #632221) * cmdline/apt-key: - use a tmpfile instead of /etc/apt/secring.gpg (Closes: #632596) * debian/apt.postinst: - remove /etc/apt/secring.gpg if it is an empty file * doc/apt-cache.8.xml: - apply madison typofix from John Feuerstein, thanks! (Closes: #633455) * apt-pkg/policy.cc: - emit an error on unknown APT::Default-Release value (Closes: #407511) * apt-pkg/aptconfiguration.cc: - ensure that native architecture is if not specified otherwise the first architecture in the Architectures vector * apt-pkg/deb/deblistparser.cc: - Strip only :any and :native if MultiArch should be stripped as it is save to ignore them in non-MultiArch contexts but if the dependency is a specific architecture (and not the native) do not strip
| * do not require unused partial dirs in 'source' (Closes: #633510)David Kalnischkies2011-07-161-0/+2
| |
* | replace the last standing double's with long longDavid Kalnischkies2011-07-141-8/+6
| |
* | * apt-pkg/acquire*.{cc,h}:David Kalnischkies2011-07-051-8/+3
| | | | | | | | - try even harder to support really big files in the fetcher by converting (hopefully) everything to 'long long' (Closes: #632271)
* | apt-pkg/acquire.h: add placeholder dpointerMichael Vogt2011-02-021-4/+23
|/
* * apt-pkg/deb/dpkgpm.cc:David Kalnischkies2010-09-021-8/+0
| | | | | | | - create Dir::Log if needed to support /var/log as tmpfs or similar, inspired by Thomas Bechtold, thanks! (Closes: #523919, LP: #220239) Easily done by moving a private method from pkgAcquire into the public area of fileutl.cc to be able to use it also in here
* * apt-pkg/depcache.cc:David Kalnischkies2010-06-031-3/+3
| | | | | | | | | | | | - switch i{Download,Usr}Size from double to (un)signed long long The biggest reason is that this saves a lot of float point operations we do in AddSizes() on integers. The only reason i see that this was a double is that it was 64bit long and can therefore store bigger values than int/long, but with the availablity of (un)signed long long we are now also at 64bit and can store sizes more than 8 Exabytes big - by the time this will be a limit the C/C++ Standard will have bigger types, hopefully.
* * apt-pkg/contrib/weakptr.h:Julian Andres Klode2010-05-041-1/+2
| | | | | | - add a class WeakPointable which allows one to register weak pointers to an object which will be set to NULL when the object is deallocated. * [ABI break] apt-pkg/acquire{-worker,-item,}.h: - subclass pkgAcquire::{Worker,Item,ItemDesc} from WeakPointable.
* * apt-pkg/contrib/fileutl.cc:David Kalnischkies2010-04-071-5/+26
| | | | | | | | | | - add a parent-guarded "mkdir -p" as CreateDirectory() * apt-pkg/acquire.{cc,h}: - add a delayed constructor with Setup() for success reporting - check for and create directories in Setup if needed instead of error out unfriendly in the Constructor (Closes: #523920, #525783) - optional handle a lock file in Setup() * cmdline/apt-get.cc: - remove the lock file handling and let Acquire take care of it instead
* add the various foldmarkers in apt-pkg & cmdline (no code change)David Kalnischkies2009-06-301-12/+12
|
* Fix an infinite loop in pkgAcquire::UriIterator::operator++() (Closes: #335615).Daniel Burrows2009-03-091-1/+1
|
* * merged with the apt--mvo branchMichael Vogt2007-05-021-2/+6
|\
| * * [ABI] apt-pkg/acquire.{cc,h}:Michael Vogt2007-04-171-1/+1
| | | | | | | | - deal better with duplicated sources.list entries (avoid double queuing of URLs) - this fixes hangs in bzip/gzip
* | * merged the no-pragma branchMichael Vogt2006-12-141-3/+0
|\ \
| * | * removed the pragma messMichael Vogt2006-10-021-3/+0
| |/
* / * merged daniels wonderful doxygen workMichael Vogt2005-11-141-29/+512
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patches applied: * dburrows@debian.org--2005/apt--0--base-0 tag of mvo@debian.org--2005/apt--debian-experimental--0--patch-9 * dburrows@debian.org--2005/apt--doxygen--0--base-0 tag of dburrows@debian.org--2005/apt--0--base-0 * dburrows@debian.org--2005/apt--doxygen--0--patch-1 Generate Doxygen output in build/doc/doxygen if Doxygen is installed. * dburrows@debian.org--2005/apt--doxygen--0--patch-2 Partially document the acquire item objects. * dburrows@debian.org--2005/apt--doxygen--0--patch-3 Add an 'acquire' group to collect the stuff related to Acquire. * dburrows@debian.org--2005/apt--doxygen--0--patch-4 Don't pick up emacs autosaves when generating the list of doxygen inputs. * dburrows@debian.org--2005/apt--doxygen--0--patch-5 Don't include redundant scope information in the doxygen output. * dburrows@debian.org--2005/apt--doxygen--0--patch-6 Write more general Acquire documentation. * dburrows@debian.org--2005/apt--doxygen--0--patch-7 I don't know why, but stuff just appeared in my tree. * dburrows@debian.org--2005/apt--doxygen--0--patch-8 Write/edit more Acquire documentation. * dburrows@debian.org--2005/apt--doxygen--0--patch-9 Document pkgAcquire::ItemDesc and pkgAcquire::Queue. * dburrows@debian.org--2005/apt--doxygen--0--patch-10 Document UriIterator (left out documentation of the standard iterator operators). * dburrows@debian.org--2005/apt--doxygen--0--patch-11 Give pkgAcquire::Queue a brief description. * dburrows@debian.org--2005/apt--doxygen--0--patch-12 Add a brief description to pkgAcquire::Item. * dburrows@debian.org--2005/apt--doxygen--0--patch-13 Add a brief description to the DiffInfo class. * dburrows@debian.org--2005/apt--doxygen--0--patch-14 Document pkgAcquire::MethodConfig. * dburrows@debian.org--2005/apt--doxygen--0--patch-15 Document pkgAcquireStatus * dburrows@debian.org--2005/apt--doxygen--0--patch-16 Edit the pkgAcquire::Item documentation to be more in line with how Acquire is documented. * dburrows@debian.org--2005/apt--doxygen--0--patch-17 Document pkgAcqDiffIndex. * dburrows@debian.org--2005/apt--doxygen--0--patch-18 Document the Md5Hash parameter to pkgAcquire::Item::Done. * dburrows@debian.org--2005/apt--doxygen--0--patch-19 Fix a spelling error * dburrows@debian.org--2005/apt--doxygen--0--patch-20 Document pkgAcqIndexDiffs and fix up some previously written documentation. * dburrows@debian.org--2005/apt--doxygen--0--patch-21 Mark the brief descriptions in the acquire item documentation. * dburrows@debian.org--2005/apt--doxygen--0--patch-22 Add documentation about the format of the Message parameter to Done&friends. * dburrows@debian.org--2005/apt--doxygen--0--patch-23 Document pkgAcqIndex. * dburrows@debian.org--2005/apt--doxygen--0--patch-24 Document pkgAcqIndexTrans. * dburrows@debian.org--2005/apt--doxygen--0--patch-25 Autogenerate Doxyfile when Doxyfile.in is modified. * dburrows@debian.org--2005/apt--doxygen--0--patch-26 Check for graphviz in configure. * dburrows@debian.org--2005/apt--doxygen--0--patch-27 Fix the detection of dot. * dburrows@debian.org--2005/apt--doxygen--0--patch-28 If dot is detected, use it to build the documentation. * dburrows@debian.org--2005/apt--doxygen--0--patch-29 Argh, pot update. * dburrows@debian.org--2005/apt--doxygen--0--patch-30 Require graphviz when building the Debian packages. * dburrows@debian.org--2005/apt--doxygen--0--patch-31 Document IndexTarget. * dburrows@debian.org--2005/apt--doxygen--0--patch-32 Consistently capitalize the first word following \param. * dburrows@debian.org--2005/apt--doxygen--0--patch-33 Document pkgAcqMetaSig. * dburrows@debian.org--2005/apt--doxygen--0--patch-34 Be a bit clearer about just what a pkgAcquire::Item is. * dburrows@debian.org--2005/apt--doxygen--0--patch-35 Document pkgAcqMetaIndex. * dburrows@debian.org--2005/apt--doxygen--0--patch-36 Document pkgAcqArchive * dburrows@debian.org--2005/apt--doxygen--0--patch-37 Document pkgAcqFile * dburrows@debian.org--2005/apt--doxygen--0--patch-38 Apply patches from mvo * dburrows@debian.org--2005/apt--doxygen--0--patch-39 Update the Doxyfile template. * dburrows@debian.org--2005/apt--doxygen--0--patch-40 Enable BUILTIN_STL_SUPPORT. * dburrows@debian.org--2005/apt--doxygen--0--patch-41 Whoops: \e, not \i, is used to enable italics. * dburrows@debian.org--2005/apt--doxygen--0--patch-42 Editorial changes and clarifications to the documentation in acquire-item.h * dburrows@debian.org--2005/apt--doxygen--0--patch-43 Clean out the old doxygen output before generating new output. * dburrows@debian.org--2005/apt--doxygen--0--patch-44 Fix setting and using the DOT_PATH doxygen configuration parameter. * dburrows@debian.org--2005/apt--doxygen--0--patch-45 Make the documentation of ��pkgAcquire::MethodConfig::SendConfig somewhat more accurate. * dburrows@debian.org--2005/apt--doxygen--0--patch-46 Partially document pkgAcquire::Worker. * dburrows@debian.org--2005/apt--doxygen--0--patch-47 Finish documenting pkgAcquire::Worker * michael.vogt@ubuntu.com--laptop/apt--doxygen--0--base-0 tag of dburrows@debian.org--2005/apt--doxygen--0--patch-37 * michael.vogt@ubuntu.com--laptop/apt--doxygen--0--patch-1 * some documentation updates * michael.vogt@ubuntu.com--laptop/apt--doxygen--0--patch-2 * apt-pkg/acquire-item.h: reviewed and some modifications * michael.vogt@ubuntu.com--laptop/apt--doxygen--0--patch-3 * minor doc update * michael.vogt@ubuntu.com--laptop/apt--doxygen--0--patch-4 * updated after the input from dburrows * mvo@debian.org--2005/apt--debian-sid--0--base-0 tag of michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-71 * mvo@debian.org--2005/apt--debian-sid--0--patch-1 * merged with apt--mvo--0 * mvo@debian.org--2005/apt--debian-sid--0--patch-2 * merged with apt--mvo * mvo@debian.org--2005/apt--debian-sid--0--patch-3 * updated apt-all.pot * mvo@debian.org--2005/apt--debian-sid--0--patch-4 * merged with apt--mvo * mvo@debian.org--2005/apt--debian-sid--0--patch-5 * merge with apt--mvo--0 * mvo@debian.org--2005/apt--debian-sid--0--patch-6 * merge with apt--mvo * mvo@debian.org--2005/apt--debian-sid--0--patch-7 * applied patch from Petr Vandrovec to fix http download corruption * mvo@debian.org--2005/apt--debian-sid--0--patch-8 * merged with apt--mvo, regenerated the po files * mvo@debian.org--2005/apt--debian-sid--0--patch-9 * merged with apt--mvo