fix: resurrect allfiles flag from rpm-2.5.x.
CVS patchset: 3312
CVS date: 1999/09/21 17:21:57
- fix: command line install had header memory leak.
- check for NULL on all memory allocations.
- free rpmrc mallocs on exit.
- - permit run time leak detection.
+ - glibc2: permit run time leak detection.
+ - fix: removed files fingerprint memory leak.
+ - fix: resurrect allfiles flag from rpm-2.5.x.
3.0.1 -> 3.0.2
- eliminate armv4 entries from rpmrc (Andrew E. Mileski).
if (lastDirAlloced < (length + 1)) {
lastDirAlloced = length + 100;
- lastDir = xrealloc(lastDir, lastDirAlloced);
+ lastDir = xrealloc(lastDir, lastDirAlloced); /* XXX memory leak */
}
strcpy(lastDir, buf);
rpmdep->orderAlloced = 5;
rpmdep->orderCount = 0;
- rpmdep->order = xcalloc(rpmdep->orderAlloced, sizeof(*rpmdep->order));
+ rpmdep->order = xcalloc(rpmdep->orderAlloced, sizeof(*rpmdep->order)); /* XXX memory leak */
return rpmdep;
}
qsort(orderList, rpmdep->addedPackages.size, sizeof(*orderList),
orderListIndexCmp);
- /* XXX memory leak */
- newOrder = xmalloc(sizeof(*newOrder) * rpmdep->orderCount);
+ newOrder = xmalloc(sizeof(*newOrder) * rpmdep->orderCount); /* XXX memory leak */
for (i = 0, newOrderCount = 0; i < orderingCount; i++) {
key.alIndex = ordering[i];
needle = bsearch(&key, orderList, rpmdep->addedPackages.size,
if (scareMemory)
fp.basename = chptr1;
else
- fp.basename = xstrdup(chptr1);
+ fp.basename = xstrdup(chptr1); /* XXX memory leak */
fp.ino = sb.st_ino;
fp.dev = sb.st_dev;
getmntinfo_r(&mounts, flags, &mntCount, &bufSize);
# endif
- filesystems = xcalloc((numAlloced + 1), sizeof(*filesystems));
+ filesystems = xcalloc((numAlloced + 1), sizeof(*filesystems)); /* XXX memory leak */
while (1) {
# if GETMNTENT_ONE
}
filesystems[num].dev = sb.st_dev;
- filesystems[num].mntPoint = xstrdup(mntdir);
+ filesystems[num].mntPoint = xstrdup(mntdir); /* XXX memory leak */
num++;
}
filesystems[num].dev = 0;
filesystems[num].mntPoint = NULL;
- fsnames = xcalloc((num + 1), sizeof(*fsnames));
+ fsnames = xcalloc((num + 1), sizeof(*fsnames)); /* XXX memory leak */
for (i = 0; i < num; i++)
fsnames[i] = filesystems[i].mntPoint;
fsnames[num] = NULL;
ptrEntry = *p = xmalloc(tableSize);
chptr = entry->data;
} else {
- ptrEntry = *p = xmalloc(tableSize + entry->length);
+ ptrEntry = *p = xmalloc(tableSize + entry->length); /* XXX memory leak */
chptr = ((char *) *p) + tableSize;
memcpy(chptr, entry->data, entry->length);
}
strcmp(thisUname, lastUname)) {
if (lastUnameAlloced < thisUnameLen + 1) {
lastUnameAlloced = thisUnameLen + 10;
- lastUname = xrealloc(lastUname, lastUnameAlloced);
+ lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
}
strcpy(lastUname, thisUname);
strcmp(thisGname, lastGname)) {
if (lastGnameAlloced < thisGnameLen + 1) {
lastGnameAlloced = thisGnameLen + 10;
- lastGname = xrealloc(lastGname, lastGnameAlloced);
+ lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
}
strcpy(lastGname, thisGname);
table->list = xrealloc(table->list, (table->count + 1)
* sizeof(*table->list));
else
- table->list = xmalloc(sizeof(*table->list));
+ table->list = xmalloc(sizeof(*table->list)); /* XXX memory leak */
- table->list[table->count].name = xstrdup(name);
+ table->list[table->count].name = xstrdup(name); /* XXX memory leak */
table->list[table->count++].score = distance;
}
}
{
rpmProblemSet probs;
- probs = xmalloc(sizeof(*probs));
+ probs = xmalloc(sizeof(*probs)); /* XXX memory leak */
probs->numProblems = probs->numProblemsAlloced = 0;
probs->probs = NULL;
static enum fileActions decideFileFate(const char * filespec, short dbMode,
const char * dbMd5, const char * dbLink, short newMode,
const char * newMd5, const char * newLink, int newFlags,
- int brokenMd5)
+ int brokenMd5, int transFlags)
{
char buffer[1024];
const char * dbAttr, * newAttr;
int save = (newFlags & RPMFILE_NOREPLACE) ? FA_ALTNAME : FA_SAVE;
if (lstat(filespec, &sb)) {
- /* the file doesn't exist on the disk create it unless the new
- package has marked it as missingok */
- if (newFlags & RPMFILE_MISSINGOK) {
+ /*
+ * The file doesn't exist on the disk. Create it unless the new
+ * package has marked it as missingok, or allfiles is requested.
+ */
+ if (!(transFlags & RPMTRANS_FLAG_ALLFILES) &&
+ (newFlags & RPMFILE_MISSINGOK)) {
rpmMessage(RPMMESS_DEBUG, _("%s skipped due to missingok flag\n"),
filespec);
return FA_SKIP;
possible in case something else (like the timestamp) has changed */
if (!strcmp(dbAttr, buffer)) {
- /* this config file has never been modified, so
- just replace it */
+ /* this config file has never been modified, so just replace it */
return FA_CREATE;
}
return FA_SKIP;
}
- /* the config file on the disk has been modified, but
- the ones in the two packages are different. It would
- be nice if RPM was smart enough to at least try and
- merge the difference ala CVS, but... */
-
+ /*
+ * The config file on the disk has been modified, but
+ * the ones in the two packages are different. It would
+ * be nice if RPM was smart enough to at least try and
+ * merge the difference ala CVS, but...
+ */
return save;
}
static int handleInstInstalledFiles(TFI_t * fi, rpmdb db,
struct sharedFileInfo * shared,
int sharedCount, int reportConflicts,
- rpmProblemSet probs)
+ rpmProblemSet probs, int transFlags)
{
Header h;
int i;
fi->fmd5s[fileNum],
fi->flinks[fileNum],
fi->fflags[fileNum],
- !headerIsEntry(h, RPMTAG_RPMVERSION));
+ !headerIsEntry(h, RPMTAG_RPMVERSION),
+ transFlags);
}
fi->replacedSizes[fileNum] = otherSizes[otherFileNum];
free(otherLinks);
headerFree(h);
- fi->replaced = xrealloc(fi->replaced,
+ fi->replaced = xrealloc(fi->replaced, /* XXX memory leak */
sizeof(*fi->replaced) * (numReplaced + 1));
fi->replaced[numReplaced].otherPkg = 0;
int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
void * notifyData, rpmProblemSet okProbs,
- rpmProblemSet * newProbs, int flags, int ignoreSet)
+ rpmProblemSet * newProbs, int transFlags, int ignoreSet)
{
int i, j;
int rc, ourrc = 0;
fi->replacedSizes = xcalloc(fi->fc, sizeof(*fi->replacedSizes));
/* Skip netshared paths, not our i18n files, and excluded docs */
- skipFiles(fi, flags & RPMTRANS_FLAG_NODOCS);
+ skipFiles(fi, transFlags & RPMTRANS_FLAG_NODOCS);
break;
}
case TR_ADDED:
handleInstInstalledFiles(fi, ts->db, shared, nexti - i,
!(beingRemoved || (ignoreSet & RPMPROB_FILTER_REPLACEOLDFILES)),
- probs);
+ probs, transFlags);
break;
case TR_REMOVED:
if (!beingRemoved)
free(fi->fps); fi->fps = NULL;
break;
case TR_REMOVED:
+ free(fi->fps); fi->fps = NULL;
break;
}
}
/* ===============================================
* If unfiltered problems exist, free memory and return.
*/
- if ((flags & RPMTRANS_FLAG_BUILD_PROBS) ||
+ if ((transFlags & RPMTRANS_FLAG_BUILD_PROBS) ||
(probs->numProblems && (!okProbs || psTrim(okProbs, probs)))) {
*newProbs = probs;
if (fd) {
if (installBinaryPackage(ts->root, ts->db, fd,
- hdrs[i], flags, notify,
+ hdrs[i], transFlags, notify,
notifyData, alp->key, fi->actions,
fi->fc ? fi->replaced : NULL,
ts->scriptFd)) {
if (ts->order[oc].u.removed.dependsOnIndex == lastFailed)
break;
if (removeBinaryPackage(ts->root, ts->db, fi->record,
- flags, fi->actions, ts->scriptFd))
+ transFlags, fi->actions, ts->scriptFd))
ourrc++;
break;
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-09-20 23:21-0400\n"
+"POT-Creation-Date: 1999-09-21 17:19-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "no packages given for uninstall"
msgstr ""
-#: ../rpm.c:1291
+#: ../rpm.c:1292
msgid "no packages given for install"
msgstr ""
-#: ../rpm.c:1314
+#: ../rpm.c:1315
msgid "extra arguments given for query of all packages"
msgstr ""
-#: ../rpm.c:1319
+#: ../rpm.c:1320
msgid "no arguments given for query"
msgstr ""
-#: ../rpm.c:1336
+#: ../rpm.c:1337
msgid "extra arguments given for verify of all packages"
msgstr ""
-#: ../rpm.c:1340
+#: ../rpm.c:1341
msgid "no arguments given for verify"
msgstr ""
msgid "package %s conflicts: %s\n"
msgstr ""
-#: ../lib/depends.c:977 ../lib/depends.c:1282
+#: ../lib/depends.c:977 ../lib/depends.c:1281
#, c-format
msgid "cannot read header at %d for dependency check"
msgstr ""
msgid "excluding %s\n"
msgstr ""
-#: ../lib/transaction.c:486
+#: ../lib/transaction.c:489
#, c-format
msgid "%s skipped due to missingok flag\n"
msgstr ""
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-09-04 10:55-0400\n"
+"POT-Creation-Date: 1999-09-21 14:38-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
alias.longName = longName, alias.shortName = shortName;
poptAddAlias(con, alias, 0);
} else if (!strcmp(entryType, "exec")) {
- con->execs = realloc(con->execs,
+ con->execs = realloc(con->execs, /* XXX memory leak */
sizeof(*con->execs) * (con->numExecs + 1));
if (longName)
con->execs[con->numExecs].longName = strdup(longName);
if (ignoreOs) probFilter |= RPMPROB_FILTER_IGNOREOS;
if (ignoreSize) probFilter |= RPMPROB_FILTER_DISKSPACE;
- if (allFiles) installFlags |= RPMTRANS_FLAG_ALLFILES;
- if (justdb) installFlags |= RPMTRANS_FLAG_JUSTDB;
if (test) installFlags |= RPMTRANS_FLAG_TEST;
+ /* RPMTRANS_FLAG_BUILD_PROBS */
if (noScripts) installFlags |= RPMTRANS_FLAG_NOSCRIPTS;
+ if (justdb) installFlags |= RPMTRANS_FLAG_JUSTDB;
if (noTriggers) installFlags |= RPMTRANS_FLAG_NOTRIGGERS;
-
- if (showPercents) interfaceFlags |= INSTALL_PERCENT;
- if (showHash) interfaceFlags |= INSTALL_HASH;
- if (noDeps) interfaceFlags |= INSTALL_NODEPS;
- if (noOrder) interfaceFlags |= INSTALL_NOORDER;
- if (upgrade) interfaceFlags |= INSTALL_UPGRADE;
-
if (!incldocs) {
if (excldocs)
installFlags |= RPMTRANS_FLAG_NODOCS;
else if (rpmExpandNumeric("%{_excludedocs}"))
installFlags |= RPMTRANS_FLAG_NODOCS;
}
+ if (allFiles) installFlags |= RPMTRANS_FLAG_ALLFILES;
+ /* RPMTRANS_FLAG_KEEPOBSOLETE */
+
+ if (showPercents) interfaceFlags |= INSTALL_PERCENT;
+ if (showHash) interfaceFlags |= INSTALL_HASH;
+ if (noDeps) interfaceFlags |= INSTALL_NODEPS;
+ if (noOrder) interfaceFlags |= INSTALL_NOORDER;
+ if (upgrade) interfaceFlags |= INSTALL_UPGRADE;
if (!poptPeekArg(optCon))
argerror(_("no packages given for install"));
Name: rpm
%define version 3.0.3
Version: %{version}
-Release: 0.29
+Release: 0.30
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
Copyright: GPL