summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* use local changelog from /usr/share/doc if possibleDavid Kalnischkies2016-02-115-2/+60
| | | | | | | | | | | If pkgAcqChangelog is told to acquire the changelog for a version it will check first if this version is installed on the disk and if so will use the local changelog in /usr/share/doc (possibily/likely gz compressed) instead of downloading the file from the web. An option is provided to disable this, which is enabled by default for the Ubuntu vendor as they truncate the local changelogs – and for apts --print-uris action.
* Release 1.2.31.2.3Julian Andres Klode2016-02-1057-3554/+2939
| | | | | Build system messed up the 1.2.2 commit by not updating the .po files properly, so they are now.
* test: use our special downloaded dir for 'source' resultDavid Kalnischkies2016-02-101-0/+2
| | | | | | | | | | | Otherwise the test run as root fails seeing the W: Can't drop privileges for downloading as file 'foo_1.tar.gz' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) warning in a command which isn't supposed to warn. One trivial test, two fixups and still counting… Git-Dch: Ignore
* accept any tarball compression in 814139 testcaseDavid Kalnischkies2016-02-101-2/+2
| | | | | | | | Travis still uses a dpkg version which defaults to gz and as which compression is picked isn't all to important as long as one is just accept any. Git-Dch: Ignore
* test that seeking to a position earlier in the file worksJulian Andres Klode2016-02-101-0/+12
| | | | | | This tests the fix for #812994, #813000 Gbp-Dch: ignore
* get dpkg lock in build-dep if cache was invalid againDavid Kalnischkies2016-02-103-6/+64
| | | | | | | | | | | | | | | | Regression introduced in a249b3e6fd798935a02b769149c9791a6fa6ef16, which in the case of an invalid cache would build the first part unlocked and later pick up the (still unlocked) cache for further processing, so the system got never locked and apt would end up complaining about being unable to release the lock at shutdown. The far more common case of having a valid cache worked as expected and hence covered up the problem – especially as tests who would have noticed it are simulations only, which do not lock. Closes: 814139 Reported-By: Balint Reczey <balint@balintreczey.hu> Reported-By: Helmut Grohne <helmut@subdivi.de> on IRC
* Set seekpos to 0 after reopening files in Seek()Julian Andres Klode2016-02-101-0/+1
| | | | | | | | | If we just reopened the file, we also need to reset the current seek position when we reset the buffer, otherwise the code will not try to seek to the position given to Skip (from 0), but will try to seek to old offset + the position given to skip. Closes: #812994, #813000
* Release 1.2.21.2.2Julian Andres Klode2016-02-0414-84/+133
|
* Use some semantically more correct buffer operationsJulian Andres Klode2016-02-041-1/+1
| | | | | | | | | | | When writing into the buffer write to free() bytes starting at getend(), instead of buffersize_max bytes at get() -> get() is a read pointer. This makes no difference in practice though, as we reset the buffer before the call, so start = end = 0. Gbp-Dch: ignore
* test: Fix apt-key tests to work with current gpg 2.1Julian Andres Klode2016-02-041-1/+11
|
* Correctly report write errors when flushing buffered writerJulian Andres Klode2016-02-041-1/+1
| | | | | We cannot just return false without setting an error, as InternalWrite does not set one itself.
* rred: If there were I/O errors, failJulian Andres Klode2016-02-041-0/+5
| | | | | We basically ignored errors from writing and flushing, let's not do that.
* NEWS: Prefix the keep deb option with Binary::apt::Julian Andres Klode2016-02-041-3/+4
| | | | | | | I find the per-binary overrides a bit confusing in their current form, but let's tell the user the truth. Closes: #812111
* Merge branch 'master' of github.com:adrian17/aptJulian Andres Klode2016-02-041-1/+3
|\
| * Avoid temporary strings in SubstVar.Adrian Wielgosik2016-02-031-1/+3
| | | | | | | | | | Microoptimization, but still gives a measurable 2-3% improvement when using commands with lots of output like `apt list`.
* | edspsystem.cc: include <stdlib.h> for mkdtempFredrik Fornwall2016-02-031-0/+1
| | | | | | | | | | | | | | Include <stdlib.h> to ensure that mkdtemp(3) is defined to improve general portability and fix a specific build failure on Android. Closes: #807367
* | avoid building dependency tree in 'source' commandDavid Kalnischkies2016-02-035-25/+5
| | | | | | | | | | | | We don't need the dependencies for obvious reasons and we don't need the candidate version either, so building a pkgDepCache is wasted effort, which we can stop doing now that build-dep cleared the path.
* | use pkgCache::VS instead of pkgDepCache::VS()David Kalnischkies2016-02-033-27/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The later just calls the earlier, but the later needs the fullblown dependency cache to be initialized, which is a very costly operation and isn't done anymore that early in the run as we would need to throw away and rebuild it again after we got all the information about source pkgs. As we end up with a nullptr for the pkgDepCache, we use a slightly longer calling convention to make sure that we use the pkgCache directly, avoiding nullptr induced segfaults and costly operations. Git-Dch: Ignore Reported-By: Balint Reczey <balint@balintreczey.hu>
* | Drop the g++ build-dep, transition is doneJulian Andres Klode2016-02-031-2/+1
|/ | | | | | It's not cross-satisfiable. Reported-by: Helmut Grohne
* Merge github.com:adrian17/aptJulian Andres Klode2016-02-021-1/+2
|\
| * Try avoiding loading long package descriptionAdrian Wielgosik2016-02-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | It's a fairly expensive call and it's called on every package, even though it's usually only used when we're interested in a small number of packages. Long description is currently only shown by this function when using `apt search X --full`. On my PC, this patch speeds up `apt list` by roughly 20% and `apt list --installed` by 1-2%.
* | Spanish program translation updateManuel "Venturi" Porras Peralta2016-02-021-197/+250
|/ | | | Closes: 813467
* Do not buffer writes larger than the buffer if possibleJulian Andres Klode2016-02-011-0/+6
| | | | | | It makes no sense to split a large block into multiple small blocks, so when we have the chance to write them unbuffered, do so.
* BufferedWriteFileFdPrivate: Simplify InternalWrite()Julian Andres Klode2016-02-011-9/+3
| | | | | | We do not need the loop, FileFd::Private() handles this for us. Gbp-Dch: ignore
* simple_buffer::write: Use free() instead of maxsize - size()Julian Andres Klode2016-02-011-3/+3
| | | | | | | | We want to check whether the amount of free space is smaller than the requested write size. Checking maxsize - size() is incorrect for bufferstart >= 0, as size() = end - start. Gbp-Dch: ignore
* support <libc>-<kernel>-<cpu> in architecture specsDavid Kalnischkies2016-01-314-18/+125
| | | | | | | | | | | | | | | | | | | APT has a different understanding than dpkg (#748936) what matches and what doesn't match an architecture specification as it isn't converting back (and forward) to Debian triplets. That has to eventually be solved some way or the other, but until that happens we change the matching in apt so that porters can continue their work on non-gnu libc-ports even if policy doesn't specify that yet (and dpkg just supporting it "by accident" via triplets). The initial patch was reformatted, fixed in terms of patterns containing "any-any", dealing with expanding an arch without libc to gnu while a pattern expands libc to any, the parsedepends test was fixed (the new if's were inserted one step too early) and another test just for the specifications added. Closes: #812212 Thanks: Bálint Réczey for initial patch
* test all redirection codes work as expectedDavid Kalnischkies2016-01-312-6/+14
| | | | Git-Dch: Ignore
* use CPPFLAGS instead of CXXFLAGS for stringview exportDavid Kalnischkies2016-01-311-1/+1
| | | | Git-Dch: Ignore
* fix "Mismatched free() / delete / delete []" in simple_bufferStefan Bühler2016-01-301-1/+1
|
* only warn about missing/invalid Date field for nowDavid Kalnischkies2016-01-273-12/+61
| | | | | | | | | | | | | | | | | | | | | The Date field in the Release file is useful to avoid allowing an attacker to 'downgrade' a user to earlier Release files (and hence to older states of the archieve with open security bugs). It is also needed to allow a user to define min/max values for the validation of a Release file (with or without the Release file providing a Valid-Until field). APT wasn't formally requiring this field before through and (agrueable not binding and still incomplete) online documentation declares it optional (until now), so we downgrade the error to a warning for now to give repository creators a bit more time to adapt – the bigger ones should have a Date field for years already, so the effected group should be small in any case. It should be noted that earlier apt versions had this as an error already, but only showed it if a Valid-Until field was present (or the user tried to used the configuration items for min/max valid-until). Closes: 809329
* deal better with (very) small apt::cache-start valuesDavid Kalnischkies2016-01-273-17/+26
| | | | | | | | | It is a bit academic to support values which aren't big enough to fit even the hashtables without resizing, but cleaning up ensures that we do the right thing (aka not segfaulting) even if something goes wrong in these deep layers. You still can't have very very small values through… Git-Dch: Ignore
* convert Version() and Architecture() to APT::StringViewDavid Kalnischkies2016-01-264-38/+47
| | | | | | Part of hidden classes, so conversion is abi-free. Git-Dch: Ignore
* remove unused Description methods in listparsersDavid Kalnischkies2016-01-265-32/+4
| | | | | | | These virtual methods are implemented in hidden classes, so we can drop them without breaking the ABI. Git-Dch: Ignore
* get sources for packages in multiple releases againDavid Kalnischkies2016-01-263-28/+28
| | | | | | | | | In 321213f0dcdcdaab04e01663e7a047b261400c9c Andreas Cadhalpun corrected the incorrect overriding of earlier better-fitting results with later (semi-)matches – but that broke the case in which packages are in multiple releases in the same version (and the user has both releases configured). Closes: 812497
* parse version correctly from binary Source fieldDavid Kalnischkies2016-01-263-2/+22
| | | | | | | | | | | In commit a221efc331693f8905da870141756c892911c433 I promoted the source package name and version to the binary cache for faster access by e.g. EDSP, but due to changing the interpretation length to soon we always ignored the version part of the Source field, so that packages ended up having the binary version as source version – which while usually just fine it is wrong for binary rebuilds. Closes: 812492
* stablize gtest testcase environmentDavid Kalnischkies2016-01-263-4/+26
| | | | | | | | | Avoid the dependency on a specific current path for the tar test and ensure that _system is correctly initialized (gcc-6 runs into a segfault otherwise and with it fixed starts to depend on the multi-arch configuration of the running system… not good). Git-Dch: Ignore
* act on various suggestions from cppcheckDavid Kalnischkies2016-01-265-21/+16
| | | | | Reported-By: cppcheck Git-Dch: Ignore
* drop explicit check for EWOULDBLOCK if it has the same value as EAGAINDavid Kalnischkies2016-01-261-0/+4
| | | | | | | | | gcc correctly reports that we check for the same value twice, expect that the manpage of read(2) tells us to do it for portability, so to make both sides happy lets add a little #if'ing here. Reported-By: gcc-6 Git-Dch: Ignore
* Delete copy constructor and operator= for DynamicJulian Andres Klode2016-01-261-0/+5
| | | | | | | | This would mess up reference counting and should not be allowed (it could be implemented correctly, but it would not be efficient and we do not need it). Gbp-Dch: ignore
* fix tests run via sudo checking the history fileDavid Kalnischkies2016-01-253-3/+23
| | | | Git-Dch: Ignore
* reimplement build-dep via apts normal resolverDavid Kalnischkies2016-01-2515-427/+398
| | | | | | | | | | | | | | | | | | | | | | | | build-dep was implemented by parsing the build-dependencies of a package and figuring out which packages to install/remove based on this. That means that for the first level of dependencies build-dep was implementing its very own resolver with all the benefits (aka: bugs) this gives us for not using the existing resolver for all levels. Making this work involves generating a dummy binary package with fitting Depends and Conflicts and as we can't create them out of thin air the cache generation needs to be involved so we end up writing a Packages file which we want to parse – after we have parsed the other Packages files already. With .dsc/.deb files we could add them before we started parsing anything. With a bit of care we can avoid generating too much data we have to throw away again (as many parts assume that e.g. the count of packages doesn't change midair), so that on a speed front there shouldn't be much of a difference, but output can be slightly confusing as if we have a completely valid cache on disk the "Reading package lists... Done" is printed two times – but apt is pretty quick about it in that case. Closes: #137560, #444930, #489911, #583914, #728317, #812173
* use consistently the last : as name:arch separatorDavid Kalnischkies2016-01-252-2/+2
| | | | | | | | Proper debian packages do not contain ':' in the package name, so for real packages this is a non-issue, but apt itself frequently makes use of packages with such an illegal name for internal proposes. Git-Dch: Ignore
* prefer upgrading installed provides satisfierDavid Kalnischkies2016-01-251-0/+2
| | | | | | | | If you have chosen to install a foreign architecture provider it is more reasonable to keep this provider instead of removing this one to replace it with a newer version from a (usually) more preferred arch. Git-Dch: Ignore
* treat an empty dependency field just like it doesn't existDavid Kalnischkies2016-01-251-1/+1
| | | | Git-Dch: Ignore
* always create pkg at the time pkg:arch is createdDavid Kalnischkies2016-01-253-21/+41
| | | | | | | | | To resolve dependencies like "pkg:arch" we create a package with the name "pkg:arch" and the architecture "any". We create these packages only if a dependency needs it as these kind of dependencies aren't that common. This commit ensured that in the even this architecture specific dependency is the only relation this package has we still create the underlying package to have them available in provides resolution.
* Release 1.2.11.2.1Julian Andres Klode2016-01-2557-65/+77
|
* Use c++11 for loop in AptHistoryRequestingUserMichael Vogt2016-01-251-6/+4
| | | | Git-Dch: ignore
* Store "Requested-By" user in history.log in a simpler formatMichael Vogt2016-01-251-7/+20
| | | | | Git-Dch: ignore Thanks: David Kalnischkies
* Log calling SUDO_USER or PKEXEC_UID in history.logMichael Vogt2016-01-251-0/+18
| | | | Thanks: Thomas Reusch
* Remap another (non-parameter) StringViewJulian Andres Klode2016-01-231-1/+3
| | | | | | | | | I only looked at parameters in the previous commit, which was not enough: One place also generated local string views. In this case, we only need to make ArchA dynamic, as NameA is not used after the FindPkg() call. Gbp-Dch: ignore