The following commit has been merged in the master branch:
commit ff180c359c91dc203f2cf49aa49495c45f955ad2
Author: Guillem Jover <[email protected]>
Date: Sat Sep 15 19:24:53 2012 +0200
libdpkg: Refactor deparchsatisfied() from archsatisfied()
This allows to specify an architecture different from the package one.
diff --git a/lib/dpkg/depcon.c b/lib/dpkg/depcon.c
index 97d02e7..37674e9 100644
--- a/lib/dpkg/depcon.c
+++ b/lib/dpkg/depcon.c
@@ -51,7 +51,8 @@ versionsatisfied(struct pkgbin *it, struct deppossi *against)
* - Conflicts/Replaces/Breaks are assumed to apply to packages of any arch.
*/
bool
-archsatisfied(struct pkgbin *it, struct deppossi *against)
+deparchsatisfied(struct pkgbin *it, const struct dpkg_arch *it_arch,
+ struct deppossi *against)
{
const struct dpkg_arch *dep_arch, *pkg_arch;
@@ -67,7 +68,7 @@ archsatisfied(struct pkgbin *it, struct deppossi *against)
against->up->type == dep_breaks))
return true;
- pkg_arch = it->arch;
+ pkg_arch = it_arch;
if (dep_arch->type == arch_none || dep_arch->type == arch_all)
dep_arch = dpkg_arch_get(arch_native);
if (pkg_arch->type == arch_none || pkg_arch->type == arch_all)
@@ -75,3 +76,9 @@ archsatisfied(struct pkgbin *it, struct deppossi *against)
return (dep_arch == pkg_arch);
}
+
+bool
+archsatisfied(struct pkgbin *it, struct deppossi *against)
+{
+ return deparchsatisfied(it, it->arch, against);
+}
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index 52c4fe2..ac37976 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -376,6 +376,8 @@ void varbufdependency(struct varbuf *vb, struct dependency
*dep);
/*** from depcon.c ***/
bool versionsatisfied(struct pkgbin *it, struct deppossi *against);
+bool deparchsatisfied(struct pkgbin *it, const struct dpkg_arch *arch,
+ struct deppossi *against);
bool archsatisfied(struct pkgbin *it, struct deppossi *against);
/*** from nfmalloc.c ***/
diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map
index ab23476..0123a40 100644
--- a/lib/dpkg/libdpkg.map
+++ b/lib/dpkg/libdpkg.map
@@ -274,6 +274,7 @@ LIBDPKG_PRIVATE {
pkg_db_iter_free;
# Dependency and Conflict functions
+ deparchsatisfied;
archsatisfied;
versionsatisfied;
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]