summaryrefslogtreecommitdiff
path: root/apt-pkg/indexcopy.cc
Commit message (Collapse)AuthorAgeFilesLines
* act on various suggestions from cppcheckDavid Kalnischkies2016-01-261-2/+2
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* avoid using global PendingError to avoid failing too often too soonDavid Kalnischkies2015-09-141-4/+4
| | | | | | | | | | | | | | | | | | | Our error reporting is historically grown into some kind of mess. A while ago I implemented stacking for the global error which is used in this commit now to wrap calls to functions which do not report (all) errors via return, so that only failures in those calls cause a failure to propergate down the chain rather than failing if anything (potentially totally unrelated) has failed at some point in the past. This way we can avoid stopping the entire acquire process just because a single source produced an error for example. It also means that after the acquire process the cache is generated – even if the acquire process had failures – as we still have the old good data around we can and should generate a cache for (again). There are probably more instances of this hiding, but all these looked like the easiest to work with and fix with reasonable (aka net-positive) effects.
* Fix all the wrong removals of includes that iwyu got wrongMichael Vogt2015-08-171-0/+1
| | | | Git-Dch: ignore
* Cleanup includes after running iwyuMichael Vogt2015-08-171-1/+0
|
* merge indexRecords into metaIndexDavid Kalnischkies2015-08-101-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | indexRecords was used to parse the Release file – mostly the hashes – while metaIndex deals with downloading the Release file, storing all indexes coming from this release and … parsing the Release file, but this time mostly for the other fields. That wasn't a problem in metaIndex as this was done in the type specific subclass, but indexRecords while allowing to override the parsing method did expect by default a specific format. APT isn't really supporting different types at the moment, but this is a violation of the abstraction we have everywhere else and, which is the actual reason for this merge: Options e.g. coming from the sources.list come to metaIndex naturally, which needs to wrap them up and bring them into indexRecords, so the acquire system is told about it as they don't get to see the metaIndex, but they don't really belong in indexRecords as this is just for storing data loaded from the Release file… the result is a complete mess. I am not saying it is a lot prettier after the merge, but at least adding new options is now slightly easier and there is just one place responsible for parsing the Release file. That can't hurt.
* 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-1/+0
| | | | | | | 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/+10
| | | | | | | | 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
* rewrite all TFRewrite instances to use the new pkgTagSection::WriteDavid Kalnischkies2015-05-111-76/+49
| | | | | | | | | While it is mostly busywork to rewrite all instances it actually fixes bugs as the data storage used by the new method is std::string rather than a char*, the later mostly created by c_str() from a std::string which the caller has to ensure keeps in scope – something apt-ftparchive actually didn't ensure and relied on copy-on-write behavior instead which c++11 forbids and hence the new default gcc abi doesn't use it.
* ensure lists/ files have correct permissions after apt-cdrom addDavid Kalnischkies2015-04-191-1/+4
| | | | | | | | Its a bit unpredictable which permissons and owners we will encounter on a CD-ROM (or a USB stick, as apt-cdrom is responsible for those too), so we have to ensure in this codepath as well that everything is nicely setup without waiting for a 'apt-get update' to fix up the (potential) mess.
* fix compile and tests errorDavid Kalnischkies2014-10-131-1/+1
| | | | | | I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore
* do not inline virtual destructors with d-pointersDavid Kalnischkies2014-10-131-0/+2
| | | | | | | | | | | | | | 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
* use HashStringList in the acquire systemDavid Kalnischkies2014-05-091-3/+5
| | | | | | | | | | | | | 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.
* follow method attribute suggestions by gccDavid Kalnischkies2014-03-131-4/+2
| | | | | Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn}
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-3/+3
| | | | | | | | 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-1/+1
| | | | | 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
* warning: extra ‘;’ [-Wpedantic]David Kalnischkies2014-03-131-2/+2
| | | | | Git-Dch: Ignore Reported-By: gcc -Wpedantic
* fix -Wmissing-field-initializers warningsDavid Kalnischkies2014-03-131-4/+4
| | | | | Reported-By: gcc Git-Dch: Ignore
* fix resource leak when verification failsMichael Vogt2013-07-251-0/+1
|
* apt-pkg/indexcopy.cc: check for pending errors before calling fdopen()Michael Vogt2013-07-251-1/+1
|
* call fdopen() after FileFd was checkedMichael Vogt2013-07-251-1/+1
|
* fail in CopyFile if the FileFds have error flag setDavid Kalnischkies2013-06-091-4/+2
| | | | | | | | | Testing for global PendingErrors in users of CopyFile is incorrect in so far as unrelated errors will prevent us from copying perfectly fine files and checking for the validity of the files is just better in CopyFiles as it already checks if files are at least opened. Add also a higher-level error message to the error stack if it fails.
* non-inline RunGPGV methods to restore ABI compatibility with previous ↵David Kalnischkies2013-05-161-0/+12
| | | | | | | | versions to fix partial upgrades (Closes: #707771) The rename in 0.9.7.9~exp2 moved the method body to the class definition which means it became inline, which isn't ABI compatibile. The reverse of moving inline to non-inline is safe though.
* merged bundle from davidMichael Vogt2013-04-081-4/+2
|\
| * various simple changes to fix cppcheck warningsDavid Kalnischkies2013-03-101-4/+2
| |
* | * apt-pkg/indexcopy.cc:David Kalnischkies2013-03-151-120/+2
|/ | | - rename RunGPGV to ExecGPGV and move it to apt-pkg/contrib/gpgv.cc
* - do not create duplicated flat-archive CD-ROM sources for foreignDavid Kalnischkies2012-09-031-6/+9
| | | | | | | architectures on multi-arch CD-ROMs - do not warn about files which have a record in the Release file, but are not present on the CD to mirror the behavior of the other methods and to allow uncompressed indexes to be dropped without scaring users - handle Components in the reduction for the source.list as multi-arch CDs
* * apt-pkg/indexcopy.cc:David Kalnischkies2012-09-021-4/+7
| | | | - do not create duplicated flat-archive cdrom sources for foreign architectures on multi-arch cdroms
* * apt-pkg/indexcopy.cc:David Kalnischkies2012-08-051-1/+6
| | | | - do not use atomic writing if the target is /dev/null as we don't want to replace it, not even automically. (Closes: #683410)
* Fix IndexCopy::CopyPackages and TranslationsCopy::CopyTranslations toMichael Vogt2012-01-311-2/+2
| | | handle compressed files again (LP: #924182, closes: #658096)
* Allow the FileFd to use an external Compressor to uncompress a given fileDavid Kalnischkies2011-12-131-91/+6
| | | | | | | | | | | internally so that it is exported and can be used like a "normal" uncompressed file with FileFd This allows us to hide th zlib usage in the implementation and use gzip instead if we don't have zlib builtin (the same for other compressors). The code includes quiet a few FIXME's so while all tests are working it shouldn't be used just yet outside of libapt as it might break.
* * apt-pkg/cdrom.cc:David Kalnischkies2011-12-111-5/+21
| | | - support InRelease files on cdrom
* use getCompressors() instead of getCompressorTypes() and use it everywhereDavid Kalnischkies2011-11-241-74/+72
| | | | to replace hardcoding of compressiontypes and compressors
* factored out the decompressor code in IndexCopy::CopyPackages() andSteve McIntyre2011-11-231-80/+94
| | | | TranslationsCopy::CopyTranslations() into a single common function
* merge with debian/experimentalDavid Kalnischkies2011-09-131-11/+10
|\
| * fix a few more cppcheck performance and scope warningsDavid Kalnischkies2011-08-111-2/+1
| |
| * cppcheck complains about some possible speed improvements which could beDavid Kalnischkies2011-08-111-9/+9
| | | | | | | | | | | | done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
* | Support large files in the complete toolset. Indexes of thisDavid Kalnischkies2011-09-131-11/+12
| | | | | | | | size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895)
* | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-2/+4
|/
* fix from David Kalnischkies for the InRelease gpg verification Michael Vogt2011-07-131-1/+20
| | | code (LP: #784473)
* * apt-pkg/indexcopy.cc:Julian Andres Klode2011-04-071-5/+5
| | | | - Use RealFileExists() instead of FileExists(), allows amongst other things a directory named Sources to exist on a CD-ROM (LP: #750694).
* - try downloading clearsigned InRelease before trying Release.gpgDavid Kalnischkies2011-01-201-1/+2
| | | | * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles
* * apt-pkg/indexcopy.cc:Michael Vogt2010-09-071-3/+10
|\ | | | | | | | | - only use trusted.gpg.d directory if it exists - do not replace /dev/null when running in APT::CDROM::NoAct mode (LP: #612666), thanks to Colin Watson
| * do not replace /dev/null when running in APT::CDROM::NoActMichael Vogt2010-09-071-1/+6
| | | | | | mode (LP: #612666), thanks to Colin Watson
| * apt-pkg/indexcopy.cc: include trustedFile (if it exists)Michael Vogt2010-09-031-5/+3
| |
| * * apt-pkg/indexcopy.cc:Michael Vogt2010-09-031-3/+7
| | | | | | - only use trusted.gpg.d directory if it exists
* | * apt-pkg/indexcopy.cc:David Kalnischkies2010-09-041-1/+1
|/ | | | - support really still the APT::GPGV::TrustedKeyring setting, as it breaks d-i badly otherwise (Closes: #595428)
* * apt-pkg/init.cc:David Kalnischkies2010-08-191-3/+2
| | | - set the default values for dir::etc::trusted options correctly
* apt-pkg, methods: Convert users of WriteEmpty to WriteAtomic.Julian Andres Klode2010-08-101-3/+3
|