summaryrefslogtreecommitdiff
path: root/doc/examples
Commit message (Collapse)AuthorAgeFilesLines
* configure-index: Add APT::Color optionJulian Andres Klode2020-03-241-0/+1
| | | | | | | | | | | This caused unbound error list growth, because each time we dumped an error, the calls to _config->FindB() inside operator << would add 3 new errors of the form: W: Using unknown config option »apt::color« of type BOOL Hence we are dumping an infinite list of errors, and eventually that list will exceed available memory.
* Show absolute time while waiting for lock instead of %, rework messageJulian Andres Klode2020-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | | Showing a percentage for a timeout is pretty non-standard. Rework the progress class so it can show an absolute progress (currently hardcoded to use seconds as a unit). If there is a timeout (aka if it's not the maximum long long unsigned -1llu), then show the timeout, otherwise just count up seconds, e.g. Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 33842 (apt)... 1/120s or Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 33842 (apt)... 1s Also improve the error message to use "Waiting for cache lock: %s" instead of "... (%s)", as having multiple sentences inside parenthesis is super weird, as is having two closing parens. We pass the information via _config, as that's reasonably easy and avoids ABI hackage. It also provides an interesting debugging tool for other kinds of progress.
* apt(8): Wait for frontend and cache lockJulian Andres Klode2020-02-261-0/+2
| | | | | | This is a rework of !6 with additional stuff for the frontend lock, so we can lock the frontend lock and then keep looping over dpkg lock.
* apt(8): Disable regular expressions and fnmatchJulian Andres Klode2020-01-151-0/+1
| | | | | This is the first step. Next step will be to add warnings to apt-get and then remove support there as well.
* Introduce apt satisfy and apt-get satisfyJulian Andres Klode2019-06-111-0/+1
| | | | | | | | | | | | | | | | | | Allow to satisfy dependency strings supplied on the command line, optionally prefixed with "Conflicts:" to satisfy them like Conflicts. Build profiles and architecture restriction lists, as used in build dependencies, are supported as well. Compared to build-dep, build-essential is not installed automatically, and installing of recommended packages follows the global default, which defaults to yes. Closes: #275379 See merge request apt-team/apt!63
* Prevent shutdown while running dpkgJulian Andres Klode2019-05-031-0/+3
| | | | | | | As long as we are running dpkg, keep an inhibitor that blocks us from shutting down. LP: #1820886
* Merge branch 'pu/dpkg-path' into 'master'Julian Andres Klode2018-12-101-0/+4
|\ | | | | | | | | Set PATH=/usr/sbin:/usr/bin:/sbin:/bin when running dpkg See merge request apt-team/apt!38
| * Set PATH=/usr/sbin:/usr/bin:/sbin:/bin when running dpkgJulian Andres Klode2018-12-101-0/+4
| | | | | | | | | | | | | | | | | | This avoids a lot of problems from local installations of scripting languages and other stuff in /usr/local for which maintainer scripts are not prepared. [v3: Inherit PATH during tests, check overrides work] [v2: Add testing]
* | Add support for /etc/apt/auth.conf.d/*.conf (netrcparts)Julian Andres Klode2018-12-041-0/+1
|/ | | | | | | | | This allows us to install matching auth files for sources.list.d files, for example; very useful. This converts aptmethod's authfd from one FileFd to a vector of pointers to FileFd, as FileFd cannot be copied, and move operators are hard.
* Allow setting Referer header for http methodDavid Kalnischkies2018-11-251-0/+1
| | | | | | Not needed for common interactions, but for some download-file interactions it could be useful to set a specific referer as some servers do not serve requested files otherwise.
* Default to https: scheme for fetching Debian changelogsBen Hutchings2018-10-131-1/+1
| | | | Closes: #910941
* Lower default timeout from 120s to 30sJulian Andres Klode2018-05-241-3/+3
| | | | | 120s is an insanely high default time out, lower it to 30s to make things a bit nicer.
* Remove obsolete RCS keywordsGuillem Jover2018-05-071-1/+0
| | | | Prompted-by: Jakub Wilk <jwilk@debian.org>
* apt-pkg: Add support for zstdJulian Andres Klode2018-03-121-0/+1
| | | | | | | zstd is a compression algorithm developed by facebook. At level 19, it is about 6% worse in size than xz -6, but decompression is multiple times faster, saving about 40% install time, especially with eatmydata on cloud instances.
* Merge branch 'pu/not-valid-before' into 'master'Julian Andres Klode2018-02-191-0/+3
|\ | | | | | | | | Check that Date of Release file is not in the future See merge request apt-team/apt!3
| * Check that Date of Release file is not in the futureJulian Andres Klode2018-02-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | By restricting the Date field to be in the past, an attacker cannot just create a repository from the future that would be accepted as a valid update for a repository. This check can be disabled by Acquire::Check-Date set to false. This will also disable Check-Valid-Until and any future date related checking, if any - the option means: "my computers date cannot be trusted." Modify the tests to allow repositories to be up to 10 hours in the future, so we can keep using hours there to simulate time changes.
* | ensure correct file permissions for auxfilesDavid Kalnischkies2018-02-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The interesting takeaway here is perhaps that 'chmod +w' is effected by the umask – obvious in hindsight of course. The usual setup helps with hiding that applying that recursively on all directories (and files) isn't correct. Ensuring files will not be stored with the wrong permissions even if in strange umask contexts is trivial in comparison. Fixing the test also highlighted that it wasn't bulletproof as apt will automatically fix the permissions of the directories it works with, so for this test we actually need to introduce a shortcut in the code. Reported-By: Ubuntu autopkgtest CI
* | add apt-helper drop-privs command…David Kalnischkies2018-02-191-6/+19
|/
* document https options in new apt-transport-https manpageDavid Kalnischkies2018-01-033-190/+1
| | | | | | Same reasoning as with the previous commit for http with the added benefit of moving the hard to discover and untranslated example config into a manpage which could be translated.
* Add rapid "happy eyeballs" connection fallback (RFC 8305)Julian Andres Klode2018-01-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | Try establishing connections in alternating address families in rapid intervals of 250 ms, adding more connections to the wait list until one succeeds (RFC 8305, happy eyeballs 2). It is important that WaitAndCheckErrors() waits until it has a successful connection, a time out, or all connections failed - otherwise the timing between tries might be wrong, and the final long wait might exit early because one connection failed without trying the others. Timing wise, this only works correctly on Linux, as select() counts down there. But we rely on that in some other places too, so this is not the time to fix that. Timeouts are only reported in the final long wait - the short inner waits are expected to time out more often, and multiple times, we do not want to report them. Closes: #668948 LP: #1308200 Gbp-Dch: paragraph
* Print syscall number and arch to stderr when trapped by seccompJulian Andres Klode2017-10-261-0/+1
| | | | | | This should help debugging crashes. The signal handler is a C++11 lambda, yay! Special care has been taken to only use signal handler -safe functions inside there.
* Sandbox methods with seccomp-BPF; except cdrom, gpgv, rshJulian Andres Klode2017-10-221-0/+3
| | | | | | | | | | | | This reduces the number of syscalls to about 140 from about 350 or so, significantly reducing security risks. Also change prepare-release to ignore the architecture lists in the build dependencies when generating the build-depends package for travis. We might want to clean up things a bit more and/or move it somewhere else.
* show a warning for Debian shutting down FTP servicesDavid Kalnischkies2017-07-261-1/+5
| | | | | | | | | | | | We detect the effected sources by matching Release info – that has potential by-catch of repositories which have incorrect field values, but those are better fixed now anyhow. The bigger incorrectness is that this message will not only be printed for the Debian services itself but also for all mirrors not under Debian control but serving Debian like more local/private mirrors which will not (directly) shutdown. It is likely through that many of them will follow suite with less visible announcements or break downright if their upstream source disappears, so having false-positives here seems benefitial for the user in the end.
* Switch from /org to /srv in example apt-ftparchive configurationPaul Wise2017-07-121-4/+4
| | | | /org has been obsoleted by /srv for many years on debian.org hosts.
* fix various typos reported by codespell & spellintianDavid Kalnischkies2017-07-081-1/+1
| | | | | Reported-By: codespell & spellintian Gbp-Dch: Ignore
* ask for releaseinfo change interactively in aptDavid Kalnischkies2017-06-281-0/+2
| | | | | | | If we have a user sitting around we can let 'apt' ask the user for a confirmation rather than print errors at the end and require the user to figure out which commandline flags are needed to confirm the changes non-interactively.
* error in update on Release information changesDavid Kalnischkies2017-06-281-7/+28
| | | | | | | | | | | The value of Origin, Label, Codename and co can be used in user configuration from apts own pinning to unattended upgrades. A repository changing this values can therefore have serious effects on the behaviour of apt and other tools using these values. In a first step we will generate error messages for these changes now explaining the need for explicit confirmation and provide config options and commandline flags to accept them.
* Introduce Acquire::AllowTLS to turn off TLS supportJulian Andres Klode2017-06-281-0/+2
| | | | | | As requested by Henrique de Moraes Holschuh, here comes an option to disable TLS support. If the option is set to false, the internal TLS layer is disabled.
* avoid explicit types for pkg counts by autoDavid Kalnischkies2017-06-261-0/+6
| | | | | | | | | Changes nothing on the program front and as the datatypes are sufficently comparable fixes no bug either, but problems later on if we ever change the types of those and prevent us using types which are too large for the values we want to store waste (a tiny bit of) resources. Gbp-Dch: Ignore
* 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
* Read dpkg tables to handle architecture wildcardsJulian Andres Klode2017-01-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our implementation of wildcards was rudimentary. It worked for some common ones, but it was also broken: For example, armel matched any-armel, but should match any-arm. With this commit, we load the correct tables from dpkg. Supported are both triplets and quadruplet tables (the latter introduced in dpkg 1.18.11). There are some odd things we have to deal with in the cache filter for historical and API reasons: * The character "*" must be accepted as an alternative to any - in fact it may appear anywhere in the wildcard as we also allow fnmatch() style wildcard matching on the commandline. * The code might get passed an arch with a minus at the end, for example the cmdline "install apt:any-arm-" will first try to check if any-arm- is a valid architecture. We deal with this by rejecting any wildcard ending in a minus. * Triplets are actually implemented by extending them to faux quadruplets - by prepending a "base" component for the architecture tuple, and "any" if there is a wildcard component. Once we have constructed a wildcard, it is transformed into an fnmatch() expression for historical reasons. In the future, we should really get a tuple class and implement matching in a better, more explicit way. This does for now though - it passes all the test cases and accepts all things it should accept. Closes: #748936 Thanks: James Clarke <jrtc27@jrtc27.com> for the initial patch
* allow warning generation for non-whitelisted optionsDavid Kalnischkies2016-12-311-243/+523
| | | | | | | | | | | | | | | The idea is simple: Each¹ Find*( call starts with a call check if the given option (with the requested type) exists in the whitelist. The whitelist is specified via our configure-index file so that we have a better chance at keeping it current. the whitelist is loaded via a special (undocumented for now) configuration stanza and if none is loaded the empty whitelist will make it so that no warnings are shown. Much needs to be done still, but that is as good a time as any to take a snapshot of the current state and release it into the wild given that it found some bugs already and has no practical effect on users. ¹ not all in this iteration, but many
* add hidden config to set packages as Essential/ImportantDavid Kalnischkies2016-11-111-1/+6
| | | | | | | | | | | | | | | | You can pretty much achieve the same with a local dummy package if you want to, but libapt has an inbuilt setting for essential: "apt" which can be overridden with this option as well – it could be helpful in quick tests and what not so adding this alternative shouldn't really hurt much. We aren't going to document them much through as care must be taken in regards to the binary caches as they aren't invalidated by config options alone, so the effects of old settings could still be in them, similar to the other already existing pkgCacheGen option(s). Closes: 767891 Thanks: Anthony Towns for initial patch
* CMake: Add initial support for documentation buildingJulian Andres Klode2016-08-061-0/+4
| | | | | | | | | | Build HTML docbook guides (untranslated) and manual pages (including translations). Also install the examples in the example subdirectory. Translation of docbook guides has not been implemented yet, but should be easy to do. The code also needs some cleanup to automatically detect the available translations.
* fix and document on the fly compressor configDavid Kalnischkies2016-05-272-4/+14
| | | | | | | libapt allows to configure compressors to be used by its system via configuration implemented in 03bef78461c6f443187b60799402624326843396, but that was never really documented and also only partly working, which also explains why the tests weren't using it…
* mention APT::AutoRemove::{Recommends,Suggests}Important optionAndreas Metzler2015-12-141-0/+3
| | | | Closes: 807413
* use @CHANGEPATH@ as placeholder in changelog URI templatesDavid Kalnischkies2015-12-021-2/+2
| | | | | | | | | 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
* provide a public interface for acquiring changelogsDavid Kalnischkies2015-06-151-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Provided is a specialized acquire item which given a version can figure out the correct URI to try by itself and if not provides an error message alongside with static methods to get just the URI it would try to download if it should just be displayed or similar such. The URI is constructed as follows: Release files can provide an URI template in the "Changelogs" field, otherwise we lookup a configuration item based on the "Label" or "Origin" of the Release file to get a (hopefully known) default value for now. This template should contain the string CHANGEPATH which is replaced with the information about the version we want the changelog for (e.g. main/a/apt/apt_1.1). This middleway was choosen as this path part was consistent over the three known implementations (+1 defunct), while the rest of the URI varies widely between them. The benefit of this construct is that it is now easy to get changelogs for Debian packages on Ubuntu and vice versa – even at the moment where the Changelogs field is present nowhere. Strictly better than what apt-get had before as it would even fail to get changelogs from security… Now it will notice that security identifies as Origin: Debian and pick this setting (assuming again that no Changelogs field exists). If on the other hand security would ship its changelogs in a different location we could set it via the Label option overruling Origin. Closes: 687147, 739854, 784027, 787190
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-11-051-2/+2
|\ | | | | | | | | Conflicts: debian/changelog
| * doc/examples/configure-index: make "Dpkg::Max{Arg,ArgBytes} match realityMichael Vogt2014-10-221-2/+2
| | | | | | | | Git-Dch: ignore
* | Use Acquire::Allow{InsecureRepositories,DowngradeToInsecureRepositories}Michael Vogt2014-10-011-1/+1
|/ | | | | | | | | | | The configuration key Acquire::AllowInsecureRepositories controls if apt allows loading of unsigned repositories at all. The configuration Acquire::AllowDowngradeToInsecureRepositories controls if a signed repository can ever become unsigned. This should really never be needed but we provide it to avoid having to mess around in /var/lib/apt/lists if there is a use-case for this (which I can't think of right now).
* Merge remote-tracking branch 'mvo/debian/sid' into debian/sidMichael Vogt2014-04-011-1/+1
|\
| * fix documentation for APT::Periodic::MaxSize "0" (closes: #740551)Michael Vogt2014-03-271-1/+1
| |
* | Add new Debug::RunScripts optionMichael Vogt2014-04-011-1/+1
|/ | | | | This debug option will display all scripts that are run by apts RunScripts and RunScriptsWithPkgs helpers.
* Fix typos in documentation (codespell)Michael Vogt2014-02-221-1/+1
|
* introduce a vendor system to change sources.listDavid Kalnischkies2013-11-301-8/+0
| | | | | | | | Many derivatives make quiet a few simple changes to apt introducing silly diffs just to change examples and co making it harder for them to update apt and harder for us to merge real changes back. First stop: doc/examples/sources.list
* fix syntax error in the configure-indexDavid Kalnischkies2013-06-201-1/+1
| | | | | | | The file isn't supposed to be a valid config file, but it should show valid syntax non-the-less. Git-Dch: Ignore
* * ftparchive/apt-ftparchive.cc:David Kalnischkies2012-06-091-3/+3
| | | | - default to putting the Contents-* files below $(SECTION) as apt-file expects them there - thanks Martin-Éric Racine! (Closes: #675827)
* * doc/examples/sources.list:David Kalnischkies2012-05-262-9/+8
| | | | - use the codename instead of 'stable' in the examples sources.list as we do in the manpage and as the debian-installer does
* * doc/apt-cdrom.8.xml:Justin B Rye2012-05-252-2/+2
| | | | - replace CDROM with the proper CD-ROM in text