The following commit has been merged in the master branch:
commit bc92c31742665972b0129da19ad4ea77a21fbbab
Author: Guillem Jover <[email protected]>
Date:   Thu Oct 25 01:08:41 2012 +0200

    libdpkg: Add new dpkg_arch_describe() function

diff --git a/lib/dpkg/arch.c b/lib/dpkg/arch.c
index d8d4312..4098661 100644
--- a/lib/dpkg/arch.c
+++ b/lib/dpkg/arch.c
@@ -227,6 +227,20 @@ varbuf_add_archqual(struct varbuf *vb, const struct 
dpkg_arch *arch)
 }
 
 /**
+ * Return a descriptive architecture name.
+ */
+const char *
+dpkg_arch_describe(const struct dpkg_arch *arch)
+{
+       if (arch->type == arch_none)
+               return C_("architecture", "<none>");
+       if (arch->type == arch_empty)
+               return C_("architecture", "<empty>");
+
+       return arch->name;
+}
+
+/**
  * Add a new foreign dpkg_arch architecture.
  */
 struct dpkg_arch *
diff --git a/lib/dpkg/arch.h b/lib/dpkg/arch.h
index d98b2fa..c686564 100644
--- a/lib/dpkg/arch.h
+++ b/lib/dpkg/arch.h
@@ -57,6 +57,8 @@ struct dpkg_arch *dpkg_arch_get(enum dpkg_arch_type type);
 struct dpkg_arch *dpkg_arch_get_list(void);
 void dpkg_arch_reset_list(void);
 
+const char *dpkg_arch_describe(const struct dpkg_arch *arch);
+
 struct dpkg_arch *dpkg_arch_add(const char *name);
 void dpkg_arch_unmark(struct dpkg_arch *arch);
 void dpkg_arch_load_list(void);
diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map
index a165978..d0c8ae4 100644
--- a/lib/dpkg/libdpkg.map
+++ b/lib/dpkg/libdpkg.map
@@ -195,6 +195,7 @@ LIBDPKG_PRIVATE {
 
        # Architecture database
        dpkg_arch_name_is_illegal;
+       dpkg_arch_describe;
        dpkg_arch_find;
        dpkg_arch_get;
        dpkg_arch_get_list;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to