summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
* 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…"
| * | EDSP: add APT-Release field to Package stanzasStefano Zacchiroli2014-05-041-2/+14
| | |
| * | EDSP: add Source field to Package stanzasStefano Zacchiroli2014-05-041-0/+6
| | |
| * | EDSP: add Architecture(s) multi-arch fields to the Request stanzaStefano Zacchiroli2014-05-041-0/+9
| | |
| * | EDSP: bump protocol version to 0.5Stefano Zacchiroli2014-05-041-1/+1
| | |
* | | Merge remote-tracking branch 'mvo/debian/sid' into debian/sidMichael Vogt2014-05-294-4/+7
|\ \ \ | | |/ | |/|
| * | Fix warning about uninitialized variableMichael Vogt2014-05-281-1/+2
| | | | | | | | | | | | Reported-By: clang++ -Werror
| * | use free() instead of delete[] in debSrcRecordParser::~debSrcRecordParserMichael Vogt2014-05-271-1/+2
| | | | | | | | | | | | | | | The Buffer was allocated using strndup() so we need to free it using free() instead of delete[]
| * | Do not try to cast a pkgDepCache::Policy to a pkgCacheMichael Vogt2014-05-271-1/+1
| | | | | | | | | | | | | | | | | | Fix incorrect cast in pkgDepCache::Policy::GetCandidateVer() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
| * | use free() instead of delete() when realloc is usedMichael Vogt2014-05-271-1/+2
| | | | | | | | | | | | | | | | | | | | | ContentsExtract::~ContentsExtract() needs to use free() because Data got allocated via realloc() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
* | | fix tight loop detection and temporary removesDavid Kalnischkies2014-05-222-173/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As outlined in #748355 apt segfaulted if it encountered a loop between a package pre-depending on a package conflicting with the previous as it ended up in an endless loop trying to unpack 'the other package'. In this specific case as an essential package is involved a lot of force needs to be applied, but can also be caused by 'normal' tight loops and highlights a problem in how we handle breaks which we want to avoid. The fix comes in multiple entangled changes: 1. All Smart* calls are guarded with loop detection. Some already had it, some had parts of it, some did it incorrect, and some didn't even try. 2. temporary removes to avoid a loop (which is done if a loop is detected) prevent the unpack of this looping package (we tried to unpack it to avoid the conflict/breaks, but due to a loop we couldn't, so we remove/deconfigure it instead which means we can't unpack it now) 3. handle conflicts and breaks very similar instead of duplicating most of the code. The only remaining difference is, as it should: deconfigure is enough for breaks, for conflicts we need the big hammer
* | | consistently fail if Smart* packagemanager actions failDavid Kalnischkies2014-05-222-51/+44
| | | | | | | | | | | | | | | | | | | | | | | | These failure conditions come with an error message attached and the conditions aren't workaroundable (otherwise this would have been done instead of returning failure), so not erroring out here means that we execute dpkg later on with a known not-working ordering adding insult (our own error messages at the end) to injury (dpkg failure).
* | | mark as Automatic/Downloadable pure as gcc suggestsDavid Kalnischkies2014-05-221-2/+2
|/ / | | | | | | | | Git-Dch: Ignore Reported-By: gcc
* | Never parse Version/Architecture tags in a Translation-$lang fileMichael Vogt2014-05-152-1/+12
| | | | | | | | | | | | | | | | | | | | Version/Architecture information in a Translation-$lang file is not allowed, so don't try to parse it. This is a fix for a bugreport where a Translation-en file contained the content of the regular Packages file (probably due to local FS corruption). This lead to strange error messages on file download. Thanks to Thomas Reusch for the report.
* | Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into ↵Michael Vogt2014-05-072-1/+3
|\ \ | | | | | | | | | debian/sid
| * | Implement CacheDB for source packages in apt-ftparchiveMichael Vogt2014-04-042-1/+3
| | |
* | | Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt2014-05-071-0/+2
|\ \ \ | |_|/ |/| |
| * | initialize Verify in second pkgAcqIndex constructorDavid Kalnischkies2014-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc reports in testcase ./test-bug-596498-trusted-unsigned-repo: apt-pkg/acquire-item.cc:1059:7: runtime error: load of value 234, which is not a valid value for type 'bool' This happens as the bool Verify is initialized only in one of the two constructors of the pkgAcqIndex class. It isn't a problem through as the verification controlled by this flag is optional and used to fail early on garbage files (like network portal pages) instead of later on in the hashsum verification or while parsing (the then untrusted) file. Reported-By: gcc-4.9 -fsanitize=undefined
* | | Only do openpty() if both stdin/stdout are terminalsMichael Vogt2014-04-301-5/+6
|/ / | | | | | | Closes: 746434
* | fix FileFd::Size bitswap on big-endian architecturesAdam Conrad2014-04-261-13/+4
| | | | | | | | | | | | | | | | | | gzip only gives us 32bit of size, storing it in a 64bit container and doing a 32bit flip on it has therefore unintended results. So we just go with a exact size container and let the flipping be handled by eglibc provided le32toh removing our #ifdef machinery. Closes: 745866
* | handle pkgnames shorter than modifiersDavid Kalnischkies2014-04-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | The bugreport highlights the problem with an empty package name. We fix this by 'ignoring' these so that it behaves just like "apt-get install". The deeper problem is that modifier strings can be longer than a package name in which case the comparison doesn't make sense, so don't compare then. Was not noticed so far as all modifiers are of length 1, so the only package name shorter than this is in fact the empty package name. Closes: 744940
* | properly undo CD-ROM mount in all error casesJohn Ogness2014-04-262-25/+42
| | | | | | | | | | | | | | | | In bug #740673 various issues in the CD-ROM handling code were identified, while most the issues ended up being fixed in another way, the unmounting of the CD-ROM in error cases was not tackled so far. (The patch was modified by the commiter to apply)
* | reduce delta from ubuntuMichael Vogt2014-04-252-1/+2
| |
* | clear HitEof flag in FileFd::SeekDavid Kalnischkies2014-04-161-1/+6
| | | | | | | | | | | | | | | | | | fseek and co do this to their eof-flags and it is more logic this way as we will usually seek away from the end (e.g. to re-read the file). The commit also improves the testcase further and adds a test for the binary compressor codepath (as gz, bzip2 and xz are handled by libraries) via the use of 'rev' as a 'compressor'.
* | force fancy progressbar redraw on window size changeDavid Kalnischkies2014-04-142-12/+26
| | | | | | | | | | | | | | | | | | | | | | We always reacted on the size change, but the bar is only redraw if the precentage changes, which can take quiet a while in big upgrades, so with a bit of refactoring we can now call for a redraw immediate to fix this. This refactor also helps in avoiding obscure pitfalls clangs static analyser was complaining about (namely failure of ioctl resulting in garbage values in the struct).
* | consider priorities only for downloadable pkgs in resolverDavid Kalnischkies2014-04-111-8/+11
| | | | | | | | | | | | | | | | | | | | A package which can't be downloaded anymore is very likely dropped from a release and can therefore no longer be 'standard' (or similar). We therefore do not grant points for them anymore and demote them to prio:extra instead which helps other packages breaking them away even if they have a lower priority. The testcase was initially created by Michael Vogt and just amended.
* | deal with umask only if we really need to for mkstempDavid Kalnischkies2014-04-111-9/+9
| | | | | | | | | | | | | | | | | | As the comment actually says: open() does the umask dance by itself, so we don't need to do it for it. We have to do it after mkstemp in Atomic though, so move it into the if. Also removes the "micro-optimisation" "FilePermissions == 600" as it doesn't trigger at the moment anyway as 600 != 0600.
* | don't double-count seeks in FileFd::Skip for bzip/xzDavid Kalnischkies2014-04-111-1/+0
| | | | | | | | | | FileFd::Read already deals with the increase of the skipposition so that we as the caller in FileFd::Skip really shouldn't increase it, too.
* | do not create an (additional) empty compressorDavid Kalnischkies2014-04-111-1/+1
| | | | | | | | | | | | | | | | FileFd code knows how to deal with such a compressor, so it isn't a problem, but it is absolutely not needed as we already have an (matching) identity compressor with '.' earlier in the list. Git-Dch: Ignore
* | use wildcard to get files in our library makefilesDavid Kalnischkies2014-04-111-45/+3
| | | | | | | | | | | | | | | | The explicit listing is a pain every time you want to add a file to the list and serves no propose as we list all files there anyway, so this is not only easier but also documents this fact. Git-Dch: Ignore
* | improve umask/fchmod code readabilityMichael Vogt2014-04-101-5/+8
| |
* | Rename FileFd::Open() Perms to AccessModeMichael Vogt2014-04-102-14/+14
| | | | | | | | | | | | | | Bug lp:#1304657 was caused by confusion around the name Perms. The new name AccessMode should make it clear that its not the literal file permissions but instead the AccessMode passed to open() (i.e. the umask needs to be applied)
* | Fix insecure file permissions when using FileFd with OpenMode::AtomicMichael Vogt2014-04-101-2/+6
| | | | | | | | | | | | | | | | | | | | Commit 7335eebea6dd43581d4650a8818b06383ab89901 introduced a bug that caused FileFd to create insecure permissions when FileFd::Atomic is used. This commit fixes the permissions and adds a test. The bug is most likely caused by the confusing "Perm" parameter that is passed to Open() - its not the file permissions but intead the "mode" part of open/creat.
* | Merge remote-tracking branch 'mvo/feature/more-fancy-progress' into debian/sidMichael Vogt2014-04-012-14/+68
|\ \
| * | Merge branch 'debian/sid' into feature/more-fancy-progressMichael Vogt2014-03-2712-65/+124
| |\|
| * | Add progressbar to "Dpkg::Progress-Fancy"Michael Vogt2014-03-272-12/+62
| | | | | | | | | | | | | | | | | | A text progressbar is now displayed in the Dpkg::Progress-Fancy mode. It can be turned off via the apt option Dpkg::Progress-Fancy::Progress-Bar=false
| * | make fancy-progress fg/bg color configurableMichael Vogt2014-03-271-2/+6
| | | | | | | | | | | | | | | Add two new options: Dpkg::Progress-Fancy::Progress-{fg,bg} that allows customizing the colors in the dpkg fancy progress output.
* | | do not crash on SIGPIPE in pkgDPkgPM::RunScriptsWithPkgs()Michael Vogt2014-04-011-7/+18
| | | | | | | | | | | | | | | If a external command closes the PIPE unexpectedly, do not crash in pkgDPkgPM::RunScriptsWithPkgs but ignore the SIGPIPE.
* | | Add new Debug::RunScripts optionMichael Vogt2014-04-012-1/+9
| |/ |/| | | | | | | This debug option will display all scripts that are run by apts RunScripts and RunScriptsWithPkgs helpers.
* | discard candidates via IsInstallOk to allow overrideDavid Kalnischkies2014-03-232-20/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 446551c8 I changed MarkInstall to discard the candidate if the candidate can't satisfy the dependency. This breaks interactive solvers like aptitude which can change the candidate on-the-fly later. In commit df77d8a5 I introduced this 'early' loop-breaking to begin with which can't be that helpful for interactive solvers as well, but makes perfect sense for non-interactives to stop them from exploring trees which can't be satisfied, but it isn't perfect as ideally we would check this before auto-installing the first dependency. This commit therefore moves the loop into its own IsInstallOk hook so that frontends can override this check if they want to and in exchange removes the loop-breaking from MarkInstall itself and does it before any dependency is installed. Closes: 740750
* | do IsInstallOk call in MarkInstall unconditionallyDavid Kalnischkies2014-03-231-4/+8
| | | | | | | | | | | | | | | | Hooked checks could be influenced by AutoInst as a lot can happen between a call without and one with this bit set. The real cache-hit check is above this call already. Individual hooked checks can then inspect the state if they want to cache. Calling them multiple times shouldn't be a problem either way.
* | ensure proper teardown in dpkg error casesDavid Kalnischkies2014-03-221-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | We have to properly close our pseudo terminals even in error cases before we call post-invoke scripts. This is done now by breaking from the dpkg calling loop instead of copying the handling, which did it in the wrong order before. This also ensures that our state file is written in error cases to record autobit and co as this was forgotten before. Closes: 738969
* | mark optional (private) symbols as hiddenDavid Kalnischkies2014-03-217-23/+31
| | | | | | | | | | | | | | | | This methods should not be used by anyone expect the library itself as they are helpers for the specific class and therefore perfect candidates for hidding. Git-Dch: Ignore