The following commit has been merged in the master branch:
commit 7ac9650539308e1f28465f024c5923ffbcd8b7dd
Author: Guillem Jover <guil...@debian.org>
Date:   Sat Feb 4 14:49:27 2012 +0100

    libdpkg: Change dpkg_arch_remove() to just unmark foreign architectures
    
    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.

diff --git a/lib/dpkg/arch.c b/lib/dpkg/arch.c
index 3860228..627b389 100644
--- a/lib/dpkg/arch.c
+++ b/lib/dpkg/arch.c
@@ -4,7 +4,7 @@
  *
  * Copyright © 2011 Linaro Limited
  * Copyright © 2011 Raphaël Hertzog <hert...@debian.org>
- * Copyright © 2011 Guillem Jover <guil...@debian.org>
+ * Copyright © 2011-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
@@ -242,19 +242,19 @@ dpkg_arch_add(const char *name)
 }
 
 /**
- * Remove a foreign dpkg_arch architecture.
+ * Unmark a foreign dpkg_arch architecture.
  */
 void
-dpkg_arch_remove(struct dpkg_arch *arch_remove)
+dpkg_arch_unmark(struct dpkg_arch *arch_remove)
 {
        struct dpkg_arch *arch;
 
-       for (arch = arch_builtin_tail; arch && arch->next; arch = arch->next) {
-               if (arch->next->type != arch_foreign)
+       for (arch = arch_builtin_tail->next; arch; arch = arch->next) {
+               if (arch->type != arch_foreign)
                        continue;
 
-               if (arch->next == arch_remove) {
-                       arch->next = arch->next->next;
+               if (arch == arch_remove) {
+                       arch->type = arch_unknown;
                        arch_list_dirty = true;
                }
        }
diff --git a/lib/dpkg/arch.h b/lib/dpkg/arch.h
index 23f532e..f0ede9e 100644
--- a/lib/dpkg/arch.h
+++ b/lib/dpkg/arch.h
@@ -4,7 +4,7 @@
  *
  * Copyright © 2011 Linaro Limited
  * Copyright © 2011 Raphaël Hertzog <hert...@debian.org>
- * Copyright © 2011 Guillem Jover <guil...@debian.org>
+ * Copyright © 2011-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
@@ -52,7 +52,7 @@ struct dpkg_arch *dpkg_arch_get_list(void);
 void dpkg_arch_reset_list(void);
 
 struct dpkg_arch *dpkg_arch_add(const char *name);
-void dpkg_arch_remove(struct dpkg_arch *arch);
+void dpkg_arch_unmark(struct dpkg_arch *arch);
 void dpkg_arch_load_list(void);
 void dpkg_arch_save_list(void);
 
diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map
index 0bdc9f3..d59c835 100644
--- a/lib/dpkg/libdpkg.map
+++ b/lib/dpkg/libdpkg.map
@@ -192,7 +192,7 @@ LIBDPKG_PRIVATE {
        dpkg_arch_get_list;
        dpkg_arch_reset_list;
        dpkg_arch_add;
-       dpkg_arch_remove;
+       dpkg_arch_unmark;
        dpkg_arch_load_list;
        dpkg_arch_save_list;
 
diff --git a/src/main.c b/src/main.c
index 4ed6ee1..fb47939 100644
--- a/src/main.c
+++ b/src/main.c
@@ -535,7 +535,7 @@ arch_remove(const char *const *argv)
   }
   pkg_db_iter_free(iter);
 
-  dpkg_arch_remove(arch);
+  dpkg_arch_unmark(arch);
   dpkg_arch_save_list();
 
   modstatdb_shutdown();

-- 
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

Reply via email to