summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* debian: Move bugscript to old location for overlayfs xdev issueJulian Andres Klode2016-09-021-0/+1
| | | | | | dpkg on overlayfs cannot rename apt/script to apt, because overlayfs will not let it move apt to a backup name, responding with XDEV instead.
* acquire: Use priority queues and a 3 stage pipeline designJulian Andres Klode2016-09-025-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Employ a priority queue instead of a normal queue to hold the items; and only add items to the running pipeline if their priority is the same or higher than the priority of items in the queue. The priorities are designed for a 3 stage pipeline system: In stage 1, all Release files and .diff/Index files are fetched. This allows us to determine what files remain to be fetched, and thus ensures a usable progress reporting. In stage 2, all Pdiff patches are fetched, so we can apply them in parallel with fetching other files in stage 3. In stage 3, all other files are fetched (complete index files such as Contents, Packages). Performance improvements, mainly from fetching the pdiff patches before complete files, so they can be applied in parallel: For the 01 Sep 2016 03:35:23 UTC -> 02 Sep 2016 09:25:37 update of Debian unstable and testing with Contents and appstream for amd64 and i386, update time reduced from 37 seconds to 24-28 seconds. Previously, apt would first download new DEP11 icon tarballs and metadata files, causing the CPU to be idle. By fetching the diffs in stage 2, we can now patch our contents and Packages files while we are downloading the DEP11 stuff.
* CMake: apt-pkg: Use correct ICONV_INCLUDE_DIRS variableJulian Andres Klode2016-09-021-1/+1
| | | | | This accidentally used ICONV_DIRECTORIES, which does not even exist. Weird.
* CMake: test/libapt: Use a prebuilt GTest library if availableJulian Andres Klode2016-09-021-15/+26
| | | | | | | If a non-existing source directory is specified, try finding the system gtest library. Debian derived distributions are a bit strange because they only ship the source code and not the library...
* gitignore: Add generated docbook stylesheetsJulian Andres Klode2016-09-021-1/+6
| | | | | | | | I switched them over to generated files in commit 9fb81c6e54a2fe05c0ad0b877fd32f30358e3877, but forgot to add them to the ignore file. Gbp-Dch: ignore
* support long keyid and fingerprint in gpgv's GOODSIGDavid Kalnischkies2016-09-012-4/+97
| | | | | | | | | | | | | | In gpgv1 GOODSIG (and the other messages of status-fd) are documented as sending the long keyid. In gpgv2 it is documented to be either long keyid or the fingerprint. At the moment it is still the long keyid, but the documentation hints at the possibility of changing this. We care about this for Signed-By support as we detect this way if the right fingerprint has signed this file (or not). The check itself is done via VALIDSIG which always is a fingerprint, but there must also be a GOODSIG (as expired sigs are valid, too) found to be accepted which wouldn't be found in the fingerprint-case and the signature hence refused.
* re-add apt breaks/replaces apt-utils (<< 1.3~exp2~)David Kalnischkies2016-09-011-0/+2
| | | | | | | | | The recently added (increased actually) Breaks were accidently dropped while our set of mostly old and outdated breaks was cleaned up. Regression-From: 20d2f4a4f164cd9026dad698e471c95d7c28973b Previously-Add-In: ab07af708e49c9219940ffd3e20a01c763267e03 Closes: #836220
* tests: silence -Wmissing-declarationsDavid Kalnischkies2016-09-013-7/+3
| | | | | Gbp-Dch: Ignore Reported-By: gcc -Wmissing-declarations
* try not to call memcpy with length 0 in hash calculationsDavid Kalnischkies2016-09-019-19/+26
| | | | | | | | | | memcpy is marked as nonnull for its input, but ignores the input anyhow if the declared length is zero. Our SHA2 implementations do this as well, it was "just" MD5 and SHA1 missing, so we add the length check here as well as along the callstack as it is really pointless to do all these method calls for "nothing". Reported-By: gcc -fsanitize=undefined
* test-apt-cdrom: Fix for gnupg 2.1.15Julian Andres Klode2016-09-011-1/+6
| | | | | | | | | | | gpg annoyingly changed its output and broke our test suite again by adding two extra lines about key type and issuer. Really annoying. Those lines also have more than one space after the colon, so let's use \s* there - and also change the other lines to support variable length whitespace in case gpg decides to break things there too.
* Base256ToNum: Fix uninitialized valueJulian Andres Klode2016-08-311-1/+2
| | | | | | | | | | If the inner Base256ToNum() returned false, it did not set Num to a new value, causing it to be uninitialized, and thus might have caused the function to exit despite a good result. Also document why the Res = Num, if (Res != Num) magic is done. Reported-By: valgrind
* TagFile: Fix off-by-one errors in comment strippingJulian Andres Klode2016-08-311-2/+2
| | | | | | | | | | | | | | | | | | | Adding 1 to the value of d->End - current makes restLength one byte too long: If we pass memchr(current, ..., restLength) has thus undefined behavior. Also, reading the value of current has undefined behavior if current >= d->End, not only for current > d->End: Consider a string of length 1, that is d->End = d->Current + 1. We can only read at d->Current + 0, but d->Current + 1 is beyond the end of the string. This probably caused several inexplicable build failures on hurd-i386 in the past, and just now caused a build failure on Ubuntu's amd64 builder. Reported-By: valgrind
* test/integration/test-srcrecord: Make executableJulian Andres Klode2016-08-311-0/+0
| | | | | | | I actually tried to amend the previous commit, but apparently I forgot to add the file mode change. Gbp-Dch: ignore
* Fix segfault and out-of-bounds read in Binary fieldsJulian Andres Klode2016-08-312-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a Binary field contains one or more spaces before a comma, the code produced a segmentation fault, as it accidentally set a pointer to 0 instead of the value of the pointer. If the comma is at the beginning of the field, the code would create a binStartNext that points one element before the start of the string, which is undefined behavior. We also need to check that we do not exit the string during the replacement of spaces before commas: A string of the form " ," would normally exit the boundary of the Buffer: binStartNext = offset 1 ',' binEnd = offset 0 ' ' isspace_ascii(*binEnd) = true => --binEnd => binEnd = - 1 We get rid of the problem by only allowing spaces to be eliminated if they are not the first character of the buffer: binStartNext = offset 1 ',' binEnd = offset 0 ' ' binEnd > buffer = false, isspace_ascii(*binEnd) = true => exit loop => binEnd remains 0
* Release 1.3~rc31.3_rc3Julian Andres Klode2016-08-3061-62/+160
|
* test: Pass -d to dpkg-buildpackageJulian Andres Klode2016-08-301-1/+1
| | | | | | | | | This works around an issue on Fedora where dpkg complains about missing build-essential: dpkg-checkbuilddeps: Unmet build dependencies: build-essential:native Gbp-Dch: ignore
* Add shippable.yml for CI on ShippableJulian Andres Klode2016-08-291-0/+15
| | | | | This uses the current Ubuntu 16.04 for testing, but it only runs one run, presumably as root.
* test, travis: Quieter testing with a new -qq modeJulian Andres Klode2016-08-294-10/+38
| | | | | | | | | | | | | | | Introduce a new -qq mode for our integration test framework, and make travis use it. The new -qq mode sets MSGLEVEL to 1. In MSGLEVEL=1, no messages are generated for passed tests, and all testcase filenames are printed in the same line. Also install first in travis, do not ls the installed output and run the install with chronic, so we only get output if it failed. Gbp-Dch: ignore
* Switch documentation from httpredir.d.o to deb.d.oJulian Andres Klode2016-08-2913-157/+157
| | | | | The CDN service deb.d.o is more reliable than the http redirector, so switch to it for our examples.
* Add new symbols to symbols fileJulian Andres Klode2016-08-291-0/+12
| | | | | | | | | | There are some optional symbols missing now, but let's keep them in for now, maybe they reappear/still exist on other platforms. The newly added ones actually appeared in older versions already, but there's no huge gain in finding out when precisely we added them.
* init: Add Dir::Bin::planners default entryJulian Andres Klode2016-08-291-0/+1
| | | | | | Apparently we had no default defined for this. Reported-By: David Kalnischkies
* init: Fix path to external solversJulian Andres Klode2016-08-291-1/+1
| | | | | | | This accidentally had two apt in it. This fixes a regression from commit 8757a0f. Gbp-Dch: ignore
* don't loop on pinning pkgs from absolute debs by regexDavid Kalnischkies2016-08-292-6/+9
| | | | | | | | | | | | | | | | | | | | | An absolute filename for a *.deb file starts with a /. A package with the name of the file is inserted in the cache which is provided by the "real" package for internal reasons. The pinning code detects a regex based wildcard by having the regex start with /. That is no problem as a / can not be included in a package nameā€¦ expect that our virtual filename package can and does. We fix this two ways actually: First, a regex is only being considered a regex if it also ends with / (we don't support flags). That stops our problem with the virtual filename packages already, but to be sure we also do not enter the loop if matcher and package name are equal. It has to be noted that the creation of pins for virtual packages like the here effected filename packages is pointless as only versions can be pinned, but checking that a package is really purely virtual is too costly compared to just creating an unused pin. Closes: 835818
* randomize acquire order for same type index filesDavid Kalnischkies2016-08-293-3/+41
| | | | | | | | | | | | | | | Without randomizing the order in which we download the index files we leak needlessly information to the mirrors of which architecture is native or foreign on this system. More importantly, we leak the order in which description translations will be used which in most cases will e.g. have the native tongue first. Note that the leak effect in practice is limited as apt detects if a file it wants to download is already available in the latest version from a previous download and does not query the server in such cases. Combined with the fact that Translation files are usually updated infrequently and not all at the same time, so a mirror can never be sure if it got asked about all files the user wants.
* Merge branch 'portability/freebsd'Julian Andres Klode2016-08-2744-119/+370
|\
| * CMake: Add missing iconv dependencyJulian Andres Klode2016-08-263-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | FreeBSD has two iconv systems: It ships an iconv.h itself, and symbols for that in the libc. But there's also the port of GNU libiconv, which unfortunately for us, Doxygen depends on. This changes things to prefer a separate libiconv library over the system one; that is, the port on FreeBSD. Gbp-Dch: ignore
| * Make root group configurable via ROOT_GROUPJulian Andres Klode2016-08-266-8/+17
| | | | | | | | | | This is needed on BSD where root's default group is wheel, not root.
| * test: Use :$(id -gn) instead of :root (when run as root)Julian Andres Klode2016-08-262-4/+4
| | | | | | | | | | | | | | On BSD systems, the root group is wheel, not root, so let's just use the default group here. Gbp-Dch: ignore
| * test: Assert multi-arch in the chrootJulian Andres Klode2016-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host system might not have a dpkg installed, which makes dpkg fail with: dpkg not recorded as installed, cannot check for multi-arch support! That's entirely useless of course. We want to know if dpkg could support multi-arch in our chroot, so we pseudo-install dpkg into the chroot and pretend it's version is one version higher than the minimum dpkg version, so dpkg --assert-multi-arch works on recent dpkgs. Gbp-Dch: ignore
| * changelog: Respect Dir setting for local changelog gettingJulian Andres Klode2016-08-262-4/+5
| | | | | | | | | | This fixes issues with chroots, but the goal here was to get the test suite working on systems without dpkg.
| * Lower-case uname -r output in kernel autoremove helperJulian Andres Klode2016-08-262-3/+3
| | | | | | | | | | This is needed on FreeBSD which has versions like 11.0-RC1, otherwise the tests would fail.
| * test: More portable check for dpkg versionsJulian Andres Klode2016-08-264-3/+6
| | | | | | | | | | | | | | This check should work regardless if dpkg was installed by dpkg or by a native package manager like RPM or pkg. Gbp-Dch: ignore
| * test: Use a file to determine TEST_DEFAULT_GROUPJulian Andres Klode2016-08-261-5/+2
| | | | | | | | | | | | | | This is more safe against sticky bits. For example, in FreeBSD all files created in /tmp have the group set to wheel. Gbp-Dch: ignore
| * apt-inst: debfile: Pass comp. Name to ExtractTar, not BinaryJulian Andres Klode2016-08-261-1/+1
| | | | | | | | | | | | In the old days, apt-inst used to use binaries, but now it uses the built-in support and matches using Name, and not a Binary.
| * test: Allow db_dump-5 instead of db_dumpJulian Andres Klode2016-08-261-3/+8
| | | | | | | | Gbp-Dch: ignore
| * Always pass a directory to find before an optionJulian Andres Klode2016-08-262-2/+2
| | | | | | | | | | | | | | On BSD systems, we cannot simply use find -name or stuff, we always have to pass a directory name first. Gbp-Dch: ignore
| * test: Fix invalid quoting in variable expansionJulian Andres Klode2016-08-261-6/+6
| | | | | | | | | | | | | | This breaks the tests with FreeBSD's shell, and is not needed - it works fine without it. Gbp-Dch: ignore
| * test: Use printf "%b\n" instead of echo for strings with '\'Julian Andres Klode2016-08-262-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Use of echo with special characters is not portable. On a normal POSIX system, the behavior with backslash escaped strings is implementation-defined. On an XSI-conformant system, they must be interpreted. A way out is the printf command - printf "%b" specifies that the following argument is to be printed with backslash escapes interpreted. Gbp-Dch: ignore
| * test: Make sure we always find a dpkg in status fileJulian Andres Klode2016-08-261-8/+8
| | | | | | | | | | | | | | Especially on non-Debian platforms, dpkg might not list itself on the host system, and thus dpkg --assert-multi-arch fails. Gbp-Dch: ignore
| * test: Avoid use of /proc/self/fdJulian Andres Klode2016-08-263-6/+11
| | | | | | | | | | | | | | | | | | Use /dev/fd in test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch, skip test-no-fds-leaked-to-maintainer-scripts (it is not guaranteed that /dev/fd contains all file descriptors), and avoid the unneeded use of /proc/fd in another test case. Gbp-Dch: ignore
| * test: Explicitly pass --admindir=var/lib/dpkg to dpkgJulian Andres Klode2016-08-261-0/+2
| | | | | | | | | | | | | | | | Our test suite assumes that dpkg's admindir is var/lib/dpkg. This might not always be true; for example, on FreeBSD, it is located at /var/db/dpkg. Gbp-Dch: ignore
| * test: Fix building of noopchrootJulian Andres Klode2016-08-261-1/+5
| | | | | | | | Gbp-Dch: ignore
| * test: Get rid of debhelper rules.tiny example depJulian Andres Klode2016-08-261-1/+13
| | | | | | | | Gbp-Dch: ignore
| * test: Allow moreutils-parallel instead of parallelJulian Andres Klode2016-08-261-1/+5
| | | | | | | | | | | | That's what it's called on FreeBSD. Gbp-Dch: ignore
| * test: Allow stunnel to be used instead of stunnel4Julian Andres Klode2016-08-261-4/+9
| | | | | | | | | | | | This is needed for Fedora and FreeBSD. Gbp-Dch: ignore
| * test: Substitute GNU commands for other commands where availableJulian Andres Klode2016-08-261-2/+18
| | | | | | | | | | | | | | We are simply checking for gnuCMD and gCMD for each command we are interested in. Gbp-Dch: ignore
| * test: Use C locale instead of C.UTF-8Julian Andres Klode2016-08-261-1/+1
| | | | | | | | Gbp-Dch: ignore
| * 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").