The following commit has been merged in the master branch: commit 5eca0227ae5d148cc2cbfcbd3404b87c7ad62c52 Author: Guillem Jover <guil...@debian.org> Date: Wed Mar 21 04:30:10 2012 +0100
dpkg: Refactor code into new clear_deconfigure_queue() function diff --git a/src/archives.c b/src/archives.c index ab24c28..6687307 100644 --- a/src/archives.c +++ b/src/archives.c @@ -1206,6 +1206,18 @@ enqueue_deconfigure(struct pkginfo *pkg, struct pkginfo *pkg_removal) deconfigure = newdeconf; } +void +clear_deconfigure_queue(void) +{ + struct pkg_deconf_list *deconf, *deconf_next; + + for (deconf = deconfigure; deconf; deconf = deconf_next) { + deconf_next = deconf->next; + free(deconf); + } + deconfigure = NULL; +} + /** * Try if we can deconfigure the package and queue it if so. * diff --git a/src/archives.h b/src/archives.h index 574e57e..706eca9 100644 --- a/src/archives.h +++ b/src/archives.h @@ -45,6 +45,7 @@ extern struct varbuf fnametmpvb; extern struct varbuf fnamenewvb; extern struct pkg_deconf_list *deconfigure; +void clear_deconfigure_queue(void); void enqueue_deconfigure(struct pkginfo *pkg, struct pkginfo *pkg_removal); void enqueue_conflictor(struct pkginfo *pkg, struct pkginfo *pkg_fixbyrm); diff --git a/src/processarc.c b/src/processarc.c index 76b8417..317846f 100644 --- a/src/processarc.c +++ b/src/processarc.c @@ -440,7 +440,7 @@ void process_archive(const char *filename) { FILE *conff; struct filenamenode *namenode; struct stat stab, oldfs; - struct pkg_deconf_list *deconpil, *deconpiltemp; + struct pkg_deconf_list *deconpil; struct pkginfo *fixbytrigaw; cleanup_pkg_failed= cleanup_conflictor_failed= 0; @@ -517,13 +517,7 @@ void process_archive(const char *filename) { _("package architecture (%s) does not match system (%s)"), pkg->available.arch->name, dpkg_arch_get(arch_native)->name); - for (deconpil= deconfigure; - deconpil; - deconpil= deconpiltemp) { - deconpiltemp= deconpil->next; - free(deconpil); - } - deconfigure = NULL; + clear_deconfigure_queue(); clear_istobes(); if (!wanttoinstall(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