summaryrefslogtreecommitdiff
path: root/ftparchive
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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-044-2/+153
| | | | | | | | | 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
* Replace UINT_MAX with std::numeric_limits<unsigned int>::max()Julian Andres Klode2015-08-141-2/+3
| | | | Gbp-Dch: ignore
* C++11: Switch from auto_ptr to unique_ptrJulian Andres Klode2015-08-131-10/+10
| | | | This is nicer
* add c++11 override marker to overridden methodsDavid Kalnischkies2015-08-102-5/+5
| | | | | | | | | C++11 adds the 'override' specifier to mark that a method is overriding a base class method and error out if not. We hide it in the APT_OVERRIDE macro to ensure that we keep compiling in pre-c++11 standards. Reported-By: clang-modernize -add-override -override-macros Git-Dch: Ignore
* fix memory leaks reported by -fsanitizeDavid Kalnischkies2015-08-104-54/+61
| | | | | | | | 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-117-192/+170
| | | | | | | | | 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-192-4/+4
| | | | | | | | | | | | | | 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
* stop displaying time of build in online helpJérémy Bobbio2015-03-161-2/+1
| | | | | | | | | | | | | | | | | | As part of the “reproducible builds” effort [1], we have noticed that apt could not be built reproducibly. One issue is that it uses the __DATE__ and __TIME__ macros of the C preprocessor to display the time of build in the online help. We believe this information not to be really useful to users as they can always look at the package data and metadata to figure it out. The attached patch simply removes this information. All non-documentation packages can then be built reproducibly with our current experimental framework. [David: changed the string slightly to be untranslateable as well] Closes: 774342
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-164-44/+41
|\
| * 128 KiB DSC files ought to be enough for everyoneDavid Kalnischkies2015-01-104-44/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | use the same code to detect quiet setting in all toolsDavid Kalnischkies2014-11-091-14/+5
| | | | | | | | Git-Dch: Ignore
* | streamline display of --help in all toolsDavid Kalnischkies2014-11-092-17/+6
| | | | | | | | | | | | | | By convention, if I run a tool with --help or --version I expect it to exit successfully with the usage, while if I do call it wrong (like without any parameters) I expect the usage message shown with a non-zero exit.