summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
Commit message (Collapse)AuthorAgeFilesLines
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-2/+2
| | | | | | | | | | | | | | 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-2/+2
| | | | | | | 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-0/+9
| | | | | | | | 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
* allow ratelimiting progress reporting for testcasesDavid Kalnischkies2015-06-151-5/+9
| | | | | | | | Progress reports once in a while which is a bit to unpredictable for testcases, so we enforce a steady progress for them in the hope that this makes the tests (mostly test-apt-progress-fd) a bit more stable. Git-Dch: Ignore
* condense parallel requests with the same hashes to oneDavid Kalnischkies2015-06-151-1/+4
| | | | | | | | | | | | | It shouldn't be too common, but sometimes people have multiple mirrors in the sources or otherwise repositories with the same content. Now that we gracefully can handle multiple requests to the same URI, we can also fold multiple requests with the same expected hashes into one. Note that this isn't trying to find oppertunities for merging, but just merges if it happens to encounter the oppertunity for it. This is most obvious in the new testcase actually as it needs to delay the action to give the acquire system enough time to figure out that they can be merged.
* deal better with acquiring the same URI multiple timesDavid Kalnischkies2015-06-151-16/+110
| | | | | | | | | | | | | | | 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.
* create our cache and lib directory always with mode 755David Kalnischkies2014-11-181-2/+5
| | | | | | | | | | | | | We autocreate for a while now the last two directories in /var/lib/apt/lists (similar for /var/cache/apt/archives) which is very nice for systems having any of those on tmpfs or other non-persistent storage. This also means though that this creation is effected by the default umask, so for people with aggressive umasks like 027 the directories will be created with 750, which means all non-root users are left out, which is usually exactly what we want then this umask is set, but the cache and lib directories contain public knowledge. There isn't any need to protect them from viewers and they render apt completely useless if not readable.
* use pkgAcquire::GetLock instead of own codeDavid Kalnischkies2014-11-091-0/+2
| | | | | | | | | Do the same with less code in apt-get. This especially ensures that the lock file (and the parent directories) exist before we are trying to lock. It also means that clean now creates the directories if they are missing so we returned to a proper clean state now. Git-Dch: Ignore
* chown finished partial files earlierDavid Kalnischkies2014-10-231-15/+25
| | | | | | | | | | | | | | | | | 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.
* check that auth.conf exists before chowning itDavid Kalnischkies2014-10-221-3/+4
| | | | Git-Dch: Ignore
* Ensure /etc/apt/auth.conf has _apt:root ownerMichael Vogt2014-10-211-2/+10
| | | | | Ensure in SetupAPTPartialDirectory() that the /etc/apt/auth.conf file can be read by the priv sep apt methods.
* fix compile and tests errorDavid Kalnischkies2014-10-131-3/+3
| | | | | | I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore
* Fix backward compatiblity of the new pkgAcquireMethod::DropPrivsOrDie()Michael Vogt2014-10-131-2/+3
| | | | | | | | Do not drop privileges in the methods when using a older version of libapt that does not support the chown magic in partial/ yet. To do this DropPrivileges() now will ignore a empty Apt::Sandbox::User. Cleanup all hardcoded _apt along the way.
* do not inline virtual destructors with d-pointersDavid Kalnischkies2014-10-131-0/+4
| | | | | | | | | | | | | | 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-23/+55
| | | | | | | | | 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.
* Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-09-291-28/+23
|\ | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h methods/gpgv.cc
| * allow fetcher setup without directory creationDavid Kalnischkies2014-09-271-13/+17
| | | | | | | | | | | | | | | | | | | | | | 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-15/+6
| | | | | | | | | | Reported-By: cppcheck Git-Dch: Ignore
* | use pkgAcqMetaBase as the transactionManagerMichael Vogt2014-09-171-69/+0
| |
* | make errors more consistentMichael Vogt2014-08-011-2/+3
| |
* | fail early (again) on gpg sig failuresMichael Vogt2014-07-311-2/+2
| |
* | Rework TransactionID stuffMichael Vogt2014-07-311-0/+3
| |
* | WIP cleanup pkgAcqMetaSigMichael Vogt2014-07-221-1/+0
| |
* | add pkgAcquire::TransactionHasError()Michael Vogt2014-07-211-3/+20
| |
* | WIP transaction based updateMichael Vogt2014-07-181-0/+50
|/
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-07-081-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/deb/deblistparser.cc doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pl.po doc/po/pt.po doc/po/pt_BR.po po/da.po po/mr.po po/vi.po
| * Do not clean "/" in pkgAcquire::Clean/pkgArchiveCleanerMichael Vogt2014-07-081-0/+3
| | | | | | | | | | | | | | Having "/" here is most likely a user configuration error and may cause removal of import symlinks like /vmlinuz Closes: #753531
* | check for UnfetchedReleaseFiles when calculating the update percent valueMichael Vogt2014-05-081-4/+9
| |
* | calculate Percent as part of pkgAcquireStatus to provide a weighted percent ↵Michael Vogt2014-04-161-17/+17
| | | | | | | | for both items and bytes
* | add Debug::acquire::progress debug option and fixme for index file loading ↵Michael Vogt2014-04-161-0/+8
| | | | | | | | with the correct extension
* | load the size from the metaindex into the fetcher to have even more accurate ↵Michael Vogt2014-04-161-1/+4
| | | | | | | | progress information
* | make the TotalFiles more reliable in apt-get updateMichael Vogt2014-04-161-4/+12
|/
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-3/+3
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-0/+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)
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-1/+1
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-3/+3
|
* * apt-pkg/acquire*.cc:Raphael Geissert2012-05-141-5/+34
| | | | | | | - handle redirections in the worker with the right method instead of in the method the redirection occured in (Closes: #668111) * methods/http.cc: - forbid redirects to change protocol
* use a static FileFd::Write overload to reduce duplication of write()-retry codeDavid Kalnischkies2012-04-111-15/+1
|
* * apt-pkg/acquire-worker.cc:David Kalnischkies2012-03-201-1/+17
| | | | | | | | | | | - check return of write() as gcc recommends * apt-pkg/acquire.cc: - check return of write() as gcc recommends * apt-pkg/cdrom.cc: - check return of chdir() and link() as gcc recommends * apt-pkg/clean.cc: - check return of chdir() as gcc recommends * apt-pkg/contrib/netrc.cc: - check return of asprintf() as gcc recommends
* fix a bunch of cppcheck "(warning) Member variable '<#>' is notDavid Kalnischkies2012-03-041-1/+1
| | | | initialized in the constructor." messages (no functional change)
* merge with debian/sidDavid Kalnischkies2011-09-131-0/+4
|\
| * * apt-pkg/acquire.cc:David Kalnischkies2011-08-221-0/+4
| | | | | | - non-existing directories are by definition clean
* | merge with debian/experimentalDavid Kalnischkies2011-09-131-11/+13
|\ \
| * \ merged from lp:~mvo/apt/mvoMichael Vogt2011-08-151-1/+3
| |\ \
| | * | * apt-pkg/acquire.cc:Michael Vogt2011-08-091-1/+3
| | | | | | | | | | | | - fix potential divide-by-zero
| * | | merged from the debian-sid branchMichael Vogt2011-08-151-10/+10
| |\ \ \ | | |/ / | |/| / | | |/
| | * cppcheck complains about some possible speed improvements which could beDavid Kalnischkies2011-08-111-10/+10
| | | | | | | | | | | | | | | | | | done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
* | | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-2/+4
|/ /
* | replace the last standing double's with long longDavid Kalnischkies2011-07-141-5/+4
| |
* | * apt-pkg/acquire*.{cc,h}:David Kalnischkies2011-07-051-1/+1
| | | | | | | | - try even harder to support really big files in the fetcher by converting (hopefully) everything to 'long long' (Closes: #632271)