Bladeren bron

dpkg: Add --assert-multi-arch option

This will allow us to query if the currently installed dpkg has
multi-arch support.
Guillem Jover 15 jaren geleden
bovenliggende
commit
0e71d79956
4 gewijzigde bestanden met toevoegingen van 15 en 1 verwijderingen
  1. 2 0
      debian/changelog
  2. 8 0
      src/enquiry.c
  3. 3 1
      src/main.c
  4. 2 0
      src/main.h

+ 2 - 0
debian/changelog

@@ -72,6 +72,8 @@ dpkg (1.16.2) UNRELEASED; urgency=low
   * Always ignore older versions when parsing the available file, not only
     for --update-avail and --merge-avail.
   * Mark not-installed non-arch-qualified selections for removal.
+  * Add new «dpkg --assert-multi-arch» command to allow checking for
+    multi-arch support availability.
 
   [ Raphaël Hertzog ]
   * Update Dpkg::Shlibs to look into multiarch paths when cross-building

+ 8 - 0
src/enquiry.c

@@ -377,6 +377,14 @@ assertmulticonrep(const char *const *argv)
                                 _("multiple Conflicts and Replaces"));
 }
 
+int
+assertmultiarch(const char *const *argv)
+{
+  struct versionrevision version = { 0, "1.16.2", NULL };
+
+  return assert_version_support(argv, &version, _("multi-arch"));
+}
+
 /**
  * Print a single package which:
  *  (a) is the target of one or more relevant predependencies.

+ 3 - 1
src/main.c

@@ -126,7 +126,8 @@ usage(const struct cmdinfo *ci, const char *value)
 
   printf(_(
 "For internal use: dpkg --assert-support-predepends | --predep-package |\n"
-"  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep.\n"
+"  --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep |\n"
+"  --assert-multi-arch.\n"
 "\n"));
 
   printf(_(
@@ -634,6 +635,7 @@ static const struct cmdinfo cmdinfos[]= {
   ACTION( "assert-working-epoch",            0,  act_assertepoch,          assertepoch     ),
   ACTION( "assert-long-filenames",           0,  act_assertlongfilenames,  assertlongfilenames ),
   ACTION( "assert-multi-conrep",             0,  act_assertmulticonrep,    assertmulticonrep ),
+  ACTION( "assert-multi-arch",               0,  act_assertmultiarch,      assertmultiarch ),
   ACTION( "add-architecture",                0,  act_arch_add,             arch_add        ),
   ACTION( "remove-architecture",             0,  act_arch_remove,          arch_remove     ),
   ACTION( "print-architecture",              0,  act_printarch,            printarch   ),

+ 2 - 0
src/main.h

@@ -88,6 +88,7 @@ enum action {
 	act_assertepoch,
 	act_assertlongfilenames,
 	act_assertmulticonrep,
+	act_assertmultiarch,
 
 	act_audit,
 	act_unpackchk,
@@ -169,6 +170,7 @@ int assertepoch(const char *const *argv);
 int assertpredep(const char *const *argv);
 int assertlongfilenames(const char *const *argv);
 int assertmulticonrep(const char *const *argv);
+int assertmultiarch(const char *const *argv);
 int predeppackage(const char *const *argv);
 int printarch(const char *const *argv);
 int printinstarch(const char *const *argv);