summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | enable fvisibility=hidden for our private libraryDavid Kalnischkies2014-03-211-0/+4
| | | | | | | | | | | | | | | | | | | | While it is a huge undertaking to enable it for our public libraries as basically everything we exported so far could be seen as public interface our private library is new and under our full control, so we can do whatever we like with it. The benefits are not that big in return of course, but it reduces the size a bit, so thats great nontheless. Git-Dch: ignore
* | continue reading in xz even if it outputs nothingDavid Kalnischkies2014-03-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that content in our buffer is not enough to produce a meaningful output in which case no output is created by liblzma, but still reports that everything is okay and we should go on. The code assumes it has reached the end through if it encounters a null read, so this commit makes it so that it looks like this read was interrupted just like the lowlevel read() on uncompressed files could. It subsequently fixes the issue with that as well as until now our loop would still break even if we wanted it to continue on. (This bug triggers our usual "Hash sum mismatch" error) Reported-By: Stefan Lippers-Hollmann <s.L-H@gmx.de>
* | Fix handling of autoclosing for compressed files (Closes: #741685)Julian Andres Klode2014-03-151-1/+1
|/ | | | | | | AutoClose is both an argument in OpenDescriptor() and an enum. In commit 84baaae93badc2da7c1f4f356456762895cef278 code using the AutoClose parameter was moved to OpenDescriptorInternal(). In that function, AutoClose meant the enum value, so the check was always false.
* fix test/integration/test-apt-helperMichael Vogt2014-03-14122-1225/+2027
|\
| * use the pretty fullname of a pkg as download desciptionDavid Kalnischkies2014-03-131-6/+2
| | | | | | | | | | | | Otherwise the "WARNING: The following packages cannot be authenticated!" messages does not include the architecture of the package, so it would be slightly misinformative.
| * refactor FileFd to hide some #ifdefsDavid Kalnischkies2014-03-131-168/+131
| | | | | | | | | | | | They tend to be ugly to look at, so hide them. Git-Dch: Ignore
| * use liblzma-dev to provide xz/lzma supportDavid Kalnischkies2014-03-133-35/+256
| | | | | | | | | | | | | | | | | | | | | | | | We have xz/lzma support for a while, but only via an external binary provided by xz-utils. Now that the Debian archive provides xz by default and dpkg pre-depends on the library provided by liblzma-dev we can switch now to use this library as well to avoid requiring an external binary. For now the binary is in a prio:required package, but this might change in the future. API wise it is quiet similar to bz2 code expect that it doesn't provide file I/O methods, so we piece this together on our own.
| * refactor setup of file opening via zlib/bz2 libDavid Kalnischkies2014-03-131-37/+36
| | | | | | | | Git-Dch: Ignore
| * move fd duplication closer to the gz/bz2 open callsDavid Kalnischkies2014-03-131-21/+20
| | | | | | | | Git-Dch: Ignore
| * abstract version hash comparison a bitDavid Kalnischkies2014-03-135-4/+47
| | | | | | | | | | | | | | | | In #737085 we see that apt can be confused if informations about versions only differ slightly. This commit adds a way of at least adding a few more data points with the next abi break to help a bit with it. Git-Dch: Ignore
| * factor out parsing of MultiArch flagDavid Kalnischkies2014-03-132-21/+29
| | | | | | | | Git-Dch: Ignore
| * msgstr with elipses need three dotsDavid Kalnischkies2014-03-131-3/+3
| | | | | | | | | | fixes some messages and their translation so that all of them have three dots for messages with an elipse. Many translations already had this.