summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* TransactionManager can never be a nullptrDavid Kalnischkies2016-05-072-27/+20
| | | | | | | | The code naturally evolved from a TransactionManager optional to a required setup which resulted in various places doing unneeded checks suggesting a more complicated setup than is actually needed. Git-Dch: Ignore
* fix same-mirror redirection for Release{,.gpg} pairDavid Kalnischkies2016-05-072-2/+23
| | | | | | | | | | | Commit 9b8034a9fd40b4d05075fda719e61f6eb4c45678 just deals with InRelease properly and generates broken URIs in case the mirror (or the achieve really) has no InRelease file. [As this was in no released version no need to clutter changelog with a fix notice.] Git-Dch: Ignore
* tests: disable generation of Release.gpg by defaultDavid Kalnischkies2016-05-049-40/+27
| | | | | | | | | | | Most tests just need a signed repository and don't care if it signed by an InRelease file or a Release.gpg file, so we can save some time by just generating one of them by default. Sounds like not much, but quickly adds up to a few seconds with the amount of tests we have accumulated by now. Git-Dch: Ignore
* tests: allow to disable generation of InRelease/Release.gpg fileDavid Kalnischkies2016-05-046-45/+33
| | | | | | | If the test just signs release files to throw away one of them to test the other, we can just as well save the time and not create it. Git-Dch: Ignore
* test: fix permission issue if run as rootDavid Kalnischkies2016-05-041-0/+1
| | | | | | | Always those silly mistakes. Do what I mean, not what I said… Reported-By: Travis Git-Dch: Ignore
* allow redirection for items without a space in the desc againDavid Kalnischkies2016-05-032-8/+14
| | | | | | | | | | Broken in a4b8112b19763cbd2c12b81d55bc7d43a591d610. If an item has a description which includes no space and is redirected to another mirror the code which wants to rewrite the description expects a space in there, but can't find it and the unguarded substr command on the string will fail with an exception thrown… Guarding it properly and everything is fine.
* let DPKG_COLORS default to our APT::Color settingDavid Kalnischkies2016-05-031-0/+7
| | | | | | | | | | dpkg can optionally colorize its output since 1.18.5. Currently this defaults to 'never', but it will eventually be 'auto'. It seems reasonable to assume that a user who has enabled/disabled colors in apt will want to have dpkg have the same state regarding color usage. This isn't overriding explicit settings by the user, so in case a user feels strongly about it one way or the other there are options.
* remove 100-levels config nesting limitDavid Kalnischkies2016-05-031-38/+36
| | | | | | | | | | | | The actual reason for this commit isn't the limit – there isn't much point in using that much nesting – its in shutting up gcc mostly: apt/apt-pkg/contrib/configuration.cc: In function ‘bool ReadConfigFile(Configuration&, const string&, const bool&, const unsigned int&)’: apt/apt-pkg/contrib/configuration.cc:686:20: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] string Stack[100]; ^ by replacing this with C++s handy std::stack container (adapter). Also cleans some whitespace noise from the file in the process.
* apt-key: add \n to dpkg-query --show --showformatCarsten Hey2016-05-011-1/+1
| | | | | | | | | | Guarding against 'broken' greps not dealing with non-text inputs "just in case" by making the input text with a proper newline. [commit message by David Kalnischkies] Reported-On: IRC Git-Dch: Ignore
* warn if apt-key is run unconditionally in maintainerscriptDavid Kalnischkies2016-05-012-1/+48
| | | | | | | | We want to stop hard-depending on gnupg and for this it is essential that apt-key isn't used in any critical execution path, which maintainerscript are. Especially as it is likely that these script call apt-key either only for (potentially now outdated cleanup) or still not use the much simpler trusted.gpg.d infrastructure.
* move gnupg|gnupg2 from apt Depends to RecommendsDavid Kalnischkies2016-05-011-1/+2
| | | | | | | | | | | | apt doesn't need gnupg in its main execution paths to function, especially the Release file verification is done with gpgv only. It is only used by apt-key for advanced key management functionality most user will never use nor need. The intend is to demote it eventually to Suggests, but we opt here for a staged downgrade as there are still third-party repositories out there which require apt-key functionality without depending on gnupg (or apt for that matter).
* ftparchive: Support writing Signed-By fieldsJulian Andres Klode2016-05-011-0/+1
|
* bugscript: include all configuration fragment filesDavid Kalnischkies2016-05-011-1/+1
| | | | Closes: 820861
* support Signed-By in Release files as a sort of HPKPDavid Kalnischkies2016-05-0146-292/+177
| | | | | | | | | | | | Users have the option since apt >= 1.1 to enforce that a Release file is signed with specific key(s) either via keyring filename or fingerprints. This commit adds an entry with the same name and value (except that it doesn't accept filenames for obvious reasons) to the Release file so that the repository owner can set a default value for this setting effecting the *next* Release file, not the current one, which provides a functionality similar "HTTP Public Key Pinning". The pinning is in effect as long as the (then old) Release file is considered valid, but it is also ignored if the Release file has no Valid-Until at all.
* support multiple fingerprints in signed-byDavid Kalnischkies2016-05-014-32/+71
| | | | | A keyring file can include multiple keys, so its only fair for transitions and such to support multiple fingerprints as well.
* gpgv: cleanup statusfd parsing a bitDavid Kalnischkies2016-05-012-58/+46
| | | | | | | | | | | We parse the messages we receive into two big categories: Most of the messages have a keyid as well as a userid and as they are errors we want to show the userids as well. The other category is also errors, but have no userid (like NO_PUBKEY). Explicitly expressing this in code should make it a bit easier to look at and it also help in dropping additional fields or just the newline at the end consistently. Git-Dch: Ignore
* don't show NO_PUBKEY warning if repo is signed by another keyDavid Kalnischkies2016-05-016-49/+134
| | | | | | | | | | | | | | | Daniel Kahn Gillmor highlights in the bugreport that security isn't improving by having the user import additional keys – especially as importing keys securely is hard. The bugreport was initially about dropping the warning to a notice, but in given the previously mentioned observation and the fact that we weren't printing a warning (or a notice) for expired or revoked keys providing a signature we drop it completely as the code to display a message if this was the only key is in another path – and is considered critical. Closes: 618445
* gpgv: handle expired sig as worthlessDavid Kalnischkies2016-05-013-2/+34
| | | | | | | Signatures on data can have an expiration date, too, which we hadn't handled previously explicitly (no problem – gpg still has a non-zero exit code so apt notices the invalid signature) so the error message wasn't as helpful as it could be (aka mentioning the key signing it).
* gpgv: use EXPKEYSIG instead of KEYEXPIREDDavid Kalnischkies2016-05-012-5/+5
| | | | | | The upstream documentation says about KEYEXPIRED: "This status line is not very useful". Indeed, it doesn't mention which key is expired, and suggests to use the other message which does.
* show StateCache flags in Pkg debug prettyprintDavid Kalnischkies2016-05-015-35/+102
| | | | | | | | | | | This basically introduces ~33 flags in the output, but a package can have only ~11 of them displayed at the same time. There is quiet a bit of duplication also (an uninstalled package is by definition a newinstall if its getting installed), but as this is debug output we are better of showing them all in case one of them isn't set in a way it is supposed to be set. Git-Dch: Ignore
* zh_TW.po: remove several fuzzy tags after reviewZhou Mo2016-04-301-8/+6
|
* deb822: Restore support for <multivalue>-{Add,Remove}James McCoy2016-04-282-2/+12
| | | | | | Redesign of multivalue options in 463c8d801595ce5ac94d7c032264820be7434232 caused the parser to look for <multivalue>{Add,Remove} (no hyphen) instead of the expected <multivalue>-{Add,Remove}.
* factor out Pkg/DepIterator prettyprinters into own headerDavid Kalnischkies2016-04-289-40/+141
| | | | | | | | | The old prettyprinters have only access to the struct they pretty print, which isn't enough usually as we want to know for a package also a bit of state information like which version is the candidate. We therefore need to pull the DepCache into context and hence use a temporary struct which is printed instead of the iterator itself.
* deprecate confusing Pkg.CandVersion() methodDavid Kalnischkies2016-04-282-2/+2
| | | | | | | This method does not return the 'current' candidate of the DepCache which would be most expected, but instead returns the version which would be candidate in a default-only policy setting – aka ignoring apt_preferences settings and co.
* respect user pinning in M-A:same version (un)screwingDavid Kalnischkies2016-04-282-2/+34
| | | | | | | | | | | | Using Pkg.CandVersion() here is wrong as its implementation will return a candidate based just on the default policy settings ignoring user preferences and otherwise set candidates (aka: it sidesteps the pkgDepCache). This causes M-A:same libraries to be detected as screwed even through they aren't, so that they end up being kept back. Reported-By: Felipe Sateler on IRC
* FileFd: avoid further writing if file failedDavid Kalnischkies2016-04-281-9/+13
| | | | | | | | If the file is in a failed state there is no point in trying to flush out the buffers as the file is to be discarded anyhow & its likely all this flushing is producing is additional error messages. Git-Dch: Ignore
* Merge branch 'fix-https-noproxy' of github.com:patcable/aptJulian Andres Klode2016-04-271-6/+6
|\
| * refactored no_proxy code to work regardless of where https proxy is setPatrick Cable2016-04-271-6/+6
|/ | | | | | | | when using the https transport mechanism, $no_proxy is ignored if apt is getting it's proxy information from $https_proxy (as opposed to Acquire::https::Proxy somewhere in apt config). if the source of proxy information is Acquire::https::Proxy set in apt.conf (or apt.conf.d), then $no_proxy is honored.
* private-show: Get rid of old policy support codeJulian Andres Klode2016-04-251-35/+2
| | | | | This does not make much sense anymore, now that we dropped the old candidate ver algorithm.
* policy: Remove TODO for replacing old GetCandidateVer()Julian Andres Klode2016-04-251-1/+0
| | | | Gbp-Dch: ignore
* policy: Get rid of old (pre-1.1) GetCandidateVer algorithmJulian Andres Klode2016-04-252-98/+0
| | | | | Bye bye old friend. You're in one Ubuntu LTS release for compat testing, now we do not need you anymore.
* restore pinning to min/max value of shortDavid Kalnischkies2016-04-252-3/+23
| | | | | | | | Broken in the previous commit (69cea1ef2cfda3c4da79fd756a8edaf2be26998e). Adding a test and a comment to avoid future embarrassment. Git-Dch: Ignore Reported-By: Julian Andres Klode on IRC
* give rc-status packages a pin of -1David Kalnischkies2016-04-251-7/+6
| | | | | | | | | | | | It would previously return a pin of 0, which is an invalid value, but the intend is that versions which are only in the dpkg/status file can't be selected for installation (= can't be a candidate) which is what a negative pin assures. This helps with the communication to EDSP solvers as they neither know about the rc-state (yet) nor that they shouldn't choose this version. Ideally they shouldn't be told about such versions at all as there is nothing to be solved here, but we will get there eventually.
* edsp: ask policy engine for the pin of the version directlyDavid Kalnischkies2016-04-251-5/+1
|
* use the same redirection mirror for all index filesDavid Kalnischkies2016-04-253-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Redirection services like httpredir.debian.org tend to use a set of mirrors from which they pick a mirror at "random" for each requested file, which is usually benefitial for the download of debs, but for the index files this can quickly cause problems (aka hashsum mismatches) if the two (or more) mirrors involved are only slightly out-of-sync. This commit "resolves" this issue by using the mirror we ended up using to get the (signed) Release file directly to get the index files belonging to this Release file instead of asking the redirection service which eliminates the risk of hitting out-of-sync mirrors. As an obvious downside the redirection service can't serve partial mirrors anymore for indexes and the download of indexes indexed in the same Release file can't be done in parallel (from different mirrors). This does not effect the download of non-index files like deb-files as out-of-sync mirrors aren't a huge problem there, so the parallel download outweights a potentially 404 error (also because this causes no errenous downloads while hashsum mismatches download the entire file before finding out that it was pointless). The rational for this is that indexes are relative to the Release file. If we would be talking about a HTML page including images, such a behaviour is obvious and intended – not doing it means in the best case a bunch of "useless" requests which will all be answered with a redirect.
* show more details for "Writing more data" errors, tooDavid Kalnischkies2016-04-254-30/+68
| | | | | | They are the small brothers of the hashsum mismatch, so they deserve a similar treatment even through we have for architectual reasons not a much to display as for hashsum mismatches for now.
* show more details for "Hash Sum mismatch" errorsDavid Kalnischkies2016-04-258-28/+259
| | | | | | | | | | | | | | | | Users tend to report these errors with just this error message… not very actionable and hard to figure out if this is a temporary or 'permanent' mirror-sync issue or even the occasional apt bug. Showing the involved hashsums and modification times should help in triaging these kind of bugs – and eventually we will have less of them via by-hash. The subheaders aren't marked for translation for now as they are technical glibberish and probably easier to deal with if not translated. After all, our iconic "Hash Sum mismatch" is translated at least. These additions were proposed in #817240 by Peter Palfrader.
* format multiline errors properly in acquire progressDavid Kalnischkies2016-04-251-5/+21
| | | | | | | | | | | Together with the GlobalError change this allows us to add errors spanning multiple lines, just that we control GlobalError while the acquire progress is dealt with potentially by individual clients which might or might not need to be adapted. This isn't critical through as it either just works as expected anyhow or is a minor styling thing (after all, all this commit does it add two spaces to indent the lines a bit…).
* drop empty line from fetch errorDavid Kalnischkies2016-04-2549-368/+152
| | | | | | | | This is a duplicate of sorts of 0efb29eb36184bbe6de7b1013d1898796d94b171 which is the a lot more frequent case of this error – and also a duplicate of this error message, just without the \n at the end. Git-Dch: Ignore
* properly format multiline error messagesDavid Kalnischkies2016-04-252-6/+55
|
* sanify unused ReportMirrorFailure a tiny bitDavid Kalnischkies2016-04-252-63/+69
| | | | | | | | | | Calling the (non-existent) reporter multiple times for the same error with different codes for the same error (e.g. hashsum) is a bit strange. It also doesn't need to be a public API. Ideally that would all look and behave slightly different, but we will worry about that at the time this is actually (planed to be) used somewhere… Git-Dch: Ignore
* don't ask server if we have entire file in partial/David Kalnischkies2016-04-254-31/+81
| | | | | | | | | | | | We have this situation in cases were parts of the transaction are refused (e.g. in a hashsum mismatch) and rerun the update (e.g. in the hope that we get a mirror which is synced this time). Previously we would ask the server with an if-range and in the best case recieve a 416 in response (less featureful server might end up giving us the entire file again or we get the wrong file this time giving us a hashsum mismatch…), which is a waste of time if we know already by checking the hashsums that we got the complete and correct file.
* add dep11 files to default Release patternsDavid Kalnischkies2016-04-251-0/+4
|
* make random acquire queues work less randomDavid Kalnischkies2016-04-252-10/+26
| | | | | | | | | | | | | | Queues feeding workers like rred are created in a random pattern to get a few of them to run in parallel – but if we already have an idling queue we don't need to assign it to a (potentially new) random queue as that saves us the (agruably small) overhead of starting up a new queue, avoids adding jobs to an already busy queue while others idle and as a bonus reduces the size of debug logs a bit. We also keep starting new queues now until we reach our limit before we assign work at random to them, which should give us a more effective utilisation overall compared to potentially adding work to busy queues while we haven't reached our queue limit yet.
* Release 1.2.111.2.11Julian Andres Klode2016-04-2557-77/+99
|
* ensure outdated files are dropped without lists-cleanupDavid Kalnischkies2016-04-142-3/+69
| | | | | Tested via (newly) empty index files, but effects also files dropped from the repository or an otherwise changed repository config.
* silently skip acquire of empty index filesDavid Kalnischkies2016-04-148-47/+41
| | | | | There is just no point in taking the time to acquire empty files – especially as it will be tiny non-empty compressed files usually.
* allow uncompressed files to be empty in store againDavid Kalnischkies2016-04-142-1/+26
| | | | | | | With the previous fix for file applied we can again hit repositories which contain uncompressed empty files, which since the introduction of the central store: method wasn't accounted for anymore as we forbid empty compressed files.
* fix Alt-Filename handling of file methodDavid Kalnischkies2016-04-143-7/+8
| | | | | | | | | | A silly of-by-one error in the stripping of the extension to check for the uncompressed filename broken in an attempt to support all compressions in commit a09f6eb8fc67cd2d836019f448f18580396185e5. Fixing this highlights also mistakes in the handling of the Alt-Filename in libapt which would cause apt to remove the file from the repository (if root has the needed rights – aka the disk isn't readonly or similar)
* recheck Pre-Depends satisfaction in SmartConfigureDavid Kalnischkies2016-04-131-2/+2
| | | | | | | | | | | | | | | | | Regression introduced in commit 590f1923121815b36ef889033c1c416a23cbe9a2 (2011!) causing apt to not check if Pre-Depends are satisfied before calling --configure. This managed to hide so perfectly well for years as Pre-Depends aren't that common, apt prefers upgrading these packages first and checks for satisfaction is already in SmartUnpack, so there is only a small window of oppertunity to break a pre-dependency relation (usually with an unpack). Verified by logchecking with two provided status files in the buglog. I would have liked to write a test, but I wasn't able to reach the needed complexity to get apt to fail – but the change is small and reasonable, so what could possible go wrong™, right? LP: #1569099