summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
Commit message (Collapse)AuthorAgeFilesLines
* parse arch-qualified Provides correctlyHelmut Grohne2015-03-161-0/+6
| | | | | | | | | | | The underlying problem is that libapt-pkg does not correctly parse these provides. Internally, it creates a version named "baz:i386" with architecture amd64. Of course, such a package name is invalid and thus this version is completely inaccessible. Thus, this bug should not cause apt to accept a broken situation as valid. Nevertheless, it prevents using architecture qualified depends. Closes: 777071
* fix some new compiler warnings reported by gcc-5David Kalnischkies2015-03-161-3/+6
| | | | Git-Dch: Ignore
* properly implement pkgRecord::Parser for *.deb filesDavid Kalnischkies2015-03-164-108/+130
| | | | | | | | | Implementing FileName() works for most cases for us, but other frontends might need more and even for us its not very stable as the normal Jump() implementation is pretty bad on a deb file and produce errors on its own at times. So, replacing this makeshift with a complete implementation by mostly just shuffling code around.
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-163-10/+45
|\
| * 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
| * use 'best' hash for source authenticationDavid Kalnischkies2014-11-102-44/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | do not make PTY slave the controlling terminalDavid Kalnischkies2014-12-101-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
* | always run 'dpkg --configure -a' at the end of our dpkg callingsDavid Kalnischkies2014-12-071-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). Closes: 769609
* | correct architecture detection for 'rc' packages for purgeDavid Kalnischkies2014-12-071-12/+4
| | | | | | | | | | | | | | | | | | We were already considering these cases, but the code was flawed, so that packages changing architectures are incorrectly handled and hence the wrong architecture is used to call dpkg with, so that dpkg says the package isn't installed (which it isn't for the requested architecture). Closes: 770898
* | fix PTY interaction on linux and kfreebsdDavid Kalnischkies2014-11-191-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-181-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
* | guard ABI changes for SourcePkg/Ver in pkgCacheDavid Kalnischkies2014-11-082-1/+12
| | | | | | | | Git-Dch: Ignore
* | mark internal interfaces as hiddenDavid Kalnischkies2014-11-088-44/+45
| | | | | | | | | | | | | | 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.
* | better non-virtual metaIndex.LocalFileName() implementationDavid Kalnischkies2014-11-082-3/+2
| | | | | | | | | | | | | | | | We can't add a new virtual method without breaking the ABI, but we can freely add new methods, so for older ABIs we just implement this method with a dynamic_cast, so that clients can be more ignorant about the API here and especially don't need to pull a very dirty trick by assuming internal knowledge (like apt-get did here).
* | use a abi version check similar to the gcc checkDavid Kalnischkies2014-11-084-4/+4
| | | | | | | | Git-Dch: Ignore
* | replace ignore-deprecated #pragma dance with _PragmaDavid Kalnischkies2014-11-081-18/+2
| | | | | | | | | | | | | | | | | | For compatibility we use/provide and fill quiet some deprecated methods and fields, which subsequently earns us a warning for using them. These warnings therefore have to be disabled for these codeparts and that is what this change does now in a slightly more elegant way. Git-Dch: Ignore
* | Merge remote-tracking branch 'mvo/feature/no-more-acquire-guessing' into ↵Michael Vogt2014-11-062-14/+0
|\ \ | | | | | | | | | debian/experimental
| * | apt-pkg/deb/debindexfile.{cc,h}: kill GetIndexes()Michael Vogt2014-11-052-14/+0
| | |
| * | Only support Translation-* that are listed in the {In,}Release fileMichael Vogt2014-10-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Handle Translation-* files exactly like Packages files (with the expection that it is ok if a download of them fails). Remove all "guessing" on apts side. This will elimimnate a bunch of errors releated to captive portals and similar. Its also more correct and removes another potential attack vector.
* | | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-11-051-2/+21
|\ \ \ | |/ / |/| / | |/ | | Conflicts: debian/changelog
| * 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.
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-10-141-57/+73
|\|
| * 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
| |
* | fix compile and tests errorDavid Kalnischkies2014-10-131-1/+1
| | | | | | | | | | | | I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore
* | trusted=yes sources are secure, we just don't know whyDavid Kalnischkies2014-10-131-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not require a special flag to be present to update trusted=yes sources as this flag in the sources.list is obviously special enough. Note that this is just disabling the error message, the user will still be warned about all the (possible) failures the repository generated, it is just triggering the acceptance of the warnings on a source-by-source level. Similarily, the trusted=no flag doesn't require the user to pass additional flags to update, if the repository looks fine in the view of apt it will update just fine. The unauthenticated warnings will "just" be presented then the data is used. In case you wonder: Both was the behavior in previous versions, too.
* | do not inline virtual destructors with d-pointersDavid Kalnischkies2014-10-136-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplementing an inline method is opening a can of worms we don't want to open if we ever want to us a d-pointer in those classes, so we do the only thing which can save us from hell: move the destructors into the cc sources and we are good. Technically not an ABI break as the methods inline or not do the same (nothing), so a program compiled against the old version still works with the new version (beside that this version is still in experimental, so nothing really has been build against this library anyway). Git-Dch: Ignore
* | Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-10-076-20/+21
|\ \ | | | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc
| * | rename StringType VERSION to VERSIONNUMBERDavid Kalnischkies2014-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | aptitude has a define for VERSION, so to not generate a FTBFS we just rename our enum element to a slightly less generic name. Git-Dch: Ignore
| * | mark private methods as hiddenDavid Kalnischkies2014-09-305-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are the only possible users of private methods, so we are also the only users who can potentially export them via using them in inline methods. The point is: We don't need these symbols exported if we don't do this, so marking them as hidden removes some methods from the API without breaking anything as nobody could have used them. Git-Dch: Ignore
* | | Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-09-294-56/+110
|\| | | | | | | | | | | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h methods/gpgv.cc
| * | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-291-22/+38
| |\| | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc
| | * generalize Acquire::GzipIndexMichael Vogt2014-09-211-22/+38
| | |
| * | store source name and version in binary cacheDavid Kalnischkies2014-09-272-6/+52
| | | | | | | | | | | | | | | | | | | | | Accessing the package records to acquire this information is pretty costly, so that information wasn't used so far in many places. The most noticeable user by far is EDSP at the moment, but there are ideas to change that which this commit tries to enable.
| * | drop stored StringItems in favor of in-memory mappingsDavid Kalnischkies2014-09-273-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strings like Section names or architectures are needed vary often. Instead of writing them each time we need them, we deploy sharing for these special strings. Until now, this was done with a linked list of strings in which we would search, which was stored in the cache. It turns out we can do this just as well in memory as well with a bunch of std::map's. In memory means here that it isn't available anymore if we have a partly invalid cache, but that isn't much of a problem in practice as the status file is compared to the other files we parse very small and includes mostly duplicates, so the space we would gain by storing is more or less equal to the size of the stored linked list…
* | | Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-09-232-91/+148
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h methods/copy.cc test/integration/test-hashsum-verification
| * | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-232-91/+148
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/cachefilter.h configure.ac debian/changelog
| | * 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.
* | | use pkgAcqMetaBase as the transactionManagerMichael Vogt2014-09-171-3/+2
| | |
* | | Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-09-052-9/+10
|\| | | | | | | | | | | feature/acq-trans
| * | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-052-8/+9
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
| | * * 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)
| | * 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