summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
Commit message (Collapse)AuthorAgeFilesLines
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-13/+13
| | | | | | | | | | | | | 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.
* Drop cacheiterators.h includeJulian Andres Klode2017-07-121-1/+0
| | | | | Including cacheiterators.h before pkgcache.h fails because pkgcache.h depends on cacheiterators.h.
* support 'apt build-dep .' (aka: without /)David Kalnischkies2016-11-101-2/+2
| | | | Reported-By: Christoph Berg (Myon) on IRC
* treat .ddeb files like .deb, especially for dpkgDavid Kalnischkies2016-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Ubuntu uses *.ddeb files for their debug packages, but the interface we are using since f495992428a396e0f98886c9a761a804aa161c68 to talk to dpkg isn't supporting *.ddeb files. This used to work previously as apt itself isn't caring about the filenames at all and if they are explicitly mentioned dpkg will accept all, too. It might or might not be a good idea to patch dpkg, too, but regardless of it happening, we don't want to couple us to closely to dpkg for this minor feature but testing for this at runtime as it would delay shipping the fix for the too long commandlines further. It is also questionable if it is really a good idea to allow any file extension to be used here (like .foobar in the testcase), but we used to and we tend to avoid breaking existing usecases if we can help it. As a bonus, this also allows the installation of ddeb files directly from the commandline as you can with deb files already. We continue to ignore udeb through as the user-mistake to useful ratio is too high. LP: #1616909
* 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-171-1/+33
| | | | | | | | | | | | | 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.
* support "install ./foo.changes"David Kalnischkies2016-07-221-2/+39
| | | | | | | | | | | | We support installing ./foo.deb (and ./foo.dsc for source) for a while now, but it can be a bit clunky to work with those directly if you e.g. build packages locally in a 'central' build-area. The changes files also include hashsums and can be signed, so this can also be considered an enhancement in terms of security as a user "just" has to verify the signature on the changes file then rather than checking all deb files individually in these manual installation procedures.
* if conf unset, don't read / as conf/pref/sources dirDavid Kalnischkies2016-06-291-4/+5
| | | | | | | | | | 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.
* deb822: Restore support for <multivalue>-{Add,Remove}James McCoy2016-04-281-2/+2
| | | | | | Redesign of multivalue options in 463c8d801595ce5ac94d7c032264820be7434232 caused the parser to look for <multivalue>{Add,Remove} (no hyphen) instead of the expected <multivalue>-{Add,Remove}.
* properly parse comments in apt_preferences and deb822-style sourcesDavid Kalnischkies2016-01-021-2/+2
| | | | | | | | | | apt_preferences and deb822-style sources used the specialized class pkgUserTagSection to deal with comments before/after a given stanza, but it couldn't deal with comments in the stanza at all. codesearch suggests that nobody else does and a vastely superior way of working with potentially commented files is implemented now, so we can officially discourage the use of the old incomplete hack class.
* require explicit paths to dsc/control as we do for deb filesDavid Kalnischkies2015-12-011-1/+7
| | | | | | | | | | | | | | 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/+1
| | | | | | Regression of 14341a7ee1ca3dbcdcdbe10ad19b947ce23d972d. Reported-By: Julian Andres Klode <jak@debian.org>
* support .deb files in upgrade operations as wellDavid Kalnischkies2015-11-041-1/+34
| | | | | | 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.
* add by-hash sources.list option and document all of by-hashDavid Kalnischkies2015-09-141-0/+1
| | | | | | | | | | | | This changes the semantics of the option (which is renamed too) to be a yes/no value with the special additional value "force" as this allows by-hash to be disabled even if the repository indicates it would be supported and is more in line with our other yes/no options like pdiff which disable themselves if no support can be detected. The feature wasn't documented so far and hasn't reached a (un)stable release yet, so changing it without trying too hard to keep compatibility seems okay.
* avoid using global PendingError to avoid failing too often too soonDavid Kalnischkies2015-09-141-1/+1
| | | | | | | | | | | | | | | | | | | Our error reporting is historically grown into some kind of mess. A while ago I implemented stacking for the global error which is used in this commit now to wrap calls to functions which do not report (all) errors via return, so that only failures in those calls cause a failure to propergate down the chain rather than failing if anything (potentially totally unrelated) has failed at some point in the past. This way we can avoid stopping the entire acquire process just because a single source produced an error for example. It also means that after the acquire process the cache is generated – even if the acquire process had failures – as we still have the old good data around we can and should generate a cache for (again). There are probably more instances of this hiding, but all these looked like the easiest to work with and fix with reasonable (aka net-positive) effects.
* detect and deal with indextarget duplicatesDavid Kalnischkies2015-08-301-0/+11
| | | | | | | | | | | | | | | Multiple targets downloading the same file is bad™ as it leads us to all sorts of problems like the acquire system breaking or simply a problem of which settings to use for them. Beside that this is most likely a mistake and silently ignoring it doesn't help the user realizing his mistake… On the other hand, we have 'duplicates' which are 'created' by how we create indextargets, so we have to prevent those from being created to but do not emit a warning for them as this is an implementation detail. And then, there is the absolute and most likely user mistake: Having the same target(s) activated in multiple entries.
* use c++11 algorithms to avoid strange compiler warningsDavid Kalnischkies2015-08-291-29/+22
| | | | | | | | | | | | | Nobody knows what makes the 'unable to optimize loop' warning to appear in the sourceslist minus-options parsing, especially if we use a foreach loop, but we can replace it with some nice c++11 algorithm+lambda usage, which also helps in making even clearer what happens here. And as this would be a lonely change, lets do it for a few more loops as well where I might or might not have seen the warning at some point in time, too. Git-Dch: Ignore
* sources.list and indextargets option for pdiffsDavid Kalnischkies2015-08-271-0/+1
| | | | | | | Disabling pdiffs can be useful occasionally, like if you have a fast local mirror where the download doesn't matter, but still want to use it for non-local mirrors. Also, some users might prefer it to only use it for very big indextargets like Contents.
* Support tabs in sources.list filesJulian Andres Klode2015-08-191-1/+1
| | | | | | Also support vertical tabs, as isspace() does the same. Closes: #796067
* Fix an obscure warning from GCCJulian Andres Klode2015-08-111-2/+2
| | | | | | | | | | | It complained about the previous code: apt-pkg/sourcelist.cc: In destructor ‘pkgSourceList::~pkgSourceList()’: apt-pkg/sourcelist.cc:278:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] for (pkgIndexFile * const File : VolatileFiles) ^ There really cannot be an overflow, though. Rewriting it like this seems to fix it.
* add volatile sources support in libapt-pkgDavid Kalnischkies2015-08-101-3/+25
| | | | | | | | | | | | | | | | | | | Sources are usually defined in sources.list (and co) and are pretty stable, but once in a while a frontend might want to add an additional "source" like a local .deb file to install this package (No support for 'real' sources being added this way as this is a multistep process). We had a hack in place to allow apt-get and apt to pull this of for a short while now, but other frontends are either left in the cold by this and/or the code for it looks dirty with FIXMEs plastering it and has on top of this also some problems (like including these 'volatile' sources in the srcpkgcache.bin file). So the biggest part in this commit is actually the rewrite of the cache generation as it is now potentially a three step process. The biggest problem with adding support now through is that this makes a bunch of previously mostly unusable by externs and therefore hidden classes public, so a bit of further tuneing on this now public API is in order…
* implement Signed-By option for sources.listDavid Kalnischkies2015-08-101-13/+15
| | | | | | | | | | Limits which key(s) can be used to sign a repository. Not immensely useful from a security perspective all by itself, but if the user has additional measures in place to confine a repository (like pinning) an attacker who gets the key for such a repository is limited to its potential and can't use the key to sign its attacks for an other (maybe less limited) repository… (yes, this is as weak as it sounds, but having the capability might come in handy for implementing other stuff later).
* add sources.list Check-Valid-Until and Valid-Until-{Max,Min} optionsDavid Kalnischkies2015-08-101-0/+3
| | | | | | | | | | | | | | | | | | These options could be set via configuration before, but the connection to the actual sources is so strong that they should really be set in the sources.list instead – especially as this can be done a lot more specific rather than e.g. disabling Valid-Until for all sources at once. Valid-Until-* names are chosen instead of the Min/Max-ValidTime as this seems like a better name and their use in the wild is probably low enough that this isn't going to confuse anyone if we have to names for the same thing in different areas. In the longrun, the config options should be removed, but for now documentation hinting at the new options is good enough as these are the kind of options you set once across many systems with different apt versions, so the new way should work everywhere first before we deprecate the old way.
* merge indexRecords into metaIndexDavid Kalnischkies2015-08-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | indexRecords was used to parse the Release file – mostly the hashes – while metaIndex deals with downloading the Release file, storing all indexes coming from this release and … parsing the Release file, but this time mostly for the other fields. That wasn't a problem in metaIndex as this was done in the type specific subclass, but indexRecords while allowing to override the parsing method did expect by default a specific format. APT isn't really supporting different types at the moment, but this is a violation of the abstraction we have everywhere else and, which is the actual reason for this merge: Options e.g. coming from the sources.list come to metaIndex naturally, which needs to wrap them up and bring them into indexRecords, so the acquire system is told about it as they don't get to see the metaIndex, but they don't really belong in indexRecords as this is just for storing data loaded from the Release file… the result is a complete mess. I am not saying it is a lot prettier after the merge, but at least adding new options is now slightly easier and there is just one place responsible for parsing the Release file. That can't hurt.
* bring back deb822 sources.list entries as .sourcesDavid Kalnischkies2015-08-101-114/+114
| | | | | | | | | | | | | | | | | | Having two different formats in the same file is very dirty and causes external tools to fail hard trying to parse them. It is probably not a good idea for them to parse them in the first place, but they do and we shouldn't break them if there is a better way. So we solve this issue for now by giving our deb822 format a new filename extension ".sources" which unsupporting applications are likely to ignore an can begin gradually moving forward rather than waiting for the unknown applications to catch up. Currently and for the forseeable future apt is going to support both with the same feature set as documented in the manpage, with the longtime plan of adopting the 'new' format as default, but that is a long way to go and might get going more from having an easier time setting options than from us pushing it explicitely.
* support lang= and target= sources.list optionsDavid Kalnischkies2015-08-101-18/+22
| | | | | | | | | | | | | | | We support arch= for a while, now we finally add lang= as well and as a first simple way of controlling which targets to acquire also target=. This asked for a redesign of the internal API of parsing and storing information about 'deb' and 'deb-src' lines. As this API isn't visible to the outside no damage done through. Beside being a nice cleanup (= it actually does more in less lines) it also provides us with a predictable order of architectures as provides in the configuration rather than based on string sorting-order, so that now the native architecture is parsed/displayed first. Observeable e.g. in apt-get output.
* make all d-pointer * const pointersDavid Kalnischkies2015-08-101-2/+2
| | | | | | | | | | | | | | Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore
* fix some new compiler warnings reported by gcc-5David Kalnischkies2015-03-161-1/+1
| | | | Git-Dch: Ignore
* fix: Prefer prefix ++/-- operators for non-primitive typesDavid Kalnischkies2014-09-271-4/+4
| | | | | Git-Dch: Ignore Reported-By: cppcheck
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-1/+10
| | | | | | | | 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)
* Merge remote-tracking branch 'mvo/debian/sid' into debian/sidMichael Vogt2014-01-251-1/+7
|\
| * support " " in deb822 source optionsMichael Vogt2014-01-251-1/+7
| |
* | set APT::Sources::Use-Deb822 to default false for nowMichael Vogt2014-01-241-1/+1
| |
* | add support for multipl types in one lineMichael Vogt2014-01-201-10/+15
| |
* | add support for multiple URIs in deb822 style sources.listMichael Vogt2014-01-201-11/+18
| |
* | add support for Enabled: no in deb822 sources.listMichael Vogt2014-01-201-0/+4
|/
* rename "Suite/Section" to pluralMichael Vogt2014-01-181-2/+2
|
* implement suggestion by donkult (thanks!)Michael Vogt2014-01-171-2/+2
|
* support multiple "Suite:" entriesMichael Vogt2014-01-161-9/+18
|
* rename URL to Uri in deb822-sourcesMichael Vogt2014-01-161-1/+1
|
* rename "distribution" in sources.list to "suite"Michael Vogt2014-01-161-1/+1
|
* * refactor to have a new virtual ParseStanzaMichael Vogt2014-01-161-26/+39
| | | | | | Have a similar ParseStanza() to the current ParseLine(). Rename the Architectures options in deb822 to make it more user friendly
* remove "," in components againMichael Vogt2014-01-161-5/+1
|
* improve error messageMichael Vogt2014-01-041-12/+22
|
* improve testsMichael Vogt2014-01-041-1/+2
|
* suppoer $(ARCH) in deb822 sources.list as wellMichael Vogt2013-12-091-2/+6
|
* add APT::Sources::Use-Deb822 to allow disabling the deb822 parserMichael Vogt2013-12-091-8/+13
|
* more refactorMichael Vogt2013-12-091-66/+67
|
* refactor deb822 reading into its own functionMichael Vogt2013-12-091-16/+33
|
* fix section addingMichael Vogt2013-12-051-1/+10
|