summaryrefslogtreecommitdiff
path: root/ftparchive
Commit message (Collapse)AuthorAgeFilesLines
* Fix remaining usec vs sec time-delta calculation typosDavid Kalnischkies2020-02-061-23/+13
| | | | | | | | | | | | | | | | | | | While moving to a more stable clock in 79b61ae I typoed the microsecond calculation part and copied it all over the place… Julian fixed the first two instances in 089e6271 and Trent reported the apt-ftparchive instances leaving one instance in progress (invisible for user though). A bit ironic that in an attempt to stop "confusing (and amusing) users" I managed to hide a typo for close to two years doing just that… Sadly we can't really test this as while "apt-ftparchive generate /dev/null" is a great interactive test, it is hard to teach our test framework that the output is "reasonably below an hour" (usually 0s, but on busy test systems it is perhaps longer…). Thanks: Trent W. Buck for initial patch Closes: #950776 References: 79b61ae7673eb6213493e2cb202f0d70c390932d, 089e627153781ae7c320a5a0724c6c70d684b689
* Remove includes of (md5|sha1|sha2).h headersJulian Andres Klode2020-01-142-6/+0
| | | | Remove it everywhere, except where it is still needed.
* Convert users of {MD5,SHA1,SHA256,SHA512}Summation to use HashesJulian Andres Klode2020-01-142-7/+6
| | | | | | | This makes use of the a function GetHashString() that returns the specific hash string. We also need to implement another overload of Add() for signed chars with sizes, so the existing users do not require reinterpret_cast everywhere.
* Apply various suggestions by cppcheckDavid Kalnischkies2019-07-083-8/+5
| | | | Reported-By: cppcheck
* Adjust code for missing includes/using std::stringJulian Andres Klode2019-06-121-0/+1
|
* Merge libapt-inst into libapt-pkgJulian Andres Klode2019-05-061-1/+1
|
* Fix typos reported by codespell & spellintianDavid Kalnischkies2018-08-292-2/+2
| | | | | | | | No user-visible change as it effects mostly code comments and not a single error message, manpage or similar. Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Use a steady clock source for progress reportingDavid Kalnischkies2018-05-281-32/+38
| | | | | | Clock changes while apt is running can result in strange reports confusing (and amusing) users. Sadly, to keep the ABI for now the code is a bit more ugly than it would need to be.
* Remove obsolete RCS keywordsGuillem Jover2018-05-0712-12/+0
| | | | Prompted-by: Jakub Wilk <jwilk@debian.org>
* Fix various typos reported by spellcheckersDavid Kalnischkies2018-05-051-1/+1
| | | | | Reported-By: codespell & spellintian Gbp-Dch: Ignore
* avoid some useless casts reported by -Wuseless-castDavid Kalnischkies2017-12-131-4/+1
| | | | | | | | | The casts are useless, but the reports show some where we can actually improve the code by replacing them with better alternatives like converting whatever int type into a string instead of casting to a specific one which might in the future be too small. Reported-By: gcc -Wuseless-cast
* ftparchive: Do not pass through disabled hashes in SourcesJulian Andres Klode2017-09-091-0/+8
| | | | | | | | | | | | | | | | When writing a Sources files hashes that were already present in the .dsc were always copied through (or modified), even if disabled. Remove them instead when they are disabled, otherwise we end up with hashes for tarballs and stuff but not for dsc files (as the dsc obviously does not hash itself). Also adjust the tests: test-compressed-indexes relied on Files being present in showsrc, and test-apt-update-weak-hashes expected the tarball to be downloaded when an archive only has MD5 and we are requiring SHA256 because that used to work because the tarball was always included. Closes: #872963
* ftparchive: sort discovered filenames before writing indexesDavid Kalnischkies2017-08-042-23/+39
| | | | | | | | | | | | | | | | | | | If 'apt-ftparchive packages /path/to/files/' (or sources) is used the files to include in the generated index (on stdout) were included in the order in which they were discovered, which isn't a very stable order which could lead to indexes changing without actually changing content causing needless changes in the repository changing hashsums, pdiffs, rsyncs, downloads, …. This does not effect apt-ftparchive calls which already have an order defined via a filelist (like generate) which will still print in the order given by the filelist. Note that a similar effect can be achieved by post-processing index files with apt-sortpkgs. Closes: 869557 Thanks: Chris Lamb for initial patch & Stefan Lippers-Hollmann for testing
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-1213-56/+53
| | | | | | | | | | | | | 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.
* fix various typos reported by codespell & spellintianDavid Kalnischkies2017-07-081-1/+1
| | | | | Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Refactor to avoid loop/dangling gcc warningsDavid Kalnischkies2017-06-261-8/+4
| | | | Gbp-Dch: Ignore
* Refactor finding compressor by name to avoid code dupDavid Kalnischkies2017-06-261-46/+33
| | | | Git-Dch: Ignore
* apt-ftparchive: Support '.ddeb' dbgsym packagesUnit 1932017-04-241-1/+1
|
* fix various typos reported by spellintianDavid Kalnischkies2017-01-192-3/+3
| | | | | | | | 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
* CMake: Document that the globs are expanded during CMakeJulian Andres Klode2017-01-171-1/+3
| | | | | | | This will avoid people from thinking that they have to do nothing when they change the set of files. Gbp-Dch: ignore
* apt-ftparchive: Support NotAutomatic and ButAutomaticUpgrades fieldsJames Clarke2016-11-111-11/+25
| | | | | | | This also changes Acquire-By-Hash to be "yes" rather than "true", so it is consistent with dak's output. Closes: #272557
* CMake: Handle Berkeley DB on FreeBSDJulian Andres Klode2016-08-261-0/+1
| | | | | | | | | | | | | The BSD systems still ship their own db.h with a historical BSD implementation, which is preferred by CMake, as it searches its default path first. We thus have to disable the DEFAULT_PATH for the search, unfortunately. We also need to pass the correct include directory to the target. Furthermore, on FreeBSD the library is called db-<VERSION>, so let's add db-5 to the list of allowed names. Gbp-Dch: ignore
* support compression and by-hash for .diff/Index filesDavid Kalnischkies2016-08-171-0/+1
| | | | | | | | | | | In af81ab9030229b4ce6cbe28f0f0831d4896fda01 by-hash got implemented as a special compression type for our usual index files like Packages. Missing in this scheme was the special .diff/Index index file containing the info about individual patches for this index file. Deriving from the index file class directly we inherent the compression handling infrastructure and in this way also by-hash nearly for free. Closes: #824926
* Get rid of the old buildsystemJulian Andres Klode2016-08-101-21/+0
| | | | Bye, bye, old friend.
* CMake: Add basic CMake build systemJulian Andres Klode2016-08-061-0/+10
| | | | | | | | | | | Introduce an initial CMake buildsystem. This build system can build a fully working apt system without translation or documentation. The FindBerkelyDB module is from kdelibs, with some small adjustements to also look in db5 directories. Initial work on this CMake build system started in 2009, and was resumed in August 2016.
* use +0000 instead of UTC by default as timezone in outputDavid Kalnischkies2016-07-021-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | All apt versions support numeric as well as 3-character timezones just fine and its actually hard to write code which doesn't "accidently" accepts it. So why change? Documenting the Date/Valid-Until fields in the Release file is easy to do in terms of referencing the datetime format used e.g. in the Debian changelogs (policy §4.4). This format specifies only the numeric timezones through, not the nowadays obsolete 3-character ones, so in the interest of least surprise we should use the same format even through it carries a small risk of regression in other clients (which encounter repositories created with apt-ftparchive). In case it is really regressing in practice, the hidden option -o APT::FTPArchive::Release::NumericTimezone=0 can be used to go back to good old UTC as timezone. The EDSP and EIPP protocols use this 'new' format, the text interface used to communicate with the acquire methods does not for compatibility reasons even if none of our methods would be effected and I doubt any other would (in these instances the timezone is 'GMT' as that is what HTTP/1.1 requires). Note that this is only true for apt talking to methods, (libapt-based) methods talking to apt will respond with the 'new' format. It is therefore strongly adviced to support both also in method input.
* Revert "travis: use gcc-5 instead of gcc(-4.8)"David Kalnischkies2016-06-291-15/+12
| | | | | | | | | | | | | | | This reverts commit 2b8221d66a8284042fc53c7bbb14bb9750e9137f. Avoiding the use of GCC >= 5 stuff lets use go back to 4.8 simplifying the travis setup again as well as reducing the backport requirements in general. This is possible because the std::get_time use requiring GCC >= 5 in 9febc2b238e1e322dce1f94ecbed46d595893b52 was replaced by handrolling it in 1d742e01470bba27715a8191c50adde4b39c2f19, so the remaining uses are just small conviniences we can do without. Gbp-Dch: Ignore
* Check for cached hash entries to determine which (if any) hash typesDominic Benson2016-06-201-1/+18
| | | | | | | | need to be generated for the current file. In 1.0.9, each hash type was handled by a separate method, each of which checked the cache. It looks like when these code paths were unified (in a311fb96b84757ef8628e6a754232614a53b7891) the cache checks were not incorporated into the new method.
* look into the right textdomain for apt-utils againDavid Kalnischkies2016-05-281-2/+0
| | | | | Broken in e7e10e47476606e3b2274cf66b1e8ea74b236757 by looking always into "apt" while we ship some tools in "apt-utils"…
* 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.
* drop some needlessly public declarations in libapt-privateDavid Kalnischkies2015-11-291-2/+2
| | | | Git-Dch: Ignore
* use function pointers instead of weak symbols for cmdline parsingDavid Kalnischkies2015-11-291-1/+1
| | | | | | | | Passing function pointers around while working on this was very icky, but if weak symbols are too much to ask for… Reverts "do not use "-Wl,-Bsymbolic-functions" during the build to avoid breakage" aka a5fc9be36211a290a7abc3ca2a8bf98943bc1f57.
* apply various suggestions made by cppcheckDavid Kalnischkies2015-11-053-6/+6
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* wrap every unlink call to check for != /dev/nullDavid Kalnischkies2015-11-043-9/+4
| | | | | | | | | | | | | | | | 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-043-49/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* reenable gcc warnings for deprecated functionsDavid Kalnischkies2015-11-042-3/+4
| | | | | | | | In the meantime the strange warnings disappeared, so we can get back to showing them – and fix the one occurance which creeped in in the meantime. Git-Dch: Ignore
* revamp all tools help messagesDavid Kalnischkies2015-11-041-7/+7
| | | | | | | | | | | | | | | | The general idea is: A small paragraph on the tool itself as a description, a list of the most used (!= all) commands available in the tool, a remark where to find more information on the tool and its commands (aka: in the manpage) and finally a common block referring to even more manpages. In exchange options are completely omitted from the output as well as deprecated or obscure commands. (Better) Information about them is available in the manpages anyway and the few options which were listed before were also the least interesting ones (-o -c -q and co are hardly of interest for someone totally new looking to find info by asking for help and anyone with a bit of experience doesn't need this short list. Those would need a list of options applying to the command they call, but they are too numerous and command specific to list them sanely in this context.
* deal with --version more centrallyDavid Kalnischkies2015-11-041-6/+1
| | | | Git-Dch: Ignore
* move apts cmdline helper type into -privateDavid Kalnischkies2015-11-041-3/+2
| | | | | | | | Its not as simple as I initially thought to abstract this enough to make it globally usable, so lets not pollute global namespace with this for now. Git-Dch: Ignore
* generate commands array after config is loadedDavid Kalnischkies2015-11-041-8/+10
| | | | | | | This ensures that location strings loaded from a location specified via configuration (Dir::Locale) effect the help messages for commands. Git-Dch: Ignore
* deduplicate main methodsDavid Kalnischkies2015-11-041-31/+5
| | | | | | | | All mains pretty much do the same thing, so lets try a little harder to move the common parts into -private to have the real differences more visible. Git-Dch: Ignore
* split up help messages for simpler reuseDavid Kalnischkies2015-11-041-15/+17
| | | | | | | | | | | | | That is one huge commit with busy work only: Help messages used to be one big translateable string, which is a pain for translators and hard to reuse for us. This change there 'explodes' this single string into new string for each documented string trying hard to split up the translated messages as well. This actually restores many translations as previously adding a single command made all of the bug message fuzzy. The splitup also highlighted that its easy to forget a line, duplicate one and similar stuff. Git-Dch: Ignore
* add --sha512 option + documentation for apt-ftparchiveDavid Kalnischkies2015-09-141-0/+1
|
* use APT::FTPArchive hash settings as default for APT::FPArchive::$filetypeDavid Kalnischkies2015-09-141-1/+1
|
* do not generate bogus hashes if hash is disabled in apt-ftparchiveDavid Kalnischkies2015-09-141-4/+9
|
* 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