summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-03-13dpkg: Add --status-logger information to --help outputGuillem Jover1-0/+1
Missed in commit 73dab65273c589b7eed823adab30870e77171bb8.
2012-03-05dpkg: Use pkg_db_find_singleton() to get the dpkg package instanceGuillem Jover1-1/+4
2012-02-24dpkg: Use pdb_parse_available in process_archive() on --record-availGuillem Jover1-1/+4
When recording the available information from the binary package, we don't want it to possibly create a duplicate pkginfo entry with the same (but mixed) architecture, and having to cleanup the obsolete one. Instead we ignore the cross-grade slot finding logic, and just use the old available slot matching the architecture.
2012-02-24dpkg: Inline parsedb_force_flags() into process_archive()Guillem Jover1-13/+8
There's no much point in that function, and if we need to set additional flags we need most of the inline code anyway.
2012-02-24dpkg: Move pkg_infodb_remove_file() before pkg_infodb_update_file()Guillem Jover1-9/+9
2012-02-24dpkg: Restore internal pkgset consistency on cross-gradesGuillem Jover1-0/+16
When we have performed a cross-grade, the pkgset will end up with two pkginfo entries having the same architecture, which would mess up subsequent lookups. Blank the duplicated pkginfo entry which should only have a valid but now obsolete available member.
2012-02-24dpkg: Store Multi-Arch field in update log for newly installed packagesGuillem Jover1-1/+3
This is needed to be able to find the correct slot where the package entry instance from the update log should be inserted to, specially when dealing with architecture cross-gradings.
2012-02-18libdpkg: Refactor parsedb flags for standard operations into new aliasesGuillem Jover2-7/+4
The three common operations are: parsing the status file, parsing the available file and parsing the control file from a binary package. This makes the code more obvious and will allow to change their values centrally.
2012-02-18dpkg: Relax --merge-avail Packages file parser to not fail on bogus versionsGuillem Jover1-2/+2
This makes the behaviour consistent with the other Packages file action (i.e. --update-avail). Missed in commit 357ab385750c1cb657ff95c0b34ad0a6bf6d2cdf.
2012-02-18Use new package status setters instead of direct assignmentsGuillem Jover8-53/+80
This does not apply for package constructors.
2012-02-18dpkg: Do not change package eflags on --auditGuillem Jover1-2/+2
Although the flags will never end up written back to disk, and there's currently only eflag_reinstreq, it's actually wrong to change their value during the audit.
2012-02-06dpkg: When removing a foreign arch, only consider < halfinstalled an issueGuillem Jover1-1/+3
Packages in lesser states do not pose any problem for dependencies.
2012-02-05dpkg-trigger: Refactor package awaiter parsing into parse_awaiter_package()Guillem Jover1-8/+28
2012-02-05libdpkg: Pass struct pkgbin to pkg_summary()Guillem Jover2-4/+5
2012-02-05libdpkg: Change dpkg_arch_remove() to just unmark foreign architecturesGuillem Jover1-1/+1
There's no point in removing the architecture from the actual list, as dpkg_arch_save() will only write out foreign architectures, and if code later looks for it, then it will be reintroduced. Rename the function to dpkg_arch_unmark() so that the name makes more sense.
2012-02-03dpkg: Refactor deconfiguration queueing into enqueue_deconfigure()Guillem Jover2-8/+16
2012-02-03dpkg: Rename push_conflictor() to enqueue_conflictor()Guillem Jover3-3/+3
2012-02-03dpkg: Use pnaw_nonambig instead of pnaw_foreign on .list file open errorGuillem Jover1-1/+1
Regression introduced in commit 0b8652b226a7601dfd71471797d15168a7337242. Spotted-by: Raphaël Hertzog <hertzog@debian.org>
2012-02-03dpkg: Fix memory leaks from deppossi iteratorsGuillem Jover1-2/+7
Regression introduced in commit b274b0d96da80ef162d45f800777f11b11defe91.
2012-02-01Change debug, progress and error output to use package specifiersGuillem Jover12-165/+237
Replace pkg->set->name with varbuf_add_pkgbin_name(), pkgbin_name() or pkg_name(). This only changes informative output, so no behaviour change should result from this. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-02-01dpkg: Pass struct pkgbin to namenodetouse()Guillem Jover6-11/+18
2012-02-01dpkg: Pass struct pkgbin to log_action()Guillem Jover6-9/+11
2012-02-01Move copyright information from --version output to file comment headersGuillem Jover3-10/+1
Having to keep this information twice is error-prone as it easily gets out of sync. Having to translate it is bothersome. It's not consistent across dpkg tools, some do print it some don't. It's currently not accurate, as the output would need to include the holders for all files that end up being part of the binary. And listing it in the --versions output is visually annoying and the wrong place. Just keep this where it belongs, at the file comment headers, above the license information.
2012-01-23libdpkg: Pass pkgbin to trig_parse_ci callbacksGuillem Jover3-10/+12
[hertzog@debian.org: - Track pkgbin in struct trigfileint. ]
2012-01-23dpkg: Rename infodb.c to infodb-access.cGuillem Jover2-2/+2
2012-01-23build: Move common headers to noinst_HEADERSGuillem Jover1-6/+10
Headers in _SOURCES variables are only used to track files to ship in the distribution tarball, as dependencies are automatically generated. So there's no point in the reduntant listings.
2012-01-16dpkg: Get rid of all remaining deppossi->ed->pkg accessRaphaël Hertzog4-121/+202
They are replaced with loops using deppossi_pkg_iterator. Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-01-16dpkg: Add new deppossi package iterator functionsGuillem Jover2-0/+78
Since a dependency now points to a pkgset, if you want to find the correct instance of the package that satisfies the dependency, you have to take into the account the arch affinity expressed by the dependency. The function deppossi_pkg_iter_next() now takes care of this. It can return multiple packages when the dependency is a wildcard one (foo:any), you just need to pass the iterator previously created by deppossi_pkg_iter_new(), and free it with deppossi_pkg_iter_free(). Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-01-09libdpkg: Pass pkginfo instead of void * to trig_parse_ci callbacksGuillem Jover1-5/+5
Use strict types instead of a ‘void *’ pointer.
2012-01-02dpkg: Add architecture checks to --auditGuillem Jover1-0/+23
2012-01-02dpkg: Switch from foreign arch option to add and remove commandsGuillem Jover3-16/+73
The --foreign-architecture option is not a good interface, the problem with it comes from the fact that the architectures supported by the database are not configuration, they are state. This shows up in several ways. When a front-end needs to load the list of architectures, it needs to get someone to parse dpkg.cfg files, this is currently done by dpkg itself, and the list can be retrieved with --print-foreign-architectures, the problem appears when wanting a front-end to load them through libdpkg. Making the latter have to execute «dpkg --print-foreign-architectures» would be suboptimal, and making libdpkg have to load dpkg.cfg would be distasteful. Another issue is that if the list of foreign architectures is on the configuration files it makes it slightly more tricky to cross-grade dpkg, and it makes it fairly easy to accidentally remove architectures required by the database. Replace the option with two new commands --add-architecture and --remove-architecture which will perform sanity checks and store and load the architecture list (including the native arch) in an internal db file under /var/lib/dpkg/.
2012-01-02Use the new atomic file API instead of ad-hoc codeGuillem Jover3-77/+28
[hertzog@debian.org: - Switch dselect method option file. ]
2011-12-22libdpkg: Refactor pkg status to abbreviations mapping into new functionsGuillem Jover1-3/+3
2011-12-08libdpkg: Remove unused end pointer argument from pkg_name_is_illegal()Guillem Jover3-3/+3
2011-12-08libdpkg: Add new dpkg_arch_get() to retrieve special architecturesGuillem Jover2-2/+2
Switch dpkg_arch_get_native() to dpkg_arch_get(arch_native), and dpkg_arch_find() calls to direct dpkg_arch_get() ones.
2011-12-08dpkg: Change --print-foreign-architectures to print an entry per lineGuillem Jover1-4/+2
Printing just a line with space separated entries makes both the code to print and to parse slightly more complicated. The worst part comes from parsing as the standard stream input operations require delimited buffers, and as such if those buffers would not be enough truncation would happen.
2011-12-05dpkg: Error out if a database .list file is not a regular fileRaphaël Hertzog1-0/+4
LP: #369898 Signed-off-by: Guillem Jover <guillem@debian.org>
2011-12-05dpkg: Initialize all clientdata members in ensure_package_clientdata()Raphaël Hertzog1-0/+1
Although all users of replacingfilesandsaid are previously calling clear_istobes() to make sure it's initialized, doing so when allocating clientdata is safer from an API point of view. Signed-off-by: Guillem Jover <guillem@debian.org>
2011-12-04dpkg-query: Use m_calloc() instead of m_malloc() + memset()Guillem Jover1-4/+2
2011-11-14Update diversions to work with pkgset instead of pkginfoRaphaël Hertzog8-45/+49
A diversion is recorded against a package name, thus a pkgset. This is due to the fact that different instances of the same pkgset cannot have conflicting pathnames, if they do the pathname object should be the same. Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-11-14Replace most pkg_db_find() calls with its newer counterpartsRaphaël Hertzog1-1/+1
The occurrences that concern triggers and diversions will be replaced in a later commit. Most of the remaining occurrences in src/* will be replaced in an update implementing the parsing of package specifiers in the input. Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-11-14Replace all pkg_db_iter_next() calls with pkg_db_iter_next_pkg()Raphaël Hertzog7-12/+12
Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-11-14Replace all pkg_db_count() calls with pkg_db_count_pkg()Raphaël Hertzog1-1/+1
Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-11-14Rename pkg_name variables to pkgnameGuillem Jover2-7/+7
This will avoid a name clash with the upcoming function of the same name.
2011-11-14dpkg: Switch functions to take pkgset to reduce deppossi->ed->pkg accessRaphaël Hertzog2-21/+24
Change some functions to use pkgset instead of pkginfo in order to avoid some deppossi->ed->pkg lookup which are inherently wrong. Analyzing reverse dependencies does not need a pkginfo but only a pkgset. This consideration is the basis for the refactoring done here. Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-11-10dpkg-query: Fix short-lived memory leak in --show and --list commandsRaphaël Hertzog1-0/+4
Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-10-30dpkg: Ignore conflict with one's own virtual package within a package setRaphaël Hertzog1-2/+2
It's common for packages to “Provides: foo” and “Conflicts: foo” when taking over another package. This self-conflict is explicitly ignored by dpkg. Now if multiple instances of a “Multi-Arch: same” package do this, it should still be allowed. Update the checks accordingly both in dpkg and in dselect. Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-10-30libdpkg: Allow pkg:arch syntax in package relationship fieldsSteve Langasek1-0/+2
Implement support for the packagename:archname syntax in package relationships, required for multiarch. Also, the only architecture value currently allowed is “any”, consistent with round one of <https://wiki.ubuntu.com/MultiarchSpec>. This may be relaxed before the wheezy release to allow for arch-specific cross dependencies in the next release, but should probably not be relaxed for package generation in order to avoid accidental archive uploads of uninstallable packages. [guillem@debian.org: - Rearrange struct deppossi for better memory alignment. - Do not print the arch qualifier if arch_none instead of NULL. - Check against arch_wildcard instead of the literal string. - Check archlength == 0 instead of arch[0] being NUL. ] Signed-off-by: Guillem Jover <guillem@debian.org>
2011-10-30Switch pkgadminfile() to get an explicit pkgbin as argumentGuillem Jover10-37/+43
The code does not do anything yet with this new argument, but it will allow it to access the multiarch information, once the on-disk layout is changed.
2011-10-27dpkg: Move match_node functions into a new file-match moduleGuillem Jover4-27/+86