Просмотр исходного кода

dpkg: Use blankpackageperfile instead of manually blanking the members

Guillem Jover лет назад: 18
Родитель
Сommit
d1826b026a
4 измененных файлов с 9 добавлено и 18 удалено
  1. 6 0
      ChangeLog
  2. 0 1
      TODO
  3. 2 9
      src/processarc.c
  4. 1 8
      src/remove.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-08-03  Guillem Jover  <guillem@debian.org>
+
+	* src/processarc.c (process_archive): Use blankpackageperfile instead
+	of manually blanking the members.
+	* src/remove.c (removal_bulk): Likewise.
+
 2008-08-03  Guillem Jover  <guillem@debian.org>
 
 	* utils/start-stop-daemon.c (pid_is_running) [!OSHURD]: Reimplement

+ 0 - 1
TODO

@@ -27,7 +27,6 @@ lenny
 ------
 
  * Code cleanup:
-   - Refactor blankfoo embedded code.
    - Get rid of static variables inside functions.
    - Coalesce admindir / infodir / foodir generation.
    - Get rid of setjmp (at least in the general case, keep for dpkg itself?)

+ 2 - 9
src/processarc.c

@@ -1071,15 +1071,8 @@ void process_archive(const char *filename) {
     otherpkg->want= want_purge;
     otherpkg->eflag= eflagv_ok;
 
-    otherpkg->installed.depends = NULL;
-    otherpkg->installed.essential= 0;
-    otherpkg->installed.description = otherpkg->installed.maintainer = NULL;
-    otherpkg->installed.installedsize = otherpkg->installed.source = NULL;
-    otherpkg->installed.origin = otherpkg->installed.bugs = NULL;
-    otherpkg->installed.architecture = NULL;
-    otherpkg->installed.conffiles = NULL;
-    blankversion(&otherpkg->installed.version);
-    otherpkg->installed.arbs = NULL;
+    blankpackageperfile(&otherpkg->installed);
+
     otherpkg->clientdata->fileslistvalid= 0;
 
     modstatdb_note(otherpkg);

+ 1 - 8
src/remove.c

@@ -601,14 +601,7 @@ void removal_bulk(struct pkginfo *pkg) {
     /* This will mess up reverse links, but if we follow them
      * we won't go back because pkg->status is stat_notinstalled.
      */
-    pkg->installed.depends = NULL;
-    pkg->installed.essential= 0;
-    pkg->installed.description = pkg->installed.maintainer = NULL;
-    pkg->installed.source = pkg->installed.installedsize = NULL;
-    pkg->installed.origin = pkg->installed.bugs = NULL;
-    pkg->installed.architecture = NULL;
-    blankversion(&pkg->installed.version);
-    pkg->installed.arbs = NULL;
+    blankpackageperfile(&pkg->installed);
   }
       
   pkg->eflag= eflagv_ok;