summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
* award points for positive dependencies againDavid Kalnischkies2015-01-101-1/+1
| | | | | | | | | | | | | | | | Commit 9ec748ff103840c4c65471ca00d3b72984131ce4 from Feb 23 last year adds a version check after 8daf68e366fa9fa2794ae667f51562663856237c added 8 days earlier negative points for breaks/conflicts with the intended that only dependencies which are satisfied propagate points (aka: old conflicts do not). The implementation was needlessly complex and flawed through preventing positive dependencies from gaining points like they did before these commits making library transitions harder instead of simpler. It worked out anyhow most of the time out of pure 'luck' (and other ways of gaining points) or got miss attributed to being a temporary hick-up. Closes: 774924
* pass-through stdin fd instead of content if not a terminalDavid Kalnischkies2014-12-231-4/+12
| | | | | | | | | | | | | | | | | | Commit 299aea924ccef428219ed6f1a026c122678429e6 fixes the problem of not logging terminal in case stdin & stdout are not a terminal. The problem is that we are then trying to pass-through stdin content by reading from the apt-process stdin and writing it to the stdin of the child (dpkg), which works great for users who can control themselves, but pipes and co are a bit less forgiving causing us to pass everything to the first child process, which if the sending part of the pipe is e.g. 'yes' we will never see the end of it (as the pipe is full at some point and further writing blocks). There is a simple solution for that of course: If stdin isn't a terminal, we us the apt-process stdin as stdin for the child directly (We don't do this if it is a terminal to be able to save the typed input in the log). Closes: 773061
* always run 'dpkg --configure -a' at the end of our dpkg callingsDavid Kalnischkies2014-12-231-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | dpkg checks now for dependencies before running triggers, so that packages can now end up in trigger states (especially those we are not touching at all with our calls) after apt is done running. The solution to this is trivial: Just tell dpkg to configure everything after we have (supposely) configured everything already. In the worst case this means dpkg will have to run a bunch of triggers, usually it will just do nothing though. The code to make this happen was already available, so we just flip a config option here to cause it to be run. This way we can keep pretending that triggers are an implementation detail of dpkg. --triggers-only would supposely work as well, but --configure is more robust in regards to future changes to dpkg and something we will hopefully make use of in future versions anyway (as it was planed at the time this and related options were implemented). Note that dpkg currently has a workaround implemented to allow upgrades to jessie to be clean, so that the test works before and after. Also note that test (compared to the one in the bug) drops the await test as its is considered a loop by dpkg now. Closes: 769609
* do not make PTY slave the controlling terminalDavid Kalnischkies2014-12-231-2/+2
| | | | | | | | | | | | | | | | | | | If we have no controlling terminal opening a terminal will make this terminal our controller, which is a serious problem if this happens to be the pseudo terminal we created to run dpkg in as we will close this terminal at the end hanging ourself up in the process… The offending open is the one we do to have at least one slave fd open all the time, but for good measure, we apply the flag also to the slave fd opening in the child process as we set the controlling terminal explicitely here. This is a regression from 150bdc9ca5d656f9fba94d37c5f4f183b02bd746 with the slight twist that this usecase was silently broken before in that it wasn't logging the output in term.log (as a pseudo terminal wasn't created). Closes: 772641
* fix PTY interaction on linux and kfreebsdDavid Kalnischkies2014-11-281-44/+55
| | | | | | | | | | | | | | | | | | | | | | | | | We run dpkg on its own pty, so we can log its output and have our own output around it (like the progress bar), while also allowing debconf and configfile prompts to happen. In commit 223ae57d468fdcac451209a095047a07a5698212 we changed to constantly reopening the slave for kfreebsd. This has the sideeffect though that in some cases slave and master will lose their connection on linux, so that no output is passed along anymore. We fix this by having always an fd referencing the slave open (linux), but we don't use it (kfreebsd). Failing to get our PTY up and running has many (bad) consequences including (not limited to, nor all at ones or in any case) garbled ouput, no output, no logging, a (partial) mixture of the previous items, … This commit is therefore also reshuffling quiet a bit of the creation code to get especially the output part up and running on linux and the logging for kfreebsd. Note that the testcase tries to cover some cases, but this is an interactivity issue so only interactive usage can really be a good test. Closes: 765687
* close leaking slave fd after setting up pty magicDavid Kalnischkies2014-11-281-2/+4
| | | | | | | The fd moves out of scope here anyway, so we should close it properly instead of leaking it which will tickle down to dpkg maintainer scripts. Closes: 767774
* allow options between command and -- on commandlineDavid Kalnischkies2014-11-101-8/+11
| | | | | | | This used to work before we implemented a stricter commandline parser and e.g. the dd-schroot-cmd command constructs commandlines like this. Reported-By: Helmut Grohne
* deprecate the Section member from package structDavid Kalnischkies2014-11-104-4/+18
| | | | | | | | | | | | | | | A version belongs to a section and has hence a section member of its own. A package on the other hand can have multiple versions from different sections. This was "solved" by using the section which was parsed first as order of sources.list defines, but that is obviously a horribly unpredictable thing. Users are way better of with the Section() as returned by the version they are dealing with. It is likely the same for all versions of a package, but in the few cases it isn't, it is important (like packages moving from main/* to contrib/* or into oldlibs …). Backport of 7a66977 which actually instantly removes the member.
* use 'best' hash for source authenticationDavid Kalnischkies2014-11-104-48/+167
| | | | | | | | | | | | | | | | Collect all hashes we can get from the source record and put them into a HashStringList so that 'apt-get source' can use it instead of using always the MD5sum. We therefore also deprecate the MD5 struct member in favor of the list. While at it, the parsing of the Files is enhanced so that records which miss "Files" (aka MD5 checksums) are still searched for other checksums as they include just as much data, just not with a nice and catchy name. This is a cherry-pick of 1262d35 with some dirty tricks to preserve ABI. LP: 1098738
* add a simple container for HashStringsDavid Kalnischkies2014-11-102-15/+187
| | | | | | | | | | | | | APT supports more than just one HashString and even allows to enforce the usage of a specific hash. This class is intended to help with storage and passing around of the HashStrings. The cherry-pick here the un-const-ification of HashType() compared to f4c3850ea335545e297504941dc8c7a8f1c83358. The point of this commit is adding infrastructure for the next one. All by itself, it just adds new symbols. Git-Dch: Ignore
* Fix incorrect comparison between signed/unsignedMichael Vogt2014-10-231-1/+1
| | | | Git-Dch: ignore
* Use sysconf(_SC_ARG_MAX) to find the size of Dpkg::MaxArgBytesMichael Vogt2014-10-231-2/+21
| | | | | Instead of hardcoding Dpkg::MaxArgBytes find out about it using the sysconf(_SC_ARG_MAX) call.
* don't cleanup cdrom files in apt-get updateDavid Kalnischkies2014-10-151-8/+7
| | | | | | | | | | Regression from merging 801745284905e7962aa77a9f37a6b4e7fcdc19d0 and b0f4b486e6850c5f98520ccf19da71d0ed748ae4. While fine by itself, merged the part fixing the filename is skipped if a cdrom source is encountered, so that our list-cleanup removes what seems to be orphaned files. Closes: 765458
* Update Status field values handlingGuillem Jover2014-10-081-12/+6
| | | | | | | | | | | | | Remove long obsolete (hold, hold-reinstreq, removal-failed) or just wrong (post-inst-failed vs postinst-failed) values, that have been autoconverted by dpkg at run-time to their new equivalents, so there should not be any such instance in any recent system (removal-failed since dpkg 1.1.4 in Apr 1996, hold and hold-reinstreq since dpkg 1.2.0 in May 1996). dpkg even stopped doing the mapping in 1.15.4 and 1.15.8 respectively. At the same time sort the list in the same order as they appear in the dpkg code.
* implement the updated build profile specjosch2014-10-061-45/+67
|
* Merge remote-tracking branch 'donkult/feature/generalize-gzipindex' into ↵Michael Vogt2014-09-262-37/+67
|\ | | | | | | debian/sid
| * generalize Acquire::GzipIndexMichael Vogt2014-09-212-37/+67
| |
* | Ensure that iTFRewritePackageOrder is "MD5sum" to match apt-ftparchiveMichael Vogt2014-09-211-1/+1
| | | | | | | | | | | | | | The iTFRewritePackageOrder is used in indexcopy to copy and normalize cdrom Packages files. This change will ensure that there is no "normalization" that changes MD5sum -> MD5Sum which alters the hash of the Packages file on disk (oh the irony).
* | Fix regression for cdrom: sources from latest security updateMichael Vogt2014-09-211-0/+6
|/ | | | | | | | | | Skip a reverify for cdrom: sources. The reverify step is actually harmful here because the apt-cdrom add code uses the indexcopy.cc which will "normalize" the Packages file from the cdrom when it writes it to the local disk. This leads to changing the "MD5sum" field (notice the lower case "s") on the cdrom Packages file to a "MD5Sum" field on the local file in /var/lib/apt/lists. Which of course alters the hash and makes apt fail to reverify the file.
* improve test for commit daff4aMichael Vogt2014-09-171-2/+3
|
* Fix regression for file:/// uris from CVE-2014-0487Michael Vogt2014-09-171-12/+6
| | | | | | | | Do not run ReverifyAfterIMS() for local file URIs as this will causes apt to mess around in the file:/// uri space. This is wrong in itself, but it will also cause a incorrect verification failure when the archive and the lists directory are on different partitions as rename().
* SECURITY UPDATE for CVE-2014-{0488,0487,0489}Michael Vogt2014-09-163-22/+85
| | | | | | incorrect invalidating of unauthenticated data (CVE-2014-0488) incorect verification of 304 reply (CVE-2014-0487) incorrect verification of Acquire::Gzip indexes (CVE-2014-0489)
* Allow override of Proxy-Auto-Detect by the users configurationMichael Vogt2014-09-121-0/+4
| | | | | | | Only run the Proxy-Auto-Detect code if there is not already a host specific configuration. Closes: 759264
* rework PTY magic to fix stair-stepping on kfreebsdDavid Kalnischkies2014-09-082-53/+107
| | | | | | | | | | | | A pty slave we have got from openpty can only be used for one dpkg child, if we give it to a second child on kfreebsd setting TIOCSCTTY fails causing the output to be stair-stepped from now on. By switching the code to creating a master and opening a new slave in the child for each child we can fix this glitch, so that at least the master remains stable. Closes: 759684
* fix progress report for upgrade and reinstallDavid Kalnischkies2014-09-081-38/+41
| | | | | | | | | | | APT treats upgrades like installs and dpkg is very similar in this, but prints still a slightly different processing message indicating that it is really an upgrade which we hadn't parsed so far, but this wasn't really visible as we quickly moved on to a 'known' state. More problematic was the reinstall case as apt hadn't recognized this for the package name detection, so that reinstalls had no progress since we introduced MultiArch.
* strip everything spacey in APT::String::StripDavid Kalnischkies2014-09-071-6/+18
| | | | Git-Dch: Ignore
* make GetLocalitySortedVersionSet more genericDavid Kalnischkies2014-09-071-0/+1
| | | | | | | | | No reason in and of by itself at the moment, but prepares for the goal of having 'apt search' and 'apt-cache search' using the same code now that they at least support the same stuff. The 'apt' code is just a multitude slower at the moment… Git-Dch: Ignore
* Ensure we have a Policy in CacheFile.BuildDepCache()Michael Vogt2014-09-051-0/+3
| | | | | | This partly reverts d059cc2 and fixes bug #753297 in a more general way by ensuring that CacheFile.BuildDepCache() builds a pkgPolicy if there isn't one already.
* * apt-pkg/deb/dpkgpm.cc:Michael Vogt2014-09-021-6/+7
| | | | | | | - update string matching for dpkg I/O errors. (LP: #1363257) - properly parse the dpkg status line so that package name is properly set and an apport report is created. Thanks to Anders Kaseorg for the patch. (LP: #1353171)
* Make Proxy-Auto-Detect check for each hostMichael Vogt2014-09-022-0/+98
| | | | | | | | | When doing Acquire::http{,s}::Proxy-Auto-Detect, run the auto-detect command for each host instead of only once. This should make using "proxy" from libproxy-tools feasible which can then be used for PAC style or other proxy configurations. Closes: #759264
* initialize iPolicyBrokenCount in DepCache::UpdateWarren He2014-08-291-1/+2
| | | | | | | | All other counters are correctly initialized here, expect this one. The practical effect is low as in apt we usually just do "!= 0" checks, but only correct counters are good counters. Closes: 758397
* support versioned provides as implemented by dpkgDavid Kalnischkies2014-08-261-2/+2
| | | | | | | | | | | | | | | | | APT supported versioned provides for a long while in an attempt to get it working with rpm. While this support is old, we can be relatively sure that it works as versioned provides are used internally to make Multi-Arch:foreign work. Previous versions of apt will print a warning indicating that the versioned provides is ignored, so that something which "Provides: foo (= 2)" doesn't provide anything. Note that dpkg does allow only a equals-relation in the provides line as anything else is deemed too complex. apt doesn't support anything else either and such a support would require potentially big changes. Closes: 758153
* Fix debListParser to accept "no" as a value for the Multi-Arch fieldJulian Andres Klode2014-08-241-1/+1
| | | | | | Seems this was missed somehow. Closes: #759099
* Fix SmartConfigure to ignore ordering of packages that are already validMichael Vogt2014-07-291-1/+48
| | | | | | | | | | With the change of SmartConfigure() in git commit 42d51f the ordering code was trying to re-order dependencies, even when at this point in time this was not needed. Now it will first check all targets of the given dependency and only if there is not a good one try to reorder and unpack/configure as needed. Closes: LP: #1347721
* apt-pkg/acquire-item.cc: make pkgAcqDiffIndex more uniformMichael Vogt2014-07-171-2/+2
|
* StringToBool: only act if the entire string is consumed by strtol()Michael Vogt2014-07-161-3/+6
| | | | | | | | | StringToBool uses strtol() internally to check if the argument is a number. This function stops when it does not find any more numbers. So a string like "0ad" (which is a valid packagename) is interpreted as a "0". The code now checks that the entire string is consumed not just a part of it. Thanks to Johannes Schauer for raising this issue.
* Do not clean "/" in pkgAcquire::Clean/pkgArchiveCleanerMichael Vogt2014-07-082-1/+7
| | | | | | | Having "/" here is most likely a user configuration error and may cause removal of import symlinks like /vmlinuz Closes: #753531
* handle moved mmap after UniqFindTagWrite callDavid Kalnischkies2014-07-071-2/+6
| | | | | | | | | | | | A call to UniqFindTagWrite can trigger the need for a bigger mmap, which is usually done by moving it, but with this move all pointers into it become invalid (and have to be remapped). The compiler calculates the pointer before the execution of the call though, so it tries to store the returned value at the old location, resulting in a segfault. We solve this by use of a temprorary variable as we did in the other instances of this problem before. Closes: #753941
* Try not to parse invalid translation files (LP: #756317)Michael Vogt2014-07-032-34/+19
|
* do not call resolver twice on (dist-)upgradeDavid Kalnischkies2014-06-181-0/+6
|
* fix SubstVar to be usable as a replace_all methodDavid Kalnischkies2014-06-181-7/+14
| | | | | | | The name suggests that it is supposed to substitute a variable with a value, but we tend to use it in a more liberal replace_all() fashion, but this breaks if either of the parameters is empty or more importantly if two "variable" occurrences follow each other directly.
* don't send pkg from an unknown architecture via EDSPDavid Kalnischkies2014-06-181-0/+7
| | | | | | | | APT's cache can include packages from architectures dpkg has no knowledge about and can therefore not be installed for e.g. to allow easy lookups. There is no point in telling external solvers about them though and some of them might even be really talkative about ignoring them if we do.
* use pkgSrcRecords::Step() instead of Next()Michael Vogt2014-06-102-4/+4
|
* Merge remote-tracking branch 'mvo/feature/srcrec-enum2' into debian/sidMichael Vogt2014-06-102-15/+31
|\
| * add pkgSrcRecords::Next() to step through all the pkgSrcRecordsMichael Vogt2014-06-092-15/+31
| |
* | do not revert candidate for protected packagesDavid Kalnischkies2014-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | In commit 21b3eac8 I promoted the check for installable dependencies to a pre-install check, which also reverts to a known good candidate (the installed version) if it fails. This revert was done even for user requested candidate switches which disabled our Broken detection so that install requests which are impossible to satisfy do not fail anymore, but print an (incomplete) solution proposal and then exit successfully. Closes: 745046
* | support parsing EDSP requests Architecture{,s} stanzaDavid Kalnischkies2014-05-301-0/+7
| | | | | | | | | | | | Adds also a small testcase for EDSP Git-Dch: Ignore
* | without a filename we can't stat pipesDavid Kalnischkies2014-05-301-1/+2
| | | | | | | | | | | | | | | | | | EDSP code uses pipes opened via an FD as sources and later for those files modification times and filesize are read - but never really used again. The result we get from FileFd is probably wrong, but as we don't use it anyway, we just don't fallback if we have nothing to fallback to Git-Dch: Ignore
* | check exit status of external solversDavid Kalnischkies2014-05-302-10/+25
| | | | | | | | | | | | Solvers are supposed to exit successfully even if they haven't found a solution, but a solver which fails drastically (like e.g. segfaults) should be detected and dealt with accordingly instead of ignored.
* | Merge EDSP 0.5 w/ multi-arch support for external solversDavid Kalnischkies2014-05-301-3/+30
|\ \ | | | | | | | | | "I am going to merge it tomorrow…"