summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* make all d-pointer * const pointersDavid Kalnischkies2015-08-1072-234/+244
| | | | | | | | | | | | | | Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore
* apply various style suggestions by cppcheckDavid Kalnischkies2015-08-1031-109/+96
| | | | | | | Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore
* policy: Fix the handling of config-files statesJulian Andres Klode2015-08-101-3/+12
| | | | Gbp-Dch: ignore
* Fix test case breakage from the new policy implementationJulian Andres Klode2015-08-105-47/+48
| | | | Everything's working now.
* policy: Fix the new policy implementation to handle downgrades correctlyJulian Andres Klode2015-08-101-9/+8
| | | | | This was broken previously, as we'd choose a downgrade when it's pin was higher than the previously selected candidate.
* Determine the candidate based on per-version pins, instead of old codeJulian Andres Klode2015-08-102-0/+37
| | | | | | | | | | | The new implementation assigns each version a pin, instead of assigning the pin to a package. This enables us to give each version of a package a different priority. Closes: #770017 Closes: #622237 Closes: #620249 Closes: #685215
* policy: Return highest file pin if version pin == 0 in GetPriority()Julian Andres Klode2015-08-101-1/+10
| | | | | This makes sure that we display a useful value instead of 0 for versions that are pinned due to package files.
* fileutl_test.cc: Check for /etc/passwd instead of /bin/shJulian Andres Klode2015-08-101-3/+3
| | | | | | This fixes the tests on systems where usrmerge is installed. Gbp-dch: ignore
* apt-cache: Change version pin output to use per-version pinsJulian Andres Klode2015-08-101-1/+1
|
* policy: Assign per-version pinsJulian Andres Klode2015-08-101-0/+11
|
* versionmatch: Extract version match checking out of Find()Julian Andres Klode2015-08-102-13/+26
| | | | | Refactor version matching to allow us to check if a version matches a pin. This will aid the per-version pinning implementation.
* pkgPolicy: Introduce storage and helpers for per-version pinsJulian Andres Klode2015-08-102-1/+12
| | | | | Per-version pins should lead to more predictable results with /etc/apt/preferences uses like pinning one version with -1.
* Turkish translation update for aptMert Dirik2015-06-231-992/+941
| | | | Closes: #789491
* Merge remote-tracking branch 'donkult/debian/experimental' into ↵Michael Vogt2015-06-23373-48186/+52895
|\ | | | | | | debian/experimental
| * add d-pointer, virtual destructors and de-inline de/constructorsDavid Kalnischkies2015-06-1659-205/+348
| | | | | | | | | | | | | | | | To have a chance to keep the ABI for a while we need all three to team up. One of them missing and we might loose, so ensuring that they are available is a very tedious but needed task once in a while. Git-Dch: Ignore
| * allow ratelimiting progress reporting for testcasesDavid Kalnischkies2015-06-153-16/+23
| | | | | | | | | | | | | | | | Progress reports once in a while which is a bit to unpredictable for testcases, so we enforce a steady progress for them in the hope that this makes the tests (mostly test-apt-progress-fd) a bit more stable. Git-Dch: Ignore
| * condense parallel requests with the same hashes to oneDavid Kalnischkies2015-06-1514-101/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | It shouldn't be too common, but sometimes people have multiple mirrors in the sources or otherwise repositories with the same content. Now that we gracefully can handle multiple requests to the same URI, we can also fold multiple requests with the same expected hashes into one. Note that this isn't trying to find oppertunities for merging, but just merges if it happens to encounter the oppertunity for it. This is most obvious in the new testcase actually as it needs to delay the action to give the acquire system enough time to figure out that they can be merged.
| * show item ID in Hit, Ign and Err lines as wellDavid Kalnischkies2015-06-1557-422/+618
| | | | | | | | | | | | | | | | Again, consistency is the main sellingpoint here, but this way it is now also easier to explain that some files move through different stages and lines are printed for them hence multiple times: That is a bit hard to believe if the number is changing all the time, but now that it keeps consistent.
| * call URIStart in cdrom and file methodDavid Kalnischkies2015-06-159-40/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All other methods call it, so they should follow along even if the work they do afterwards is hardly breathtaking and usually results in a URIDone pretty soon, but the acquire system tells the individual item about this via a virtual method call, so even through none of our existing items contains any critical code in these, maybe one day they might. Consistency at least once… Which is also why this has a good sideeffect: file: and cdrom: requests appear now in the 'apt-get update' output. Finally - it never made sense to hide them for me. Okay, I guess it made before the new hit behavior, but now that you can actually see the difference in an update it makes sense to see if a file: repository changed or not as well.
| * deal better with acquiring the same URI multiple timesDavid Kalnischkies2015-06-158-152/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an unlikely event for indexes and co, but it can happen quiet easily e.g. for changelogs where you want to get the changelogs for multiple binary package(version)s which happen to all be built from a single source. The interesting part is that the Acquire system actually detected this already and set the item requesting the URI again to StatDone - expect that this is hardly sufficient: an Item must be Complete=true as well to be considered truely done and that is only the tip of the ::Done handling iceberg. So instead of this StatDone hack we allow QItems to be owned by multiple items and notify all owners about everything now, so that for the point of each item they got it downloaded just for them.
| * ensure valid or remove destination file in file methodDavid Kalnischkies2015-06-151-11/+33
| | | | | | | | | | | | | | 'file' isn't using the destination file per-se, but returns another name via "Filename" header. It still should deal with destination files as they could exist (pkgAcqFile e.g. creates links in that location) and are potentially bogus.
| * provide a public interface for acquiring changelogsDavid Kalnischkies2015-06-1512-224/+507
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provided is a specialized acquire item which given a version can figure out the correct URI to try by itself and if not provides an error message alongside with static methods to get just the URI it would try to download if it should just be displayed or similar such. The URI is constructed as follows: Release files can provide an URI template in the "Changelogs" field, otherwise we lookup a configuration item based on the "Label" or "Origin" of the Release file to get a (hopefully known) default value for now. This template should contain the string CHANGEPATH which is replaced with the information about the version we want the changelog for (e.g. main/a/apt/apt_1.1). This middleway was choosen as this path part was consistent over the three known implementations (+1 defunct), while the rest of the URI varies widely between them. The benefit of this construct is that it is now easy to get changelogs for Debian packages on Ubuntu and vice versa – even at the moment where the Changelogs field is present nowhere. Strictly better than what apt-get had before as it would even fail to get changelogs from security… Now it will notice that security identifies as Origin: Debian and pick this setting (assuming again that no Changelogs field exists). If on the other hand security would ship its changelogs in a different location we could set it via the Label option overruling Origin. Closes: 687147, 739854, 784027, 787190
| * hide Translation-* in 'apt-cache policy' outputDavid Kalnischkies2015-06-153-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Translation-* files are internally handled as PackageFiles which isn't super nice, but giving them their own struct is a bit overkill so let it be for the moment. They always appeared in the policy output because of this through and now that they are properly linked to a ReleaseFile they even display all the pinning information on them, but they don't contain any packages which could be pinned… No problem, but useless and potentially confusing output. Adding a 'NoPackages' flag which can be set on those files and be used in applications seems like a simple way to fix this display issue.
| * populate the Architecture field for PackageFilesDavid Kalnischkies2015-06-154-6/+16
| | | | | | | | | | | | | | | | | | | | | | This is mainly visible in the policy, so that you can now pin by b= and let it only effect Packages files of this architecture and hence the packages coming from it (which do not need to be from this architecture, but very likely are in a normal repository setup). If you should pin by architecture in this way is a different question… Closes: 687255
| * implement default apt-get file --release-info modeDavid Kalnischkies2015-06-1511-37/+88
| | | | | | | | | | | | | | | | | | | | Selecting targets based on the Release they belong to isn't to unrealistic. In fact, it is assumed to be the most used case so it is made the default especially as this allows to bundle another thing we have to be careful with: Filenames and only showing targets we have acquired. Closes: 752702
| * store Release files data in the CacheDavid Kalnischkies2015-06-1227-219/+573
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to read the Release file for each Packages file and store the data in the PackageFile struct even through potentially many Packages (and Translation-*) files could use the same data. The point of the exercise isn't the duplicated data through. Having the Release files as first-class citizens in the Cache allows us to properly track their state as well as allows us to use the information also for files which aren't in the cache, but where we know to which Release file they belong (Sources are an example for this). This modifies the pkgCache structs, especially the PackagesFile struct which depending on how libapt users access the data in these structs can mean huge breakage or no visible change. As a single data point: aptitude seems to be fine with this. Even if there is breakage it is trivial to fix in a backportable way while avoiding breakage for everyone would be a huge pain for us. Note that not all PackageFile structs have a corresponding ReleaseFile. In particular the dpkg/status file as well as *.deb files have not. As these have only a Archive property need, the Component property takes over this duty and the ReleaseFile remains zero. This is also the reason why it isn't needed nor particularily recommended to change from PackagesFile to ReleaseFile blindly. Sticking with the earlier is usually the better option.
| * implement 'apt-get files' to access index targetsDavid Kalnischkies2015-06-118-10/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | Downloading additional files is only half the job. We still need a way to allow external tools to know where the files are they requested for download given that we don't want them to choose their own location. 'apt-get files' is our answer to this showing by default in a deb822 format information about each IndexTarget with the potential to filter the records based on lines and an option to change the output format. The command serves also as an example on how to get to this information via libapt.
| * use an enum instead of strings as IndexTarget::Option interfaceDavid Kalnischkies2015-06-114-12/+38
| | | | | | | | | | | | | | Strings are easy to typo and we can keep the extensibility we require here with a simple enum we can append to without endangering ABI. Git-Dch: Ignore
| * use IndexTarget to get to IndexFileDavid Kalnischkies2015-06-117-509/+197
| | | | | | | | | | | | | | | | Removes a bunch of duplicated code in the deb-specific parts. Especially the Description part is now handled centrally by IndexTarget instead of being duplicated to the derivations of IndexFile. Git-Dch: Ignore
| * show URI.Path in all acquire item descriptionsDavid Kalnischkies2015-06-1117-50/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a rather strange sight that index items use SiteOnly which strips the Path, while e.g. deb files are downloaded with NoUserPassword which does not. Important to note here is that for the file transport Path is pretty important as there is no Host which would be displayed by Site, which always resulted in "interesting" unspecific errors for "file:". Adding a 'middle' ground between the two which does show the Path but potentially modifies it (it strips a pending / at the end if existing) solves this "file:" issue, syncs the output and in the end helps to identify which file is meant exactly in progress output and co as a single site can have multiple repositories in different paths.
| * rename Calculate- to GetIndexTargets and use it as official APIDavid Kalnischkies2015-06-103-27/+21
| | | | | | | | | | | | | | | | We need a general way to get from a sources.list entry to IndexTargets and with this change we can move from pkgSourceList over the list of metaIndexes it includes to the IndexTargets each metaIndex can have. Git-Dch: Ignore
| * stop using IndexTarget pointers which are never freedDavid Kalnischkies2015-06-104-118/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating and passing around a bunch of pointers of IndexTargets (and of a vector of pointers of IndexTargets) is probably done to avoid the 'costly' copy of container, but we are really not in a timecritical operation here and move semantics will help us even further in the future. On the other hand we never do a proper cleanup of these pointers, which is very dirty, even if structures aren't that big… The changes will effecting many items only effect our own hidden class, so we can do that without fearing breaking interfaces or anything. Git-Dch: Ignore
| * store all targets data in IndexTarget structDavid Kalnischkies2015-06-106-108/+97
| | | | | | | | | | | | | | We still need an API for the targets, so slowly prepare the IndexTargets to let them take this job. Git-Dch: Ignore
| * abstract the code to iterate over all targets a bitDavid Kalnischkies2015-06-103-95/+142
| | | | | | | | | | | | | | | | | | We have two places in the code which need to iterate over targets and do certain things with it. The first one is actually creating these targets for download and the second instance pepares certain targets for reading. Git-Dch: Ignore
| * replace ULONG_MAX with c++ style std::numeric_limitsDavid Kalnischkies2015-06-091-2/+2
| | | | | | | | | | | | | | For some reason travis seems to be unhappy about it claiming it is not defined. Well, lets not think to deeply about it… Git-Dch: Ignore
| * configureable acquire targets to download additional filesDavid Kalnischkies2015-06-098-192/+376
| | | | | | | | | | | | | | | | First pass at making the acquire system capable of downloading files based on configuration rather than hardcoded entries. It is now possible to instruct 'deb' and 'deb-src' sources.list lines to download more than just Packages/Translation-* and Sources files. Details on how to do that can be found in the included documentation file.
| * remove debianism file-content verificationDavid Kalnischkies2015-06-092-40/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code requires every index file we download to have a Package field, but that doesn't hold true for all index we might want to download in the future. Some might not even be deb822 formatted files… The check was needed as apt used to accept unverifiable files like Translation-*, but nowadays it requires hashes for these as well. Even for unsigned repositories we interpret the Release file as binding now, which means this check isn't triggerable expect for repositories which do not have a Release file at all – something which is highly discouraged! Git-Dch: Ignore
| * do not request files if we expect an IMS hitDavid Kalnischkies2015-06-098-45/+127
| | | | | | | | | | | | | | | | | | | | If we have a file on disk and the hashes are the same in the new Release file and the old one we have on disk we know that if we ask the server for the file, we will at best get an IMS hit – at worse the server doesn't support this and sends us the (unchanged) file and we have to run all our checks on it again for nothing. So, we can save ourselves (and the servers) some unneeded requests if we figure this out on our own.
| * cleanup pdiff support detection decisionDavid Kalnischkies2015-06-092-45/+45
| | | | | | | | | | | | | | | | | | | | | | Its a bit unclean to create an item just to let the item decide that it can't do anything and let it fail, so instead we let the item creator decide in all cases if patching should be attempted. Also pulls a small trick to get the hashes for the current file without calculating them by looking at the 'old' Release file if we have it. Git-Dch: Ignore
| * support hashes for compressed pdiff filesDavid Kalnischkies2015-06-097-28/+125
| | | | | | | | | | | | | | | | At the moment we only have hashes for the uncompressed pdiff files, but via the new '$HASH-Download' field in the .diff/Index hashes can be provided for the .gz compressed pdiff file, which apt will pick up now and use to verify the download. Now, we "just" need a buy in from the creators of repositories…
| * fix download-file using testcases to run as rootDavid Kalnischkies2015-06-092-16/+17
| | | | | | | | Git-Dch: Ignore
| * add more parsing error checking for rredDavid Kalnischkies2015-06-093-22/+245
| | | | | | | | | | | | | | The rred parser is very accepting regarding 'invalid' files. Given that we can't trust the input it might be a bit too relaxed. In any case, checking for more errors can't hurt given that we support only a very specific subset of ed commands.
| * check patch hashes in rred worker instead of in the handlerDavid Kalnischkies2015-06-096-59/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rred is responsible for unpacking and reading the patch files in one go, but we currently only have hashes for the uncompressed patch files, so the handler read the entire patch file before dispatching it to the worker which would read it again – both with an implicit uncompress. Worse, while the workers operate in parallel the handler is the central orchestration unit, so having it busy with work means the workers do (potentially) nothing. This means rred is working with 'untrusted' data, which is bad. Yet, having the unpack in the handler meant that the untrusted uncompress was done as root which isn't better either. Now, we have it at least contained in a binary which we can harden a bit better. In the long run, we want hashes for the compressed patch files through to be safe.
| * rework hashsum verification in the acquire systemDavid Kalnischkies2015-06-0922-1871/+1824
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having every item having its own code to verify the file(s) it handles is an errorprune process and easy to break, especially if items move through various stages (download, uncompress, patching, …). With a giant rework we centralize (most of) the verification to have a better enforcement rate and (hopefully) less chance for bugs, but it breaks the ABI bigtime in exchange – and as we break it anyway, it is broken even harder. It shouldn't effect most frontends as they don't deal with the acquire system at all or implement their own items, but some do and will need to be patched (might be an opportunity to use apt on-board material). The theory is simple: Items implement methods to decide if hashes need to be checked (in this stage) and to return the expected hashes for this item (in this stage). The verification itself is done in worker message passing which has the benefit that a hashsum error is now a proper error for the acquire system rather than a Done() which is later revised to a Failed().
| * don't try other compressions on hashsum mismatchDavid Kalnischkies2015-06-074-16/+52
| | | | | | | | | | | | | | | | | | If we e.g. fail on hash verification for Packages.xz its highly unlikely that it will be any better with Packages.gz, so we just waste download bandwidth and time. It also causes us always to fallback to the uncompressed Packages file for which the error will finally be reported, which in turn confuses users as the file usually doesn't exist on the mirrors, so a bug in apt is suspected for even trying it…
| * Merge branch 'debian/sid' into debian/experimentalMichael Vogt2015-05-2211-40/+158
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/pkgcache.h debian/changelog methods/https.cc methods/server.cc test/integration/test-apt-download-progress
| | * Update methods/https.cc now that ServerState::Size is renamedMichael Vogt2015-05-221-1/+1
| | | | | | | | | | | | Git-Dch: ignore
| | * Merge remote-tracking branch 'upstream/debian/jessie' into debian/sidMichael Vogt2015-05-2261-21141/+21431
| | |\ | | | | | | | | | | | | | | | | Conflicts: apt-pkg/deb/dpkgpm.cc
| | | * releasing package apt version 1.0.9.9Michael Vogt2015-04-281-0/+10
| | | |
| | | * remove "first package seen is native package" assumptionDavid Kalnischkies2015-04-223-14/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for #777760 causes packages of foreign (and the native) architectures, to be created correctly, but invalidates (like the previously existing, but policy-forbidden architecture-less packages we had to support for some upgrade scenarios) the assumption that the first (and only) package in the cache for a single architecture system must be the package for the native architecture (as, where should the other architectures come from, right? Wrong.). Depending on the order of parsing sources more or less packages can be effected by this. The effects are strange (for apt it mostly effects simulation/debug output, but also apt-mark on these specific packages), which complicates debugging, but relatively harmless if understood as most actions do not need direct named access to packages. The problem is fixed by removing the single-arch special casing in the paths who had them (Cache.FindPkg), so they use the same code as multi-arch systems, which use them as a wrapper for Grp.FindPkg. Note that single-arch system code was using Grp.FindPkg before as well if a Grp structure was handily available, so we don't introduce new untested code here: We remove more brittle special cases which are less tested instead (this was planed to be done for Stretch anyhow). Note further that the method with the assumption itself isn't fixed. As it is a private method I opted for declaring it deprecated instead and remove all its call positions. As it is private no-one can call this method legally (thanks to how c++ works by default its still an exported symbol through) and fixing it basically means reimplementing code we already have in Grp.FindPkg. Removing rather than fixing seems hence like a good solution. Closes: 782777 Thanks: Axel Beckert for testing