summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* replace run-parts with find|sort to avoid debianutils usageDavid Kalnischkies2015-12-061-1/+1
| | | | | | | After e75e5879 the reason for an implicit dependency on debianutils (which is essential for debian, but likely not on other systems) was just two uses of run-parts, which can be replaced with the a lot more portable find-piped-into-sort duo.
* replace "which" with "command -v" for portabilityDavid Kalnischkies2015-12-061-1/+1
| | | | | | | | which is a debian specific tool packaged in debianutils (essential) while command is a shell builtin defined by POSIX. Closes: 807144 Thanks: Mingye Wang for the suggestion.
* use @CHANGEPATH@ as placeholder in changelog URI templatesDavid Kalnischkies2015-12-022-9/+9
| | | | | | | | | This should make it more obvious that CHANGEPATH is a placeholder which apt will replace with a package specific path rather than a string constant. Mail-Reference: <87d1upgvaf.fsf@deep-thought.43-1.org> Mail-Archive: https://lists.debian.org/debian-dak/2015/12/msg00005.html
* tests: apt build-dep actually reports no depends correctlyDavid Kalnischkies2015-12-022-2/+14
| | | | | | | | | | 'Regression' of 7d19ee92f2368a40e739cb27d22d6d28f37ebf45, just that it now works more as expected than previously. Of course, build-essentials are implicitly also build dependencies, so by definition all packages have build dependencies, but that isn't what this message wants to say and it isn't what the user expects. Git-Dch: Ignore
* require explicit paths to dsc/control as we do for deb filesDavid Kalnischkies2015-12-012-3/+13
| | | | | | | | | | | | | | Otherwise a user is subject to unexpected content-injection depending on which directory she happens to start apt in. This also cleans up the code requiring less implementation details in build-dep which is always good. Technically, this is an ABI break as we override virtual methods, but that they weren't overridden was a mistake resulting in pure classes, which shouldn't be pure, so they were unusable – and as they are new in 1.1 nobody is using them yet (and hopefully ever as they are borderline implementation details). Closes: 806693
* accept ../ on the cmdline as start for a deb file as wellDavid Kalnischkies2015-11-291-1/+5
| | | | | | Regression of 14341a7ee1ca3dbcdcdbe10ad19b947ce23d972d. Reported-By: Julian Andres Klode <jak@debian.org>
* tests: fix typos, correct helpmsgs and test testsDavid Kalnischkies2015-11-292-6/+11
| | | | Git-Dch: Ignore
* do not override exact targetrelease matches with lesser matchesAndreas Cadhalpun2015-11-291-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The relevant testcases are in test/integration/test-apt-get-source. There is a test for #731853 that is supposed to "ensure that apt will pick the higher version number" of 0.0.1 (stable) and 0.1 (stable). However, this works by pure chance, as simply reversing the order of the two insertsource lines makes the test fail. So #731853 isn't really fixed, yet. Actually, that's related to the problem I reported, as the underlying issue for both is the same: In the FindSrc function apt chooses a new 'best hit', if either * there is a target release and it matches the release of the package, * or the version of the package is higher than the last best hit. Consider having 1.0 (stable), 2.0 (unstable) and 1.5 (unstable), in this order. Looking for the version in stable, apt first selects 1.0, because the release matches the target release, but then subsequently selects 2.0, because the version is higher. Looking for the version in unstable, apt first selects 2.0, because the release matches the target release, but then subsequently selects 1.5, because the release also matches the target release. The correct way would be to choose a new 'best hit', if either * there is a target release and it matches the release of the package, * or there is no target release and the version is higher than the last best hit. Closes: 746412 Mail-Reference: <565A604B.7090104@googlemail.com> Mail-Archive: https://lists.debian.org/debian-devel/2015/11/msg00470.html
* disable privilege-drop verification by default as fakeroot trips over itDavid Kalnischkies2015-11-281-0/+2
| | | | | | | | | | | | | Dropping privileges is an involved process for code and system alike so ideally we want to verify that all the work wasn't in vain. Stuff designed to sidestep the usual privilege checks like fakeroot (and its many alternatives) have their problem with this through, partly through missing wrapping (#806521), partly as e.g. regaining root from an unprivileged user is in their design. This commit therefore disables most of these checks by default so that apt runs fine again in a fakeroot environment. Closes: 806475
* tests: use id to get user/group instead of environmentDavid Kalnischkies2015-11-281-2/+2
| | | | | | | debci seems to have a cleaner environment now and even if not we could never guess nogroup, so figure it out properly via 'id'. Git-Dch: Ignore
* outsmart gcc -O3 over-optimization in pkgCdrom::FindPackagesDavid Kalnischkies2015-11-271-0/+2
| | | | | | | | Seems like a simpler workaround than forcing a lower optimization level just for this for all of apt. See also: https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1473674
* slightly rephrase notice shown for insecure repositoriesJustin B Rye2015-11-253-5/+5
| | | | Git-Dch: Ignore
* show potentially arch-qualified fullname in 'apt show'David Kalnischkies2015-11-211-9/+26
| | | | | | We do not show the architecture as a dedicated field as this is rather technical information, but as packagename it makes sense to show the architecture as other part of apt will refer to it in this way.
* review of new/changed translatable program stringsJustin B Rye2015-11-215-10/+10
| | | | | Reference mail: https://lists.debian.org/debian-l10n-english/2015/11/msg00006.html
* do not sent Last-Modified if we expect a changed fileDavid Kalnischkies2015-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | In 8d041b4f we made apt figure out based on the last Release file it has if it should request a file or not given that the hashes changed or not. So if we have a last Release file and do a request, do not sent a Last-Modified header as we expect a change so much that a non-change would indeed be an error. The Last-Modified header is therefore at best ignored by the server, so sending it is just wasted effort. In the worst case as time is a fragile thing the server decides against sending us an update with the idea that we already have the latest content, which we know for a fact that we haven't. Given that we sent less information to the server our request is on its own also less identifiable as coming from a returning or new user. The disadvantage is that if we end up getting an old index file after getting a new Release file from another mirror the old mirror will not be able to tell us 'Hit', but instead sends us the complete file we discard, but both lets us end up with the same error class in the end, so the difference isn't big in practice.
* ignore lost+found in private directory cleanupDavid Kalnischkies2015-11-192-4/+7
| | | | | | | | | | In ce1f3a2c we started warning about failing unlinking, which we consistently do for directories. That isn't a problem as directories usually aren't in the places we do want to clean up – with the potential exeception of "lost+found", so lets ignore it like we ignore our own partial/ subdirectory. Closes: 805424
* tests: use quiet level 0 by default in testsDavid Kalnischkies2015-11-1929-107/+117
| | | | Git-Dch: Ignore
* support setting empty values (sanely) & removing support forDavid Kalnischkies2015-11-192-16/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | space-gapping: '-o option= value' That is a very old feature (straight from 1998), but it is super surprising if you try setting empty values and instead get error messages or a non-empty value as the next parameter is treated as the value – which could have been empty, so if for some reason you need a compatible way of setting an empty value try: '-o option="" ""'. I can only guess that the idea was to support '-o option value', but we survived 17 years without it, we will do fine in the future I guess. Similar is the case for '-t= testing' even through '-t testing' existed before and the code even tried to detect mistakes like '-t= -b' … all gone now. Technically that is as its removing a feature replacing it with another a major interface break. In practice I really hope for my and their sanity that nobody was using this; but if for some reaon you do: Remove the space and be done. I found the patch and the bugreport actually only after the fact, but its reassuring that others are puzzled by this as well and hence a thanks is in perfect order here as the patch is practical identical [expect that this one here adds tests and other bonus items]. Thanks: Daniel Hartwig for initial patch. Closes: 693092
* do not use _apt for file/copy sources if it isn't world-accessibleDavid Kalnischkies2015-11-194-9/+35
| | | | | | | | | | | | | | | | | | | | | | In 0940230d we started dropping privileges for file (and a bit later for copy, too) with the intend of uniforming this for all methods. The commit message says that the source will likely fail based on the compressors already – and there isn't much secret in the repository content. After all, after apt has run the update everyone can access the content via apt anyway… There are sources through which worked before which are mostly single-deb (and those with the uncompressed files available). The first one being especially surprising for users maybe, so instead of failing, we make it so that apt detects that it can't access a source as _apt and if so doesn't drop (for all sources!) privileges – but we limit this to file/copy, so the uncompress which might be needed will still fail – but that failed before this regression. We display a notice about this, mostly so that if it still fails (e.g. compressed) the user has some idea what is wrong. Closes: 805069
* tests: fail testsuccess if notices are shown, tooDavid Kalnischkies2015-11-181-16/+50
| | | | | | | | Notices are just hints, but if they are printed in tests, they should be expected and if not the test should fail. No current test has this problem, so that is just potential future proving. Git-Dch: Ignore
* "support" unsigned Release files without hashes againDavid Kalnischkies2015-11-051-2/+7
| | | | | | | | | This 'ignores' the component Release files you can find in Debian alongside the binary-* directories, which isn't exactly a common usecase, but it worked before, so lets support it again as this isn't worse than a valid Release file which is unsigned. Git-Dch: Ignore
* encode UTF-8 characters correctly in QuoteStringDavid Kalnischkies2015-11-051-0/+11
| | | | | | | Limit the field length to a char to avoid bogus FF for utf-8 characters with the default length. Closes: 799123
* apply various suggestions made by cppcheckDavid Kalnischkies2015-11-051-1/+1
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* allow acquire method specific options via Binary scopeDavid Kalnischkies2015-11-051-7/+7
| | | | | | | | Allows users who know what they are getting themselves into with this trick to e.g. disable privilege dropping for e.g. file:// until they can fix up the permissions on those repositories. It helps also the test framework and people with a similar setup (= me) to run in less modified environments.
* drop privileges in copy:// method as we do for file://David Kalnischkies2015-11-054-48/+58
| | | | | | | | | | | Continueing on the track of dropping privileges in all methods, lets drop it in copy, too, as the reasoning for it is very similar to file and the interaction between the too quiet interesting as copy kinda surfed as a fallback for file not being able to read the file. Both now show a better error message as well as it was previously claiming to have a hashsum mismatch, given that it couldn't read the file. Git-Dch: Ignore
* allow getaddrinfo flag AI_ADDRCONFIG to be disabledDavid Kalnischkies2015-11-041-0/+1
| | | | | | | | | This flags is generally handy to avoid having to deal with ipv6 results on an ipv4-only system, but it prevents e.g. the testcases from working if the testsystem has no configured address at the moment (expect loopback), so allow it to be sidestepped and let the testcases sidestep it. Git-Dch: Ignore
* ensure FileFd doesn't try to open /dev/null as atomic and coDavid Kalnischkies2015-11-042-0/+34
| | | | | | | | | | The wrapping will fail in the best case and actually end up deleting /dev/null in the worst case. Given that there is no point in trying to write atomically to /dev/null as you can't read from it again just ignore these flags if higher level code ends up trying to use them on /dev/null. Git-Dch: Ignore
* ignore newlines in dpkg-deb control output for installing debsDavid Kalnischkies2015-11-041-0/+29
| | | | | | | | | | | Leading or trailing newlines can be confusing for our parser as it expects two newlines to start/stop a new stanza. To solve this the lines we wanna add are printed first, ignore any leading newlines and then add the stanza as provided by dpkg-deb with or without trailing newlines as the parser will look at the first stanza only anyway and removing trailing newlines is considerably harder to do. Closes: 802553
* support arch:all data e.g. in separate Packages fileDavid Kalnischkies2015-11-0431-123/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* sanify API to get 'the' candidate versionDavid Kalnischkies2015-11-041-0/+19
| | | | | | | | | This was discussed a while ago on #debian-apt and now that I see myself making this mistake lets bite the bullet and fix it in the easy way out version: Using a new name which fits with a similar named setter and deprecate the old method instead of 'hostily' changing API. Closes: #803471
* revamp all tools help messagesDavid Kalnischkies2015-11-041-1/+1
| | | | | | | | | | | | | | | | 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.
* move apts cmdline helper type into -privateDavid Kalnischkies2015-11-042-9/+9
| | | | | | | | 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-042-4/+10
| | | | | | | This ensures that location strings loaded from a location specified via configuration (Dir::Locale) effect the help messages for commands. Git-Dch: Ignore
* new quiet level -qq for apt to hide progress outputDavid Kalnischkies2015-11-043-5/+5
| | | | | | | | | -q is for logging and -qqq (old -qq) basically kills every output expect errors, so there should be a way of declaring a middleground in which the output of e.g. 'update' isn't as verbose, but still shows some things. The test framework was actually making use of by accident as it ignored the quiet level in output setup for apt before. Eventually we should figure out some better quiet levels for all tools…
* disable updating insecure repositories in apt by defaultDavid Kalnischkies2015-11-044-20/+11
| | | | | | apt is an interactive command and the reasons we haven't this option set for everything is mostly in keeping compatibility for a little while longer to allow scripts to be changed if need be.
* move 'search' implementations as wellDavid Kalnischkies2015-11-041-8/+5
| | | | Git-Dch: Ignore
* add binary-specific options via Binary scopeDavid Kalnischkies2015-11-042-0/+59
| | | | | | Especially with apt now, it can be useful to set an option only for apt and not for apt-get. Using a binary-specific subtree which is merged into the root seems like a simple enough trick to achieve this.
* suggest 'apt autoremove' to get right of unneeded packagesDavid Kalnischkies2015-11-045-15/+35
| | | | | | | | | | The bugreport is more conservative in asking for a conditional, but given that this is a message intended to be read by users to be run by users we should suggest using a command intended to be used by users. And while we are at, add sudo to the message – conditional of course. Closes: 801571
* refer to apt-secure(8) in unsecure repositories warningDavid Kalnischkies2015-11-045-7/+95
| | | | | | The manpage is also slightly updated to work better as a central hub to push people from all angles into the right directions without writting a book disguised as an error message.
* rework errors and warnings around insecure repositoriesDavid Kalnischkies2015-11-045-10/+30
| | | | | | | | | | | | | | | | Insecure (aka unsigned) repositories are bad, period. We want to get right of them finally and as a first step we are printing scary warnings. This is already done, this commit just changes the messages to be more consistent and prevents them from being displayed if authenticity is guaranteed some other way (as indicated with trusted=yes). The idea is to first print the pure fact like "repository isn't signed" as a warning (and later as an error), while giving an explaination in a immediately following notice (which is displayed only in quiet level 0: so in interactive use, not in scripts and alike). Closes: 796549
* support .deb files in upgrade operations as wellDavid Kalnischkies2015-11-041-9/+5
| | | | | | The main part is refactoring through to allow hiding the magic needed to support .deb files in deeper layers of libapt so that frontends have less exposure to Debian specific classes like debDebPkgFileIndex.
* unbreak the copy-method claiming hashsum mismatch since ~exp9David Kalnischkies2015-11-042-7/+23
| | | | | | | | | | | | | | | | Commit 653ef26c70dc9c0e2cbfdd4e79117876bb63e87d broke the camels back in sofar that everything works in terms of our internal use of copy:/, but external use is completely destroyed. This is kinda the reverse of what happened in "parallel" in the sid branch, where external use was mostly fine, internal and external exploded on the GzipIndexes option. We fix this now by rewriting our internal use by letting copy:/ only do what the name suggests it does: Copy files and not uncompress them on-the-fly. Then we teach copy and the uncompressors how to deal with /dev/null and use it as destination file in case we don't want to store the uncompressed files on disk. Closes: 799158
* tests: ensure sponge-files are cleaned up properlyDavid Kalnischkies2015-11-041-0/+2
| | | | Git-Dch: Ignore
* tests: change test-skipping detection for arch-specific pkgsDavid Kalnischkies2015-11-041-8/+3
| | | | | | | | | | dpkg-checkbuilddeps changed its exitcodes in the recent past so the old check always fails now skipping the test. Lets try a slightly more stable (at least assume it to be) variant of detecting this. See also 4f6d26b4d41474aa390329b7e9cb167eb70b2821. Git-Dch: Ignore
* allow all dpkg selections to be set via apt-mark and libaptDavid Kalnischkies2015-11-041-0/+40
| | | | | | As we have support for 'hold', we need support for undoing a hold which in effect means that we implemented most other states as well, just that they weren't exposed in the interface directly so far.
* provide public interface to hold/unhold packagesDavid Kalnischkies2015-11-041-0/+13
| | | | | | We had this code lying around in apt-mark for a while now, but other frontends need this (and similar) functionality as well, so its high time that we provide a public interface in libapt for this stuff.
* thread-safety tests: Adjust path to listsJulian Andres Klode2015-10-301-3/+3
| | | | Gbp-Dch: ignore
* Provide tests for thread-safetyJulian Andres Klode2015-10-303-0/+101
| | | | | | | | | | | | | | | | | These scripts currently produce HTML output that is directly piped into an HTML file on alioth. There are three categories. The first two check external library calls to use the ones specified by POSIX to be thread-safe. The main profile excludes functions that are thread-safe on Linux or glibc in general, while the portable output strictly follows posix. The internal.html output lists internal function calls, such as configuration setting. This is supposed to be automated further at some point, so we can automatically check for regressions.
* cacheset: Fix compilation on new GCC in C++98 modeJulian Andres Klode2015-10-301-0/+26
| | | | | | | | | | | | | Since gcc 4.9, the API for erase slightly changed. In commit 3dddcdf2432e78f37c74d8c76c2c519a8d935ab2 the existing checks for __cplusplus where changed to check the gcc version, as the __cplusplus check did nothing, because gcc 4.8 already provided the standard value in there. Fix the code to check for the gcc version in two more places, and change the existing checks to use a convenience macro.
* tests: add a -j $jobs mode to test runner for parallel executionDavid Kalnischkies2015-09-152-15/+75
| | | | | | | | | | Now that tests can be run in parallel, lets actually do it… The mode has some downsides like not collecting the failed tests, but it can be a lot faster than a sequential run and is therefore a good alternative in testing those "this shouldn't break anything" changes (which tend to break everything if untested). Git-Dch: Ignore