[Reproducible-commits] [dpkg] 25/63: dpkg: Switch tarcontext newfilesp member into a filenamenode_queue

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Mar 4 17:44:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/buildinfo
in repository dpkg.

commit 68a1aec292a37aae6ff552b51de75d02e00e4c91
Author: Guillem Jover <guillem at debian.org>
Date:   Fri Feb 19 01:33:23 2016 +0100

    dpkg: Switch tarcontext newfilesp member into a filenamenode_queue
---
 src/archives.c |  8 ++++----
 src/archives.h |  3 ++-
 src/unpack.c   | 20 ++++++++++----------
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/archives.c b/src/archives.c
index 8a0ef34..0434e36 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -604,8 +604,8 @@ struct fileinlist *addfiletolist(struct tarcontext *tc,
   nifd = tar_pool_alloc(sizeof(*nifd));
   nifd->namenode= namenode;
   nifd->next = NULL;
-  *tc->newfilesp = nifd;
-  tc->newfilesp = &nifd->next;
+  *tc->newfiles_queue->tail = nifd;
+  tc->newfiles_queue->tail = &nifd->next;
   return nifd;
 }
 
@@ -615,7 +615,7 @@ remove_file_from_list(struct tarcontext *tc, struct tar_entry *ti,
                       struct fileinlist *nifd)
 {
   tar_pool_free(nifd);
-  tc->newfilesp = oldnifd;
+  *tc->newfiles_queue->tail = *oldnifd;
   *oldnifd = NULL;
 }
 
@@ -693,7 +693,7 @@ tarobject(void *ctx, struct tar_entry *ti)
   /* Append to list of files.
    * The trailing ‘/’ put on the end of names in tarfiles has already
    * been stripped by tar_extractor(). */
-  oldnifd= tc->newfilesp;
+  oldnifd = tc->newfiles_queue->tail;
   nifd= addfiletolist(tc, findnamenode(ti->name, 0));
   nifd->namenode->flags |= fnnf_new_inarchive;
 
diff --git a/src/archives.h b/src/archives.h
index c7fff1a..819f2e9 100644
--- a/src/archives.h
+++ b/src/archives.h
@@ -29,7 +29,8 @@
 struct tarcontext {
   int backendpipe;
   struct pkginfo *pkg;
-  struct fileinlist **newfilesp;
+  /** A queue of filenamenode that have been extracted anew. */
+  struct filenamenode_queue *newfiles_queue;
   /** Are all “Multi-arch: same” instances about to be in sync? */
   bool pkgset_getting_in_sync;
 };
diff --git a/src/unpack.c b/src/unpack.c
index ba886a7..23e8e5c 100644
--- a/src/unpack.c
+++ b/src/unpack.c
@@ -524,9 +524,8 @@ void process_archive(const char *filename) {
   char *cidirrest;
   char *psize;
   const char *pfilename;
-  struct fileinlist *newfileslist;
   struct fileinlist *cfile;
-  struct filenamenode_queue newconffiles;
+  struct filenamenode_queue newconffiles, newfiles_queue;
   struct reversefilelistiter rlistit;
   struct conffile **iconffileslastp, *newiconff;
   struct dependency *dsearch, *newdeplist, **newdeplistlastp;
@@ -960,8 +959,9 @@ void process_archive(const char *filename) {
   close(p1[1]);
   p1[1] = -1;
 
-  newfileslist = NULL;
-  tc.newfilesp = &newfileslist;
+  newfiles_queue.head = NULL;
+  newfiles_queue.tail = &newfiles_queue.head;
+  tc.newfiles_queue = &newfiles_queue;
   push_cleanup(cu_fileslist, ~0, NULL, 0, 0);
   tc.pkg= pkg;
   tc.backendpipe= p1[0];
@@ -981,7 +981,7 @@ void process_archive(const char *filename) {
   p1[0] = -1;
   subproc_reap(pid, BACKEND " --fsys-tarfile", SUBPROC_NOPIPE);
 
-  tar_deferred_extract(newfileslist, pkg);
+  tar_deferred_extract(newfiles_queue.head, pkg);
 
   if (oldversionstatus == PKG_STAT_HALFINSTALLED ||
       oldversionstatus == PKG_STAT_UNPACKED) {
@@ -1079,7 +1079,7 @@ void process_archive(const char *filename) {
       debug(dbg_eachfile, "process_archive: checking %s for same files on "
 	    "upgrade/downgrade", fnamevb.buf);
 
-      for (cfile= newfileslist; cfile; cfile= cfile->next) {
+      for (cfile = newfiles_queue.head; cfile; cfile = cfile->next) {
 	/* If the file has been filtered then treat it as if it didn't exist
 	 * on the file system. */
 	if (cfile->namenode->flags & fnnf_filtered)
@@ -1158,7 +1158,7 @@ void process_archive(const char *filename) {
 
   /* OK, now we can write the updated files-in-this package list,
    * since we've done away (hopefully) with all the old junk. */
-  write_filelist_except(pkg, &pkg->available, newfileslist, 0);
+  write_filelist_except(pkg, &pkg->available, newfiles_queue.head, 0);
 
   /* Trigger interests may have changed.
    * Firstly we go through the old list of interests deleting them.
@@ -1178,7 +1178,7 @@ void process_archive(const char *filename) {
   pkg_infodb_update(pkg, cidir, cidirrest);
 
   /* We store now the checksums dynamically computed while unpacking. */
-  write_filehash_except(pkg, &pkg->available, newfileslist, 0);
+  write_filehash_except(pkg, &pkg->available, newfiles_queue.head, 0);
 
   /*
    * Update the status database.
@@ -1371,7 +1371,7 @@ void process_archive(const char *filename) {
    * had the version we overwrote. To prevent this we make
    * sure that we don't claim this package is OK until we
    * have claimed ‘ownership’ of all its files. */
-  for (cfile= newfileslist; cfile; cfile= cfile->next) {
+  for (cfile = newfiles_queue.head; cfile; cfile = cfile->next) {
     struct filepackages_iterator *iter;
     struct pkgset *divpkgset;
 
@@ -1444,7 +1444,7 @@ void process_archive(const char *filename) {
    * package as a conffile and don't appear at all in the new.
    * They stay recorded as obsolete conffiles and will eventually
    * (if not taken over by another package) be forgotten. */
-  for (cfile= newfileslist; cfile; cfile= cfile->next) {
+  for (cfile = newfiles_queue.head; cfile; cfile = cfile->next) {
     struct filenamenode *usenode;
 
     if (cfile->namenode->flags & fnnf_new_conff) continue;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list