The following commit has been merged in the master branch:
commit 175aa99c46f11561bcc456efa88a1653d1270069
Author: Ian Jackson <[EMAIL PROTECTED]>
Date:   Thu Mar 20 07:04:22 2008 +0200

    Move duplicate pkgadminfile functions to lib/dbmodify.c

diff --git a/ChangeLog b/ChangeLog
index 51d972f..02345a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-20  Ian Jackson  <[EMAIL PROTECTED]>
+
+       * src/main.h (pkgadminfile): Move prototype to ...
+       * lib/dpkg-db.h: ... here.
+       * src/help.c (pkgadminfile): Move function definition to ...
+       * lib/dbmodify.c: ... here.
+       * src/query.c (pkgadminfile): Remove duplicated functions.
+
 2008-03-20  Ian Jackson  <[EMAIL PROTECTED]>,
             Guillem Jover  <[EMAIL PROTECTED]>
 
diff --git a/lib/dbmodify.c b/lib/dbmodify.c
index cfc95ca..ba85037 100644
--- a/lib/dbmodify.c
+++ b/lib/dbmodify.c
@@ -288,6 +288,18 @@ void modstatdb_note(struct pkginfo *pkg) {
   onerr_abort--;
 }
 
+const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile) {
+  static struct varbuf vb;
+  varbufreset(&vb);
+  varbufaddstr(&vb,admindir);
+  varbufaddstr(&vb,"/" INFODIR);
+  varbufaddstr(&vb,pkg->name);
+  varbufaddc(&vb,'.');
+  varbufaddstr(&vb,whichfile);
+  varbufaddc(&vb,0);
+  return vb.buf;
+}
+
 const char *log_file= NULL;
 
 void log_message(const char *fmt, ...) {
diff --git a/lib/dpkg-db.h b/lib/dpkg-db.h
index 9f8de44..c306f3b 100644
--- a/lib/dpkg-db.h
+++ b/lib/dpkg-db.h
@@ -175,6 +175,8 @@ void modstatdb_shutdown(void);
 
 extern char *statusfile, *availablefile; /* initialised by modstatdb_init */
 
+const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
+
 extern const char *log_file;
 void log_message(const char *fmt, ...) PRINTFFORMAT(1, 2);
 
diff --git a/src/help.c b/src/help.c
index 5103ecb..d7f2f04 100644
--- a/src/help.c
+++ b/src/help.c
@@ -144,18 +144,6 @@ int force_conflicts(struct deppossi *possi) {
   return fc_conflicts;
 }
 
-const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile) {
-  static struct varbuf vb;
-  varbufreset(&vb);
-  varbufaddstr(&vb,admindir);
-  varbufaddstr(&vb,"/" INFODIR);
-  varbufaddstr(&vb,pkg->name);
-  varbufaddc(&vb,'.');
-  varbufaddstr(&vb,whichfile);
-  varbufaddc(&vb,0);
-  return vb.buf;
-}
-
 static const char* preexecscript(const char *path, char *const *argv) {
   /* returns the path to the script inside the chroot
    * none of the stuff here will work if admindir isn't inside instdir
diff --git a/src/main.h b/src/main.h
index 59cc9f8..a490e8d 100644
--- a/src/main.h
+++ b/src/main.h
@@ -182,7 +182,6 @@ int force_conff_new(struct deppossi *possi);
 int force_conff_miss(struct deppossi *possi);
 int force_conflicts(struct deppossi *possi);
 void ensure_package_clientdata(struct pkginfo *pkg);
-const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
 void oldconffsetflags(const struct conffile *searchconff);
 void ensure_pathname_nonexisting(const char *pathname);
 int chmodsafe_unlink(const char *pathname, const char **failed);
diff --git a/src/query.c b/src/query.c
index 91b9111..c50ddde 100644
--- a/src/query.c
+++ b/src/query.c
@@ -54,18 +54,6 @@ void ensure_package_clientdata(struct pkginfo *pkg) {
   pkg->clientdata->files= 0;
 }
 
-const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile) {
-  static struct varbuf vb;
-  varbufreset(&vb);
-  varbufaddstr(&vb,admindir);
-  varbufaddstr(&vb,"/" INFODIR);
-  varbufaddstr(&vb,pkg->name);
-  varbufaddc(&vb,'.');
-  varbufaddstr(&vb,whichfile);
-  varbufaddc(&vb,0);
-  return vb.buf;
-}
-
 int pkglistqsortcmp(const void *a, const void *b) {
   const struct pkginfo *pa= *(const struct pkginfo**)a;
   const struct pkginfo *pb= *(const struct pkginfo**)b;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to