summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Make directory paths configurableJulian Andres Klode2016-08-268-22/+45
| | | | | | | This allows other vendors to use different paths, or to build your own APT in /opt for testing. Note that this uses + 1 in some places, as the paths we receive are absolute, but we need to strip of the initial /.
* apt-key: Only use readlink -f for existing componentsJulian Andres Klode2016-08-261-1/+1
| | | | | On FreeBSD, readlink -f requires the last component to exist.
* Use C locale instead of C.UTF-8 for protocol stringsJulian Andres Klode2016-08-264-6/+6
| | | | | | The C.UTF-8 locale is not portable, so we need to use C, otherwise we crash on other systems. We can use std::locale::classic() for that, which might also be a bit cheaper than using locale("C").
* CMake: Add support for libintlJulian Andres Klode2016-08-261-3/+9
| | | | | | | | | | | | | This basically just links everything to libintl if USE_NLS is on. It would be better to just link those targets that are actually translated, but doing so is a huge PITA. Also move the include_directories() for the build-tree include/ directory to the top of the CMakeLists.txt, otherwise it only gets passed after Intl_INCLUDE_DIRS, which means we will built against installed apt-pkg headers (if any) instead of our own. Gbp-Dch: ignore
* CMake: Handle Berkeley DB on FreeBSDJulian Andres Klode2016-08-262-3/+15
| | | | | | | | | | | | | 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
* methods/connect.cc: Only use AI_IDN if definedJulian Andres Klode2016-08-261-0/+2
| | | | Gbp-Dch: ignore
* CMake/private-download: Fix statfs includes on FreeBSDJulian Andres Klode2016-08-262-5/+13
| | | | | | | On FreeBSD, we have to include sys/params.h and sys/mount.h, not sys/vfs.h. Gbp-Dch: ignore
* CMake: Add FindLZ4 and FindLZMAJulian Andres Klode2016-08-263-3/+53
| | | | | | This makes things work with /usr/local on FreeBSD. Gbp-Dch: ignore
* CMake: Do not use -lresolv if res_init exists in libcJulian Andres Klode2016-08-263-2/+10
| | | | Gbp-Dch: ignore
* CMake: Do not hardcode -ldlJulian Andres Klode2016-08-261-1/+1
| | | | | | Does not exist on FreeBSD Gbp-Dch: ignore
* CMake: Handle endian.h locations on other platformsJulian Andres Klode2016-08-263-0/+27
| | | | Gbp-Dch: ignore
* CMake: Handle BSD platforms with sig_t instead of sighandler_tJulian Andres Klode2016-08-261-0/+13
| | | | | | | Somewhat annoying, but OK. Might want to switch to something more clever to get rid of the typedef at all. Gbp-Dch: ignore
* Add missing includes and external definitionsJulian Andres Klode2016-08-268-0/+10
| | | | | | | | | | | | | | | Several modules use std::array without including the array header. Bad modules. Some modules use STDOUT_FILENO and friends, or close() without including unistd.h, where they are defined. One module also uses WIFEXITED() without including sys/wait.h. Finally, environ is not specified to be defined in unistd.h. We are required to define it ourselves according to POSIX, so let's do that.
* CMake: Define _WITH_GETLINE for FreeBSDJulian Andres Klode2016-08-231-0/+3
| | | | Gbp-Dch: ignore
* CMake: Do not add po/ if USE_NLS is OFFJulian Andres Klode2016-08-232-2/+6
| | | | | | Previously, we would have generated all the translations, but not turn them on in the code. Instead, move the Translation crap into po/ and disable po/ alltogether if USE_NLS if OFF.
* CMake: Discover docbook stylesheet in other locationsJulian Andres Klode2016-08-234-6/+34
| | | | | Distributions seem to install this stuff all over the place, so let's add a common list of paths we know about.
* install-progress: Call the real ::fork() in our fork() methodJulian Andres Klode2016-08-231-1/+1
| | | | | | We basically called ourselves before, creating an endless loop. Reported-By: clang
* CMake: Add Large File SupportJulian Andres Klode2016-08-232-0/+154
| | | | | | | | This module should cover all sorts of large file supports, as long as they either support the getconf LFS_CFLAGS command; or the _FILE_OFFSET_BITS=64 or _LARGE_FILES macros. Closes: #834767
* prevent C++ locale number formatting in text APIs (try 3)David Kalnischkies2016-08-232-36/+44
| | | | | | | | | | | This time it is the formatting of floating numbers in progress reporting with a radix charater potentially not being dot. Followup of 7303e11ff28f920a6277c159aa46f80c007350bb. Regression of b58e2c7c56b1416a343e81f9f80cb1f02c128e25 in so far as it exchanging very effected with slightly less effected code. LP: 1611010
* do dpkg --configure before --remove/--purge --pendingDavid Kalnischkies2016-08-233-3/+52
| | | | | | | | | | | | | | | | | | | Commit 7ec343309b7bc6001b465c870609b3c570026149 got us most of the way, but the last mile was botched by having the pending calls in the wrong order as this way we potentially 'force' dpkg to remove/purge a package it doesn't want to as another package still depends on it and the replacement isn't fully installed yet. So what we do now is a configure before remove and purge (all with --no-triggers) and finishing off with another configure pending call to take care of the triggers. Note that in the bugreport example our current planner is forcing dpkg to remove the package earlier via --force-depends which we could do for the pending calls as well and could be used as a workaround, but we want to do less forcing eventually. Closes: 835094
* zh_CN.po: update simplified Chinese translationZhou Mo2016-08-201-23/+18
|
* CMake: Fix uninitialized variablesJulian Andres Klode2016-08-203-2/+5
| | | | | | This fixes some actual bugs for PROJECT and BZIP2_INCLUDE_DIR. Gbp-Dch: ignore
* CMake: Translations: Build byproduct before outputJulian Andres Klode2016-08-201-4/+4
| | | | | | This can lead to an inconsistent state otherwise, with the output being updated and the byproduct not; for example, when the build was manually interrupted.
* debian: Get rid of dh_movefiles againJulian Andres Klode2016-08-204-5/+5
| | | | | | | This workaround is a bit more ugly, but does not use a (somewhat) deprecated debhelper command. Gbp-Dch: ignore
* debian: Run wrap-and-sortJulian Andres Klode2016-08-197-59/+71
| | | | | Manually clean up the apt.maintscript, it moved stuff from before the comment to after the comment...
* debian: Drop outdated stuffJulian Andres Klode2016-08-192-9/+0
| | | | | The README.source is not usable anymore, and the Build-Conflicts andd Breaks/Replaces are not needed anymore.
* debian: Add more lintian overridesJulian Andres Klode2016-08-192-0/+4
|
* debian: Switch to debhelper 10Julian Andres Klode2016-08-193-3/+3
| | | | | | | | | | | debhelper 10 is much nicer with the installation part from a dirty tree, so you can just fix some stuff breaking the install step and then continue building with debuild -b -nc until you have fixed all your stuff. It also has some other advantages, of course, like some bug fixes in shell escaping for maintscript, or systemd helper changes.
* debian: Make better use of the tree installed by CMakeJulian Andres Klode2016-08-199-29/+2
| | | | | | | This gets rid of the special casing of etc/apt, various example file installations handled by the upstream build system, and of course the directory creation for all dirs created by the upstream build system.
* CMake: Install config and logging directoriesJulian Andres Klode2016-08-192-0/+26
| | | | | | These directories are essential for apt to work, so we should install them in the upstream build system and not just in the debian packaging...
* tests/control: Handle the gpg1/gpg2 mess a bit betterJulian Andres Klode2016-08-191-1/+4
| | | | | | | Hardcoding gpgv1 and gnupg1 breaks Ubuntu, because on Ubuntu, these packages do not exist yet. Instead allow gnupg (<< 2) for gnupg1 and gnupg2 for gnupg (>= 2), so we cover all potential combinations.
* prepare-release: Use equivs and gdebi-core for travis depsJulian Andres Klode2016-08-192-4/+26
| | | | | | | | Our previous hack did not really support or groups and other more advanced dependency types. This hack basically removes build profiles, and the @-type depends for tests, and otherwise converts the deps to a package which is then installed via gdebi.
* Ignore SIGINT and SIGQUIT for Pre-Install hooksJulian Andres Klode2016-08-191-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of erroring out when receiving a SIGINT, let the child deal with it - we'll error out anyway if the child exits with an error or due to the signal. Also ignore SIGQUIT, as system() ignores it. This basically fixes Bug #832593, but: we are running the hooks via sh -c. Some shells exit with a signal error even if the command they are executing catches the signal and exits successfully. So far, this has been noticed on dash, which unfortunately, is our default shell. Example: $ cat trap.sh trap 'echo int' INT; sleep 10; exit 0 $ if dash -c ./trap.sh; then echo OK: $?; else echo FAIL: $?; fi ^Cint FAIL: 130 $ if mksh -c ./trap.sh; then echo OK: $?; else echo FAIL: $?; fi ^Cint OK: 0 $ if bash -c ./trap.sh; then echo OK: $?; else echo FAIL: $?; fi ^Cint OK: 0
* CMake: Translations: Pass --previous to msgmergeJulian Andres Klode2016-08-191-1/+1
| | | | | | | | When updating our .po files, pass --previous to msgmerge to make it easier for translators to translate fuzzy strings. Thanks: Guillem Jover for the suggestion.
* CMake: Translations: Don't rebuild .mo for line number changesJulian Andres Klode2016-08-191-1/+4
| | | | | | | | | | If only the line numbers changed in a file without any of the translatable strings changing, the .po and .mo files were rebuilt, making building simple code changes somewhat annoying. We can work around this by passing --add-location=file to msgcomm when we are creating the temporary .pot file used for building the .mo files.
* debian: Install etc/apt if present (e.g., on Ubuntu)Julian Andres Klode2016-08-181-1/+2
| | | | | On Ubuntu, cmake installs are vendor-specific apt.conf.d snippet, causing the build to fail.
* Release 1.3~rc21.3_rc2Julian Andres Klode2016-08-1760-229/+658
|
* methods: read config in most to least specific orderDavid Kalnischkies2016-08-172-4/+5
| | | | | | | | | | | | The implementation of the generic config fallback did the fallback in the wrong order so that the least specific option wasn't the last value picked but in fact the first one… doh! So in the bugreports case http -> https -> http::<hostname> -> https::<hostname> while it should have been the reverse as before. Regression-In: 30060442025824c491f58887ca7369f3c572fa57 Closes: 834642
* don't count each Type as an individual deb822-sources stanzaDavid Kalnischkies2016-08-171-5/+3
| | | | Reported-By: Mattia Rizzolo <mattia@debian.org> in #834629
* add --with-source option and Packages/Sources supportDavid Kalnischkies2016-08-178-5/+108
| | | | | | | | | | | | | We support "./foobar.deb" as a way to install a deb file directly. Recently .changes files were added. This highlights a problem as you can't add the changes file without also trying to install all of them. Now, it could also be handy to add entire Packages/Sources files to perhaps get a bunch of packages in without installing them all implicitly. This commit introduces --with-source which allows to add *.deb, *.changes, *.dsc, source-dirs, Packages & Sources files (the later can also be compressed) without also installing them.
* allow spaces in fingerprints for 'apt-key del'David Kalnischkies2016-08-172-2/+10
| | | | | | Fingerprints tend to be displayed in space-separated octet pairs so be nice and allow delete to remove a key based on such a string rather than requiring that the user is deleting all the spaces manually.
* add the gpg-classic variant to the gpgv/gnupg or-groupDavid Kalnischkies2016-08-178-62/+52
| | | | | | We need to support partial upgrades anyhow, so we have to deal with the different versions and your tests try to ensure that we do, so we shouldn't make any explicit higher requirements.
* tests: update self-sigs on our test keysDavid Kalnischkies2016-08-1710-0/+0
| | | | | | | | | | | | | | | | | | gpg upstream committed "gpgv: Tweak default options for extra security." applied on the 1.x and 2.x branches: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=e32c575e0f3704e7563048eea6d26844bdfc494b This commit includes "[…], but we should validate the key by its self signature for primary key, and back signature for subkey." Our testkeys are old and do not really considered best practices in the last years, so their most recent self-signature is SHA1-only which with this gpg commit and our testcases defaulting to --weak-digest sha1 are refused. So what we do here is just applying some of the recent best practices on top of our testcase keys. Gbp-Dch: Ignore
* tests: set source directory for gdbDavid Kalnischkies2016-08-171-1/+1
| | | | | | Helps interactive gdb calls find the source code. Gbp-Dch: Ignore
* default to Dir=/ in dpkg/status file finding magicDavid Kalnischkies2016-08-171-12/+10
| | | | | | | | | | | | | Seen in cme #833656 if Dir isn't set (yet) we end up later absoluting a path which was supposed to be absolute already, so if Dir is empty we assume it to be '/' instead. In practice this is a bug in the software using libapt, but for maxium compatibility lets explicitly set the default value here to be safe. Reported-By: Paul Wise <pabs@debian.org> Inspired-By: Brendan O'Dea <bod@debian.org> Fixes-Regression: 475f75506db48a7fa90711fce4ed129f6a14cc9a Shadows-Bug: #833656
* support compression and by-hash for .diff/Index filesDavid Kalnischkies2016-08-174-114/+151
| | | | | | | | | | | 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
* support getting only-uncompressed files via by-hashDavid Kalnischkies2016-08-171-0/+2
| | | | | | The URI we later want to modify to get the file via by-hash was unset in case a file was only available uncompressed (which is usually not the case) causing an acquire error.
* set the correct item FileSize in by-hash caseDavid Kalnischkies2016-08-171-4/+3
| | | | | | | | | | In af81ab9030229b4ce6cbe28f0f0831d4896fda01 we implement by-hash as a special compression type, which breaks this filesize setting as the code is looking for a foobar.by-hash file then. Dealing this slightly gets us the intended value. Note that this has no direct effect as this value will be set in other ways, too, and could only effect progress reporting. Gbp-Dch: Ignore
* retry without same redirection mirror on 404 errorsDavid Kalnischkies2016-08-172-5/+41
| | | | | | | | If 9b8034a9fd40b4d05075fda719e61f6eb4c45678 serves the Release files from a partial mirror we will end up getting 404 for some of the indexes. Instead of giving up, we will instead ignore our same redirection mirror constrain and ask the redirection service as a potential hashsum mismatch is better than keeping the certain 404 error.
* check internal redirections for loops, tooDavid Kalnischkies2016-08-172-0/+22
| | | | | | | | | | Now that we have the redirections loopchecker centrally in our items we can use it also to prevent internal redirections to loop caused by bugs as in a few instances we get into the business of rewriting the URI we will query by ourself as we predict we would see such a redirect anyway. Our code has no bugs of course, hence no practical difference. ;) Gbp-Dch: Ignore