Procházet zdrojové kódy

dpkg: Rename filenamenode_queu_push() to tar_filenamenode_queue_push()

Make the function less general, as we are using an extraction specific
obstack.
Guillem Jover před 10 roky
rodič
revize
e37401bdf5
4 změnil soubory, kde provedl 22 přidání a 23 odebrání
  1. 16 16
      src/archives.c
  2. 4 0
      src/archives.h
  3. 0 5
      src/main.h
  4. 2 2
      src/unpack.c

+ 16 - 16
src/archives.c

@@ -113,6 +113,22 @@ tar_pool_release(void)
   }
 }
 
+struct fileinlist *
+tar_filenamenode_queue_push(struct filenamenode_queue *queue,
+                            struct filenamenode *namenode)
+{
+  struct fileinlist *node;
+
+  node = tar_pool_alloc(sizeof(*node));
+  node->namenode = namenode;
+  node->next = NULL;
+
+  *queue->tail = node;
+  queue->tail = &node->next;
+
+  return node;
+}
+
 /**
  * Check if a file or directory will save a package from disappearance.
  *
@@ -1648,19 +1664,3 @@ wanttoinstall(struct pkginfo *pkg)
     }
   }
 }
-
-struct fileinlist *
-filenamenode_queue_push(struct filenamenode_queue *queue,
-                        struct filenamenode *namenode)
-{
-  struct fileinlist *node;
-
-  node = tar_pool_alloc(sizeof(*node));
-  node->next = NULL;
-  node->namenode = namenode;
-
-  *queue->tail = node;
-  queue->tail = &node->next;
-
-  return node;
-}

+ 4 - 0
src/archives.h

@@ -73,6 +73,10 @@ int tarobject(void *ctx, struct tar_entry *ti);
 int tarfileread(void *ud, char *buf, int len);
 void tar_deferred_extract(struct fileinlist *files, struct pkginfo *pkg);
 
+struct fileinlist *
+tar_filenamenode_queue_push(struct filenamenode_queue *queue,
+                            struct filenamenode *namenode);
+
 bool filesavespackage(struct fileinlist *, struct pkginfo *,
                       struct pkginfo *pkgbeinginstalled);
 

+ 0 - 5
src/main.h

@@ -27,7 +27,6 @@
 
 /* These two are defined in filesdb.h. */
 struct fileinlist;
-struct filenamenode_queue;
 struct filenamenode;
 
 enum pkg_istobe {
@@ -163,10 +162,6 @@ int archivefiles(const char *const *argv);
 void process_archive(const char *filename);
 bool wanttoinstall(struct pkginfo *pkg);
 
-struct fileinlist *
-filenamenode_queue_push(struct filenamenode_queue *queue,
-                        struct filenamenode *namenode);
-
 /* from update.c */
 
 int forgetold(const char *const *argv);

+ 2 - 2
src/unpack.c

@@ -237,7 +237,7 @@ deb_parse_conffiles(struct pkginfo *pkg, const char *control_conffiles,
 
     namenode = findnamenode(conffilenamebuf, 0);
     namenode->oldhash = NEWCONFFILEFLAG;
-    newconff = filenamenode_queue_push(newconffiles, namenode);
+    newconff = tar_filenamenode_queue_push(newconffiles, namenode);
 
     /*
      * Let's see if any packages have this file.
@@ -1137,7 +1137,7 @@ void process_archive(const char *filename) {
 	  debug(dbg_eachfile, "process_archive: old conff %s"
 		" is disappearing", namenode->name);
 	  namenode->flags |= fnnf_obs_conff;
-	  filenamenode_queue_push(&newconffiles, namenode);
+	  tar_filenamenode_queue_push(&newconffiles, namenode);
 	  addfiletolist(&tc, namenode);
 	}
 	continue;