summaryrefslogtreecommitdiff
path: root/apt-pkg
AgeCommit message (Collapse)Author
2014-06-18do not call resolver twice on (dist-)upgradeDavid Kalnischkies
2014-06-18fix SubstVar to be usable as a replace_all methodDavid Kalnischkies
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.
2014-06-18don't send pkg from an unknown architecture via EDSPDavid Kalnischkies
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.
2014-06-10use pkgSrcRecords::Step() instead of Next()Michael Vogt
2014-06-10Merge remote-tracking branch 'mvo/feature/srcrec-enum2' into debian/sidMichael Vogt
2014-06-09add pkgSrcRecords::Next() to step through all the pkgSrcRecordsMichael Vogt
2014-06-07do not revert candidate for protected packagesDavid Kalnischkies
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
2014-05-30support parsing EDSP requests Architecture{,s} stanzaDavid Kalnischkies
Adds also a small testcase for EDSP Git-Dch: Ignore
2014-05-30without a filename we can't stat pipesDavid Kalnischkies
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
2014-05-30check exit status of external solversDavid Kalnischkies
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.
2014-05-30Merge EDSP 0.5 w/ multi-arch support for external solversDavid Kalnischkies
"I am going to merge it tomorrow…"
2014-05-29Merge remote-tracking branch 'mvo/debian/sid' into debian/sidMichael Vogt
2014-05-28Fix warning about uninitialized variableMichael Vogt
Reported-By: clang++ -Werror
2014-05-27use free() instead of delete[] in debSrcRecordParser::~debSrcRecordParserMichael Vogt
The Buffer was allocated using strndup() so we need to free it using free() instead of delete[]
2014-05-27Do not try to cast a pkgDepCache::Policy to a pkgCacheMichael Vogt
Fix incorrect cast in pkgDepCache::Policy::GetCandidateVer() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
2014-05-27use free() instead of delete() when realloc is usedMichael Vogt
ContentsExtract::~ContentsExtract() needs to use free() because Data got allocated via realloc() Reported-By: clang -fsanitize=address -fno-omit-frame-pointer
2014-05-22fix tight loop detection and temporary removesDavid Kalnischkies
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
2014-05-22consistently fail if Smart* packagemanager actions failDavid Kalnischkies
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).
2014-05-22mark as Automatic/Downloadable pure as gcc suggestsDavid Kalnischkies
Git-Dch: Ignore Reported-By: gcc
2014-05-15Never parse Version/Architecture tags in a Translation-$lang fileMichael Vogt
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.
2014-05-07Merge remote-tracking branch 'mvo/feature/apt-ftparchive-srccache2' into ↵Michael Vogt
debian/sid
2014-05-07Merge remote-tracking branch 'donkult/debian/sid' into debian/sidMichael Vogt
2014-05-04EDSP: add APT-Release field to Package stanzasStefano Zacchiroli
2014-05-04EDSP: add Source field to Package stanzasStefano Zacchiroli
2014-05-04EDSP: add Architecture(s) multi-arch fields to the Request stanzaStefano Zacchiroli
2014-05-04EDSP: bump protocol version to 0.5Stefano Zacchiroli
2014-04-30Only do openpty() if both stdin/stdout are terminalsMichael Vogt
Closes: 746434
2014-04-28initialize Verify in second pkgAcqIndex constructorDavid Kalnischkies
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
2014-04-26fix FileFd::Size bitswap on big-endian architecturesAdam Conrad
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
2014-04-26handle pkgnames shorter than modifiersDavid Kalnischkies
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
2014-04-26properly undo CD-ROM mount in all error casesJohn Ogness
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)
2014-04-25reduce delta from ubuntuMichael Vogt
2014-04-16clear HitEof flag in FileFd::SeekDavid Kalnischkies
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'.
2014-04-14force fancy progressbar redraw on window size changeDavid Kalnischkies
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).
2014-04-11consider priorities only for downloadable pkgs in resolverDavid Kalnischkies
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.
2014-04-11deal with umask only if we really need to for mkstempDavid Kalnischkies
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.
2014-04-11don't double-count seeks in FileFd::Skip for bzip/xzDavid Kalnischkies
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.
2014-04-11do not create an (additional) empty compressorDavid Kalnischkies
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
2014-04-11use wildcard to get files in our library makefilesDavid Kalnischkies
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
2014-04-10improve umask/fchmod code readabilityMichael Vogt
2014-04-10Rename FileFd::Open() Perms to AccessModeMichael Vogt
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)
2014-04-10Fix insecure file permissions when using FileFd with OpenMode::AtomicMichael Vogt
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.
2014-04-04Implement CacheDB for source packages in apt-ftparchiveMichael Vogt
2014-04-01Merge remote-tracking branch 'mvo/feature/more-fancy-progress' into debian/sidMichael Vogt
2014-04-01do not crash on SIGPIPE in pkgDPkgPM::RunScriptsWithPkgs()Michael Vogt
If a external command closes the PIPE unexpectedly, do not crash in pkgDPkgPM::RunScriptsWithPkgs but ignore the SIGPIPE.
2014-04-01Add new Debug::RunScripts optionMichael Vogt
This debug option will display all scripts that are run by apts RunScripts and RunScriptsWithPkgs helpers.
2014-03-27Merge branch 'debian/sid' into feature/more-fancy-progressMichael Vogt
2014-03-27Add progressbar to "Dpkg::Progress-Fancy"Michael Vogt
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
2014-03-27make fancy-progress fg/bg color configurableMichael Vogt
Add two new options: Dpkg::Progress-Fancy::Progress-{fg,bg} that allows customizing the colors in the dpkg fancy progress output.
2014-03-23discard candidates via IsInstallOk to allow overrideDavid Kalnischkies
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