The following commit has been merged in the master branch: commit 905e3ecfea913c9a1fc652c2c5357febb3d59ebd Author: Guillem Jover <guil...@debian.org> Date: Sun Feb 5 06:57:14 2012 +0100
libdpkg: Add new pkg_db_get_pkg() diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h index afa7e19..717d9d9 100644 --- a/lib/dpkg/dpkg-db.h +++ b/lib/dpkg/dpkg-db.h @@ -4,7 +4,7 @@ * * Copyright © 1994,1995 Ian Jackson <i...@chiark.greenend.org.uk> * Copyright © 2000,2001 Wichert Akkerman - * Copyright © 2006-2011 Guillem Jover <guil...@debian.org> + * Copyright © 2006-2012 Guillem Jover <guil...@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -273,6 +273,7 @@ bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info); struct pkginfo *pkg_db_find(const char *name); struct pkgset *pkg_db_find_set(const char *name); +struct pkginfo *pkg_db_get_pkg(struct pkgset *set, const struct dpkg_arch *arch); struct pkginfo *pkg_db_find_pkg(const char *name, const struct dpkg_arch *arch); int pkg_db_count_set(void); int pkg_db_count_pkg(void); diff --git a/lib/dpkg/pkg-db.c b/lib/dpkg/pkg-db.c index 6ca08ab..940638d 100644 --- a/lib/dpkg/pkg-db.c +++ b/lib/dpkg/pkg-db.c @@ -3,6 +3,7 @@ * pkg-db.c - Low level package database routines (hash tables, etc.) * * Copyright © 1995 Ian Jackson <i...@chiark.greenend.org.uk> + * Copyright © 2008-2012 Guillem Jover <guil...@debian.org> * Copyright © 2011 Linaro Limited * Copyright © 2011 Raphaël Hertzog <hert...@debian.org> * @@ -105,6 +106,24 @@ pkg_db_find_set(const char *inname) } /** + * Return the package instance in a set with the given architecture. + * + * @param set The package set to use. + * @param arch The requested architecture. + * + * @return The package instance. + */ +struct pkginfo * +pkg_db_get_pkg(struct pkgset *set, const struct dpkg_arch *arch) +{ + struct pkginfo *pkg; + + pkg = &set->pkg; + + return pkg; +} + +/** * Return the package instance with the given name and architecture. * * @param name The package name. @@ -119,7 +138,7 @@ pkg_db_find_pkg(const char *name, const struct dpkg_arch *arch) struct pkginfo *pkg; set = pkg_db_find_set(name); - pkg = &set->pkg; + pkg = pkg_db_get_pkg(set, arch); return pkg; } -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org