summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-03-31Rename iterfiles*() functions to files_db_iter_*()Guillem Jover5-21/+27
2012-03-31dpkg-query: Use literal format in printf call to allow compiler checksGuillem Jover1-15/+21
2012-03-31Rename informativeversion() to dpkg_version_is_informative()Guillem Jover3-5/+8
2012-03-31Rename blankversion() to dpkg_version_blank()Guillem Jover3-6/+6
2012-03-30dpkg: Pass filenamenode to pkg_files_add_file() instead of string and flagsGuillem Jover1-4/+8
2012-03-30Fix coding-styleGuillem Jover3-12/+12
2012-03-27dpkg: Refactor code into new clear_deconfigure_queue() functionGuillem Jover3-8/+15
2012-03-27dpkg: Move comment and assignment just before its related code blockGuillem Jover1-4/+4
The related code blocks got split by the introduction of code inbetween in commit e5bf4b7412bb2a4e5ff33f128c3cb8dcd96fcfdb.
2012-03-27dpkg: Rename <foo> to «pathname» in comments to not confuse doxygenGuillem Jover1-11/+11
Doxygen considers <word> as HTML markup text, and issues warnings on unknown keywords.
2012-03-27Mark enum and struct member comments as doxygen descriptionsGuillem Jover3-21/+23
2012-03-27Do not use `' quote pairs for non-translatable stringsGuillem Jover5-39/+44
2012-03-27Clarify internerr() messagesGuillem Jover2-2/+3
Print the bogus value that triggered the internal error, or simply reword unclear messages.
2012-03-19dpkg: Add --assert-multi-arch optionGuillem Jover3-1/+13
This will allow us to query if the currently installed dpkg has multi-arch support.
2012-03-19dpkg: Only allow setting selections for known packagesGuillem Jover1-0/+6
2012-03-19dpkg: Do not try to disappear other packages from the same setRaphaël Hertzog2-0/+13
Packages within a set can rightfully share files and should not be disappeared in the case where they share all the files. Closes: #652063 Reported-by: Martin Pitt <mpitt@debian.org> Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-19dpkg: Upgrade the database automatically to the new multi-arch layoutGuillem Jover6-0/+258
The upgrade is scheduled by explicit calls to pkg_infodb_upgrade() if the current database format version is less than the latest supported format or if the previous upgrade was interrupted. The upgrade goes as follows: - link all old files to their new names. - set <admindir>/info/format-new to 1. - remove all old files. - rename <admindir>/info/format-new to <admindir>/info/format. In case of abrupt interruption, the presence of <admindir>/info/format-new means the upgrade is not yet completed and it needs to be retried. In case of clean interruption with rollback, that file is removed after the old layout has been restored. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Designed-by: Guillem Jover <guillem@debian.org> Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-19dpkg: Update on-disk database to use a multiarch compliant layoutGuillem Jover5-2/+138
The usage of the new layout is conditional to a prior database upgrade that should write a version number greater than 0 in <admindir>/info/format. The file is parsed when needed from pkg_infodb_get_format(). Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-19dpkg: Allow shared files between Multi-Arch: same packagesGuillem Jover3-20/+246
If all the already installed packages are synchronized, and the version to be installed is the same, then we check that the shared file has the same contents as what's already installed. Otherwise we blindly allow the updated package to replace the file. For conffiles, instead of checking against the on-disk version, we check instead against either: - the MD5 hash stored for any of the other configured instances of the package. - the MD5 hash of the already present .dpkg-new file for the unpacked instances of the packages. During removal, we only remove the file if it's not shared with other packages of the same set. During upgrade, we don't remove the file from other packages containing the same file if the package is part of the same set. We do this even for packages which are not “Multi-Arch: same” since there's only one .list controlg file for the package set and we should not modify it since it has already been written. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-18dpkg: Store in tarcontext whether the pkgset is getting in syncGuillem Jover2-0/+27
This will be used later by the extraction code to know whether it should ensure consistency of shared files or not. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-18dpkg: Change debug output to always arch-qualify package namesGuillem Jover7-40/+40
2012-03-16dpkg-divert: Improve ignored removal request messageSven Joachim1-1/+1
Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-16dpkg: Remove old control files on upgrade when needed for Multi-Arch changeRaphaël Hertzog1-0/+10
When we upgrade from “Multi-Arch: same” to something else (or vice versa) the layout used for the control files changes (pkg.foo vs pkg:arch.foo) and it means we must get rid of the old control files. Sponsored-by: Linaro Limited [guillem@debian.org: - Reword comment and debug message. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-16dpkg-divert: Properly handle diversions of shared filesRaphaël Hertzog2-1/+48
dpkg-divert does nothing if the same diversion is recorded multiple times. However when a diversion is removed, it does so even if the shared file is still in place. We change dpkg-divert's behaviour to ignore a diversion removal request until the diverted file is no longer owned by another package of the same package set. We also update the test-suite to provide a status file now that dpkg-divert reads it. Sponsored-by: Linaro Limited [guillem@debian.org: - Handle missing DPKG_MAINTSCRIPT_ARCH when upgrading from old dpkg. - Split ignore removal logic into a new function. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-16dpkg: Pass filenamenode instead of fileinlist to cu_installnew()Guillem Jover2-4/+2
2012-03-16dpkg: Compute and track hashes for newly unpacked fileGuillem Jover3-4/+14
This will be used for checksum generation at unpack time, and for shared file verification.
2012-03-16dpkg: Use fd_skip() instead of fd_read() on tarobject_skip_padding()Guillem Jover1-3/+2
2012-03-16dpkg: Refactor skipping tarobject padding into new tarobject_skip_padding()Guillem Jover1-11/+12
2012-03-16dpkg: Rename tarfile_skip_one_forward() to tarobject_skip_entry()Guillem Jover1-3/+3
2012-03-16dpkg: Refactor tar object extraction into new tarobject_extract()Guillem Jover1-90/+102
2012-03-14dpkg: Add restrictions for configuration of a Multi-Arch: same packageRaphaël Hertzog1-0/+28
A “Multi-Arch: same” package can only be configured if all the other instances of the same package are synchronized (i.e. have the same unpacked version) and if they are in state where they can be configured. Sponsored-by: Linaro Limited [guillem@debian.org: - Rework error strings. - Fix coding-style. - Check against <= stat_configfiles instead of < stat_halfinstalled. - Split unrelated check into different conditionals. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Deconfigure other instances of the unpacked packageRaphaël Hertzog1-0/+11
When a new version of a “Multi-Arch: same” package is installed, the other instances that are not synchronized (i.e. which have a different version) must be deconfigured. Sponsored-by: Linaro Limited [guillem@debian.org: - Ignore the package earlier if the package state is not correct. - Use enqueue_deconfigure() instead of ad-hoc code. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Update architecture check to allow foreign architecturesRaphaël Hertzog1-1/+4
Packages whose architecture has been whitelisted with --add-architecture do not need --force-architecture to be installed. Even foreign packages which are “Multi-Arch: no” can be installed provided that all their foreign dependencies are already satisfied. Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Complete arch checking of package relationships in the resolverSteve Langasek2-0/+8
In places where the architecture qualifier of a dependency has not been validated before-hand (through usage of deppossi_pkg_iterator), add a manual verification. In both cases, the checks are not needed with the current rules where both Replaces and Breaks can only have “any” as architecture qualifier but for completeness, we put them nevertheless. Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Do not force dependencies on dependtry >= 3, wait until >= 4Guillem Jover1-1/+1
To fix the non-working --force-depends-version (bug #57104) in commit c54fb50e3a08d467955856e81be178b712b7ebdb, a check for fc_dependsversion was added alongside the existing fc_depends for dependtry >= 3, as it could not be just replaced because there was no other code to pickup the fc_depends for that specific case in dependtry >= 4. Now that fc_depends always gets applied after all calls to deppossi_ok_found() have finished, it's safe to remove the misplaced fc_depends, so that it happens at dependtry >= 4, where it belongs.
2012-03-14dpkg: Let --force-depends rescue the dependency check in all casesRaphaël Hertzog1-5/+7
The logic that allowed --force-depends to do its job was embedded in deppossi_ok_found() but that function is no longer called when there are no packages matching the architecture restriction implied by the dependency. Due to the structure of the internal database this happens only with foreign packages. Instead of relying on deppossi_ok_found() we move the logic directly into dependencies_ok(), just at the end of the dependencies checks. Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Make md5hash() a public functionRaphaël Hertzog2-3/+3
Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Update output commands to print package specifiersRaphaël Hertzog2-6/+10
This affects --audit, --yet-to-unpack and --get-selections. Sponsored-by: Linaro Limited [guillem@debian.org: - Adapt to new pkg_name API. - Only arch-qualify when unambiguous. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Use package specifiers for maintainer script argumentsGuillem Jover2-9/+21
Replace pkg->set->name with pkg_name() and pkgbin_name(). Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Use package specifiers in statusfd and log messagesGuillem Jover3-5/+7
The colon is often used as a separator but it is always preceded and/or followed by a space so that it's possible to distinguish between the colon used as a separator and the colon embedded in a package name (like in "libc6:amd64"). Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg-query: Update output commands to print package specifiersGuillem Jover1-4/+4
This affects --list and --show. Also use package specifiers in the default output format and document this change in the manual page. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14Update triggers support to understand multi-archGuillem Jover1-9/+14
Instead of storing/parsing package names, we have to store/parse package specifiers that can include an architecture qualifier. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg: Update commands and options to accept package specifiersGuillem Jover3-11/+32
This affects --ignore-depends, --configure, --remove, --purge, --triggers-only, --get-selections and --set-selections. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg-query: Update commands to accept package specifiers as argumentsRaphaël Hertzog1-4/+35
This affects --list, --show, --listfiles, --status, --print-avail and --control-path. Sponsored-by: Linaro Limited [guillem@debian.org: - Adapt to new pkg_spec API. - Do not memset the pkg_spec array nor directly assign to flags member, use pkg_spec_init() instead. - Check for parse errors from pkg_spec_parse_pkg() and bail out. - Use psf_arch_def_wildcard instead of _native for -l and -W. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-14dpkg-query: Only load the available file on -l or -W with new --load-availGuillem Jover1-2/+6
Change the default behaviour of not loading the available file depending on whether arguments have been passed to the commands, to instead adding a new explicit option to let the user request the additional information from the available file. This is needed to avoid confusion given that with multiarch the available file can contain multiple instances for the same package.
2012-03-14Rework common badusage strings to allow for possible translation reuseGuillem Jover2-11/+11
Use cmdinfo long name instead of hard-coding it in the literal string, and reword some strings to make them more generally usable.
2012-03-14dpkg: Use ohshit() instead of ohshite() on illegal names in --ignore-dependsGuillem Jover1-1/+1
2012-03-13libdpkg: Never return NULL from pkg_db_find_singleton()Guillem Jover1-3/+0
2012-03-13libdpkg: Change pkg_sorter_by_name() to pkg_sorter_by_nonambig_name_arch()Guillem Jover2-3/+3
The reworked function takes into account the architecture while comparing the packages, if that would make the package name output ambiguous. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-13libdpkg: Move pkg_sorter_by_name() from pkg module to pkg-showGuillem Jover1-0/+1
The function is being used for showing purposes.
2012-03-13Use new EMPTYHASHFLAG instead of EMPTY_HASH or literal stringGuillem Jover1-3/+2