summaryrefslogtreecommitdiff
path: root/apt-pkg/init.cc
Commit message (Collapse)AuthorAgeFilesLines
* Silence clang warning -Wstring-plus-intDavid Kalnischkies2020-05-251-4/+4
| | | | | | | | | | | | | ../apt-pkg/init.cc:137:39: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] Cnf.CndSet("Dir::State", STATE_DIR + 1); ../apt-pkg/init.cc:137:39: note: use array indexing to silence this warning We have a few instances of that & it should be reasonably clear that we are not actually trying to append here, but ignoring or silencing this warning with an override is far more costly than just using what clang suggests here. Reported-By: clang Gbp-Dch: Ignore
* Merge branch 'pu/dpkg-path' into 'master'Julian Andres Klode2018-12-101-0/+3
|\ | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | 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.
* Remove "Tanglu" config for Acquire::Changelogs and as vendorManuel A. Fernandez Montecelo2018-10-261-1/+0
| | | | | This is an inactive derivative according to the census, and all the URLs which are part of tanglu.org are dead.
* Remove "Ultimedia" config for Acquire::ChangelogsManuel A. Fernandez Montecelo2018-10-261-1/+0
| | | | | This is an inactive derivative according to the census, and all the URLs which are part of .ultimediaos.com are dead.
* Default to https: scheme for fetching Debian changelogsBen Hutchings2018-10-131-1/+1
| | | | Closes: #910941
* Fix typos reported by codespell & spellintianDavid Kalnischkies2018-08-291-1/+1
| | | | | | | | No user-visible change as it effects mostly code comments and not a single error message, manpage or similar. Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Remove obsolete RCS keywordsGuillem Jover2018-05-071-1/+0
| | | | Prompted-by: Jakub Wilk <jwilk@debian.org>
* Fix various typos reported by spellcheckersDavid Kalnischkies2018-05-051-1/+1
| | | | | Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Use https for Ubuntu changelogsJulian Andres Klode2018-03-151-1/+1
| | | | We just enabled https on changelogs.ubuntu.com, let's use it.
* allow a method to request auxiliary filesDavid Kalnischkies2018-01-031-1/+0
| | | | | | | | | | | | | | | | | | | | If a method needs a file to operate like e.g. mirror needs to get a list of mirrors before it can redirect the the actual requests to them. That could easily be solved by moving the logic into libapt directly, but by allowing a method to request other methods to do something we can keep this logic contained in the method and allow e.g. also methods which perform binary patching or similar things. Previously they would need to implement their own acquire system inside the existing one which in all likelyhood will not support the same features and methods nor operate with similar security compared to what we have already running 'above' the requesting method. That said, to avoid methods producing conflicts with "proper" files we are downloading a new directory is introduced to keep the auxiliary files in. [The message magic number 351 is a tribute to the german Grundgesetz article 35 paragraph 1 which defines that all authorities of the state(s) help each other on request.]
* show warnings instead of errors if files are unreadableDavid Kalnischkies2017-07-261-11/+9
| | | | | | | | | | We used to fail on unreadable config/preferences/sources files, but at least for sources we didn't in the past and it seems harsh to refuse to work because of a single file, especially as the error messages are inconsistent and end up being silly (like suggesting to run apt update to fix the problem…). LP: #1701852
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-6/+6
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* Ignore \.ucf-[a-z]+$ like we do for \.dpkg-[a-z]+$Julian Andres Klode2017-03-071-0/+1
| | | | | | This gets rid of warnings about .ucf-dist files Reported-By: Axel Beckert (on IRC)
* fix various typos reported by codespellDavid Kalnischkies2017-01-191-1/+1
| | | | | | | Nothing in user visible strings. Gbp-Dch: Ignore Reported-By: codespell
* Read dpkg tables to handle architecture wildcardsJulian Andres Klode2017-01-171-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* Make directory paths configurableJulian Andres Klode2016-08-261-6/+6
| | | | | | | 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 /.
* if conf unset, don't read / as conf/pref/sources dirDavid Kalnischkies2016-06-291-3/+4
| | | | | | | | | | Usually these config options are set to sensible values, but if init isn't run or the user interferes with configuration clearing or similar the options could indeed carry an empty value, which will result in FindDir returning a '/'. That feels kinda wrong, but as a public interface there isn't much we can do about it and instead make it so that we get the special file /dev/null back we know how to deal with in such cases.
* eipp: let apt make a plan, not make stuff planeDavid Kalnischkies2016-06-291-1/+1
| | | | | | | | | | | | | | Julian noticed on IRC that I fall victim to a lovely false friend by calling referring to a 'planer' all the time even through these are machines to e.g. remove splinters from woodwork ("make stuff plane"). The term I meant is written in german in this way (= with a single n) but in english there are two, aka: 'planner'. As that is unreleased code switching all instances without any transitional provisions. Also the reason why its skipped in changelog. Thanks: Julian Andres Klode Gbp-Dch: Ignore
* eipp: enable xz-compressed scenario loggingDavid Kalnischkies2016-06-271-0/+1
| | | | | | | | | | | | In 385d9f2f23057bc5808b5e013e77ba16d1c94da4 I implemented the storage of scenario files based on enabling this by default for EIPP, but I implemented it first optionally for EDSP to have it independent. The reasons mentioned in the earlier commit (debugging and bugreports) obviously apply here, especially as EIPP solutions aren't user approved, nearly impossible to verify before starting the execution and at the time of error the scenario has changed already, so that reproducing the issue becomes hard(er).
* add insecure (and weak) allow-options for sources.listDavid Kalnischkies2016-06-221-0/+1
| | | | | | | | Weak had no dedicated option before and Insecure and Downgrade were both global options, which given the effect they all have on security is rather bad. Setting them for individual repositories only isn't great but at least slightly better and also more consistent with other settings for repositories.
* forbid insecure repositories by default expect in apt-getDavid Kalnischkies2016-06-221-4/+1
| | | | | | | | | | | | | | | With this commit all APT-based clients default to refusing to work with unsigned or otherwise insufficently secured repositories. In terms of apt and apt-get this changes nothing, but it effects all tools using libapt like aptitude, synaptic or packagekit. The exception remains apt-get for stretch for now as this might break too many scripts/usecases too quickly. The documentation is updated and extended to reflect how to opt out or in on this behaviour change. Closes: 808367
* edsp: optionally store a compressed copy of the last scenarioDavid Kalnischkies2016-06-081-2/+2
| | | | | | | | For bugreports and co it could be handy to have the scenario and all the settings used in it around later for inspection for EDSP like protocols. EDSP might not be the most interesting as the user can still interrupt the process before the solution is applied and users tend to have an opinion on the "rightness" of a solution, so it is disabled by default.
* use local changelog from /usr/share/doc if possibleDavid Kalnischkies2016-02-111-0/+1
| | | | | | | | | | | If pkgAcqChangelog is told to acquire the changelog for a version it will check first if this version is installed on the disk and if so will use the local changelog in /usr/share/doc (possibily/likely gz compressed) instead of downloading the file from the web. An option is provided to disable this, which is enabled by default for the Ubuntu vendor as they truncate the local changelogs – and for apts --print-uris action.
* use @CHANGEPATH@ as placeholder in changelog URI templatesDavid Kalnischkies2015-12-021-4/+4
| | | | | | | | | 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
* Cleanup includes after running iwyuMichael Vogt2015-08-171-1/+0
|
* Set Acquire::Changelogs::URI::Origin::Tanglu for Tanglu changelogsJulian Andres Klode2015-08-141-0/+1
|
* rename 'apt-get files' to 'apt-get indextargets'David Kalnischkies2015-08-101-17/+17
| | | | | | | | 'files' is a bit too generic as a name for a command usually only used programmatically (if at all) by developers, so instead of "wasting" this generic name for this we use "indextargets" which is actually the name of the datastructure the displayed data is stored in. Along with this rename the config options are renamed accordingly.
* remove the longtime deprecated vendor{,list} stuffDavid Kalnischkies2015-08-101-2/+0
| | | | | | | History suggests that this comes from an earlier apt-secure implementation, but never really became a thing, totally unused and marked as deprecated for "ages" now. Especially as it did nothing even if it would have been used (libapt itself didn't use it at all).
* provide a public interface for acquiring changelogsDavid Kalnischkies2015-06-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* store all targets data in IndexTarget structDavid Kalnischkies2015-06-101-6/+6
| | | | | | | We still need an API for the targets, so slowly prepare the IndexTargets to let them take this job. Git-Dch: Ignore
* configureable acquire targets to download additional filesDavid Kalnischkies2015-06-091-1/+19
| | | | | | | | First pass at making the acquire system capable of downloading files based on configuration rather than hardcoded entries. It is now possible to instruct 'deb' and 'deb-src' sources.list lines to download more than just Packages/Translation-* and Sources files. Details on how to do that can be found in the included documentation file.
* mark internal interfaces as hiddenDavid Kalnischkies2014-11-081-1/+1
| | | | | | | We have a bunch of classes which are of no use for the outside world, but were still exported and so needed to preserve ABI/API. Marking them as hidden to not export them any longer is a big API break in theory, but in practice nobody is using them – as if they would its a bug.
* Change default of Acquire::AllowInsecureRepositories to "true"Michael Vogt2014-10-131-1/+4
| | | | | This change is made for backward compatiblity and should be reverted once jessie is out.
* Fix backward compatiblity of the new pkgAcquireMethod::DropPrivsOrDie()Michael Vogt2014-10-131-0/+3
| | | | | | | | Do not drop privileges in the methods when using a older version of libapt that does not support the chown magic in partial/ yet. To do this DropPrivileges() now will ignore a empty Apt::Sandbox::User. Cleanup all hardcoded _apt along the way.
* Use Acquire::Allow{InsecureRepositories,DowngradeToInsecureRepositories}Michael Vogt2014-10-011-0/+4
| | | | | | | | | | | 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).
* reduce delta from ubuntuMichael Vogt2014-04-251-0/+1
|
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-1/+3
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* do not use an empty APT_CONFIG environment variableDavid Kalnischkies2014-02-101-1/+1
|
* drop old /var/state to /var/lib transition artefactsDavid Kalnischkies2013-12-011-9/+1
| | | | | | Regardless of when this transition was, it is so long ago that everyone who would still need this has a million other problems to deal with now so lets just drop this code.
* the previously used VERSION didn't work everywhere so we are switchingDavid Kalnischkies2012-03-221-1/+1
| | | | to the more standard PACKAGE_VERSION and make it work in every file
* merge with my debian-sid branchDavid Kalnischkies2011-10-301-7/+6
|\
| * * apt-pkg/init.cc:David Kalnischkies2011-09-211-7/+6
| | | | | | - silently ignore *.orig and *.save files by default
* | use forward declaration in headers if possible instead of includesDavid Kalnischkies2011-09-191-0/+2
| |
* | do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-3/+3
| |
* | reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies2011-09-131-2/+4
| |
* | merged from http://bzr.debian.org/bzr/apt/apt/debian-sidMichael Vogt2011-07-151-38/+41
|\|