summaryrefslogtreecommitdiff
path: root/ftparchive/writer.cc
Commit message (Collapse)AuthorAgeFilesLines
* avoid changing the global LC_TIME for Release writingDavid Kalnischkies2016-05-281-17/+12
| | | | | Using C++ here avoids calling setlocale here which never really was that ideal, but needed to avoid locale specific weekday/month names.
* prevent C++ locale number formatting in text APIsDavid Kalnischkies2016-05-271-3/+3
| | | | | | | | | | | Setting the C++ locale via std::locale::global(std::locale("")); which would otherwise default to the default C locale (aka: unaffected by setlocale) effects the formatting of numeric types in IO streams, which for output for humans is perfectly sensible, but breaks our many text interfaces used and parsed by us and others without expecting the numbers to be formatted. Closes: #825396
* ftparchive: Support writing Signed-By fieldsJulian Andres Klode2016-05-011-0/+1
|
* add dep11 files to default Release patternsDavid Kalnischkies2016-04-251-0/+4
|
* include all compressed Packages/Sources files in Release fileDavid Kalnischkies2016-01-081-8/+2
| | | | | | | | Having a hardcoded list of compression types here doesn't really provide us with anything beside added complexity each time someone adds a new compression type. That we don't need to be that specific is evident by Contents and Translation-* matchers which are a lot more generic and didn't generate problems anyhow.
* wrap every unlink call to check for != /dev/nullDavid Kalnischkies2015-11-041-3/+1
| | | | | | | | | | | | | | | | Unlinking /dev/null is bad, we shouldn't do that. Also, we should print at least a warning if we tried to unlink a file but didn't manage to pull it of (ignoring the case were the file is /dev/null or doesn't exist in the first place). This got triggered by a relatively unlikely to cause problem in pkgAcquire::Worker::PrepareFiles which would while temporary uncompressed files (which are set to keep compressed) figure out that to files are the same and prepare for sharing by deleting them. Bad move. That also shows why not printing a warning is a bad idea as this hide the error for in non-root test runs. Git-Dch: Ignore
* support arch:all data e.g. in separate Packages fileDavid Kalnischkies2015-11-041-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on a discussion with Niels Thykier who asked for Contents-all this implements apt trying for all architecture dependent files to get a file for the architecture all, which is treated internally now as an official architecture which is always around (like native). This way arch:all data can be shared instead of duplicated for each architecture requiring the user to download the same information again and again. There is one problem however: In Debian there is already a binary-all/ Packages file, but the binary-any files still include arch:all packages, so that downloading this file now would be a waste of time, bandwidth and diskspace. We therefore need a way to decide if it makes sense to download the all file for Packages in Debian or not. The obvious answer would be a special flag in the Release file indicating this, which would need to default to 'no' and every reasonable repository would override it to 'yes' in a few years time, but the flag would be there "forever". Looking closer at a Release file we see the field "Architectures", which doesn't include 'all' at the moment. With the idea outlined above that 'all' is a "proper" architecture now, we interpret this field as being authoritative in declaring which architectures are supported by this repository. If it says 'all', apt will try to get all, if not it will be skipped. This gives us another interesting feature: If I configure a source to download armel and mips, but it declares it supports only armel apt will now print a notice saying as much. Previously this was a very cryptic failure. If on the other hand the repository supports mips, too, but for some reason doesn't ship mips packages at the moment, this 'missing' file is silently ignored (= that is the same as the repository including an empty file). The Architectures field isn't mandatory through, so if it isn't there, we assume that every architecture is supported by this repository, which skips the arch:all if not listed in the release file.
* use APT::FTPArchive hash settings as default for APT::FPArchive::$filetypeDavid Kalnischkies2015-09-141-1/+1
|
* Set APT::FTPArchive::DoByHash to false by defaultMichael Vogt2015-09-071-3/+3
| | | | | | | | "apt-ftparchive release" will create the by-hash files if this mode is enabled. This maybe unexpected by existing users so make it a opt-in. Git-Dch: ignore
* Ensure that no by-hash file for "Release/InRelease is written"Michael Vogt2015-09-071-1/+3
| | | | | | Git-Dch: ignore Brown-paperbag: yes Thanks: Donkult
* Add support for writing by-hash dirs in apt-ftparchiveMichael Vogt2015-09-041-1/+66
| | | | | | | | | This option is enabled via the APT::FTPArchive::DoByHash switch. It will also honor the option APT::FTPArchive::By-Hash-Keep that controls how many previous generation of by-hash files should be kept (defaults to 3). Merged from https://github.com/mvo5/apt/tree/feature/apt-ftparchive-by-hash
* C++11: Switch from auto_ptr to unique_ptrJulian Andres Klode2015-08-131-10/+10
| | | | This is nicer
* fix memory leaks reported by -fsanitizeDavid Kalnischkies2015-08-101-11/+20
| | | | | | | | Various small leaks here and there. Nothing particularily big, but still good to fix. Found by the sanitizers while running our testcases. Reported-By: gcc -fsanitize Git-Dch: Ignore
* rewrite all TFRewrite instances to use the new pkgTagSection::WriteDavid Kalnischkies2015-05-111-109/+95
| | | | | | | | | 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.
* fix 'Source' to 'Package' rename in apt-ftparchiveDavid Kalnischkies2015-05-111-1/+2
| | | | | | This rename with value is ordered by the 'old' name 'Source', but should be ordered by the new name… by splitting the operation in a delete and a new field we can easily fix this problem locally for now.
* calculate only expected hashes in methodsDavid Kalnischkies2015-04-191-2/+2
| | | | | | | | | | | | | | Methods get told which hashes are expected by the acquire system, which means we can use this list to restrict what we calculate in the methods as any extra we are calculating is wasted effort as we can't compare it with anything anyway. Adding support for a new hash algorithm is therefore 'free' now and if a algorithm is no longer provided in a repository for a file, we automatically stop calculating it. In practice this results in a speed-up in Debian as we don't have SHA512 here (so far), so we practically stop calculating it.
* reimplement the last uses of sprintfDavid Kalnischkies2015-04-101-4/+4
| | | | | | | | Working with strings c-style is complicated and error-prune, so by converting to c++ style we gain some simplicity and avoid buffer overflows by later extensions. Git-Dch: Ignore
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-161-10/+2
|\
| * 128 KiB DSC files ought to be enough for everyoneDavid Kalnischkies2015-01-101-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Your mileage may vary, but don't worry: There is more than one way to do it, but our one size fits all is not a bigger hammer, but an entire roundhouse kick! So brace yourself for the tl;dr: The limit is gone.* Beware: This fixes also the problem that a double newline is unconditionally added 'later' which is an overcommitment in case the dsc filesize is limit-2 <= x <= limit. * limited to numbers fitting into an unsigned long long. Closes: 774893
* | promote filesize to a hashstringDavid Kalnischkies2014-10-241-1/+3
| | | | | | | | | | | | | | | | | | It is a very simple hashstring, which is why it isn't contributing to the usability of a list of them, but it is also trivial to check and calculate, so it doesn't hurt checking it either as it can combined even with the simplest other hashes greatly complicate attacks on them as you suddenly need a same-size hash collision, which is usually a lot harder to achieve.
* | deal with hashes in ftparchive more dynamic as wellDavid Kalnischkies2014-05-091-132/+118
| | | | | | | | | | | | | | | | | | | | | | Now that libapts acquire system happily passes around hashes and can be made to support new ones without an ABI break in the future, we can free ftparchive from all the deprecation warnings the last commit introduced for it. The goal here isn't to preserve ABI as we have none to keep here, but to help avoiding introduction problems of 'new' hashes later as bugs creep into the copy&paste parts, so short/less of them is good.
* | use a std::vector instead of hardcoded arrayDavid Kalnischkies2014-05-081-41/+39
|/ | | | | | | | Arrays with predefined lengths are very fragile as they are likely forgotten in future changes and the size in this case is dynamic making it even more dangerous. Git-Dch: Ignore
* Implement CacheDB for source packages in apt-ftparchiveMichael Vogt2014-04-041-53/+54
|
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-8/+17
| | | | | | | | 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-3/+3
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* fix -Wall errorsMichael Vogt2013-08-081-1/+2
|
* merged lp:~mvo/apt/add-missing-dsc-hashesMichael Vogt2013-04-081-10/+41
|\
| * merge patch apt_0.9.7.7ubuntu2~md1.debdiff, thanks to Marc DeslauriersMichael Vogt2013-01-311-10/+41
| |
* | - add method to open (maybe) clearsigned files transparentlyDavid Kalnischkies2013-03-181-59/+46
|/ | | | | * ftparchive/writer.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc files
* * ftparchive/writer.cc:David Kalnischkies2012-07-041-1/+1
| | | | - handle the APT::FTPArchive::Packages::SHA512 option correctly instead of overriding SHA256, thanks Christian Marillat! (Closes: #680252)
* * ftparchive/writer.cc:David Kalnischkies2012-05-211-0/+1
| | | - include Contents-* files in Release files (Closes: #673647)
* * apt-pkg/acquire-item.cc:David Kalnischkies2012-02-181-0/+1
| | | | | | | | | | | | | | | - drop support for i18n/Index file (introduced in 0.8.11) and use the Release file instead to get the Translations (Closes: #649314) * ftparchive/writer.cc: - add 'Translation-*' to the default patterns i18n/Index was never used outside debian - and even here it isn't used consistently as only 'main' has such a file. As the Release file now includes the Translation-* files we therefore drop support for i18n/Index. A version supporting it was never part of a debian release and still supporting it would mean that we get 99% of the time a 404 as response to the request anyway and confuse archive maintainers who want to provide all files APT tries to acquire.
* try to avoid direct usage of .Fd() if possible and do read()s and coDavid Kalnischkies2011-12-171-1/+1
| | | | on the FileFd instead
* remove the second usage instance of ExecCompressor in ftparchiveDavid Kalnischkies2011-12-141-15/+8
| | | | by again using the FileFd directly
* merge with debian/experimentalDavid Kalnischkies2011-09-131-2/+2
|\
| * merged from the debian-sid branchMichael Vogt2011-08-151-2/+2
| |\
| | * cppcheck complains about some possible speed improvements which could beDavid Kalnischkies2011-08-111-2/+2
| | | | | | | | | | | | | | | | | | 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-9/+9
| | | | | | | | | | | | 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-4/+6
|/ /
* | * ftparchive/writer.cc:David Kalnischkies2011-07-131-26/+8
| | | | | | - generate all checksums in one run over the file for Release
* | merge lp:~mvo/apt/abi-breakMichael Vogt2011-06-291-2/+35
|\ \ | |/ |/|
| * merge lp:~mvo/apt/sha512-template to add support for sha512Michael Vogt2011-06-081-2/+32
|/|
| * move sha512,256 into apt-pkg/sha2.{cc,h}, move gifford implementation to ↵Michael Vogt2011-02-251-2/+1
| | | | | | | | sha2_internal.{cc,h}
| * add sha512 support to apt-ftparchiveMichael Vogt2011-02-221-1/+29
| |
* | - load the supported compressors from configurationDavid Kalnischkies2011-02-271-0/+1
| | | | | | - support adding new compressors by configuration
* | * ftparchive/multicompress.cc, apt-inst/deb/debfile.cc:David Kalnischkies2011-02-221-0/+2
|\ \ | | | | | | | | | | | | | | | - support xz compressor to create xz-compressed Indexes and be able to open data.tar.xz files * ftparchive/writer.cc: - include xz-compressed Packages and Sources files in Release file
| * | * ftparchive/writer.cc:David Kalnischkies2011-02-221-0/+2
| | | | | | | | | - include xz-compressed Packages and Sources files in Release file
* | | add options to disable specific checksums for IndexesDavid Kalnischkies2011-02-221-56/+87
| | |
* | | * ftparchive/writer.cc:David Kalnischkies2011-02-221-0/+5
| |/ |/| | | - ensure that Date and Valid-Until time strings are not localised
* | include Index files by default in the Release fileDavid Kalnischkies2011-01-241-0/+1
| |