The following commit has been merged in the master branch:
commit ab9482eb45e27a0b0c058a2662b28b7d3642173d
Author: Guillem Jover <[email protected]>
Date: Thu Mar 11 21:13:25 2010 +0100
libdpkg: Add a new updatesdir variable in dbmodify
Use it to initialize updatefnbuf, instead of constructing it from
admindir and UPDATESDIR.
diff --git a/lib/dpkg/dbmodify.c b/lib/dpkg/dbmodify.c
index 9c725ed..25860d6 100644
--- a/lib/dpkg/dbmodify.c
+++ b/lib/dpkg/dbmodify.c
@@ -49,6 +49,7 @@ static enum modstatdb_rw cstatus=-1, cflags=0;
static char *importanttmpfile=NULL;
static FILE *importanttmp;
static int nextupdate;
+static char *updatesdir;
static int updateslength;
static char *updatefnbuf, *updatefnrest;
static char *infodir;
@@ -132,6 +133,7 @@ static const struct fni {
} fnis[] = {
{ STATUSFILE, &statusfile },
{ AVAILFILE, &availablefile },
+ { UPDATESDIR, &updatesdir },
{ UPDATESDIR IMPORTANTTMP, &importanttmpfile },
{ INFODIR, &infodir },
{ NULL, NULL }
@@ -211,9 +213,8 @@ modstatdb_init(const char *admindir, enum modstatdb_rw
readwritereq)
internerr("unknown modstatdb_rw '%d'", readwritereq);
}
- updatefnbuf = m_malloc(strlen(admindir) + sizeof(UPDATESDIR) +
IMPORTANTMAXLEN + 5);
- strcpy(updatefnbuf, admindir);
- strcat(updatefnbuf,"/" UPDATESDIR);
+ updatefnbuf = m_malloc(strlen(updatesdir) + IMPORTANTMAXLEN + 5);
+ strcpy(updatefnbuf, updatesdir);
updatefnrest= updatefnbuf+strlen(updatefnbuf);
if (cstatus != msdbrw_needsuperuserlockonly) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]