check for NULL on all memory allocations.
free rpmrc mallocs on exit.
permit run time leak detection.
CVS patchset: 3311
CVS date: 1999/09/21 03:22:53
- do versioned provides/conflicts resolution correctly.
- rpmpopt: display versioned provides/obsoletes.
- revert to shared libbz2.so now that bzip2 is in base install.
+ - 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.
3.0.1 -> 3.0.2
- eliminate armv4 entries from rpmrc (Andrew E. Mileski).
#include "system.h"
-#include "build/rpmbuild.h"
-#include "popt/popt.h"
+#include "rpmbuild.h"
#include "build.h"
#include "install.h"
fprintf(stderr, _("buildroot already specified"));
exit(EXIT_FAILURE);
}
- data->buildRootOverride = strdup(arg);
+ data->buildRootOverride = xstrdup(arg);
break;
case POPT_BUILDARCH:
fprintf(stderr, _("--buildarch has been obsoleted. Use the --target option instead.\n"));
case POPT_TARGETPLATFORM:
if (data->targets) {
int len = strlen(data->targets) + strlen(arg) + 2;
- data->targets = realloc(data->targets, len);
+ data->targets = xrealloc(data->targets, len);
strcat(data->targets, ",");
} else {
- data->targets = malloc(strlen(arg) + 1);
+ data->targets = xmalloc(strlen(arg) + 1);
data->targets[0] = '\0';
}
strcat(data->targets, arg);
{
Value v;
- v = (Value) malloc(sizeof(struct _value));
+ v = (Value) xmalloc(sizeof(struct _value));
v->type = VALUE_TYPE_INTEGER;
v->data.i = i;
return v;
{
Value v;
- v = (Value) malloc(sizeof(struct _value));
+ v = (Value) xmalloc(sizeof(struct _value));
v->type = VALUE_TYPE_STRING;
- v->data.s = strdup(s);
+ v->data.s = xstrdup(s);
return v;
}
return NULL;
}
- copy = malloc(strlen(v1->data.s) + strlen(v2->data.s) + 1);
+ copy = xmalloc(strlen(v1->data.s) + strlen(v2->data.s) + 1);
strcpy(copy, v1->data.s);
strcat(copy, v2->data.s);
DEBUG(printf("parseExprBoolean(?, '%s')\n", expr));
/* Initialize the expression parser state. */
- state.str = state.p = strdup(expr);
+ state.str = state.p = xstrdup(expr);
state.spec = spec;
rdToken(&state);
DEBUG(printf("parseExprString(?, '%s')\n", expr));
/* Initialize the expression parser state. */
- state.str = state.p = strdup(expr);
+ state.str = state.p = xstrdup(expr);
state.spec = spec;
rdToken(&state);
case VALUE_TYPE_INTEGER: {
char buf[128];
sprintf(buf, "%d", v->data.i);
- result = strdup(buf);
+ result = xstrdup(buf);
} break;
case VALUE_TYPE_STRING:
- result = strdup(v->data.s);
+ result = xstrdup(v->data.s);
break;
default:
break;
freeAttrRec(nar);
*nar = *oar; /* structure assignment */
if (nar->ar_fmodestr)
- nar->ar_fmodestr = strdup(nar->ar_fmodestr);
+ nar->ar_fmodestr = xstrdup(nar->ar_fmodestr);
if (nar->ar_dmodestr)
- nar->ar_dmodestr = strdup(nar->ar_dmodestr);
+ nar->ar_dmodestr = xstrdup(nar->ar_dmodestr);
if (nar->ar_user)
- nar->ar_user = strdup(nar->ar_user);
+ nar->ar_user = xstrdup(nar->ar_user);
if (nar->ar_group)
- nar->ar_group = strdup(nar->ar_group);
+ nar->ar_group = xstrdup(nar->ar_group);
}
#if 0
/* Add new locale */
fl->currentLangs = (const char **) ((fl->currentLangs == NULL)
- ? malloc(sizeof(*fl->currentLangs))
- : realloc(fl->currentLangs,(fl->nLangs+1)*sizeof(*fl->currentLangs)));
- newp = malloc( np+1 );
+ ? xmalloc(sizeof(*fl->currentLangs))
+ : xrealloc(fl->currentLangs,((fl->nLangs+1)*sizeof(*fl->currentLangs))));
+ newp = xmalloc( np+1 );
strncpy(newp, p, np);
newp[np] = '\0';
fl->currentLangs[fl->nLangs++] = newp;
fl->processingFailed = 1;
res = 1;
}
- fl->docDirs[fl->docDirCount++] = strdup(s);
+ fl->docDirs[fl->docDirCount++] = xstrdup(s);
if (strtokWithQuotes(NULL, " \t\n")) {
rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir"));
fl->processingFailed = 1;
}
*cpioCount = 0;
- clp = *cpioList = malloc(sizeof(**cpioList) * fl->fileListRecsUsed);
+ clp = *cpioList = xmalloc(sizeof(**cpioList) * fl->fileListRecsUsed);
for (flp = fl->fileList, count = fl->fileListRecsUsed; count > 0; flp++, count--) {
if ((count > 1) && !strcmp(flp->fileName, flp[1].fileName)) {
/* Make the cpio list */
if (! (flp->flags & RPMFILE_GHOST)) {
- clp->fsPath = strdup(flp->diskName);
- clp->archivePath = strdup(flp->fileName + skipLen);
+ clp->fsPath = xstrdup(flp->diskName);
+ clp->archivePath = xstrdup(flp->fileName + skipLen);
clp->finalMode = flp->fl_mode;
clp->finalUid = flp->fl_uid;
clp->finalGid = flp->fl_gid;
/* Add to the file list */
if (fl->fileListRecsUsed == fl->fileListRecsAlloced) {
fl->fileListRecsAlloced += 128;
- fl->fileList = realloc(fl->fileList,
+ fl->fileList = xrealloc(fl->fileList,
fl->fileListRecsAlloced * sizeof(*(fl->fileList)));
}
flp->fl_uid = fileUid;
flp->fl_gid = fileGid;
- flp->fileName = strdup(fileName);
- flp->diskName = strdup(diskName);
+ flp->fileName = xstrdup(fileName);
+ flp->diskName = xstrdup(diskName);
flp->uname = fileUname;
flp->gname = fileGname;
for (i = 0; i < fl->nLangs; i++)
nl += strlen(fl->currentLangs[i]) + 1;
- flp->langs = ncl = malloc(nl);
+ flp->langs = ncl = xmalloc(nl);
for (i = 0; i < fl->nLangs; i++) {
const char *ocl;
if (i) *ncl++ = '|';
*ncl = '\0';
}
} else if (! parseForRegexLang(fileName, &lang)) {
- flp->langs = strdup(lang);
+ flp->langs = xstrdup(lang);
} else {
- flp->langs = strdup("");
+ flp->langs = xstrdup("");
}
flp->flags = fl->currentFlags;
if (headerGetEntry(pkg->header, RPMTAG_DEFAULTPREFIX,
NULL, (void **)&fl.prefix, NULL)) {
- fl.prefix = strdup(fl.prefix);
+ fl.prefix = xstrdup(fl.prefix);
} else {
fl.prefix = NULL;
}
fl.defVerifyFlags = RPMVERIFY_ALL;
fl.docDirCount = 0;
- fl.docDirs[fl.docDirCount++] = strdup("/usr/doc");
- fl.docDirs[fl.docDirCount++] = strdup("/usr/man");
- fl.docDirs[fl.docDirCount++] = strdup("/usr/info");
- fl.docDirs[fl.docDirCount++] = strdup("/usr/X11R6/man");
+ fl.docDirs[fl.docDirCount++] = xstrdup("/usr/doc");
+ fl.docDirs[fl.docDirCount++] = xstrdup("/usr/man");
+ fl.docDirs[fl.docDirCount++] = xstrdup("/usr/info");
+ fl.docDirs[fl.docDirCount++] = xstrdup("/usr/X11R6/man");
fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_docdir}", NULL);
fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_mandir}", NULL);
fl.docDirs[fl.docDirCount++] = rpmGetPath("%{_infodir}", NULL);
if (fl.isSpecialDoc) {
/* Save this stuff for last */
FREE(specialDoc);
- specialDoc = strdup(fileName);
+ specialDoc = xstrdup(fileName);
dupAttrRec(&fl.cur_ar, &specialDocAttrRec);
} else {
processBinaryFile(pkg, &fl, fileName);
spec->sourceCpioList = NULL;
spec->sourceCpioCount = 0;
- fl.fileList = malloc((spec->numSources + 1) * sizeof(FileListRec));
+ fl.fileList = xmalloc((spec->numSources + 1) * sizeof(FileListRec));
fl.processingFailed = 0;
fl.fileListRecsUsed = 0;
fl.totalFileSize = 0;
flp->flags |= RPMFILE_GHOST;
s++;
}
- flp->diskName = strdup(s);
+ flp->diskName = xstrdup(s);
fn = strrchr(s, '/');
if (fn) {
fn++;
} else {
fn = s;
}
- flp->fileName = strdup(fn);
+ flp->fileName = xstrdup(fn);
flp->verifyFlags = RPMVERIFY_ALL;
stat(s, &flp->fl_st);
flp->uname = getUname(flp->fl_uid);
flp->gname = getGname(flp->fl_gid);
- flp->langs = strdup("");
+ flp->langs = xstrdup("");
fl.totalFileSize += flp->fl_size;
uids[x] = uid;
uid_used++;
if (pw) {
- unames[x] = strdup(pw->pw_name);
+ unames[x] = xstrdup(pw->pw_name);
} else {
unames[x] = NULL;
}
uid_used++;
if (pw) {
uids[x] = pw->pw_uid;
- unames[x] = strdup(pw->pw_name);
+ unames[x] = xstrdup(pw->pw_name);
} else {
uids[x] = -1;
- unames[x] = strdup(uname);
+ unames[x] = xstrdup(uname);
}
return unames[x];
}
gids[x] = gid;
gid_used++;
if (gr) {
- gnames[x] = strdup(gr->gr_name);
+ gnames[x] = xstrdup(gr->gr_name);
} else {
gnames[x] = NULL;
}
gid_used++;
if (gr) {
gids[x] = gr->gr_gid;
- gnames[x] = strdup(gr->gr_name);
+ gnames[x] = xstrdup(gr->gr_name);
} else {
gids[x] = -1;
- gnames[x] = strdup(gname);
+ gnames[x] = xstrdup(gname);
}
return gnames[x];
}
headerNVR(spec->packages->header, &name, &version, &release);
sprintf(fileName, "%s-%s-%s.%ssrc.rpm", name, version, release,
spec->noSource ? "no" : "");
- spec->sourceRpmName = strdup(fileName);
+ spec->sourceRpmName = xstrdup(fileName);
}
return 0;
/* Create and add the cookie */
if (cookie) {
sprintf(buf, "%s %d", buildHost(), (int) time(NULL));
- *cookie = strdup(buf);
+ *cookie = xstrdup(buf);
headerAddEntry(h, RPMTAG_COOKIE, RPM_STRING_TYPE, *cookie, 1);
}
}
if (file) {
- pkg->fileFile = strdup(file);
+ pkg->fileFile = xstrdup(file);
}
pkg->fileList = newStringBuf();
goto exit;
}
- icon = malloc(statbuf.st_size);
+ icon = xmalloc(statbuf.st_size);
*icon = '\0';
fd = fdOpen(fn, O_RDONLY, 0);
nb = fdRead(fd, icon, statbuf.st_size);
if (st) {
if (st->st_ntags == st->st_nalloc) {
st->st_nalloc += 10;
- st->st_t = realloc(st->st_t, st->st_nalloc * sizeof(*(st->st_t)));
+ st->st_t = xrealloc(st->st_t, st->st_nalloc * sizeof(*(st->st_t)));
}
t = st->st_t + st->st_ntags++;
t->t_tag = tag;
t->t_startx = spec->lineNum - 1;
t->t_nlines = 1;
- t->t_lang = strdup(lang);
+ t->t_lang = xstrdup(lang);
t->t_msgid = NULL;
if (!(t->t_lang && strcmp(t->t_lang, RPMBUILD_DEFAULT_LANG))) {
char *n;
if (headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &n, NULL)) {
char buf[1024];
sprintf(buf, "%s(%s)", n, tagName(tag));
- t->t_msgid = strdup(buf);
+ t->t_msgid = xstrdup(buf);
}
}
}
if (spec->buildRoot == NULL) {
const char *buildroot = rpmGetPath("%{buildroot}", NULL);
if (buildroot && *buildroot != '%') {
- spec->buildRoot = strdup(cleanFileName(buildroot));
+ spec->buildRoot = xstrdup(cleanFileName(buildroot));
macro = NULL;
} else {
- spec->buildRoot = strdup(cleanFileName(field));
+ spec->buildRoot = xstrdup(cleanFileName(field));
}
xfree(buildroot);
} else {
}
if (dirName) {
- spec->buildSubdir = strdup(dirName);
+ spec->buildSubdir = xstrdup(dirName);
} else {
headerGetEntry(spec->packages->header, RPMTAG_VERSION, NULL,
(void **) &version, NULL);
headerGetEntry(spec->packages->header, RPMTAG_NAME, NULL,
(void **) &name, NULL);
sprintf(buf, "%s-%s", name, version);
- spec->buildSubdir = strdup(buf);
+ spec->buildSubdir = xstrdup(buf);
}
free(argv);
re = r;
SKIPNONWHITE(re);
- req = malloc((re-r) + 1);
+ req = xmalloc((re-r) + 1);
strncpy(req, r, (re-r));
req[re-r] = '\0';
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
- version = malloc((ve-v) + 1);
+ version = xmalloc((ve-v) + 1);
strncpy(version, v, (ve-v));
version[ve-v] = '\0';
re = ve; /* ==> next token after version string starts here */
index = last->index + 1;
}
- new = malloc(sizeof(*new));
+ new = xmalloc(sizeof(*new));
- new->fileName = (file) ? strdup(file) : NULL;
- new->script = (*script) ? strdup(script) : NULL;
- new->prog = strdup(prog);
+ new->fileName = (file) ? xstrdup(file) : NULL;
+ new->script = (*script) ? xstrdup(script) : NULL;
+ new->prog = xstrdup(prog);
new->index = index;
new->next = NULL;
if (file) {
switch (parsePart) {
case PART_PRE:
- pkg->preInFile = strdup(file);
+ pkg->preInFile = xstrdup(file);
break;
case PART_POST:
- pkg->postInFile = strdup(file);
+ pkg->postInFile = xstrdup(file);
break;
case PART_PREUN:
- pkg->preUnFile = strdup(file);
+ pkg->preUnFile = xstrdup(file);
break;
case PART_POSTUN:
- pkg->postUnFile = strdup(file);
+ pkg->postUnFile = xstrdup(file);
break;
case PART_VERIFYSCRIPT:
- pkg->verifyFile = strdup(file);
+ pkg->verifyFile = xstrdup(file);
break;
}
}
OFI_t * ofi;
ofi = newOpenFileInfo();
- ofi->fileName = strdup(fileName);
+ ofi->fileName = xstrdup(fileName);
ofi->next = spec->fileStack;
spec->fileStack = ofi;
}
struct speclines *sl = spec->sl;
if (sl->sl_nlines == sl->sl_nalloc) {
sl->sl_nalloc += 100;
- sl->sl_lines = (char **)realloc(sl->sl_lines,
+ sl->sl_lines = (char **) xrealloc(sl->sl_lines,
sl->sl_nalloc * sizeof(*(sl->sl_lines)));
}
- sl->sl_lines[sl->sl_nlines++] = strdup(ofi->readBuf);
+ sl->sl_lines[sl->sl_nlines++] = xstrdup(ofi->readBuf);
}
}
}
if (match != -1) {
- rl = malloc(sizeof(struct ReadLevelEntry));
+ rl = xmalloc(sizeof(struct ReadLevelEntry));
rl->reading = spec->readStack->reading && match;
rl->next = spec->readStack;
spec->readStack = rl;
spec = newSpec();
spec->fileStack = newOpenFileInfo();
- spec->fileStack->fileName = strdup(specFile);
+ spec->fileStack->fileName = xstrdup(specFile);
- spec->specFile = strdup(specFile);
+ spec->specFile = xstrdup(specFile);
if (buildRoot) {
spec->gotBuildRoot = 1;
- spec->buildRoot = strdup(buildRoot);
+ spec->buildRoot = xstrdup(buildRoot);
addMacro(spec->macros, "buildroot", NULL, buildRoot, RMIL_SPEC);
}
addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC);
spec->force = force;
if (passPhrase) {
- spec->passPhrase = strdup(passPhrase);
+ spec->passPhrase = xstrdup(passPhrase);
}
if (cookie) {
- spec->cookie = strdup(cookie);
+ spec->cookie = xstrdup(cookie);
}
{ const char *timecheck = rpmExpand("%{_timecheck}", NULL);
if (parsePart == PART_BUILDARCHITECTURES) {
spec->buildArchitectureSpecs =
- malloc(sizeof(Spec) * spec->buildArchitectureCount);
+ xmalloc(sizeof(Spec) * spec->buildArchitectureCount);
index = 0;
for (x = 0; x < spec->buildArchitectureCount; x++) {
if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
spec->buildArchitectures[x])) {
rpmGetMachine(&saveArch, NULL);
- saveArch = strdup(saveArch);
+ saveArch = xstrdup(saveArch);
rpmSetMachine(spec->buildArchitectures[x], NULL);
if (parseSpec(&(spec->buildArchitectureSpecs[index]),
specFile, buildRoot, 1,
* XXX A copy of this string is embedded in headers.
*/
if (!strcmp(os, "linux")) {
- os = myos = strdup(os);
+ os = myos = xstrdup(os);
*os = 'L';
}
Package p;
Package pp;
- p = malloc(sizeof(*p));
+ p = xmalloc(sizeof(*p));
p->header = headerNew();
p->icon = NULL;
}
/* Create the entry and link it in */
- p = malloc(sizeof(struct Source));
+ p = xmalloc(sizeof(struct Source));
p->num = num;
- p->fullSource = strdup(field);
+ p->fullSource = xstrdup(field);
p->source = strrchr(p->fullSource, '/');
p->flags = flag;
if (p->source) {
struct speclines *sl;
if (specedit == NULL)
return NULL;
- sl = malloc(sizeof(struct speclines));
+ sl = xmalloc(sizeof(struct speclines));
sl->sl_lines = NULL;
sl->sl_nalloc = 0;
sl->sl_nlines = 0;
struct spectags *st;
if (specedit == NULL)
return NULL;
- st = malloc(sizeof(struct spectags));
+ st = xmalloc(sizeof(struct spectags));
st->st_t = NULL;
st->st_nalloc = 0;
st->st_ntags = 0;
{
Spec spec;
- spec = (Spec)malloc(sizeof *spec);
+ spec = (Spec)xmalloc(sizeof *spec);
spec->specFile = NULL;
spec->sourceRpmName = NULL;
spec->nextline = NULL;
spec->nextpeekc = '\0';
spec->lineNum = 0;
- spec->readStack = malloc(sizeof(struct ReadLevelEntry));
+ spec->readStack = xmalloc(sizeof(struct ReadLevelEntry));
spec->readStack->next = NULL;
spec->readStack->reading = 1;
{
struct OpenFileInfo *ofi;
- ofi = malloc(sizeof(struct OpenFileInfo));
+ ofi = xmalloc(sizeof(struct OpenFileInfo));
ofi->file = NULL;
ofi->fileName = NULL;
ofi->lineNum = 0;
AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/vmount.h)
AC_CHECK_HEADERS(bzlib.h libio.h zlib.h)
-AC_CHECK_HEADERS(mcheck.h)
+AC_CHECK_HEADERS(err.h mcheck.h)
dnl whether or not we should try build rpmconvert, which is used to convert
dnl rpm databases from rpm 1.x to rpm 2.x or later. It requires the gdbm
if (package.fileCount) {
/* some packages have no file lists */
- fileList = malloc(sizeof(char *) * package.fileCount);
- fileLinktoList = malloc(sizeof(char *) * package.fileCount);
- fileMD5List = malloc(sizeof(char *) * package.fileCount);
- fileSizeList = malloc(sizeof(int_32) * package.fileCount);
- fileUIDList = malloc(sizeof(int_32) * package.fileCount);
- fileGIDList = malloc(sizeof(int_32) * package.fileCount);
- fileMtimesList = malloc(sizeof(int_32) * package.fileCount);
- fileFlagsList = malloc(sizeof(int_32) * package.fileCount);
- fileModesList = malloc(sizeof(int_16) * package.fileCount);
- fileRDevsList = malloc(sizeof(int_16) * package.fileCount);
- fileStatesList = malloc(sizeof(char) * package.fileCount);
+ fileList = xmalloc(sizeof(char *) * package.fileCount);
+ fileLinktoList = xmalloc(sizeof(char *) * package.fileCount);
+ fileMD5List = xmalloc(sizeof(char *) * package.fileCount);
+ fileSizeList = xmalloc(sizeof(int_32) * package.fileCount);
+ fileUIDList = xmalloc(sizeof(int_32) * package.fileCount);
+ fileGIDList = xmalloc(sizeof(int_32) * package.fileCount);
+ fileMtimesList = xmalloc(sizeof(int_32) * package.fileCount);
+ fileFlagsList = xmalloc(sizeof(int_32) * package.fileCount);
+ fileModesList = xmalloc(sizeof(int_16) * package.fileCount);
+ fileRDevsList = xmalloc(sizeof(int_16) * package.fileCount);
+ fileStatesList = xmalloc(sizeof(char) * package.fileCount);
/* reverse the file list while we're at it */
j = package.fileCount - 1;
lookup.c macro.c md5.c md5sum.c \
messages.c misc.c oldheader.c package.c problems.c query.c \
rebuilddb.c rpmbzio.c rpmchecksig.c rpmdb.c rpmerr.c rpminstall.c \
- rpmio.c rpmlead.c rpmrc.c signature.c stringbuf.c tagName.c tagtable.c \
- transaction.c tread.c uninstall.c url.c verify.c
+ rpmio.c rpmlead.c rpmmalloc.c rpmrc.c signature.c stringbuf.c \
+ tagName.c tagtable.c transaction.c tread.c uninstall.c url.c verify.c
tagtable.c: rpmlib.h
@echo '#include "system.h"' > tagtable.c
GET_NUM_FIELD(physHeader.namesize, nameSize);
- chPtr->path = malloc(nameSize + 1);
+ chPtr->path = xmalloc(nameSize + 1);
if (ourread(cfd, chPtr->path, nameSize) != nameSize) {
free(chPtr->path);
chPtr->path = NULL;
static int checkDirectory(char * filename)
{
- static char * lastDir = NULL;
+ static char * lastDir = NULL; /* XXX memory leak */
static int lastDirLength = 0;
static int lastDirAlloced = 0;
int length = strlen(filename);
if (lastDirAlloced < (length + 1)) {
lastDirAlloced = length + 100;
- lastDir = realloc(lastDir, lastDirAlloced);
+ lastDir = xrealloc(lastDir, lastDirAlloced);
}
strcpy(lastDir, buf);
if (!lstat(li->files[i], &sb)) {
if (unlink(li->files[i])) {
if (failedFile)
- *failedFile = strdup(li->files[i]);
+ *failedFile = xstrdup(li->files[i]);
return CPIOERR_UNLINK_FAILED;
}
}
if (link(li->files[li->createdPath], li->files[i])) {
if (failedFile)
- *failedFile = strdup(li->files[i]);
+ *failedFile = xstrdup(li->files[i]);
return CPIOERR_LINK_FAILED;
}
if (map) {
if (map->mapFlags & CPIO_MAP_PATH) {
free(ch.path);
- ch.path = strdup(map->fsPath);
+ ch.path = xstrdup(map->fsPath);
}
if (map->mapFlags & CPIO_MAP_MODE)
}
if (li == NULL) {
- li = malloc(sizeof(*li));
+ li = xmalloc(sizeof(*li));
li->inode = ch.inode;
li->dev = ch.dev;
li->nlink = ch.nlink;
li->linksLeft = ch.nlink;
li->createdPath = -1;
- li->files = calloc(sizeof(char *), li->nlink);
+ li->files = xcalloc(li->nlink,(sizeof(*li->files)));
li->next = links;
links = li;
}
for (linkNum = 0; linkNum < li->nlink; linkNum++)
if (!li->files[linkNum]) break;
- li->files[linkNum] = strdup(ch.path);
+ li->files[linkNum] = xstrdup(ch.path);
}
if ((ch.nlink > 1) && S_ISREG(ch.mode) && !ch.size &&
}
if (rc && failedFile && *failedFile == NULL) {
- *failedFile = strdup(ch.path);
+ *failedFile = xstrdup(ch.path);
olderr = errno;
unlink(ch.path);
if ((rc = writeFile(cfd, hlink->sb, mappings + hlink->fileMaps[i],
&size, 0))) {
if (failedFile)
- *failedFile = strdup(mappings[hlink->fileMaps[i]].fsPath);
+ *failedFile = xstrdup(mappings[hlink->fileMaps[i]].fsPath);
return rc;
}
if (sizep)
*sizep = total;
if (failedFile)
- *failedFile = strdup(mappings[hlink->fileMaps[hlink->linksLeft]].fsPath);
+ *failedFile = xstrdup(mappings[hlink->fileMaps[hlink->linksLeft]].fsPath);
return rc;
}
total += size;
if (rc) {
if (failedFile)
- *failedFile = strdup(mappings[i].fsPath);
+ *failedFile = xstrdup(mappings[i].fsPath);
return CPIOERR_STAT_FAILED;
}
(hlink->dev != sb.st_dev || hlink->inode != sb.st_ino))
hlink = hlink->next;
if (!hlink) {
- hlink = malloc(sizeof(*hlink));
+ hlink = xmalloc(sizeof(*hlink));
hlink->next = hlinkList.next;
hlinkList.next = hlink;
hlink->sb = sb; /* structure assignment */
hlink->inode = sb.st_ino;
hlink->nlink = sb.st_nlink;
hlink->linksLeft = sb.st_nlink;
- hlink->fileMaps = malloc(sizeof(*hlink->fileMaps) *
+ hlink->fileMaps = xmalloc(sizeof(*hlink->fileMaps) *
sb.st_nlink);
}
} else {
if ((rc = writeFile(cfd, sb, mappings + i, &size, 1))) {
if (failedFile)
- *failedFile = strdup(mappings[i].fsPath);
+ *failedFile = xstrdup(mappings[i].fsPath);
return rc;
}
dbiIndex * dbiOpenIndex(const char * filename, int flags, int perms, DBTYPE type) {
dbiIndex * dbi;
- dbi = malloc(sizeof(*dbi));
+ dbi = xmalloc(sizeof(*dbi));
dbi->db = dbopen(filename, flags, perms, type, NULL);
if (!dbi->db) {
free(dbi);
strerror(errno));
return NULL;
}
- dbi->indexname = strdup(filename);
+ dbi->indexname = xstrdup(filename);
return dbi;
}
return 1;
}
- { char *k = malloc(key.size + 1);
+ { char *k = xmalloc(key.size + 1);
memcpy(k, key.data, key.size);
k[key.size] = '\0';
*keyp = k;
return 1;
}
- set->recs = malloc(data.size);
+ set->recs = xmalloc(data.size);
memcpy(set->recs, data.data, data.size);
set->count = data.size / sizeof(dbiIndexRecord);
return 0;
set->count++;
if (set->count == 1) {
- set->recs = malloc(set->count * sizeof(dbiIndexRecord));
+ set->recs = xmalloc(set->count * sizeof(dbiIndexRecord));
} else {
- set->recs = realloc(set->recs, set->count * sizeof(dbiIndexRecord));
+ set->recs = xrealloc(set->recs, set->count * sizeof(dbiIndexRecord));
}
set->recs[set->count - 1] = rec;
nb += strlen(keyEVR);
}
- t = tbuf = malloc(nb + 1);
+ t = tbuf = xmalloc(nb + 1);
if (key)
while(*key) *t++ = *key++;
if (keyFlags) {
static /*@only@*/ char *buildEVR(int_32 *e, const char *v, const char *r)
{
- char *pEVR = malloc(21 + strlen(v) + 1 + strlen(r) + 1);
+ char *pEVR = xmalloc(21 + strlen(v) + 1 + strlen(r) + 1);
*pEVR = '\0';
if (e)
sprintf(pEVR, "%d:", *e);
static void alCreate(/*@out@*/struct availableList * al)
{
- size_t nb;
-
al->alloced = 5;
al->size = 0;
- nb = sizeof(*al->list) * al->alloced;
- al->list = malloc(nb);
- memset(al->list, 0, nb);
+ al->list = xcalloc(al->alloced, sizeof(*al->list));
al->index.index = NULL;
al->index.size = 0;
if (al->size == al->alloced) {
al->alloced += 5;
- al->list = realloc(al->list, sizeof(*al->list) * al->alloced);
+ al->list = xrealloc(al->list, sizeof(*al->list) * al->alloced);
}
p = al->list + al->size++;
- p->h = headerLink(h);
+ p->h = headerLink(h); /* XXX reference held by transaction set */
headerNVR(p->h, &p->name, &p->version, &p->release);
if (relocs) {
for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++);
- p->relocs = malloc(sizeof(*p->relocs) * (i + 1));
+ p->relocs = xmalloc(sizeof(*p->relocs) * (i + 1));
for (i = 0, r = relocs; r->oldPath || r->newPath; i++, r++) {
- p->relocs[i].oldPath = r->oldPath ? strdup(r->oldPath) : NULL;
- p->relocs[i].newPath = r->newPath ? strdup(r->newPath) : NULL;
+ p->relocs[i].oldPath = r->oldPath ? xstrdup(r->oldPath) : NULL;
+ p->relocs[i].newPath = r->newPath ? xstrdup(r->newPath) : NULL;
}
p->relocs[i].oldPath = NULL;
p->relocs[i].newPath = NULL;
}
if (ai->size) {
- size_t nb = sizeof(*ai->index) * ai->size;
- ai->index = malloc(nb);
- memset(ai->index, 0, nb);
+ ai->index = xcalloc(ai->size, sizeof(*ai->index));
k = 0;
for (i = 0; i < al->size; i++) {
}
/* Both AEVR and BEVR exist. */
- aEVR = strdup(AEVR);
+ aEVR = xstrdup(AEVR);
parseEVR(aEVR, &aE, &aV, &aR);
- bEVR = strdup(BEVR);
+ bEVR = xstrdup(BEVR);
parseEVR(bEVR, &bE, &bV, &bR);
/* Compare {A,B} [epoch:]version[-release] */
{
rpmTransactionSet rpmdep;
int rootLength;
- size_t nb;
if (!root) root = "";
- rpmdep = malloc(sizeof(*rpmdep));
+ rpmdep = xmalloc(sizeof(*rpmdep));
rpmdep->db = db;
rpmdep->scriptFd = NULL;
rpmdep->numRemovedPackages = 0;
rpmdep->allocedRemovedPackages = 5;
- nb = sizeof(*rpmdep->removedPackages) * rpmdep->allocedRemovedPackages;
- rpmdep->removedPackages = malloc(nb);
- memset(rpmdep->removedPackages, 0, nb);
+ rpmdep->removedPackages = xcalloc(rpmdep->allocedRemovedPackages,
+ sizeof(*rpmdep->removedPackages));
/* This canonicalizes the root */
rootLength = strlen(root);
root = newRootdir;
}
- rpmdep->root = strdup(root);
+ rpmdep->root = xstrdup(root);
alCreate(&rpmdep->addedPackages);
alCreate(&rpmdep->availablePackages);
rpmdep->orderAlloced = 5;
rpmdep->orderCount = 0;
- nb = sizeof(*rpmdep->order) * rpmdep->orderAlloced;
- rpmdep->order = malloc(nb);
- memset(rpmdep->order, 0, nb);
+ rpmdep->order = xcalloc(rpmdep->orderAlloced, sizeof(*rpmdep->order));
return rpmdep;
}
{
if (rpmdep->numRemovedPackages == rpmdep->allocedRemovedPackages) {
rpmdep->allocedRemovedPackages += 5;
- rpmdep->removedPackages = realloc(rpmdep->removedPackages,
+ rpmdep->removedPackages = xrealloc(rpmdep->removedPackages,
sizeof(int *) * rpmdep->allocedRemovedPackages);
}
if (rpmdep->orderCount == rpmdep->orderAlloced) {
rpmdep->orderAlloced += 5;
- rpmdep->order = realloc(rpmdep->order,
+ rpmdep->order = xrealloc(rpmdep->order,
sizeof(*rpmdep->order) * rpmdep->orderAlloced);
}
if (rpmdep->orderCount == rpmdep->orderAlloced) {
rpmdep->orderAlloced += 5;
- rpmdep->order = realloc(rpmdep->order,
+ rpmdep->order = xrealloc(rpmdep->order,
sizeof(*rpmdep->order) * rpmdep->orderAlloced);
}
rpmdep->order[rpmdep->orderCount].type = TR_ADDED;
if (psp->num == psp->alloced) {
psp->alloced += 5;
- psp->problems = realloc(psp->problems, sizeof(*psp->problems) *
+ psp->problems = xrealloc(psp->problems, sizeof(*psp->problems) *
psp->alloced);
}
psp->problems[psp->num].byHeader = headerLink(h);
- psp->problems[psp->num].byName = strdup(name);
- psp->problems[psp->num].byVersion = strdup(version);
- psp->problems[psp->num].byRelease = strdup(release);
- psp->problems[psp->num].needsName = strdup(requires[i]);
- psp->problems[psp->num].needsVersion = strdup(requiresEVR[i]);
+ psp->problems[psp->num].byName = xstrdup(name);
+ psp->problems[psp->num].byVersion = xstrdup(version);
+ psp->problems[psp->num].byRelease = xstrdup(release);
+ psp->problems[psp->num].needsName = xstrdup(requires[i]);
+ psp->problems[psp->num].needsVersion = xstrdup(requiresEVR[i]);
psp->problems[psp->num].needsFlags = requireFlags[i];
psp->problems[psp->num].sense = RPMDEP_SENSE_REQUIRES;
if (psp->num == psp->alloced) {
psp->alloced += 5;
- psp->problems = realloc(psp->problems, sizeof(*psp->problems) *
+ psp->problems = xrealloc(psp->problems, sizeof(*psp->problems) *
psp->alloced);
}
psp->problems[psp->num].byHeader = headerLink(h);
- psp->problems[psp->num].byName = strdup(name);
- psp->problems[psp->num].byVersion = strdup(version);
- psp->problems[psp->num].byRelease = strdup(release);
- psp->problems[psp->num].needsName = strdup(conflicts[i]);
- psp->problems[psp->num].needsVersion = strdup(conflictsEVR[i]);
+ psp->problems[psp->num].byName = xstrdup(name);
+ psp->problems[psp->num].byVersion = xstrdup(version);
+ psp->problems[psp->num].byRelease = xstrdup(release);
+ psp->problems[psp->num].needsName = xstrdup(conflicts[i]);
+ psp->problems[psp->num].needsVersion = xstrdup(conflictsEVR[i]);
psp->problems[psp->num].needsFlags = conflictFlags[i];
psp->problems[psp->num].sense = RPMDEP_SENSE_CONFLICTS;
psp->problems[psp->num].suggestedPackage = NULL;
with removes for upgrades immediately follwing the installation of
the new package. This would be easier if we could sort the
addedPackages array, but we store indexes into it in various places. */
- orderList = malloc(sizeof(*orderList) * rpmdep->addedPackages.size);
+ orderList = xmalloc(sizeof(*orderList) * rpmdep->addedPackages.size);
for (i = 0, j = 0; i < rpmdep->orderCount; i++) {
if (rpmdep->order[i].type == TR_ADDED) {
orderList[j].alIndex = rpmdep->order[i].u.addedIndex;
qsort(orderList, rpmdep->addedPackages.size, sizeof(*orderList),
orderListIndexCmp);
- newOrder = malloc(sizeof(*newOrder) * rpmdep->orderCount);
+ /* XXX memory leak */
+ newOrder = xmalloc(sizeof(*newOrder) * rpmdep->orderCount);
for (i = 0, newOrderCount = 0; i < orderingCount; i++) {
key.alIndex = ordering[i];
needle = bsearch(&key, orderList, rpmdep->addedPackages.size,
int rc;
Header h = NULL;
struct problemsSet ps;
- size_t nb;
ps.alloced = 5;
ps.num = 0;
- nb = sizeof(struct rpmDependencyConflict) * ps.alloced;
- ps.problems = malloc(nb);
- memset(ps.problems, 0, nb);
+ ps.problems = xcalloc(ps.alloced, sizeof(struct rpmDependencyConflict));
*conflicts = NULL;
*numConflicts = 0;
return 0;
exit:
- if (h) headerFree(h);
+ if (h) {
+ headerFree(h);
+ }
if (ps.problems) free(ps.problems);
return 1;
}
fas.fileSize = faLseek(&fas, 0, SEEK_CUR);
}
+ /* XXX xmalloc is inappopriate here */
if ((fa = malloc(sizeof(*fa))) != NULL) {
fa->fd = fas.fd;
fa->readOnly = fas.readOnly;
static char * permsString(int mode)
{
- char * perms = malloc(11);
+ char * perms = xmalloc(11);
strcpy(perms, "-----------");
char * val;
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else if (*item & RPMSENSE_TRIGGERIN) {
- val = strdup("in");
+ val = xstrdup("in");
} else {
- val = strdup("un");
+ val = xstrdup("un");
}
return val;
char * buf;
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else {
- val = malloc(15 + padding);
+ val = xmalloc(15 + padding);
strcat(formatPrefix, "s");
buf = permsString(*((int_32 *) data));
sprintf(val, formatPrefix, buf);
int anint = *((int_32 *) data);
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else {
buf[0] = '\0';
if (anint & RPMFILE_GHOST)
strcat(buf, "g");
- val = malloc(5 + padding);
+ val = xmalloc(5 + padding);
strcat(formatPrefix, "s");
sprintf(val, formatPrefix, buf);
}
int anint = *((int_32 *) data);
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else {
buf[0] = '\0';
if (anint & RPMSENSE_EQUAL)
strcat(buf, "=");
- val = malloc(5 + padding);
+ val = xmalloc(5 + padding);
strcat(formatPrefix, "s");
sprintf(val, formatPrefix, buf);
}
return 0;
} else if (headerGetEntry(h, RPMTAG_INSTPREFIXES, NULL, (void **) &array,
count)) {
- *((char **) data) = strdup(array[0]);
+ *((char **) data) = xstrdup(array[0]);
*freeData = 1;
*type = RPM_STRING_TYPE;
free(array);
*freeData = 1;
if (filenames == NULL) {
- usages = malloc(sizeof(usages) * (*count));
- memset(usages, 0, sizeof(usages) * (*count));
+ usages = xcalloc((*count), sizeof(usages));
*data = usages;
return 0;
free(s);
*freeData = 1;
- *data = conds = malloc(sizeof(char * ) * numScripts);
+ *data = conds = xmalloc(sizeof(char * ) * numScripts);
*count = numScripts;
*type = RPM_STRING_ARRAY_TYPE;
for (i = 0; i < numScripts; i++) {
- chptr = malloc(1);
- *chptr = '\0';
+ chptr = xstrdup("");
for (j = 0; j < numNames; j++) {
if (indices[j] != i) continue;
- item = malloc(strlen(names[j]) + strlen(versions[j]) + 20);
+ item = xmalloc(strlen(names[j]) + strlen(versions[j]) + 20);
if (flags[j] & RPMSENSE_SENSEMASK) {
buf[0] = '%', buf[1] = '\0';
flagsStr = depflagsFormat(RPM_INT32_TYPE, flags, buf,
strcpy(item, names[j]);
}
- chptr = realloc(chptr, strlen(chptr) + strlen(item) + 5);
+ chptr = xrealloc(chptr, strlen(chptr) + strlen(item) + 5);
if (*chptr) strcat(chptr, ", ");
strcat(chptr, item);
free(item);
free(s);
*freeData = 1;
- *data = conds = malloc(sizeof(char * ) * numScripts);
+ *data = conds = xmalloc(sizeof(char * ) * numScripts);
*count = numScripts;
*type = RPM_STRING_ARRAY_TYPE;
for (i = 0; i < numScripts; i++) {
if (indices[j] != i) continue;
if (flags[j] & RPMSENSE_TRIGGERIN)
- conds[i] = strdup("in");
+ conds[i] = xstrdup("in");
else if (flags[j] & RPMSENSE_TRIGGERUN)
- conds[i] = strdup("un");
+ conds[i] = xstrdup("un");
else
- conds[i] = strdup("postun");
+ conds[i] = xstrdup("postun");
break;
}
}
if (scareMemory)
fp.basename = chptr1;
else
- fp.basename = strdup(chptr1);
+ fp.basename = xstrdup(chptr1);
fp.ino = cache->ino;
fp.dev = cache->dev;
return fp;
if (scareMemory)
fp.basename = chptr1;
else
- fp.basename = strdup(chptr1);
+ fp.basename = xstrdup(chptr1);
fp.ino = sb.st_ino;
fp.dev = sb.st_dev;
numFilesystems = num;
- filesystems = malloc(sizeof(*filesystems) * (numFilesystems + 1));
- fsnames = malloc(sizeof(char *) * (numFilesystems + 1));
+ filesystems = xcalloc((numFilesystems + 1), sizeof(*filesystems));
+ fsnames = xcalloc((numFilesystems + 1), sizeof(char *));
for (vm = buf, i = 0; i < num; i++) {
char *fsn;
fsnameLength = vm->vmt_data[VMT_STUB].vmt_size;
- fsn = malloc(fsnameLength + 1);
+ fsn = xmalloc(fsnameLength + 1);
strncpy(fsn, (char *)vm + vm->vmt_data[VMT_STUB].vmt_off,
fsnameLength);
getmntinfo_r(&mounts, flags, &mntCount, &bufSize);
# endif
- filesystems = malloc(sizeof(*filesystems) * (numAlloced + 1));
- memset(filesystems, 0, sizeof(*filesystems) * (numAlloced + 1));
+ filesystems = xcalloc((numAlloced + 1), sizeof(*filesystems));
while (1) {
# if GETMNTENT_ONE
if (num == numAlloced) {
numAlloced += 10;
- filesystems = realloc(filesystems,
+ filesystems = xrealloc(filesystems,
sizeof(*filesystems) * (numAlloced + 1));
}
filesystems[num].dev = sb.st_dev;
- filesystems[num].mntPoint = strdup(mntdir);
+ filesystems[num].mntPoint = xstrdup(mntdir);
num++;
}
filesystems[num].dev = 0;
filesystems[num].mntPoint = NULL;
- fsnames = malloc(sizeof(*fsnames) * (num + 1));
+ fsnames = xcalloc((num + 1), sizeof(*fsnames));
for (i = 0; i < num; i++)
fsnames[i] = filesystems[i].mntPoint;
fsnames[num] = NULL;
if (getFilesystemList())
return 1;
- usages = calloc(numFilesystems, sizeof(usages));
+ usages = xcalloc(numFilesystems, sizeof(usages));
sourceDir = rpmGetPath("", "/%{_sourcedir}", NULL);
{
hashTable ht;
- ht = malloc(sizeof(*ht));
+ ht = xmalloc(sizeof(*ht));
ht->numBuckets = numBuckets;
- ht->buckets = calloc(sizeof(*ht->buckets), numBuckets);
+ ht->buckets = xcalloc(numBuckets, sizeof(*ht->buckets));
ht->keySize = keySize;
ht->fn = fn;
ht->eq = eq;
b = b->next;
if (!b) {
- b = malloc(sizeof(*b));
+ b = xmalloc(sizeof(*b));
if (ht->keySize) {
- char *k = malloc(ht->keySize);
+ char *k = xmalloc(ht->keySize);
memcpy(k, key, ht->keySize);
b->key = k;
} else {
ht->buckets[hash] = b;
}
- b->data = realloc(b->data, sizeof(*b->data) * (b->dataCount + 1));
+ b->data = xrealloc(b->data, sizeof(*b->data) * (b->dataCount + 1));
b->data[b->dataCount++] = data;
}
i = entry->info.count;
tableSize = i * sizeof(char *);
if (minimizeMemory) {
- ptrEntry = *p = malloc(tableSize);
+ ptrEntry = *p = xmalloc(tableSize);
chptr = entry->data;
} else {
- ptrEntry = *p = malloc(tableSize + entry->length);
+ ptrEntry = *p = xmalloc(tableSize + entry->length);
chptr = ((char *) *p) + tableSize;
memcpy(chptr, entry->data, entry->length);
}
HeaderIterator headerInitIterator(Header h)
{
- HeaderIterator hi = malloc(sizeof(struct headerIteratorS));
+ HeaderIterator hi = xmalloc(sizeof(struct headerIteratorS));
headerSort(h);
const char * dataStart;
struct entryInfo * pe;
struct indexEntry * entry;
- struct headerToken *h = malloc(sizeof(struct headerToken));
+ struct headerToken *h = xmalloc(sizeof(struct headerToken));
const char * src;
char * dst;
int i;
h->indexAlloced = il;
h->indexUsed = il;
- h->index = malloc(il * sizeof(struct indexEntry));
+ h->index = xmalloc(sizeof(struct indexEntry) * il);
h->usageCount = 1;
/* This assumes you only headerLoad() something you headerUnload()-ed */
src = dataStart + htonl(pe->offset);
entry->length = dataLength(entry->info.type, src,
entry->info.count, 1);
- entry->data = dst = malloc(entry->length);
+ entry->data = dst = xmalloc(entry->length);
/* copy data w/ endian conversions */
switch (entry->info.type) {
headerSort(h);
*lengthPtr = headerSizeof(h, 0);
- pi = p = malloc(*lengthPtr);
+ pi = p = xmalloc(*lengthPtr);
*pi++ = htonl(h->indexUsed);
if (totalSize > (32*1024*1024))
return NULL;
- dataBlock = p = malloc(totalSize);
+ dataBlock = p = xmalloc(totalSize);
*p++ = htonl(il);
*p++ = htonl(dl);
totalSize = sizeof(int_32) + sizeof(int_32) +
(il * sizeof(struct entryInfo)) + dl;
- block = p = malloc(totalSize);
+ block = p = xmalloc(totalSize);
*p++ = htonl(il);
*p++ = htonl(dl);
Header headerNew()
{
- Header h = malloc(sizeof(struct headerToken));
+ Header h = xmalloc(sizeof(struct headerToken));
- h->index = malloc(INDEX_MALLOC_SIZE * sizeof(struct indexEntry));
h->indexAlloced = INDEX_MALLOC_SIZE;
+ h->index = xcalloc(h->indexAlloced, sizeof(struct indexEntry));
h->indexUsed = 0;
h->sorted = 0;
return h;
}
+int headerUsageCount(Header h)
+{
+ return h->usageCount;
+}
+
unsigned int headerSizeof(Header h, int magicp)
{
unsigned int size;
void * data;
length = dataLength(type, p, c, 0);
- data = malloc(length);
+ data = xmalloc(length);
copyData(type, data, p, c, length);
/* Allocate more index space if necessary */
if (h->indexUsed == h->indexAlloced) {
h->indexAlloced += INDEX_MALLOC_SIZE;
- h->index = realloc(h->index,
+ h->index = xrealloc(h->index,
h->indexAlloced * sizeof(struct indexEntry));
}
if (!headerGetRawEntry(h, HEADER_I18NTABLE, &type, (void **)&s, &count))
return NULL;
- if ((table = (char **)calloc((count+1), sizeof(char *))) == NULL)
+ if ((table = (char **)xcalloc((count+1), sizeof(char *))) == NULL)
return NULL;
for (i = 0, e = *s; i < count > 0; i++, e += strlen(e)+1) {
if (langNum >= table->info.count) {
length = strlen(lang) + 1;
- table->data = realloc(table->data, table->length + length);
+ table->data = xrealloc(table->data, table->length + length);
memcpy(((char *)table->data) + table->length, lang, length);
table->length += length;
table->info.count++;
ghosts = langNum - entry->info.count;
length = strlen(string) + 1 + ghosts;
- entry->data = realloc(entry->data, entry->length + length);
+ entry->data = xrealloc(entry->data, entry->length + length);
memset(((char *)entry->data) + entry->length, '\0', ghosts);
strcpy(((char *)entry->data) + entry->length + ghosts, string);
sn = strlen(string) + 1;
en = (ee-e);
length = bn + sn + en;
- t = buf = malloc(length);
+ t = buf = xmalloc(length);
/* Copy values into new storage */
memcpy(t, b, bn);
length = dataLength(type, p, c, 0);
- entry->data = realloc(entry->data, entry->length + length);
+ entry->data = xrealloc(entry->data, entry->length + length);
copyData(type, ((char *) entry->data) + entry->length, p, c, length);
entry->length += length;
if (*chptr == '%') numTokens++;
numTokens = numTokens * 2 + 1;
- format = calloc(sizeof(*format), numTokens);
+ format = xcalloc(numTokens, sizeof(*format));
if (endPtr) *endPtr = NULL;
dst = start = str;
}
if (*chptr == '|') {
- parseFormat(strdup(""), tags, extensions, &token->u.cond.elseFormat,
+ parseFormat(xstrdup(""), tags, extensions, &token->u.cond.elseFormat,
&token->u.cond.numElseTokens, &end, PARSER_IN_EXPR,
error);
} else {
strcat(buf, "s");
len = strlen(strarray[element]) + tag->pad + 20;
- val = malloc(len);
+ val = xmalloc(len);
sprintf(val, buf, strarray[element]);
}
strcat(buf, "s");
len = strlen(data) + tag->pad + 20;
- val = malloc(len);
+ val = xmalloc(len);
sprintf(val, buf, data);
}
break;
if (!val) {
strcat(buf, "d");
len = 10 + tag->pad + 20;
- val = malloc(len);
+ val = xmalloc(len);
sprintf(val, buf, intVal);
}
break;
default:
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(unknown type)"));
break;
}
break;
case PTOK_STRING:
- val = malloc(token->u.string.len + 1);
+ val = xmalloc(token->u.string.len + 1);
strcpy(val, token->u.string.string);
break;
}
alloced = condNumFormats * 20;
- val = malloc(alloced ? alloced : 1);
+ val = xmalloc(alloced ? alloced : 1);
*val = '\0';
len = 0;
thisItemLen = strlen(thisItem);
if ((thisItemLen + len) >= alloced) {
alloced = (thisItemLen + len) + 200;
- val = realloc(val, alloced);
+ val = xrealloc(val, alloced);
}
strcat(val, thisItem);
len += thisItemLen;
}
if (numElements == -1) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, "(none)"); /* XXX i18n? NO!, sez; gafton */
} else {
alloced = numElements * token->u.array.numTokens * 20;
- val = malloc(alloced);
+ val = xmalloc(alloced);
*val = '\0';
len = 0;
thisItemLen = strlen(thisItem);
if ((thisItemLen + len) >= alloced) {
alloced = (thisItemLen + len) + 200;
- val = realloc(val, alloced);
+ val = xrealloc(val, alloced);
}
strcat(val, thisItem);
len += thisItemLen;
ext++;
}
- return calloc(i, sizeof(struct extensionCache));
+ return xcalloc(i, sizeof(struct extensionCache));
}
static void freeExtensionCache(const struct headerSprintfExtension * extensions,
struct extensionCache * extCache;
/*fmtString = escapeString(origFmt);*/
- fmtString = strdup(origFmt);
+ fmtString = xstrdup(origFmt);
if (parseFormat(fmtString, tags, extensions, &format, &numTokens,
NULL, PARSER_BEGIN, error)) {
answerAlloced = 1024;
answerLength = 0;
- answer = malloc(answerAlloced);
+ answer = xmalloc(answerAlloced);
*answer = '\0';
for (i = 0; i < numTokens; i++) {
if ((answerLength + pieceLength) >= answerAlloced) {
while ((answerLength + pieceLength) >= answerAlloced)
answerAlloced += 1024;
- answer = realloc(answer, answerAlloced);
+ answer = xrealloc(answer, answerAlloced);
}
strcat(answer, piece);
char * val;
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else {
- val = malloc(20 + padding);
+ val = xmalloc(20 + padding);
strcat(formatPrefix, "o");
sprintf(val, formatPrefix, *((int_32 *) data));
}
char * val;
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else {
- val = malloc(20 + padding);
+ val = xmalloc(20 + padding);
strcat(formatPrefix, "x");
sprintf(val, formatPrefix, *((int_32 *) data));
}
char buf[50];
if (type != RPM_INT32_TYPE) {
- val = malloc(20);
+ val = xmalloc(20);
strcpy(val, _("(not a number)"));
} else {
- val = malloc(50 + padding);
+ val = xmalloc(50 + padding);
strcat(formatPrefix, "s");
/* this is important if sizeof(int_32) ! sizeof(time_t) */
char * result, * dst, * src, * buf;
if (type == RPM_INT32_TYPE) {
- result = malloc(padding + 20);
+ result = xmalloc(padding + 20);
strcat(formatPrefix, "d");
sprintf(result, formatPrefix, *((int_32 *) data));
} else {
strcat(formatPrefix, "s");
sprintf(buf, formatPrefix, data);
- result = dst = malloc(strlen(buf) * 4 + 3);
+ result = dst = xmalloc(strlen(buf) * 4 + 3);
*dst++ = '\'';
for (src = buf; *src; src++) {
if (*src == '\'') {
Header headerCopy(Header h);
void headerSort(Header h);
Header headerLink(Header h);
+int headerUsageCount(Header h);
void headerCopyTags(Header headerFrom, Header headerTo, int_32 *tagstocopy);
static /*@only@*/ struct fileMemory *newFileMemory(void)
{
- struct fileMemory *fileMem = malloc(sizeof(*fileMem));
+ struct fileMemory *fileMem = xmalloc(sizeof(*fileMem));
fileMem->files = NULL;
fileMem->names = NULL;
fileMem->cpioNames = NULL;
fileCount = *fileCountPtr;
- files = *filesPtr = mem->files = malloc(sizeof(*mem->files) * fileCount);
+ files = *filesPtr = mem->files = xcalloc(fileCount, sizeof(*mem->files));
headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL);
headerGetEntry(h, RPMTAG_FILEMODES, NULL, (void **) &fileModes, NULL);
if (ourInfo->specFilePtr) {
chptr = cpioInfo->file + strlen(cpioInfo->file) - 5;
if (!strcmp(chptr, ".spec"))
- *ourInfo->specFilePtr = strdup(cpioInfo->file);
+ *ourInfo->specFilePtr = xstrdup(cpioInfo->file);
}
}
}
if (specFilePtr)
- *specFilePtr = strdup(correctSpecFile);
+ *specFilePtr = xstrdup(correctSpecFile);
} else {
if (specFilePtr)
- *specFilePtr = strdup(files[specFileIndex].relativePath);
+ *specFilePtr = xstrdup(files[specFileIndex].relativePath);
}
rc = 0;
*cookie = NULL;
if (h != NULL &&
headerGetEntry(h, RPMTAG_COOKIE, NULL, (void **) cookie, NULL)) {
- *cookie = strdup(*cookie);
+ *cookie = xstrdup(*cookie);
}
}
rpmInstallLoadMacros(h);
rc = installSources(h, rootdir, fd, specFile, notify, notifyData);
- if (h != NULL) headerFree(h);
+ if (h != NULL) {
+ headerFree(h);
+ }
return rc;
}
}
}
- fileStates = malloc(sizeof(*fileStates) * fileCount);
+ fileStates = xmalloc(sizeof(*fileStates) * fileCount);
for (i = 0; i < fileCount; i++)
fileStates[i] = files[i].state;
fileMem = NULL;
} else if (flags & RPMTRANS_FLAG_JUSTDB) {
if (headerGetEntry(h, RPMTAG_FILENAMES, NULL, NULL, &fileCount)) {
- fileStates = malloc(sizeof(*fileStates) * fileCount);
+ fileStates = xmalloc(sizeof(*fileStates) * fileCount);
memset(fileStates, RPMFILE_STATE_NORMAL, fileCount);
headerAddEntry(h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fileStates,
fileCount);
chdir(currDir);
}
if (fileMem) freeFileMemory(fileMem);
- if (rc)
+ if (rc) {
headerFree(h);
+ }
return rc;
}
{
if (mc->macroTable == NULL) {
mc->macrosAllocated = MACRO_CHUNK_SIZE;
- mc->macroTable = (MacroEntry **)malloc(sizeof(*(mc->macroTable)) *
- mc->macrosAllocated);
+ mc->macroTable = (MacroEntry **)
+ xmalloc(sizeof(*(mc->macroTable)) * mc->macrosAllocated);
mc->firstFree = 0;
} else {
mc->macrosAllocated += MACRO_CHUNK_SIZE;
- mc->macroTable = (MacroEntry **)realloc(mc->macroTable, sizeof(*(mc->macroTable)) *
+ mc->macroTable = (MacroEntry **)
+ xrealloc(mc->macroTable, sizeof(*(mc->macroTable)) *
mc->macrosAllocated);
}
memset(&mc->macroTable[mc->firstFree], 0, MACRO_CHUNK_SIZE * sizeof(*(mc->macroTable)));
pushMacro(MacroEntry **mep, const char *n, const char *o, const char *b, int level)
{
MacroEntry *prev = (*mep ? *mep : NULL);
- MacroEntry *me = (MacroEntry *) malloc(sizeof(*me));
+ MacroEntry *me = (MacroEntry *) xmalloc(sizeof(*me));
me->prev = prev;
- me->name = (prev ? prev->name : strdup(n));
- me->opts = (o ? strdup(o) : NULL);
- me->body = strdup(b ? b : "");
+ me->name = (prev ? prev->name : xstrdup(n));
+ me->opts = (o ? xstrdup(o) : NULL);
+ me->body = xstrdup(b ? b : "");
me->used = 0;
me->level = level;
*mep = me;
if (mc == NULL)
mc = &globalMacroContext;
- for (mfile = m = strdup(macrofiles); *mfile; mfile = me) {
+ for (mfile = m = xstrdup(macrofiles); *mfile; mfile = me) {
FILE *fp;
char buf[BUFSIZ];
va_list ap;
if (arg == NULL)
- return strdup("");
+ return xstrdup("");
p = buf;
strcpy(p, arg);
}
va_end(ap);
expandMacros(NULL, NULL, buf, sizeof(buf));
- return strdup(buf);
+ return xstrdup(buf); /* XXX build memory leaks */
}
int
va_list ap;
if (path == NULL)
- return strdup("");
+ return xstrdup("");
p = buf;
strcpy(p, path);
}
va_end(ap);
expandMacros(NULL, NULL, buf, sizeof(buf));
- return strdup(buf);
+ return xstrdup(buf);
}
/* =============================================================== */
int i;
int fields;
- s = malloc(length + 1);
+ s = xmalloc(length + 1);
fields = 1;
for (source = str, dest = s, i = 0; i < length; i++, source++, dest++) {
*dest = '\0';
- list = malloc(sizeof(char *) * (fields + 1));
+ list = xmalloc(sizeof(char *) * (fields + 1));
dest = s;
list[0] = dest;
/* FIXME: this leaks memory! */
- a = malloc(strlen(str) + 1);
+ a = xmalloc(strlen(str) + 1);
strcpy(a, str);
return putenv(a);
strcmp(thisUname, lastUname)) {
if (lastUnameAlloced < thisUnameLen + 1) {
lastUnameAlloced = thisUnameLen + 10;
- lastUname = realloc(lastUname, lastUnameAlloced);
+ lastUname = xrealloc(lastUname, lastUnameAlloced);
}
strcpy(lastUname, thisUname);
strcmp(thisGname, lastGname)) {
if (lastGnameAlloced < thisGnameLen + 1) {
lastGnameAlloced = thisGnameLen + 10;
- lastGname = realloc(lastGname, lastGnameAlloced);
+ lastGname = xrealloc(lastGname, lastGnameAlloced);
}
strcpy(lastGname, thisGname);
len = strlen(pwent->pw_name);
if (lastUnameLen < len + 1) {
lastUnameLen = len + 20;
- lastUname = realloc(lastUname, lastUnameLen);
+ lastUname = xrealloc(lastUname, lastUnameLen);
}
strcpy(lastUname, pwent->pw_name);
len = strlen(grent->gr_name);
if (lastGnameLen < len + 1) {
lastGnameLen = len + 20;
- lastGname = realloc(lastGname, lastGnameLen);
+ lastGname = xrealloc(lastGname, lastGnameLen);
}
strcpy(lastGname, grent->gr_name);
char * currDir;
currDirLen = 50;
- currDir = malloc(currDirLen);
+ currDir = xmalloc(currDirLen);
while (!getcwd(currDir, currDirLen) && errno == ERANGE) {
currDirLen += 50;
- currDir = realloc(currDir, currDirLen);
+ currDir = xrealloc(currDir, currDirLen);
}
return currDir;
groupLength = htonl(lit.groupLength);
header->iconLength = htonl(lit.iconLength);
- header->spec = malloc(header->specLength);
- header->name = malloc(strlen(lit.labelstr) + 1);
+ header->spec = xmalloc(header->specLength);
+ header->name = xmalloc(strlen(lit.labelstr) + 1);
if (!header->spec || !header->name) {
if (header->spec) free(header->spec);
if (header->name) free(header->name);
header->version = chptr + 1;
if (groupLength) {
- header->group = malloc(groupLength + 1);
+ header->group = xmalloc(groupLength + 1);
if (!header->group) {
free(header->spec);
free(header->name);
}
if (header->iconLength) {
- header->icon = malloc(header->iconLength);
+ header->icon = xmalloc(header->iconLength);
if (!header->icon) {
free(header->spec);
free(header->name);
case PREAMBLE:
if (!strncmp("Description: ", *strptr, 13))
- spec->description = strdup((*strptr) + 13);
+ spec->description = xstrdup((*strptr) + 13);
else if (!strncmp("Distribution: ", *strptr, 14))
- spec->distribution = strdup((*strptr) + 14);
+ spec->distribution = xstrdup((*strptr) + 14);
else if (!strncmp("Vendor: ", *strptr, 8))
- spec->vendor = strdup((*strptr) + 8);
+ spec->vendor = xstrdup((*strptr) + 8);
else if (!strncmp("BuildHost: ", *strptr, 11))
- spec->buildHost = strdup((*strptr) + 11);
+ spec->buildHost = xstrdup((*strptr) + 11);
else if (!strncmp("BuildDate: ", *strptr, 11))
spec->buildTime = atoi((*strptr) + 11);
else if (!strncmp("Copyright: ", *strptr, 11))
- spec->copyright = strdup((*strptr) + 11);
+ spec->copyright = xstrdup((*strptr) + 11);
break;
case PREUN: case PREIN: case POSTIN: case POSTUN:
if (!*str) {
- *str = malloc(strlen(*strptr) + 2);
+ *str = xmalloc(strlen(*strptr) + 2);
strlength = 0;
(*str)[0] = '\0';
}
else
- *str = realloc(*str, strlength + strlen(*strptr) + 2);
+ *str = xrealloc(*str, strlength + strlen(*strptr) + 2);
strcat(*str, *strptr);
strcat(*str, "\n");
strlength += strlen(*strptr) + 1;
}
}
- spec->files = malloc(sizeof(struct oldrpmFileInfo) * spec->fileCount);
+ spec->files = xmalloc(sizeof(struct oldrpmFileInfo) * spec->fileCount);
if (!spec->files) {
freeSplitString(lines);
return "out of memory";
freeSplitString(lines);
- if (!spec->vendor) spec->vendor = strdup("");
- if (!spec->description) spec->description = strdup("");
- if (!spec->distribution) spec->distribution = strdup("");
- if (!spec->copyright) spec->copyright = strdup("");
+ if (!spec->vendor) spec->vendor = xstrdup("");
+ if (!spec->description) spec->description = xstrdup("");
+ if (!spec->distribution) spec->distribution = xstrdup("");
+ if (!spec->copyright) spec->copyright = xstrdup("");
return NULL;
}
fields = splitString(str, strlen(str), ' ');
- fi->path = strdup(path);
+ fi->path = xstrdup(path);
if (!strcmp(state, "normal"))
fi->state = RPMFILE_STATE_NORMAL;
else if (!strcmp(state, "replaced"))
fields = splitString(str, strlen(str), ' ');
- fi->path = strdup(fields[0]);
+ fi->path = xstrdup(fields[0]);
fi->state = RPMFILE_STATE_NORMAL;
infoFromFields(fields + 1, fi);
fi->rdev = strtol(fields[8], NULL, 16);
if (S_ISLNK(fi->mode)) {
- fi->linkto = strdup(fields[9]);
+ fi->linkto = xstrdup(fields[9]);
} else {
fi->linkto = NULL;
}
char * buf;
if (fi->linkto)
- buf = malloc(strlen(fi->linkto) + 100);
+ buf = xmalloc(strlen(fi->linkto) + 100);
else
- buf = malloc(100);
+ buf = xmalloc(100);
sprintf(buf, "%ld %ld %s %o %d %d %s %s %x ", (long)fi->size, (long)fi->mtime,
fi->md5, fi->mode, (int)fi->uid, (int)fi->gid,
if (spec.fileCount) {
/* some packages have no file lists */
- fileList = malloc(sizeof(char *) * spec.fileCount);
- fileLinktoList = malloc(sizeof(char *) * spec.fileCount);
- fileMD5List = malloc(sizeof(char *) * spec.fileCount);
- fileSizeList = malloc(sizeof(int_32) * spec.fileCount);
- fileUIDList = malloc(sizeof(int_32) * spec.fileCount);
- fileGIDList = malloc(sizeof(int_32) * spec.fileCount);
- fileMtimesList = malloc(sizeof(int_32) * spec.fileCount);
- fileFlagsList = malloc(sizeof(int_32) * spec.fileCount);
- fileModesList = malloc(sizeof(int_16) * spec.fileCount);
- fileRDevsList = malloc(sizeof(int_16) * spec.fileCount);
- fileStatesList = malloc(sizeof(char) * spec.fileCount);
- unames = malloc(sizeof(char *) * spec.fileCount);
- gnames = malloc(sizeof(char *) * spec.fileCount);
-
+ fileList = xmalloc(sizeof(char *) * spec.fileCount);
+ fileLinktoList = xmalloc(sizeof(char *) * spec.fileCount);
+ fileMD5List = xmalloc(sizeof(char *) * spec.fileCount);
+ fileSizeList = xmalloc(sizeof(int_32) * spec.fileCount);
+ fileUIDList = xmalloc(sizeof(int_32) * spec.fileCount);
+ fileGIDList = xmalloc(sizeof(int_32) * spec.fileCount);
+ fileMtimesList = xmalloc(sizeof(int_32) * spec.fileCount);
+ fileFlagsList = xmalloc(sizeof(int_32) * spec.fileCount);
+ fileModesList = xmalloc(sizeof(int_16) * spec.fileCount);
+ fileRDevsList = xmalloc(sizeof(int_16) * spec.fileCount);
+ fileStatesList = xmalloc(sizeof(char) * spec.fileCount);
+ unames = xmalloc(sizeof(char *) * spec.fileCount);
+ gnames = xmalloc(sizeof(char *) * spec.fileCount);
/* We also need to contstruct a file owner/group list. We'll just
hope the numbers all map to something, those that don't will
unames[j] = uidToUname(fileUIDList[j]);
if (unames[j])
- unames[j] = strdup(unames[j]);
+ unames[j] = xstrdup(unames[j]);
else {
- unames[j] = malloc(20);
+ unames[j] = xmalloc(20);
sprintf(unames[j], "uid%d", fileUIDList[j]);
}
gnames[j] = gidToGname(fileGIDList[j]);
if (gnames[j])
- gnames[j] = strdup(gnames[j]);
+ gnames[j] = xstrdup(gnames[j]);
else {
- gnames[j] = malloc(20);
+ gnames[j] = xmalloc(20);
sprintf(gnames[j], "gid%d", fileGIDList[j]);
}
}
*hdr = headerRead(fd, (lead->major >= 3) ?
HEADER_MAGIC_YES : HEADER_MAGIC_NO);
if (*hdr == NULL) {
- if (sigs != NULL) headerFree(*sigs);
+ if (sigs != NULL) {
+ headerFree(*sigs);
+ }
return 2;
}
/*@notreached@*/ break;
}
- if (hdrPtr == NULL) headerFree(*hdr);
+ if (hdrPtr == NULL) {
+ headerFree(*hdr);
+ }
return 0;
}
if (prob.altH)
headerNVR(prob.altH, &altName, &altVersion, &altRelease);
- buf = malloc(strlen(name) + strlen(version) + strlen(release) + 400);
+ buf = xmalloc(strlen(name) + strlen(version) + strlen(release) + 400);
switch (prob.type) {
case RPMPROB_BADARCH:
# define PATH_MAX 255
#endif
-#include "build/rpmbuild.h"
-#include "popt/popt.h"
+#include "rpmbuild.h"
#include <rpmurl.h>
/* ======================================================================== */
static char * permsString(int mode)
{
- char *perms = strdup("----------");
+ char *perms = xstrdup("----------");
if (S_ISDIR(mode))
perms[0] = 'd';
headerGetEntry(spec->packages->header, RPMTAG_NAME, NULL,
(void **) &n, NULL);
sprintf(buf, "%s(%s)", n, tagName(t->t_tag));
- t->t_msgid = strdup(buf);
+ t->t_msgid = xstrdup(buf);
}
- msgstr = strdup(dgettext(specedit, t->t_msgid));
+ msgstr = xstrdup(dgettext(specedit, t->t_msgid));
switch(t->t_tag) {
case RPMTAG_SUMMARY:
sprintf(buf, "%s: %s\n",
((t->t_tag == RPMTAG_GROUP) ? "Group" : "Summary"),
msgstr);
- sl->sl_lines[t->t_startx] = strdup(buf);
+ sl->sl_lines[t->t_startx] = xstrdup(buf);
break;
case RPMTAG_DESCRIPTION:
for (j = 1; j < t->t_nlines; j++) {
sl->sl_lines[t->t_startx] = NULL;
continue;
}
- sl->sl_lines[t->t_startx + 1] = strdup(msgstr);
+ sl->sl_lines[t->t_startx + 1] = xstrdup(msgstr);
if (t->t_nlines > 2)
- sl->sl_lines[t->t_startx + 2] = strdup("\n\n");
+ sl->sl_lines[t->t_startx + 2] = xstrdup("\n\n");
break;
}
}
{ char *qf = (char *)qva->qva_queryFormat;
if (qf) {
int len = strlen(qf) + strlen(arg) + 1;
- qf = realloc(qf, len);
+ qf = xrealloc(qf, len);
strcat(qf, arg);
} else {
- qf = malloc(strlen(arg) + 1);
+ qf = xmalloc(strlen(arg) + 1);
strcpy(qf, arg);
}
qva->qva_queryFormat = qf;
#include "rpmdb.h"
-int rpmdbRebuild(const char * rootdir) {
+int rpmdbRebuild(const char * rootdir)
+{
rpmdb olddb, newdb;
const char * dbpath = NULL;
const char * newdbpath = NULL;
static /*@only@*/ rpmdb newRpmdb(void)
{
- rpmdb db = malloc(sizeof(*db));
+ rpmdb db = xmalloc(sizeof(*db));
db->pkgs = NULL;
db->nameIndex = NULL;
db->fileIndex = NULL;
&db->nameIndex, DB_HASH);
if (minimal) {
- *rpmdbp = malloc(sizeof(struct rpmdb_s));
+ *rpmdbp = xmalloc(sizeof(struct rpmdb_s));
if (rpmdbp)
- *rpmdbp = db;
+ *rpmdbp = db; /* structure assignment */
else
rpmdbClose(db);
return 0;
/* this may be worth batching by basename, but probably not as
basenames are quite unique as it is */
- intMatches = malloc(sizeof(*intMatches) * intMatchesAlloced);
- memset(intMatches, 0, sizeof(*intMatches) * intMatchesAlloced);
+ intMatches = xcalloc(intMatchesAlloced, sizeof(*intMatches));
/* Gather all matches from the database */
for (i = 0; i < numItems; i++) {
if ((numIntMatches + dbiIndexSetCount(matches)) >= intMatchesAlloced) {
intMatchesAlloced += dbiIndexSetCount(matches);
intMatchesAlloced += intMatchesAlloced / 5;
- intMatches = realloc(intMatches,
+ intMatches = xrealloc(intMatches,
sizeof(*intMatches) * intMatchesAlloced);
}
headerGetEntryMinMemory(h, RPMTAG_FILENAMES, NULL,
(void **) &fullfl, &fc);
- fl = malloc(sizeof(*fl) * num);
- memset(fl, 0, sizeof(*fl) * num);
+ fl = xcalloc(num, sizeof(*fl));
for (i = 0; i < num; i++)
fl[i] = fullfl[im[i].rec.fileNumber];
free(fullfl);
- fps = malloc(sizeof(*fps) * num);
- memset(fps, 0, sizeof(*fps) * num);
+ fps = xcalloc(num, sizeof(*fps));
fpLookupList(fl, fps, num, 1);
free(fl);
}
if (headerGetEntry(h, RPMTAG_PREFIXES, NULL,
(void **) &paths, &c) && (c == 1)) {
- defaultReloc->oldPath = strdup(paths[0]);
+ defaultReloc->oldPath = xstrdup(paths[0]);
free(paths);
} else {
headerGetEntry(h, RPMTAG_NAME, NULL, (void **) &name,
rc = rpmtransAddPackage(rpmdep, h, NULL, *filename,
(interfaceFlags & INSTALL_UPGRADE) != 0,
relocations);
- if (rc) {
- if (rc == 1)
+
+ headerFree(h); /* XXX reference held by transaction set */
+ fdClose(fd);
+
+ switch(rc) {
+ case 0:
+ break;
+ case 1:
rpmMessage(RPMMESS_ERROR,
_("error reading from file %s\n"), *filename);
- else if (rc == 2)
+ return numPackages;
+ /*@notreached@*/ break;
+ case 2:
rpmMessage(RPMMESS_ERROR,
_("file %s requires a newer version of RPM\n"),
*filename);
- return numPackages;
+ return numPackages;
+ /*@notreached@*/ break;
}
if (defaultReloc) {
defaultReloc->oldPath = NULL;
}
- fdClose(fd);
numBinaryPackages++;
}
break;
pushed through a translation table (if appropriate) */
void rpmSetMachine(const char * arch, const char * os);
void rpmGetMachine(/*@out@*/char **arch, /*@out@*/char **os);
+void rpmFreeRpmrc(void);
/** **/
static void rpmRebuildTargetVars(const char **target, const char ** canontarget);
-
static struct machCacheEntry * machCacheFindEntry(struct machCache * cache,
char * key)
{
}
if (!entry) {
- cache->cache = realloc(cache->cache,
+ cache->cache = xrealloc(cache->cache,
(cache->size + 1) * sizeof(*cache->cache));
entry = cache->cache + cache->size++;
- entry->name = strdup(name);
+ entry->name = xstrdup(name);
entry->count = 0;
entry->visited = 0;
}
if (chptr[0] == '\0') /* does strtok() return "" ever?? */
continue;
if (entry->count)
- entry->equivs = realloc(entry->equivs, sizeof(*entry->equivs)
+ entry->equivs = xrealloc(entry->equivs, sizeof(*entry->equivs)
* (entry->count + 1));
else
- entry->equivs = malloc(sizeof(*entry->equivs));
+ entry->equivs = xmalloc(sizeof(*entry->equivs));
- entry->equivs[entry->count] = strdup(chptr);
+ entry->equivs[entry->count] = xstrdup(chptr);
entry->count++;
}
equiv = machEquivSearch(table, name);
if (!equiv) {
if (table->count)
- table->list = realloc(table->list, (table->count + 1)
+ table->list = xrealloc(table->list, (table->count + 1)
* sizeof(*table->list));
else
- table->list = malloc(sizeof(*table->list));
+ table->list = xmalloc(sizeof(*table->list));
- table->list[table->count].name = strdup(name);
+ table->list[table->count].name = xstrdup(name);
table->list[table->count++].score = distance;
}
}
if (! *tableLen) {
*tableLen = 2;
- *table = malloc(2 * sizeof(struct canonEntry));
+ *table = xmalloc(2 * sizeof(struct canonEntry));
} else {
(*tableLen) += 2;
- *table = realloc(*table, sizeof(struct canonEntry) * (*tableLen));
+ *table = xrealloc(*table, sizeof(struct canonEntry) * (*tableLen));
}
t = & ((*table)[*tableLen - 2]);
return(RPMERR_RPMRC);
}
- t->name = strdup(t->name);
- t->short_name = strdup(t->short_name);
+ t->name = xstrdup(t->name);
+ t->short_name = xstrdup(t->short_name);
/* From A B C entry */
/* Add B B C entry */
- t[1].name = strdup(t->short_name);
- t[1].short_name = strdup(t->short_name);
+ t[1].name = xstrdup(t->short_name);
+ t[1].short_name = xstrdup(t->short_name);
t[1].num = t->num;
return 0;
if (! *tableLen) {
*tableLen = 1;
- *table = malloc(sizeof(struct defaultEntry));
+ *table = xmalloc(sizeof(struct defaultEntry));
} else {
(*tableLen)++;
- *table = realloc(*table, sizeof(struct defaultEntry) * (*tableLen));
+ *table = xrealloc(*table, sizeof(struct defaultEntry) * (*tableLen));
}
t = & ((*table)[*tableLen - 1]);
return RPMERR_RPMRC;
}
- t->name = strdup(t->name);
- t->defName = strdup(t->defName);
+ t->name = xstrdup(t->name);
+ t->defName = xstrdup(t->defName);
return 0;
}
/* Read each file in rcfiles. */
rc = 0;
- for (r = myrcfiles = strdup(rcfiles); *r != '\0'; r = re) {
+ for (r = myrcfiles = xstrdup(rcfiles); *r != '\0'; r = re) {
char fn[4096];
FD_t fd;
{ char *t;
s = rpmGetVar(RPMVAR_PROVIDES);
if (s == NULL) s = "";
- fn = t = malloc(strlen(s) + strlen(se) + 2);
+ fn = t = xmalloc(strlen(s) + strlen(se) + 2);
while (*s) *t++ = *s++;
*t++ = ' ';
while (*se) *t++ = *se++;
if (option->macroize &&
(arch == NULL || !strcmp(arch, current[ARCH]))) {
char *n, *name;
- n = name = malloc(strlen(option->name)+2);
+ n = name = xmalloc(strlen(option->name)+2);
if (option->localize)
*n++ = '_';
strcpy(n, option->name);
char *prelid = NULL;
FD_t fd = fdOpen("/etc/.relid", O_RDONLY, 0700);
if (fdFileno(fd) > 0) {
- chptr = (char *) calloc(256,1);
+ chptr = (char *) xcalloc(1, 256);
if (chptr != NULL) {
int irelid = fdRead(fd, (void *)chptr, 256);
fdClose(fd);
void rpmSetVar(int var, const char *val) {
freeRpmVar(&values[var]);
- values[var].value = (val ? strdup(val) : NULL);
+ values[var].value = (val ? xstrdup(val) : NULL);
}
static void rpmSetVarArch(int var, const char * val, const char * arch) {
if (next->value) free(next->value);
if (next->arch) free(next->arch);
} else if (next->arch || arch) {
- next->next = malloc(sizeof(*next->next));
+ next->next = xmalloc(sizeof(*next->next));
next = next->next;
next->next = NULL;
}
}
- next->value = strdup(val);
- next->arch = (arch ? strdup(arch) : NULL);
+ next->value = xstrdup(val);
+ next->arch = (arch ? xstrdup(arch) : NULL);
}
void rpmSetTables(int archTable, int osTable) {
if (!current[ARCH] || strcmp(arch, current[ARCH])) {
if (current[ARCH]) free(current[ARCH]);
- current[ARCH] = strdup(arch);
+ current[ARCH] = xstrdup(arch);
rebuildCompatTables(ARCH, host_cpu);
}
if (!current[OS] || strcmp(os, current[OS])) {
if (current[OS]) free(current[OS]);
- current[OS] = strdup(os);
+ current[OS] = xstrdup(os);
/*
* XXX Capitalizing the 'L' is needed to insure that old
* XXX os-from-uname (e.g. "Linux") is compatible with the new
if (buildtarget && *buildtarget) {
char *c;
/* Set arch and os from specified build target */
- ca = strdup(*buildtarget);
+ ca = xstrdup(*buildtarget);
if ((c = strchr(ca, '-')) != NULL) {
*c++ = '\0';
else
co++;
}
- if (co != NULL) co = strdup(co);
+ if (co != NULL) co = xstrdup(co);
}
} else {
/* Set build target from rpm arch and os */
rpmGetArchInfo(&ca,NULL);
- if (ca) ca = strdup(ca);
+ if (ca) ca = xstrdup(ca);
rpmGetOsInfo(&co,NULL);
- if (co) co = strdup(co);
+ if (co) co = xstrdup(co);
}
/* If still not set, Set target arch/os from default uname(2) values */
if (ca == NULL) {
defaultMachine(&ca, NULL);
- ca = strdup(ca);
+ ca = xstrdup(ca);
}
for (x = 0; ca[x]; x++)
ca[x] = tolower(ca[x]);
if (co == NULL) {
defaultMachine(NULL, &co);
- co = strdup(co);
+ co = xstrdup(co);
}
for (x = 0; co[x]; x++)
co[x] = tolower(co[x]);
/* XXX For now, set canonical target to arch-os */
if (ct == NULL) {
- ct = malloc(strlen(ca) + sizeof("-") + strlen(co));
+ ct = xmalloc(strlen(ca) + sizeof("-") + strlen(co));
sprintf(ct, "%s-%s", ca, co);
}
free(co);
}
+void rpmFreeRpmrc(void)
+{
+ int i, j, k;
+
+ for (i = 0; i < RPM_MACHTABLE_COUNT; i++) {
+ struct tableType *t;
+ t = tables + i;
+ if (t->equiv.list) {
+ for (j = 0; j < t->equiv.count; j++) {
+ if (t->equiv.list[j].name) xfree(t->equiv.list[j].name);
+ }
+ xfree(t->equiv.list);
+ }
+ if (t->cache.cache) {
+ for (j = 0; j < t->cache.size; j++) {
+ struct machCacheEntry *e;
+ e = t->cache.cache + j;
+ if (e == NULL) continue;
+ if (e->name) xfree(e->name);
+ if (e->equivs) {
+ for (k = 0; k < e->count; k++) {
+ if (e->equivs[k]) xfree(e->equivs[k]);
+ }
+ xfree(e->equivs);
+ }
+ }
+ xfree(t->cache.cache);
+ }
+ if (t->defaults) {
+ for (j = 0; j < t->defaultsLength; j++) {
+ if (t->defaults[j].name) xfree(t->defaults[j].name);
+ if (t->defaults[j].defName) xfree(t->defaults[j].defName);
+ }
+ xfree(t->defaults);
+ }
+ if (t->canons) {
+ for (j = 0; j < t->canonsLength; j++) {
+ if (t->canons[j].name) xfree(t->canons[j].name);
+ if (t->canons[j].short_name) xfree(t->canons[j].short_name);
+ }
+ xfree(t->canons);
+ }
+ }
+
+ for (i = 0; i < RPMVAR_NUM; i++) {
+ struct rpmvarValue *this;
+ while ((this = values[i].next) != NULL) {
+ values[i].next = this->next;
+ if (this->value) xfree(this->value);
+ if (this->arch) xfree(this->arch);
+ xfree(this);
+ }
+ if (values[i].value) xfree(values[i].value);
+ if (values[i].arch) xfree(values[i].arch);
+ }
+ if (current[OS]) xfree(current[OS]);
+ if (current[ARCH]) xfree(current[ARCH]);
+ return;
+}
+
int rpmShowRC(FILE *f)
{
struct rpmOption *opt;
Header rpmNewSignature(void)
{
- return headerNew();
+ Header h = headerNew();
+ return h;
}
void rpmFreeSignature(Header h)
*size = statbuf.st_size;
rpmMessage(RPMMESS_DEBUG, _("PGP sig size: %d\n"), *size);
- *sig = malloc(*size);
+ *sig = xmalloc(*size);
{ FD_t fd;
int rc;
*size = statbuf.st_size;
rpmMessage(RPMMESS_DEBUG, _("GPG sig size: %d\n"), *size);
- *sig = malloc(*size);
+ *sig = xmalloc(*size);
{ FD_t fd;
int rc;
StringBuf newStringBuf(void)
{
- StringBuf sb = malloc(sizeof(struct StringBufRec));
+ StringBuf sb = xmalloc(sizeof(struct StringBufRec));
- sb->buf = malloc(BUF_CHUNK * sizeof(char));
+ sb->free = sb->allocated = BUF_CHUNK;
+ sb->buf = xcalloc(sb->allocated, sizeof(*sb->buf));
sb->buf[0] = '\0';
sb->tail = sb->buf;
- sb->allocated = BUF_CHUNK;
- sb->free = BUF_CHUNK;
return sb;
}
while ((l + nl + 1) > sb->free) {
sb->allocated += BUF_CHUNK;
sb->free += BUF_CHUNK;
- sb->buf = realloc(sb->buf, sb->allocated);
+ sb->buf = xrealloc(sb->buf, sb->allocated);
sb->tail = sb->buf + (sb->allocated - sb->free);
}
{
rpmProblemSet probs;
- probs = malloc(sizeof(*probs));
+ probs = xmalloc(sizeof(*probs));
probs->numProblems = probs->numProblemsAlloced = 0;
probs->probs = NULL;
probs->numProblemsAlloced *= 2;
else
probs->numProblemsAlloced = 2;
- probs->probs = realloc(probs->probs,
+ probs->probs = xrealloc(probs->probs,
probs->numProblemsAlloced * sizeof(*probs->probs));
}
probs->probs[probs->numProblems].h = headerLink(h);
probs->probs[probs->numProblems].ulong1 = ulong1;
if (str1)
- probs->probs[probs->numProblems].str1 = strdup(str1);
+ probs->probs[probs->numProblems].str1 = xstrdup(str1);
else
probs->probs[probs->numProblems].str1 = NULL;
- if (altH)
+ if (altH) {
probs->probs[probs->numProblems].altH = headerLink(altH);
- else
+ } else
probs->probs[probs->numProblems].altH = NULL;
probs->probs[probs->numProblems++].ignoreProblem = 0;
for (i = 0; i < probs->numProblems; i++) {
headerFree(probs->probs[i].h);
if (probs->probs[i].str1) free(probs->probs[i].str1);
- if (probs->probs[i].altH) headerFree(probs->probs[i].altH);
+ if (probs->probs[i].altH) {
+ headerFree(probs->probs[i].altH);
+ }
}
free(probs);
}
(void **) &validRelocations, &numValid))
numValid = 0;
- if (!rawRelocations && !numValid) return headerLink(origH);
+ if (!rawRelocations && !numValid) {
+ Header oH = headerLink(origH);
+ return oH;
+ }
h = headerCopy(origH);
/* Add relocation values to the header */
if (numValid) {
const char ** actualRelocations;
- actualRelocations = malloc(sizeof(*actualRelocations) * numValid);
+ actualRelocations = xmalloc(sizeof(*actualRelocations) * numValid);
for (i = 0; i < numValid; i++) {
for (j = 0; j < numRelocations; j++) {
if (strcmp(validRelocations[i], relocations[j].oldPath))
headerGetEntryMinMemory(h, RPMTAG_FILESIZES, NULL,
(void **) &otherSizes, NULL);
- fi->replaced = malloc(sizeof(*fi->replaced) * sharedCount);
+ fi->replaced = xmalloc(sizeof(*fi->replaced) * sharedCount);
for (i = 0; i < sharedCount; i++, shared++) {
int otherFileNum, fileNum;
free(otherLinks);
headerFree(h);
- fi->replaced = realloc(fi->replaced,
+ fi->replaced = xrealloc(fi->replaced,
sizeof(*fi->replaced) * (numReplaced + 1));
fi->replaced[numReplaced].otherPkg = 0;
}
/* Allocate file actions (and initialize to RPMFILE_STATE_NORMAL) */
- fi->actions = calloc(sizeof(*fi->actions), fi->fc);
+ fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
hdrs[i] = relocateFileList(alp, probs, alp->h, fi->actions,
ignoreSet & RPMPROB_FILTER_FORCERELOCATE);
fi->h = headerLink(hdrs[i]);
/* actions is initialized earlier for added packages */
if (fi->actions == NULL)
- fi->actions = calloc(sizeof(*fi->actions), fi->fc);
+ fi->actions = xcalloc(fi->fc, sizeof(*fi->actions));
headerGetEntry(fi->h, RPMTAG_FILEMODES, NULL,
(void **) &fi->fmodes, NULL);
(void **) &fi->fmd5s, NULL);
headerGetEntry(fi->h, RPMTAG_FILELINKTOS, NULL,
(void **) &fi->flinks, NULL);
- fi->fsizes = memcpy(malloc(fi->fc * sizeof(*fi->fsizes)),
+ fi->fsizes = memcpy(xmalloc(fi->fc * sizeof(*fi->fsizes)),
fi->fsizes, fi->fc * sizeof(*fi->fsizes));
- fi->fflags = memcpy(malloc(fi->fc * sizeof(*fi->fflags)),
+ fi->fflags = memcpy(xmalloc(fi->fc * sizeof(*fi->fflags)),
fi->fflags, fi->fc * sizeof(*fi->fflags));
- fi->fmodes = memcpy(malloc(fi->fc * sizeof(*fi->fmodes)),
+ fi->fmodes = memcpy(xmalloc(fi->fc * sizeof(*fi->fmodes)),
fi->fmodes, fi->fc * sizeof(*fi->fmodes));
- fi->fstates = memcpy(malloc(fi->fc * sizeof(*fi->fstates)),
+ fi->fstates = memcpy(xmalloc(fi->fc * sizeof(*fi->fstates)),
fi->fstates, fi->fc * sizeof(*fi->fstates));
headerFree(fi->h);
fi->h = NULL;
(void **) &fi->flinks, NULL);
/* 0 makes for noops */
- fi->replacedSizes = calloc(fi->fc, sizeof(*fi->replacedSizes));
+ fi->replacedSizes = xcalloc(fi->fc, sizeof(*fi->replacedSizes));
/* Skip netshared paths, not our i18n files, and excluded docs */
skipFiles(fi, flags & RPMTRANS_FLAG_NODOCS);
break;
}
- fi->fps = malloc(fi->fc * sizeof(*fi->fps));
+ fi->fps = xmalloc(sizeof(*fi->fps) * fi->fc);
}
/* There are too many returns to plug this leak. Use alloca instead. */
NULL, notifyData));
/* Extract file info for all files in this package from the database. */
- matches = malloc(sizeof(*matches) * fi->fc);
+ matches = xmalloc(sizeof(*matches) * fi->fc);
if (rpmdbFindFpList(ts->db, fi->fps, matches, fi->fc)) return 1;
numShared = 0;
numShared += dbiIndexSetCount(matches[i]);
/* Build sorted file info list for this package. */
- shared = sharedList = malloc(sizeof(*sharedList) * (numShared + 1));
+ shared = sharedList = xmalloc(sizeof(*sharedList) * (numShared + 1));
for (i = 0; i < fi->fc; i++) {
/*
* Take care not to mark files as replaced in packages that will
rc = 0;
exit:
- if (h) headerFree(h);
+ if (h) {
+ headerFree(h);
+ }
return rc;
}
}
rc = runScript(h, root, programArgc, argv, script, arg, -1, err);
- if (programType == RPM_STRING_ARRAY_TYPE) free(programArgv);
+ if (programArgv && programType == RPM_STRING_ARRAY_TYPE) free(programArgv);
return rc;
}
if (empty == NULL) {
uCount++;
if (uCache)
- uCache = realloc(uCache, sizeof(*uCache) * uCount);
+ uCache = xrealloc(uCache, sizeof(*uCache) * uCount);
else
- uCache = malloc(sizeof(*uCache));
+ uCache = xmalloc(sizeof(*uCache));
empty = &uCache[i];
}
*empty = u;
FREE(u->password);
prompt = alloca(strlen(u->host) + strlen(u->user) + 40);
sprintf(prompt, _("Password for %s@%s: "), u->user, u->host);
- u->password = strdup(getpass(prompt));
+ u->password = xstrdup(getpass(prompt));
}
if (u->proxyh == NULL) {
const char *proxy = rpmExpand("%{_ftpproxy}", NULL);
if (proxy && *proxy != '%') {
const char *uu = (u->user ? u->user : "anonymous");
- char *nu = malloc(strlen(uu) + sizeof("@") + strlen(u->host));
+ char *nu = xmalloc(strlen(uu) + sizeof("@") + strlen(u->host));
strcpy(nu, uu);
strcat(nu, "@");
strcat(nu, u->host);
u->proxyu = nu;
- u->proxyh = strdup(proxy);
+ u->proxyh = xstrdup(proxy);
}
xfree(proxy);
}
if (u->proxyh == NULL) {
const char *proxy = rpmExpand("%{_httpproxy}", NULL);
if (proxy && *proxy != '%')
- u->proxyh = strdup(proxy);
+ u->proxyh = xstrdup(proxy);
xfree(proxy);
}
if ((u = newUrlinfo()) == NULL)
return -1;
- if ((se = s = myurl = strdup(url)) == NULL) {
+ if ((se = s = myurl = xstrdup(url)) == NULL) {
freeUrlinfo(u);
return -1;
}
- u->url = strdup(url);
+ u->url = xstrdup(url);
do {
/* Point to end of next item */
/* Item was service. Save service and go for the rest ...*/
if ((se != s) && se[-1] == ':' && se[0] == '/' && se[1] == '/') {
se[-1] = '\0';
- u->service = strdup(s);
+ u->service = xstrdup(s);
se += 2; /* skip over "//" */
s = se++;
continue;
}
/* Item was everything-but-path. Save path and continue parse on rest */
- u->path = strdup(se);
+ u->path = xstrdup(se);
*se = '\0';
break;
} while (1);
while (fe > f && *fe != ':') fe--;
if (*fe == ':') {
*fe++ = '\0';
- u->password = strdup(fe);
+ u->password = xstrdup(fe);
}
- u->user = strdup(f);
+ u->user = xstrdup(f);
}
/* Look for ...host:port */
while (*fe && *fe != ':') fe++;
if (*fe == ':') {
*fe++ = '\0';
- u->portstr = strdup(fe);
+ u->portstr = xstrdup(fe);
if (u->portstr != NULL && u->portstr[0] != '\0') {
char *end;
u->port = strtol(u->portstr, &end, 0);
}
}
}
- u->host = strdup(f);
+ u->host = xstrdup(f);
if (u->port < 0 && u->service != NULL) {
struct servent *serv;
char buffer[50];
if (withFileNum && label.fileNumber > -1)
- c = malloc(strlen(label.name) + strlen(label.version) +
+ c = xmalloc(strlen(label.name) + strlen(label.version) +
strlen(label.release) + 10);
else
- c = malloc(strlen(label.name) + strlen(label.version) +
+ c = xmalloc(strlen(label.name) + strlen(label.version) +
strlen(label.release) + 3);
strcpy(c, label.name);
char * labelstr, * l;
labelstr = oldrpmdbLabelToLabelstr(label, 0);
- labelstr = realloc(labelstr, strlen(labelstr) + 10);
+ labelstr = xrealloc(labelstr, strlen(labelstr) + 10);
strcat(labelstr, ":");
strcat(labelstr, which);
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-09-20 09:21-0400\n"
+"POT-Creation-Date: 1999-09-20 23:21-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"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
-#: ../build.c:24 ../lib/rpminstall.c:222 ../lib/rpminstall.c:374
+#: ../build.c:23 ../lib/rpminstall.c:222 ../lib/rpminstall.c:382
#, c-format
msgid "cannot open %s/packages.rpm\n"
msgstr ""
-#: ../build.c:34
+#: ../build.c:33
msgid "failed build dependencies:\n"
msgstr ""
-#: ../build.c:62
+#: ../build.c:61
#, c-format
msgid "Unable to open spec file: %s\n"
msgstr ""
-#: ../build.c:118 ../build.c:131
+#: ../build.c:117 ../build.c:130
#, c-format
msgid "Failed to open tar pipe: %s\n"
msgstr ""
#. Give up
-#: ../build.c:139
+#: ../build.c:138
#, c-format
msgid "Failed to read spec file from %s\n"
msgstr ""
-#: ../build.c:164
+#: ../build.c:163
#, c-format
msgid "Failed to rename %s to %s: %s\n"
msgstr ""
-#: ../build.c:202
+#: ../build.c:201
#, c-format
msgid "File is not a regular file: %s\n"
msgstr ""
-#: ../build.c:208
+#: ../build.c:207
#, c-format
msgid "File %s does not appear to be a specfile.\n"
msgstr ""
#. parse up the build operators
-#: ../build.c:259
+#: ../build.c:258
#, c-format
msgid "Building target platforms: %s\n"
msgstr ""
-#: ../build.c:268
+#: ../build.c:267
#, c-format
msgid "Building for target %s\n"
msgstr ""
-#: ../build.c:312
+#: ../build.c:311
msgid "buildroot already specified"
msgstr ""
-#: ../build.c:318
+#: ../build.c:317
msgid "--buildarch has been obsoleted. Use the --target option instead.\n"
msgstr ""
-#: ../build.c:322
+#: ../build.c:321
msgid "--buildos has been obsoleted. Use the --target option instead.\n"
msgstr ""
-#: ../build.c:343
+#: ../build.c:342
msgid "override build architecture"
msgstr ""
-#: ../build.c:345
+#: ../build.c:344
msgid "override build operating system"
msgstr ""
-#: ../build.c:347
+#: ../build.c:346
msgid "override build root"
msgstr ""
-#: ../build.c:349 ../rpm.c:457
+#: ../build.c:348 ../rpm.c:456
msgid "remove build tree when done"
msgstr ""
-#: ../build.c:351
+#: ../build.c:350
msgid "do not execute any stages of the build"
msgstr ""
-#: ../build.c:353
+#: ../build.c:352
msgid "do not accept I18N msgstr's from specfile"
msgstr ""
-#: ../build.c:355
+#: ../build.c:354
msgid "remove sources when done"
msgstr ""
-#: ../build.c:357
+#: ../build.c:356
msgid "remove specfile when done"
msgstr ""
-#: ../build.c:359 ../rpm.c:455
+#: ../build.c:358 ../rpm.c:454
msgid "skip straight to specified stage (only for c,i)"
msgstr ""
-#: ../build.c:361
+#: ../build.c:360
msgid "override target platform"
msgstr ""
-#: ../build.c:363
+#: ../build.c:362
msgid "lookup I18N strings in specfile catalog"
msgstr ""
msgid "no copyright!\n"
msgstr ""
-#: ../rpm.c:159
+#: ../rpm.c:158
#, c-format
msgid "rpm: %s\n"
msgstr ""
-#: ../rpm.c:170
+#: ../rpm.c:169
#, c-format
msgid "RPM version %s\n"
msgstr ""
-#: ../rpm.c:174
+#: ../rpm.c:173
msgid "Copyright (C) 1998 - Red Hat Software"
msgstr ""
-#: ../rpm.c:175
+#: ../rpm.c:174
msgid "This may be freely redistributed under the terms of the GNU GPL"
msgstr ""
-#: ../rpm.c:183
+#: ../rpm.c:182
msgid "usage: rpm {--help}"
msgstr ""
-#: ../rpm.c:184
+#: ../rpm.c:183
msgid " rpm {--version}"
msgstr ""
-#: ../rpm.c:185
+#: ../rpm.c:184
msgid " rpm {--initdb} [--dbpath <dir>]"
msgstr ""
-#: ../rpm.c:186
+#: ../rpm.c:185
msgid ""
" rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]"
msgstr ""
-#: ../rpm.c:187
+#: ../rpm.c:186
msgid " [--replacepkgs] [--replacefiles] [--root <dir>]"
msgstr ""
-#: ../rpm.c:188
+#: ../rpm.c:187
msgid " [--excludedocs] [--includedocs] [--noscripts]"
msgstr ""
-#: ../rpm.c:189
+#: ../rpm.c:188
msgid ""
" [--rcfile <file>] [--ignorearch] [--dbpath <dir>]"
msgstr ""
-#: ../rpm.c:190
+#: ../rpm.c:189
msgid ""
" [--prefix <dir>] [--ignoreos] [--nodeps] [--allfiles]"
msgstr ""
-#: ../rpm.c:191
+#: ../rpm.c:190
msgid ""
" [--ftpproxy <host>] [--ftpport <port>] [--justdb]"
msgstr ""
-#: ../rpm.c:192 ../rpm.c:201 ../rpm.c:210
+#: ../rpm.c:191 ../rpm.c:200 ../rpm.c:209
msgid " [--httpproxy <host>] [--httpport <port>] "
msgstr ""
-#: ../rpm.c:193 ../rpm.c:203
+#: ../rpm.c:192 ../rpm.c:202
msgid " [--noorder] [--relocate oldpath=newpath]"
msgstr ""
-#: ../rpm.c:194
+#: ../rpm.c:193
msgid ""
" [--badreloc] [--notriggers] [--excludepath <path>]"
msgstr ""
-#: ../rpm.c:195
+#: ../rpm.c:194
msgid " [--ignoresize] file1.rpm ... fileN.rpm"
msgstr ""
-#: ../rpm.c:196
+#: ../rpm.c:195
msgid ""
" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]"
msgstr ""
-#: ../rpm.c:197
+#: ../rpm.c:196
msgid " [--oldpackage] [--root <dir>] [--noscripts]"
msgstr ""
-#: ../rpm.c:198
+#: ../rpm.c:197
msgid ""
" [--excludedocs] [--includedocs] [--rcfile <file>]"
msgstr ""
-#: ../rpm.c:199
+#: ../rpm.c:198
msgid ""
" [--ignorearch] [--dbpath <dir>] [--prefix <dir>] "
msgstr ""
-#: ../rpm.c:200
+#: ../rpm.c:199
msgid " [--ftpproxy <host>] [--ftpport <port>]"
msgstr ""
-#: ../rpm.c:202
+#: ../rpm.c:201
msgid " [--ignoreos] [--nodeps] [--allfiles] [--justdb]"
msgstr ""
-#: ../rpm.c:204
+#: ../rpm.c:203
msgid ""
" [--badreloc] [--excludepath <path>] [--ignoresize]"
msgstr ""
-#: ../rpm.c:205
+#: ../rpm.c:204
msgid " file1.rpm ... fileN.rpm"
msgstr ""
-#: ../rpm.c:206
+#: ../rpm.c:205
msgid " rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]"
msgstr ""
-#: ../rpm.c:207
+#: ../rpm.c:206
msgid " [--scripts] [--root <dir>] [--rcfile <file>]"
msgstr ""
-#: ../rpm.c:208
+#: ../rpm.c:207
msgid " [--whatprovides] [--whatrequires] [--requires]"
msgstr ""
-#: ../rpm.c:209
+#: ../rpm.c:208
msgid ""
" [--triggeredby] [--ftpuseport] [--ftpproxy <host>]"
msgstr ""
-#: ../rpm.c:211
+#: ../rpm.c:210
msgid ""
" [--ftpport <port>] [--provides] [--triggers] [--dump]"
msgstr ""
-#: ../rpm.c:212
+#: ../rpm.c:211
msgid " [--changelog] [--dbpath <dir>] [targets]"
msgstr ""
-#: ../rpm.c:213
+#: ../rpm.c:212
msgid " rpm {--verify -V -y} [-afpg] [--root <dir>] [--rcfile <file>]"
msgstr ""
-#: ../rpm.c:214
+#: ../rpm.c:213
msgid ""
" [--dbpath <dir>] [--nodeps] [--nofiles] [--noscripts]"
msgstr ""
-#: ../rpm.c:215
+#: ../rpm.c:214
msgid " [--nomd5] [targets]"
msgstr ""
-#: ../rpm.c:216
+#: ../rpm.c:215
msgid " rpm {--setperms} [-afpg] [target]"
msgstr ""
-#: ../rpm.c:217
+#: ../rpm.c:216
msgid " rpm {--setugids} [-afpg] [target]"
msgstr ""
-#: ../rpm.c:218
+#: ../rpm.c:217
msgid " rpm {--freshen -F} file1.rpm ... fileN.rpm"
msgstr ""
-#: ../rpm.c:219
+#: ../rpm.c:218
msgid " rpm {--erase -e} [--root <dir>] [--noscripts] [--rcfile <file>]"
msgstr ""
-#: ../rpm.c:220
+#: ../rpm.c:219
msgid " [--dbpath <dir>] [--nodeps] [--allmatches]"
msgstr ""
-#: ../rpm.c:221
+#: ../rpm.c:220
msgid ""
" [--justdb] [--notriggers] rpackage1 ... packageN"
msgstr ""
-#: ../rpm.c:222
+#: ../rpm.c:221
msgid ""
" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile <file>]"
msgstr ""
-#: ../rpm.c:223
+#: ../rpm.c:222
msgid " [--sign] [--nobuild] [--timecheck <s>] ]"
msgstr ""
-#: ../rpm.c:224
+#: ../rpm.c:223
msgid " [--target=platform1[,platform2...]]"
msgstr ""
-#: ../rpm.c:225
+#: ../rpm.c:224
msgid " [--rmsource] specfile"
msgstr ""
-#: ../rpm.c:226
+#: ../rpm.c:225
msgid " rpm {--rmsource} [--rcfile <file>] [-v] specfile"
msgstr ""
-#: ../rpm.c:227
+#: ../rpm.c:226
msgid ""
" rpm {--rebuild} [--rcfile <file>] [-v] source1.rpm ... sourceN.rpm"
msgstr ""
-#: ../rpm.c:228
+#: ../rpm.c:227
msgid ""
" rpm {--recompile} [--rcfile <file>] [-v] source1.rpm ... sourceN.rpm"
msgstr ""
-#: ../rpm.c:229
+#: ../rpm.c:228
msgid " rpm {--resign} [--rcfile <file>] package1 package2 ... packageN"
msgstr ""
-#: ../rpm.c:230
+#: ../rpm.c:229
msgid " rpm {--addsign} [--rcfile <file>] package1 package2 ... packageN"
msgstr ""
-#: ../rpm.c:231
+#: ../rpm.c:230
msgid ""
" rpm {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile <file>]"
msgstr ""
-#: ../rpm.c:232
+#: ../rpm.c:231
msgid " package1 ... packageN"
msgstr ""
-#: ../rpm.c:233
+#: ../rpm.c:232
msgid " rpm {--rebuilddb} [--rcfile <file>] [--dbpath <dir>]"
msgstr ""
-#: ../rpm.c:234
+#: ../rpm.c:233
msgid " rpm {--querytags}"
msgstr ""
-#: ../rpm.c:268
+#: ../rpm.c:267
msgid "usage:"
msgstr ""
-#: ../rpm.c:270
+#: ../rpm.c:269
msgid "print this message"
msgstr ""
-#: ../rpm.c:272
+#: ../rpm.c:271
msgid "print the version of rpm being used"
msgstr ""
-#: ../rpm.c:273
+#: ../rpm.c:272
msgid " all modes support the following arguments:"
msgstr ""
-#: ../rpm.c:274
+#: ../rpm.c:273
msgid " --rcfile <file> "
msgstr ""
-#: ../rpm.c:275
+#: ../rpm.c:274
msgid "use <file> instead of /etc/rpmrc and $HOME/.rpmrc"
msgstr ""
-#: ../rpm.c:277
+#: ../rpm.c:276
msgid "be a little more verbose"
msgstr ""
-#: ../rpm.c:279
+#: ../rpm.c:278
msgid "be incredibly verbose (for debugging)"
msgstr ""
-#: ../rpm.c:281
+#: ../rpm.c:280
msgid "query mode"
msgstr ""
-#: ../rpm.c:282 ../rpm.c:344 ../rpm.c:408 ../rpm.c:436
+#: ../rpm.c:281 ../rpm.c:343 ../rpm.c:407 ../rpm.c:435
msgid " --root <dir> "
msgstr ""
-#: ../rpm.c:283 ../rpm.c:345 ../rpm.c:409 ../rpm.c:437 ../rpm.c:499
+#: ../rpm.c:282 ../rpm.c:344 ../rpm.c:408 ../rpm.c:436 ../rpm.c:498
msgid "use <dir> as the top level directory"
msgstr ""
-#: ../rpm.c:284 ../rpm.c:342 ../rpm.c:372 ../rpm.c:424 ../rpm.c:496
+#: ../rpm.c:283 ../rpm.c:341 ../rpm.c:371 ../rpm.c:423 ../rpm.c:495
msgid " --dbpath <dir> "
msgstr ""
-#: ../rpm.c:285 ../rpm.c:343 ../rpm.c:373 ../rpm.c:425 ../rpm.c:497
+#: ../rpm.c:284 ../rpm.c:342 ../rpm.c:372 ../rpm.c:424 ../rpm.c:496
msgid "use <dir> as the directory for the database"
msgstr ""
-#: ../rpm.c:286
+#: ../rpm.c:285
msgid " --queryformat <qfmt>"
msgstr ""
-#: ../rpm.c:287
+#: ../rpm.c:286
msgid "use <qfmt> as the header format (implies -i)"
msgstr ""
-#: ../rpm.c:288
+#: ../rpm.c:287
msgid ""
" install, upgrade and query (with -p) allow ftp URL's to be used in place"
msgstr ""
-#: ../rpm.c:289
+#: ../rpm.c:288
msgid " of file names as well as the following options:"
msgstr ""
-#: ../rpm.c:290
+#: ../rpm.c:289
msgid " --ftpproxy <host> "
msgstr ""
-#: ../rpm.c:291
+#: ../rpm.c:290
msgid "hostname or IP of ftp proxy"
msgstr ""
-#: ../rpm.c:292
+#: ../rpm.c:291
msgid " --ftpport <port> "
msgstr ""
-#: ../rpm.c:293
+#: ../rpm.c:292
msgid "port number of ftp server (or proxy)"
msgstr ""
-#: ../rpm.c:294
+#: ../rpm.c:293
msgid " --httpproxy <host> "
msgstr ""
-#: ../rpm.c:295
+#: ../rpm.c:294
msgid "hostname or IP of http proxy"
msgstr ""
-#: ../rpm.c:296
+#: ../rpm.c:295
msgid " --httpport <port> "
msgstr ""
-#: ../rpm.c:297
+#: ../rpm.c:296
msgid "port number of http server (or proxy)"
msgstr ""
-#: ../rpm.c:298
+#: ../rpm.c:297
msgid " Package specification options:"
msgstr ""
-#: ../rpm.c:300
+#: ../rpm.c:299
msgid "query all packages"
msgstr ""
-#: ../rpm.c:301
+#: ../rpm.c:300
msgid " -f <file>+ "
msgstr ""
-#: ../rpm.c:302
+#: ../rpm.c:301
msgid "query package owning <file>"
msgstr ""
-#: ../rpm.c:303
+#: ../rpm.c:302
msgid " -p <packagefile>+ "
msgstr ""
-#: ../rpm.c:304
+#: ../rpm.c:303
msgid "query (uninstalled) package <packagefile>"
msgstr ""
-#: ../rpm.c:305
+#: ../rpm.c:304
msgid " --triggeredby <pkg>"
msgstr ""
-#: ../rpm.c:306
+#: ../rpm.c:305
msgid "query packages triggered by <pkg>"
msgstr ""
-#: ../rpm.c:307
+#: ../rpm.c:306
msgid " --whatprovides <cap>"
msgstr ""
-#: ../rpm.c:308
+#: ../rpm.c:307
msgid "query packages which provide <cap> capability"
msgstr ""
-#: ../rpm.c:309
+#: ../rpm.c:308
msgid " --whatrequires <cap>"
msgstr ""
-#: ../rpm.c:310
+#: ../rpm.c:309
msgid "query packages which require <cap> capability"
msgstr ""
-#: ../rpm.c:311
+#: ../rpm.c:310
msgid " Information selection options:"
msgstr ""
-#: ../rpm.c:313
+#: ../rpm.c:312
msgid "display package information"
msgstr ""
-#: ../rpm.c:315
+#: ../rpm.c:314
msgid "display the package's change log"
msgstr ""
-#: ../rpm.c:317
+#: ../rpm.c:316
msgid "display package file list"
msgstr ""
-#: ../rpm.c:319
+#: ../rpm.c:318
msgid "show file states (implies -l)"
msgstr ""
-#: ../rpm.c:321
+#: ../rpm.c:320
msgid "list only documentation files (implies -l)"
msgstr ""
-#: ../rpm.c:323
+#: ../rpm.c:322
msgid "list only configuration files (implies -l)"
msgstr ""
-#: ../rpm.c:325
+#: ../rpm.c:324
msgid ""
"show all verifiable information for each file (must be used with -l, -c, or "
"-d)"
msgstr ""
-#: ../rpm.c:327
+#: ../rpm.c:326
msgid "list capabilities package provides"
msgstr ""
-#: ../rpm.c:328
+#: ../rpm.c:327
msgid " --requires"
msgstr ""
-#: ../rpm.c:330
+#: ../rpm.c:329
msgid "list package dependencies"
msgstr ""
-#: ../rpm.c:332
+#: ../rpm.c:331
msgid "print the various [un]install scripts"
msgstr ""
-#: ../rpm.c:334
+#: ../rpm.c:333
msgid "show the trigger scripts contained in the package"
msgstr ""
-#: ../rpm.c:338
+#: ../rpm.c:337
msgid " --pipe <cmd> "
msgstr ""
-#: ../rpm.c:339
+#: ../rpm.c:338
msgid "send stdout to <cmd>"
msgstr ""
-#: ../rpm.c:341
+#: ../rpm.c:340
msgid ""
"verify a package installation using the same same package specification "
"options as -q"
msgstr ""
-#: ../rpm.c:347 ../rpm.c:395 ../rpm.c:429
+#: ../rpm.c:346 ../rpm.c:394 ../rpm.c:428
msgid "do not verify package dependencies"
msgstr ""
-#: ../rpm.c:349
+#: ../rpm.c:348
msgid "do not verify file md5 checksums"
msgstr ""
-#: ../rpm.c:351
+#: ../rpm.c:350
msgid "do not verify file attributes"
msgstr ""
-#: ../rpm.c:354
+#: ../rpm.c:353
msgid ""
"set the file permissions to those in the package database using the same "
"package specification options as -q"
msgstr ""
-#: ../rpm.c:357
+#: ../rpm.c:356
msgid ""
"set the file owner and group to those in the package database using the same "
"package specification options as -q"
msgstr ""
-#: ../rpm.c:361
+#: ../rpm.c:360
msgid " --install <packagefile>"
msgstr ""
-#: ../rpm.c:362
+#: ../rpm.c:361
msgid " -i <packagefile> "
msgstr ""
-#: ../rpm.c:363
+#: ../rpm.c:362
msgid "install package"
msgstr ""
-#: ../rpm.c:364
+#: ../rpm.c:363
msgid " --excludepath <path>"
msgstr ""
-#: ../rpm.c:365
+#: ../rpm.c:364
msgid "skip files in path <path>"
msgstr ""
-#: ../rpm.c:366
+#: ../rpm.c:365
msgid " --relocate <oldpath>=<newpath>"
msgstr ""
-#: ../rpm.c:367
+#: ../rpm.c:366
msgid "relocate files from <oldpath> to <newpath>"
msgstr ""
-#: ../rpm.c:369
+#: ../rpm.c:368
msgid "relocate files even though the package doesn't allow it"
msgstr ""
-#: ../rpm.c:370
+#: ../rpm.c:369
msgid " --prefix <dir> "
msgstr ""
-#: ../rpm.c:371
+#: ../rpm.c:370
msgid "relocate the package to <dir>, if relocatable"
msgstr ""
-#: ../rpm.c:375
+#: ../rpm.c:374
msgid "do not install documentation"
msgstr ""
-#: ../rpm.c:377
+#: ../rpm.c:376
msgid "short hand for --replacepkgs --replacefiles"
msgstr ""
-#: ../rpm.c:380
+#: ../rpm.c:379
msgid "print hash marks as package installs (good with -v)"
msgstr ""
-#: ../rpm.c:382
+#: ../rpm.c:381
msgid "install all files, even configurations which might otherwise be skipped"
msgstr ""
-#: ../rpm.c:385
+#: ../rpm.c:384
msgid "don't verify package architecture"
msgstr ""
-#: ../rpm.c:387
+#: ../rpm.c:386
msgid "don't check disk space before installing"
msgstr ""
-#: ../rpm.c:389
+#: ../rpm.c:388
msgid "don't verify package operating system"
msgstr ""
-#: ../rpm.c:391
+#: ../rpm.c:390
msgid "install documentation"
msgstr ""
-#: ../rpm.c:393 ../rpm.c:427
+#: ../rpm.c:392 ../rpm.c:426
msgid "update the database, but do not modify the filesystem"
msgstr ""
-#: ../rpm.c:397 ../rpm.c:431
+#: ../rpm.c:396 ../rpm.c:430
msgid "do not reorder package installation to satisfy dependencies"
msgstr ""
-#: ../rpm.c:399
+#: ../rpm.c:398
msgid "don't execute any installation scripts"
msgstr ""
-#: ../rpm.c:401 ../rpm.c:435
+#: ../rpm.c:400 ../rpm.c:434
msgid "don't execute any scripts triggered by this package"
msgstr ""
-#: ../rpm.c:403
+#: ../rpm.c:402
msgid "print percentages as package installs"
msgstr ""
-#: ../rpm.c:405
+#: ../rpm.c:404
msgid "install even if the package replaces installed files"
msgstr ""
-#: ../rpm.c:407
+#: ../rpm.c:406
msgid "reinstall if the package is already present"
msgstr ""
-#: ../rpm.c:411
+#: ../rpm.c:410
msgid "don't install, but tell if it would work or not"
msgstr ""
-#: ../rpm.c:413
+#: ../rpm.c:412
msgid " --upgrade <packagefile>"
msgstr ""
-#: ../rpm.c:414
+#: ../rpm.c:413
msgid " -U <packagefile> "
msgstr ""
-#: ../rpm.c:415
+#: ../rpm.c:414
msgid "upgrade package (same options as --install, plus)"
msgstr ""
-#: ../rpm.c:417
+#: ../rpm.c:416
msgid ""
"upgrade to an old version of the package (--force on upgrades does this "
"automatically)"
msgstr ""
-#: ../rpm.c:419
+#: ../rpm.c:418
msgid " --erase <package>"
msgstr ""
-#: ../rpm.c:421
+#: ../rpm.c:420
msgid "erase (uninstall) package"
msgstr ""
-#: ../rpm.c:423
+#: ../rpm.c:422
msgid ""
"remove all packages which match <package> (normally an error is generated if "
"<package> specified multiple packages)"
msgstr ""
-#: ../rpm.c:433
+#: ../rpm.c:432
msgid "do not execute any package specific scripts"
msgstr ""
-#: ../rpm.c:439
+#: ../rpm.c:438
msgid " -b<stage> <spec> "
msgstr ""
-#: ../rpm.c:440
+#: ../rpm.c:439
msgid " -t<stage> <tarball> "
msgstr ""
-#: ../rpm.c:441
+#: ../rpm.c:440
msgid "build package, where <stage> is one of:"
msgstr ""
-#: ../rpm.c:443
+#: ../rpm.c:442
msgid "prep (unpack sources and apply patches)"
msgstr ""
-#: ../rpm.c:445
+#: ../rpm.c:444
#, c-format
msgid "list check (do some cursory checks on %files)"
msgstr ""
-#: ../rpm.c:447
+#: ../rpm.c:446
msgid "compile (prep and compile)"
msgstr ""
-#: ../rpm.c:449
+#: ../rpm.c:448
msgid "install (prep, compile, install)"
msgstr ""
-#: ../rpm.c:451
+#: ../rpm.c:450
msgid "binary package (prep, compile, install, package)"
msgstr ""
-#: ../rpm.c:453
+#: ../rpm.c:452
msgid "bin/src package (prep, compile, install, package)"
msgstr ""
-#: ../rpm.c:459
+#: ../rpm.c:458
msgid "remove sources and spec file when done"
msgstr ""
-#: ../rpm.c:461
+#: ../rpm.c:460
msgid "generate PGP/GPG signature"
msgstr ""
-#: ../rpm.c:462
+#: ../rpm.c:461
msgid " --buildroot <dir> "
msgstr ""
-#: ../rpm.c:463
+#: ../rpm.c:462
msgid "use <dir> as the build root"
msgstr ""
-#: ../rpm.c:464
+#: ../rpm.c:463
msgid " --target=<platform>+"
msgstr ""
-#: ../rpm.c:465
+#: ../rpm.c:464
msgid "build the packages for the build targets platform1...platformN."
msgstr ""
-#: ../rpm.c:467
+#: ../rpm.c:466
msgid "do not execute any stages"
msgstr ""
-#: ../rpm.c:468
+#: ../rpm.c:467
msgid " --timecheck <secs> "
msgstr ""
-#: ../rpm.c:469
+#: ../rpm.c:468
msgid "set the time check to <secs> seconds (0 disables)"
msgstr ""
-#: ../rpm.c:471
+#: ../rpm.c:470
msgid " --rebuild <src_pkg> "
msgstr ""
-#: ../rpm.c:472
+#: ../rpm.c:471
msgid ""
"install source package, build binary package and remove spec file, sources, "
"patches, and icons."
msgstr ""
-#: ../rpm.c:473
+#: ../rpm.c:472
msgid " --rmsource <spec> "
msgstr ""
-#: ../rpm.c:474
+#: ../rpm.c:473
msgid "remove sources and spec file"
msgstr ""
-#: ../rpm.c:475
+#: ../rpm.c:474
msgid " --recompile <src_pkg> "
msgstr ""
-#: ../rpm.c:476
+#: ../rpm.c:475
msgid "like --rebuild, but don't build any package"
msgstr ""
-#: ../rpm.c:477
+#: ../rpm.c:476
msgid " --resign <pkg>+ "
msgstr ""
-#: ../rpm.c:478
+#: ../rpm.c:477
msgid "sign a package (discard current signature)"
msgstr ""
-#: ../rpm.c:479
+#: ../rpm.c:478
msgid " --addsign <pkg>+ "
msgstr ""
-#: ../rpm.c:480
+#: ../rpm.c:479
msgid "add a signature to a package"
msgstr ""
-#: ../rpm.c:482
+#: ../rpm.c:481
msgid " --checksig <pkg>+ "
msgstr ""
-#: ../rpm.c:483
+#: ../rpm.c:482
msgid "verify package signature"
msgstr ""
-#: ../rpm.c:485
+#: ../rpm.c:484
msgid "skip any PGP signatures"
msgstr ""
-#: ../rpm.c:487
+#: ../rpm.c:486
msgid "skip any GPG signatures"
msgstr ""
-#: ../rpm.c:489
+#: ../rpm.c:488
msgid "skip any MD5 signatures"
msgstr ""
-#: ../rpm.c:491
+#: ../rpm.c:490
msgid "list the tags that can be used in a query format"
msgstr ""
-#: ../rpm.c:493
+#: ../rpm.c:492
msgid "make sure a valid database exists"
msgstr ""
-#: ../rpm.c:495
+#: ../rpm.c:494
msgid "rebuild database from existing database"
msgstr ""
-#: ../rpm.c:638 ../rpm.c:644 ../rpm.c:651 ../rpm.c:657 ../rpm.c:666
-#: ../rpm.c:673 ../rpm.c:720 ../rpm.c:726 ../rpm.c:760 ../rpm.c:766
-#: ../rpm.c:772 ../rpm.c:780 ../rpm.c:815 ../rpm.c:870 ../rpm.c:877
+#: ../rpm.c:637 ../rpm.c:643 ../rpm.c:650 ../rpm.c:656 ../rpm.c:665
+#: ../rpm.c:672 ../rpm.c:719 ../rpm.c:725 ../rpm.c:759 ../rpm.c:765
+#: ../rpm.c:771 ../rpm.c:779 ../rpm.c:814 ../rpm.c:869 ../rpm.c:876
msgid "only one major mode may be specified"
msgstr ""
-#: ../rpm.c:659
+#: ../rpm.c:658
msgid "-u and --uninstall are deprecated and no longer work.\n"
msgstr ""
-#: ../rpm.c:661
+#: ../rpm.c:660
msgid "Use -e or --erase instead.\n"
msgstr ""
-#: ../rpm.c:677
+#: ../rpm.c:676
msgid "--build (-b) requires one of a,b,i,c,p,l as its sole argument"
msgstr ""
-#: ../rpm.c:681
+#: ../rpm.c:680
msgid "--tarbuild (-t) requires one of a,b,i,c,p,l as its sole argument"
msgstr ""
-#: ../rpm.c:733 ../rpm.c:739 ../rpm.c:746 ../rpm.c:753 ../rpm.c:884
+#: ../rpm.c:732 ../rpm.c:738 ../rpm.c:745 ../rpm.c:752 ../rpm.c:883
msgid "one type of query/verify may be performed at a time"
msgstr ""
-#: ../rpm.c:788
+#: ../rpm.c:787
msgid "arguments to --dbpath must begin with a /"
msgstr ""
-#: ../rpm.c:821
+#: ../rpm.c:820
msgid "relocations must begin with a /"
msgstr ""
-#: ../rpm.c:823
+#: ../rpm.c:822
msgid "relocations must contain a ="
msgstr ""
-#: ../rpm.c:826
+#: ../rpm.c:825
msgid "relocations must have a / following the ="
msgstr ""
-#: ../rpm.c:835
+#: ../rpm.c:834
msgid "exclude paths must begin with a /"
msgstr ""
-#: ../rpm.c:844
+#: ../rpm.c:843
#, c-format
msgid "Internal error in argument processing (%d) :-(\n"
msgstr ""
-#: ../rpm.c:897
+#: ../rpm.c:896
msgid "--dbpath given for operation that does not use a database"
msgstr ""
-#: ../rpm.c:902
+#: ../rpm.c:901
msgid "--timecheck may only be used during package builds"
msgstr ""
-#: ../rpm.c:905
+#: ../rpm.c:904
msgid "unexpected query flags"
msgstr ""
-#: ../rpm.c:908
+#: ../rpm.c:907
msgid "unexpected query format"
msgstr ""
-#: ../rpm.c:912
+#: ../rpm.c:911
msgid "unexpected query source"
msgstr ""
-#: ../rpm.c:918
+#: ../rpm.c:917
msgid "only installation, upgrading, rmsource and rmspec may be forced"
msgstr ""
-#: ../rpm.c:921
+#: ../rpm.c:920
msgid "files may only be relocated during package installation"
msgstr ""
-#: ../rpm.c:924
+#: ../rpm.c:923
msgid "only one of --prefix or --relocate may be used"
msgstr ""
-#: ../rpm.c:927
+#: ../rpm.c:926
msgid ""
"--relocate and --excludepath may only be used when installing new packages"
msgstr ""
-#: ../rpm.c:930
+#: ../rpm.c:929
msgid "--prefix may only be used when installing new packages"
msgstr ""
-#: ../rpm.c:933
+#: ../rpm.c:932
msgid "arguments to --prefix must begin with a /"
msgstr ""
-#: ../rpm.c:936
+#: ../rpm.c:935
msgid "--hash (-h) may only be specified during package installation"
msgstr ""
-#: ../rpm.c:940
+#: ../rpm.c:939
msgid "--percent may only be specified during package installation"
msgstr ""
-#: ../rpm.c:944
+#: ../rpm.c:943
msgid "--replacefiles may only be specified during package installation"
msgstr ""
-#: ../rpm.c:948
+#: ../rpm.c:947
msgid "--replacepkgs may only be specified during package installation"
msgstr ""
-#: ../rpm.c:952
+#: ../rpm.c:951
msgid "--excludedocs may only be specified during package installation"
msgstr ""
-#: ../rpm.c:956
+#: ../rpm.c:955
msgid "--includedocs may only be specified during package installation"
msgstr ""
-#: ../rpm.c:960
+#: ../rpm.c:959
msgid "only one of --excludedocs and --includedocs may be specified"
msgstr ""
-#: ../rpm.c:964
+#: ../rpm.c:963
msgid "--ignorearch may only be specified during package installation"
msgstr ""
-#: ../rpm.c:968
+#: ../rpm.c:967
msgid "--ignoreos may only be specified during package installation"
msgstr ""
-#: ../rpm.c:972
+#: ../rpm.c:971
msgid "--ignoresize may only be specified during package installation"
msgstr ""
-#: ../rpm.c:976
+#: ../rpm.c:975
msgid "--allmatches may only be specified during package erasure"
msgstr ""
-#: ../rpm.c:980
+#: ../rpm.c:979
msgid "--allfiles may only be specified during package installation"
msgstr ""
-#: ../rpm.c:984
+#: ../rpm.c:983
msgid "--justdb may only be specified during package installation and erasure"
msgstr ""
-#: ../rpm.c:989
+#: ../rpm.c:988
msgid ""
"--noscripts may only be specified during package installation, erasure, and "
"verification"
msgstr ""
-#: ../rpm.c:993
+#: ../rpm.c:992
msgid ""
"--notriggers may only be specified during package installation, erasure, and "
"verification"
msgstr ""
-#: ../rpm.c:999
+#: ../rpm.c:998
msgid ""
"--nodeps may only be specified during package building, installation, "
"erasure, and verification"
msgstr ""
-#: ../rpm.c:1004
+#: ../rpm.c:1003
msgid ""
"--test may only be specified during package installation, erasure, and "
"building"
msgstr ""
-#: ../rpm.c:1009
+#: ../rpm.c:1008
msgid ""
"--root (-r) may only be specified during installation, erasure, querying, "
"and database rebuilds"
msgstr ""
-#: ../rpm.c:1014
+#: ../rpm.c:1013
msgid "arguments to --root (-r) must begin with a /"
msgstr ""
-#: ../rpm.c:1017
+#: ../rpm.c:1016
msgid "--oldpackage may only be used during upgrades"
msgstr ""
-#: ../rpm.c:1022
+#: ../rpm.c:1021
msgid ""
"ftp options can only be used during package queries, installs, and upgrades"
msgstr ""
-#: ../rpm.c:1028
+#: ../rpm.c:1027
msgid ""
"http options can only be used during package queries, installs, and upgrades"
msgstr ""
-#: ../rpm.c:1032
+#: ../rpm.c:1031
msgid "--nopgp may only be used during signature checking"
msgstr ""
-#: ../rpm.c:1035
+#: ../rpm.c:1034
msgid "--nogpg may only be used during signature checking"
msgstr ""
-#: ../rpm.c:1038
+#: ../rpm.c:1037
msgid ""
"--nomd5 may only be used during signature checking and package verification"
msgstr ""
-#: ../rpm.c:1062
+#: ../rpm.c:1061
msgid "no files to sign\n"
msgstr ""
-#: ../rpm.c:1067
+#: ../rpm.c:1066
#, c-format
msgid "cannot access file %s\n"
msgstr ""
-#: ../rpm.c:1082
+#: ../rpm.c:1081
msgid "pgp not found: "
msgstr ""
-#: ../rpm.c:1086
+#: ../rpm.c:1085
msgid "Enter pass phrase: "
msgstr ""
-#: ../rpm.c:1088
+#: ../rpm.c:1087
msgid "Pass phrase check failed\n"
msgstr ""
-#: ../rpm.c:1091
+#: ../rpm.c:1090
msgid "Pass phrase is good.\n"
msgstr ""
-#: ../rpm.c:1096
+#: ../rpm.c:1095
msgid "Invalid %%_signature spec in macro file.\n"
msgstr ""
-#: ../rpm.c:1102
+#: ../rpm.c:1101
msgid "--sign may only be used during package building"
msgstr ""
-#: ../rpm.c:1117
+#: ../rpm.c:1116
msgid "exec failed\n"
msgstr ""
-#: ../rpm.c:1136
+#: ../rpm.c:1135
msgid "unexpected arguments to --querytags "
msgstr ""
-#: ../rpm.c:1147
+#: ../rpm.c:1146
msgid "no packages given for signature check"
msgstr ""
-#: ../rpm.c:1159
+#: ../rpm.c:1158
msgid "no packages given for signing"
msgstr ""
-#: ../rpm.c:1172
+#: ../rpm.c:1171
msgid "no packages files given for rebuild"
msgstr ""
-#: ../rpm.c:1229
+#: ../rpm.c:1228
msgid "no spec files given for build"
msgstr ""
-#: ../rpm.c:1231
+#: ../rpm.c:1230
msgid "no tar files given for build"
msgstr ""
-#: ../rpm.c:1243
+#: ../rpm.c:1242
msgid "no packages given for uninstall"
msgstr ""
-#: ../rpm.c:1292
+#: ../rpm.c:1291
msgid "no packages given for install"
msgstr ""
-#: ../rpm.c:1315
+#: ../rpm.c:1314
msgid "extra arguments given for query of all packages"
msgstr ""
-#: ../rpm.c:1320
+#: ../rpm.c:1319
msgid "no arguments given for query"
msgstr ""
-#: ../rpm.c:1337
+#: ../rpm.c:1336
msgid "extra arguments given for verify of all packages"
msgstr ""
-#: ../rpm.c:1341
+#: ../rpm.c:1340
msgid "no arguments given for verify"
msgstr ""
msgid "error removing record %s into %s"
msgstr ""
-#: ../lib/depends.c:456
+#: ../lib/depends.c:450
msgid "dbrecMatchesDepFlags() failed to read header"
msgstr ""
-#: ../lib/depends.c:731
+#: ../lib/depends.c:721
#, c-format
msgid "dependencies: looking for %s\n"
msgstr ""
#. requirements are not satisfied.
-#: ../lib/depends.c:870
+#: ../lib/depends.c:860
#, c-format
msgid "package %s require not satisfied: %s\n"
msgstr ""
#. conflicts exist.
-#: ../lib/depends.c:932
+#: ../lib/depends.c:922
#, c-format
msgid "package %s conflicts: %s\n"
msgstr ""
-#: ../lib/depends.c:987 ../lib/depends.c:1294
+#: ../lib/depends.c:977 ../lib/depends.c:1282
#, c-format
msgid "cannot read header at %d for dependency check"
msgstr ""
-#: ../lib/depends.c:1082
+#: ../lib/depends.c:1072
#, c-format
msgid "loop in prerequisite chain: %s"
msgstr ""
-#: ../lib/falloc.c:159
+#: ../lib/falloc.c:160
#, c-format
msgid ""
"free list corrupt (%u)- please run\n"
msgstr ""
#: ../lib/formats.c:66 ../lib/formats.c:84 ../lib/formats.c:105
-#: ../lib/formats.c:138 ../lib/header.c:2113 ../lib/header.c:2130
-#: ../lib/header.c:2150
+#: ../lib/formats.c:138 ../lib/header.c:2118 ../lib/header.c:2135
+#: ../lib/header.c:2155
msgid "(not a number)"
msgstr ""
msgid "mntctl() failed to return fugger size: %s"
msgstr ""
-#: ../lib/fs.c:75 ../lib/fs.c:254
+#: ../lib/fs.c:75 ../lib/fs.c:253
#, c-format
msgid "failed to stat %s: %s"
msgstr ""
msgid "failed to open %s: %s"
msgstr ""
-#: ../lib/fs.c:275
+#: ../lib/fs.c:274
#, c-format
msgid "file %s is on an unknown device"
msgstr ""
msgid "Data type %d not supprted\n"
msgstr ""
-#: ../lib/header.c:1110
+#: ../lib/header.c:1115
#, c-format
msgid "Bad count for headerAddEntry(): %d\n"
msgstr ""
-#: ../lib/header.c:1511
+#: ../lib/header.c:1516
#, c-format
msgid "missing { after %"
msgstr ""
-#: ../lib/header.c:1539
+#: ../lib/header.c:1544
msgid "missing } after %{"
msgstr ""
-#: ../lib/header.c:1551
+#: ../lib/header.c:1556
msgid "empty tag format"
msgstr ""
-#: ../lib/header.c:1561
+#: ../lib/header.c:1566
msgid "empty tag name"
msgstr ""
-#: ../lib/header.c:1576
+#: ../lib/header.c:1581
msgid "unknown tag"
msgstr ""
-#: ../lib/header.c:1602
+#: ../lib/header.c:1607
msgid "] expected at end of array"
msgstr ""
-#: ../lib/header.c:1618
+#: ../lib/header.c:1623
msgid "unexpected ]"
msgstr ""
-#: ../lib/header.c:1620
+#: ../lib/header.c:1625
msgid "unexpected }"
msgstr ""
-#: ../lib/header.c:1673
+#: ../lib/header.c:1678
msgid "? expected in expression"
msgstr ""
-#: ../lib/header.c:1680
+#: ../lib/header.c:1685
msgid "{ expected after ? in expression"
msgstr ""
-#: ../lib/header.c:1690 ../lib/header.c:1722
+#: ../lib/header.c:1695 ../lib/header.c:1727
msgid "} expected in expression"
msgstr ""
-#: ../lib/header.c:1697
+#: ../lib/header.c:1702
msgid ": expected following ? subexpression"
msgstr ""
-#: ../lib/header.c:1710
+#: ../lib/header.c:1715
msgid "{ expected after : in expression"
msgstr ""
-#: ../lib/header.c:1729
+#: ../lib/header.c:1734
msgid "| expected at end of expression"
msgstr ""
-#: ../lib/header.c:1896
+#: ../lib/header.c:1901
msgid "(unknown type)"
msgstr ""
msgid "renaming %s to %s\n"
msgstr ""
-#: ../lib/install.c:531 ../lib/install.c:807 ../lib/uninstall.c:26
+#: ../lib/install.c:531 ../lib/install.c:809 ../lib/uninstall.c:26
#, c-format
msgid "rename of %s to %s failed: %s"
msgstr ""
msgid "source package expected, binary found"
msgstr ""
-#: ../lib/install.c:676
+#: ../lib/install.c:678
#, c-format
msgid "package: %s-%s-%s files test = %d\n"
msgstr ""
-#: ../lib/install.c:737
+#: ../lib/install.c:739
msgid "stopping install as we're running --test\n"
msgstr ""
-#: ../lib/install.c:742
+#: ../lib/install.c:744
msgid "running preinstall script (if any)\n"
msgstr ""
-#: ../lib/install.c:767
+#: ../lib/install.c:769
#, c-format
msgid "warning: %s created as %s"
msgstr ""
-#: ../lib/install.c:803
+#: ../lib/install.c:805
#, c-format
msgid "warning: %s saved as %s"
msgstr ""
-#: ../lib/install.c:877
+#: ../lib/install.c:879
msgid "running postinstall scripts (if any)\n"
msgstr ""
msgid "cannot read header at %d for lookup"
msgstr ""
-#: ../lib/macro.c:148
+#: ../lib/macro.c:149
#, c-format
msgid "======================== active %d empty %d\n"
msgstr ""
#. XXX just in case
-#: ../lib/macro.c:242
+#: ../lib/macro.c:243
#, c-format
msgid "%3d>%*s(empty)"
msgstr ""
-#: ../lib/macro.c:277
+#: ../lib/macro.c:278
#, c-format
msgid "%3d<%*s(empty)\n"
msgstr ""
-#: ../lib/macro.c:456
+#: ../lib/macro.c:457
msgid "Macro %%%s has unterminated body"
msgstr ""
-#: ../lib/macro.c:482
+#: ../lib/macro.c:483
msgid "Macro %%%s has illegal name (%%define)"
msgstr ""
-#: ../lib/macro.c:488
+#: ../lib/macro.c:489
msgid "Macro %%%s has unterminated opts"
msgstr ""
-#: ../lib/macro.c:493
+#: ../lib/macro.c:494
msgid "Macro %%%s has empty body"
msgstr ""
-#: ../lib/macro.c:498
+#: ../lib/macro.c:499
msgid "Macro %%%s failed to expand"
msgstr ""
-#: ../lib/macro.c:523
+#: ../lib/macro.c:524
msgid "Macro %%%s has illegal name (%%undefine)"
msgstr ""
-#: ../lib/macro.c:600
+#: ../lib/macro.c:601
msgid "Macro %%%s (%s) was not used below level %d"
msgstr ""
-#: ../lib/macro.c:697
+#: ../lib/macro.c:698
#, c-format
msgid "Unknown option %c in %s(%s)"
msgstr ""
-#: ../lib/macro.c:869
+#: ../lib/macro.c:870
#, c-format
msgid "Recursion depth(%d) greater than max(%d)"
msgstr ""
-#: ../lib/macro.c:935 ../lib/macro.c:951
+#: ../lib/macro.c:936 ../lib/macro.c:952
#, c-format
msgid "Unterminated %c: %s"
msgstr ""
-#: ../lib/macro.c:991
+#: ../lib/macro.c:992
msgid "A %% is followed by an unparseable macro"
msgstr ""
-#: ../lib/macro.c:1114
+#: ../lib/macro.c:1115
msgid "Macro %%%.*s not found, skipping"
msgstr ""
-#: ../lib/macro.c:1195
+#: ../lib/macro.c:1196
msgid "Target buffer overflow"
msgstr ""
-#: ../lib/macro.c:1342 ../lib/macro.c:1350
+#: ../lib/macro.c:1343 ../lib/macro.c:1351
#, c-format
msgid "File %s: %s"
msgstr ""
-#: ../lib/macro.c:1353
+#: ../lib/macro.c:1354
#, c-format
msgid "File %s is smaller than %d bytes"
msgstr ""
msgid "bad file state: %s"
msgstr ""
-#: ../lib/package.c:235
+#: ../lib/package.c:234
msgid "package is a version one package!\n"
msgstr ""
-#: ../lib/package.c:240
+#: ../lib/package.c:239
msgid "old style source package -- I'll do my best\n"
msgstr ""
-#: ../lib/package.c:243
+#: ../lib/package.c:242
#, c-format
msgid "archive offset is %d\n"
msgstr ""
-#: ../lib/package.c:253
+#: ../lib/package.c:252
msgid "old style binary package\n"
msgstr ""
-#: ../lib/package.c:297
+#: ../lib/package.c:298
msgid ""
"only packages with major numbers <= 3 are supported by this version of RPM"
msgstr ""
msgid "unknown error %d encountered while manipulating package %s-%s-%s"
msgstr ""
-#: ../lib/query.c:139
+#: ../lib/query.c:138
#, c-format
msgid "error in format: %s\n"
msgstr ""
-#: ../lib/query.c:181
+#: ../lib/query.c:180
msgid "(contains no files)"
msgstr ""
-#: ../lib/query.c:234
+#: ../lib/query.c:233
msgid "normal "
msgstr ""
-#: ../lib/query.c:236
+#: ../lib/query.c:235
msgid "replaced "
msgstr ""
-#: ../lib/query.c:238
+#: ../lib/query.c:237
msgid "not installed "
msgstr ""
-#: ../lib/query.c:240
+#: ../lib/query.c:239
msgid "net shared "
msgstr ""
-#: ../lib/query.c:242
+#: ../lib/query.c:241
#, c-format
msgid "(unknown %3d) "
msgstr ""
-#: ../lib/query.c:246
+#: ../lib/query.c:245
msgid "(no state) "
msgstr ""
-#: ../lib/query.c:262 ../lib/query.c:292
+#: ../lib/query.c:261 ../lib/query.c:291
msgid "package has neither file owner or id lists"
msgstr ""
-#: ../lib/query.c:401
+#: ../lib/query.c:400
#, c-format
msgid "record number %u\n"
msgstr ""
-#: ../lib/query.c:405
+#: ../lib/query.c:404
msgid "error: could not read database record\n"
msgstr ""
-#: ../lib/query.c:443
+#: ../lib/query.c:442
#, c-format
msgid "open of %s failed: %s\n"
msgstr ""
-#: ../lib/query.c:456
+#: ../lib/query.c:455
msgid "old format source packages cannot be queried\n"
msgstr ""
-#: ../lib/query.c:465 ../lib/rpminstall.c:203
+#: ../lib/query.c:464 ../lib/rpminstall.c:203
#, c-format
msgid "%s does not appear to be a RPM package\n"
msgstr ""
-#: ../lib/query.c:468
+#: ../lib/query.c:467
#, c-format
msgid "query of %s failed\n"
msgstr ""
-#: ../lib/query.c:495
+#: ../lib/query.c:494
#, c-format
msgid "query of specfile %s failed, can't parse\n"
msgstr ""
-#: ../lib/query.c:520
+#: ../lib/query.c:519
msgid "could not read database record!\n"
msgstr ""
-#: ../lib/query.c:531
+#: ../lib/query.c:530
#, c-format
msgid "group %s does not contain any packages\n"
msgstr ""
-#: ../lib/query.c:541
+#: ../lib/query.c:540
#, c-format
msgid "no package provides %s\n"
msgstr ""
-#: ../lib/query.c:551
+#: ../lib/query.c:550
#, c-format
msgid "no package triggers %s\n"
msgstr ""
-#: ../lib/query.c:561
+#: ../lib/query.c:560
#, c-format
msgid "no package requires %s\n"
msgstr ""
-#: ../lib/query.c:576
+#: ../lib/query.c:575
#, c-format
msgid "file %s: %s\n"
msgstr ""
-#: ../lib/query.c:579
+#: ../lib/query.c:578
#, c-format
msgid "file %s is not owned by any package\n"
msgstr ""
-#: ../lib/query.c:592
+#: ../lib/query.c:591
#, c-format
msgid "invalid package number: %s\n"
msgstr ""
-#: ../lib/query.c:595
+#: ../lib/query.c:594
#, c-format
msgid "package record number: %d\n"
msgstr ""
-#: ../lib/query.c:598
+#: ../lib/query.c:597
#, c-format
msgid "record %d could not be read\n"
msgstr ""
-#: ../lib/query.c:610 ../lib/rpminstall.c:385
+#: ../lib/query.c:609 ../lib/rpminstall.c:393
#, c-format
msgid "package %s is not installed\n"
msgstr ""
-#: ../lib/query.c:613
+#: ../lib/query.c:612
#, c-format
msgid "error looking for package %s\n"
msgstr ""
-#: ../lib/query.c:635
+#: ../lib/query.c:634
msgid "rpmQuery: rpmdbOpen() failed\n"
msgstr ""
-#: ../lib/query.c:692
+#: ../lib/query.c:691
msgid "query package owning file"
msgstr ""
-#: ../lib/query.c:694
+#: ../lib/query.c:693
msgid "query packages in group"
msgstr ""
-#: ../lib/query.c:696
+#: ../lib/query.c:695
msgid "query a package file"
msgstr ""
-#: ../lib/query.c:700
+#: ../lib/query.c:699
msgid "query a spec file"
msgstr ""
-#: ../lib/query.c:702
+#: ../lib/query.c:701
msgid "query the pacakges triggered by the package"
msgstr ""
-#: ../lib/query.c:704
+#: ../lib/query.c:703
msgid "query the packages which require a capability"
msgstr ""
-#: ../lib/query.c:706
+#: ../lib/query.c:705
msgid "query the packages which provide a capability"
msgstr ""
-#: ../lib/query.c:743
+#: ../lib/query.c:742
msgid "list all configuration files"
msgstr ""
-#: ../lib/query.c:745
+#: ../lib/query.c:744
msgid "list all documentation files"
msgstr ""
-#: ../lib/query.c:747
+#: ../lib/query.c:746
msgid "dump basic file information"
msgstr ""
-#: ../lib/query.c:749
+#: ../lib/query.c:748
msgid "list files in package"
msgstr ""
-#: ../lib/query.c:753
+#: ../lib/query.c:752
msgid "use the following query format"
msgstr ""
-#: ../lib/query.c:755
+#: ../lib/query.c:754
msgid "substitute i18n sections from the following catalogue"
msgstr ""
-#: ../lib/query.c:758
+#: ../lib/query.c:757
msgid "display the states of the listed files"
msgstr ""
-#: ../lib/query.c:760
+#: ../lib/query.c:759
msgid "display a verbose file listing"
msgstr ""
-#: ../lib/rebuilddb.c:19
+#: ../lib/rebuilddb.c:20
#, c-format
msgid "rebuilding database in rootdir %s\n"
msgstr ""
-#: ../lib/rebuilddb.c:23 ../lib/rpmdb.c:69 ../lib/rpmdb.c:88
+#: ../lib/rebuilddb.c:24 ../lib/rpmdb.c:69 ../lib/rpmdb.c:88
#: ../lib/rpmdb.c:105
msgid "no dbpath has been set"
msgstr ""
-#: ../lib/rebuilddb.c:32
+#: ../lib/rebuilddb.c:33
#, c-format
msgid "temporary database %s already exists"
msgstr ""
-#: ../lib/rebuilddb.c:36
+#: ../lib/rebuilddb.c:37
#, c-format
msgid "creating directory: %s\n"
msgstr ""
-#: ../lib/rebuilddb.c:38
+#: ../lib/rebuilddb.c:39
#, c-format
msgid "error creating directory %s: %s"
msgstr ""
-#: ../lib/rebuilddb.c:42
+#: ../lib/rebuilddb.c:43
msgid "opening old database\n"
msgstr ""
-#: ../lib/rebuilddb.c:49
+#: ../lib/rebuilddb.c:50
msgid "opening new database\n"
msgstr ""
-#: ../lib/rebuilddb.c:59 ../lib/rebuilddb.c:77
+#: ../lib/rebuilddb.c:60 ../lib/rebuilddb.c:78
#, c-format
msgid "record number %d in database is bad -- skipping it"
msgstr ""
-#: ../lib/rebuilddb.c:71
+#: ../lib/rebuilddb.c:72
#, c-format
msgid "cannot add record originally at %d"
msgstr ""
-#: ../lib/rebuilddb.c:90
+#: ../lib/rebuilddb.c:91
msgid "failed to rebuild database; original database remains in place\n"
msgstr ""
-#: ../lib/rebuilddb.c:98
+#: ../lib/rebuilddb.c:99
msgid "failed to replace old database with new database!\n"
msgstr ""
-#: ../lib/rebuilddb.c:100
+#: ../lib/rebuilddb.c:101
#, c-format
msgid "replaces files in %s with files from %s to recover"
msgstr ""
-#: ../lib/rebuilddb.c:106
+#: ../lib/rebuilddb.c:107
#, c-format
msgid "failed to remove directory %s: %s\n"
msgstr ""
msgid "retrieved %d packages\n"
msgstr ""
-#: ../lib/rpminstall.c:191 ../lib/rpminstall.c:324
+#: ../lib/rpminstall.c:191 ../lib/rpminstall.c:332
#, c-format
msgid "cannot open file %s\n"
msgstr ""
-#: ../lib/rpminstall.c:207 ../lib/rpminstall.c:461
+#: ../lib/rpminstall.c:207 ../lib/rpminstall.c:469
#, c-format
msgid "%s cannot be installed\n"
msgstr ""
msgid "package %s is not relocateable\n"
msgstr ""
-#: ../lib/rpminstall.c:255
+#: ../lib/rpminstall.c:261
#, c-format
msgid "error reading from file %s\n"
msgstr ""
-#: ../lib/rpminstall.c:258
+#: ../lib/rpminstall.c:266
#, c-format
msgid "file %s requires a newer version of RPM\n"
msgstr ""
-#: ../lib/rpminstall.c:275
+#: ../lib/rpminstall.c:283
#, c-format
msgid "found %d source and %d binary packages\n"
msgstr ""
-#: ../lib/rpminstall.c:286
+#: ../lib/rpminstall.c:294
msgid "failed dependencies:\n"
msgstr ""
-#: ../lib/rpminstall.c:304
+#: ../lib/rpminstall.c:312
msgid "installing binary packages\n"
msgstr ""
-#: ../lib/rpminstall.c:389
+#: ../lib/rpminstall.c:397
#, c-format
msgid "searching for package %s\n"
msgstr ""
-#: ../lib/rpminstall.c:398
+#: ../lib/rpminstall.c:406
#, c-format
msgid "\"%s\" specifies multiple packages\n"
msgstr ""
-#: ../lib/rpminstall.c:424
+#: ../lib/rpminstall.c:432
msgid "removing these packages would break dependencies:\n"
msgstr ""
-#: ../lib/rpminstall.c:451
+#: ../lib/rpminstall.c:459
#, c-format
msgid "cannot open %s\n"
msgstr ""
-#: ../lib/rpminstall.c:456
+#: ../lib/rpminstall.c:464
#, c-format
msgid "Installing %s\n"
msgstr ""
msgid "read failed: %s (%d)"
msgstr ""
-#: ../lib/rpmrc.c:178
+#: ../lib/rpmrc.c:177
#, c-format
msgid "missing second ':' at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:181
+#: ../lib/rpmrc.c:180
#, c-format
msgid "missing architecture name at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:329
+#: ../lib/rpmrc.c:328
#, c-format
msgid "Incomplete data line at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:333
+#: ../lib/rpmrc.c:332
#, c-format
msgid "Too many args in data line at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:340
+#: ../lib/rpmrc.c:339
#, c-format
msgid "Bad arch/os number: %s (%s:%d)"
msgstr ""
-#: ../lib/rpmrc.c:374
+#: ../lib/rpmrc.c:373
#, c-format
msgid "Incomplete default line at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:379
+#: ../lib/rpmrc.c:378
#, c-format
msgid "Too many args in default line at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:562
+#: ../lib/rpmrc.c:561
#, c-format
msgid "Cannot expand %s"
msgstr ""
-#: ../lib/rpmrc.c:577
+#: ../lib/rpmrc.c:576
#, c-format
msgid "Unable to open %s for reading: %s."
msgstr ""
-#: ../lib/rpmrc.c:609
+#: ../lib/rpmrc.c:608
#, c-format
msgid "Failed to read %s: %s."
msgstr ""
-#: ../lib/rpmrc.c:639
+#: ../lib/rpmrc.c:638
#, c-format
msgid "missing ':' at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:656 ../lib/rpmrc.c:730
+#: ../lib/rpmrc.c:655 ../lib/rpmrc.c:729
#, c-format
msgid "missing argument for %s at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:673 ../lib/rpmrc.c:695
+#: ../lib/rpmrc.c:672 ../lib/rpmrc.c:694
#, c-format
msgid "%s expansion failed at %s:%d \"%s\""
msgstr ""
-#: ../lib/rpmrc.c:681
+#: ../lib/rpmrc.c:680
#, c-format
msgid "cannot open %s at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:722
+#: ../lib/rpmrc.c:721
#, c-format
msgid "missing architecture for %s at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:789
+#: ../lib/rpmrc.c:788
#, c-format
msgid "bad option '%s' at %s:%d"
msgstr ""
-#: ../lib/rpmrc.c:1148
+#: ../lib/rpmrc.c:1147
#, c-format
msgid "Unknown system: %s\n"
msgstr ""
-#: ../lib/rpmrc.c:1149
+#: ../lib/rpmrc.c:1148
msgid "Please contact rpm-list@redhat.com\n"
msgstr ""
msgid "Signature pad : %d\n"
msgstr ""
-#: ../lib/signature.c:265
+#: ../lib/signature.c:266
#, c-format
msgid "Couldn't exec pgp (%s)"
msgstr ""
-#: ../lib/signature.c:276
+#: ../lib/signature.c:277
msgid "pgp failed"
msgstr ""
#. PGP failed to write signature
#. Just in case
-#: ../lib/signature.c:283
+#: ../lib/signature.c:284
msgid "pgp failed to write signature"
msgstr ""
-#: ../lib/signature.c:288
+#: ../lib/signature.c:289
#, c-format
msgid "PGP sig size: %d\n"
msgstr ""
-#: ../lib/signature.c:299 ../lib/signature.c:376
+#: ../lib/signature.c:300 ../lib/signature.c:377
msgid "unable to read the signature"
msgstr ""
-#: ../lib/signature.c:304
+#: ../lib/signature.c:305
#, c-format
msgid "Got %d bytes of PGP sig\n"
msgstr ""
-#: ../lib/signature.c:342 ../lib/signature.c:685
+#: ../lib/signature.c:343 ../lib/signature.c:686
msgid "Couldn't exec gpg"
msgstr ""
-#: ../lib/signature.c:353
+#: ../lib/signature.c:354
msgid "gpg failed"
msgstr ""
#. GPG failed to write signature
#. Just in case
-#: ../lib/signature.c:360
+#: ../lib/signature.c:361
msgid "gpg failed to write signature"
msgstr ""
-#: ../lib/signature.c:365
+#: ../lib/signature.c:366
#, c-format
msgid "GPG sig size: %d\n"
msgstr ""
-#: ../lib/signature.c:381
+#: ../lib/signature.c:382
#, c-format
msgid "Got %d bytes of GPG sig\n"
msgstr ""
-#: ../lib/signature.c:408
+#: ../lib/signature.c:409
msgid "Generating signature using PGP.\n"
msgstr ""
-#: ../lib/signature.c:414
+#: ../lib/signature.c:415
msgid "Generating signature using GPG.\n"
msgstr ""
-#: ../lib/signature.c:491 ../lib/signature.c:553
+#: ../lib/signature.c:492 ../lib/signature.c:554
msgid "Could not run pgp. Use --nopgp to skip PGP checks."
msgstr ""
-#: ../lib/signature.c:551 ../lib/signature.c:624
+#: ../lib/signature.c:552 ../lib/signature.c:625
msgid "exec failed!\n"
msgstr ""
-#: ../lib/signature.c:626
+#: ../lib/signature.c:627
msgid "Could not run gpg. Use --nogpg to skip GPG checks."
msgstr ""
-#: ../lib/signature.c:714
+#: ../lib/signature.c:715
msgid "Couldn't exec pgp"
msgstr ""
#. @notreached@
#. This case should have been screened out long ago.
-#: ../lib/signature.c:718 ../lib/signature.c:771
+#: ../lib/signature.c:719 ../lib/signature.c:772
msgid "Invalid %%_signature spec in macro file"
msgstr ""
-#: ../lib/signature.c:751
+#: ../lib/signature.c:752
msgid "You must set \"%%_gpg_name\" in your macro file"
msgstr ""
-#: ../lib/signature.c:763
+#: ../lib/signature.c:764
msgid "You must set \"%%_pgp_name\" in your macro file"
msgstr ""
-#: ../lib/transaction.c:358
+#: ../lib/transaction.c:363
#, c-format
msgid "relocating %s to %s\n"
msgstr ""
-#: ../lib/transaction.c:365
+#: ../lib/transaction.c:370
#, c-format
msgid "excluding %s\n"
msgstr ""
-#: ../lib/transaction.c:481
+#: ../lib/transaction.c:486
#, c-format
msgid "%s skipped due to missingok flag\n"
msgstr ""
msgid "removing database entry\n"
msgstr ""
-#: ../lib/uninstall.c:363
+#: ../lib/uninstall.c:365
msgid "execution of script failed"
msgstr ""
#include "system.h"
-#include "build/rpmbuild.h"
+#include "rpmbuild.h"
#include "build.h"
#include "install.h"
-#include "lib/signature.h"
-#include "popt/popt.h"
+#include "signature.h"
#define GETOPT_REBUILD 1003
#define GETOPT_RECOMPILE 1004
*errString++ = '\0';
if (*errString != '/')
argerror(_("relocations must have a / following the ="));
- relocations = realloc(relocations,
+ relocations = xrealloc(relocations,
sizeof(*relocations) * (numRelocations + 1));
relocations[numRelocations].oldPath = optArg;
relocations[numRelocations++].newPath = errString;
if (*optArg != '/')
argerror(_("exclude paths must begin with a /"));
- relocations = realloc(relocations,
+ relocations = xrealloc(relocations,
sizeof(*relocations) * (numRelocations + 1));
relocations[numRelocations].oldPath = optArg;
relocations[numRelocations++].newPath = NULL;
exit(EXIT_FAILURE);
}
fprintf(stderr, _("Pass phrase is good.\n"));
- passPhrase = strdup(passPhrase);
+ passPhrase = xstrdup(passPhrase);
break;
default:
fprintf(stderr,
relocations[0].newPath = prefix;
relocations[1].oldPath = relocations[1].newPath = NULL;
} else if (relocations) {
- relocations = realloc(relocations,
+ relocations = xrealloc(relocations,
sizeof(*relocations) * (numRelocations + 1));
relocations[numRelocations].oldPath = NULL;
relocations[numRelocations].newPath = NULL;
}
poptFreeContext(optCon);
+ freeMacros(NULL);
+ rpmFreeRpmrc();
if (pipeChild) {
fclose(stdout);
Name: rpm
%define version 3.0.3
Version: %{version}
-Release: 0.28
+Release: 0.29
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
Copyright: GPL
{
if (mc->macroTable == NULL) {
mc->macrosAllocated = MACRO_CHUNK_SIZE;
- mc->macroTable = (MacroEntry **)malloc(sizeof(*(mc->macroTable)) *
- mc->macrosAllocated);
+ mc->macroTable = (MacroEntry **)
+ xmalloc(sizeof(*(mc->macroTable)) * mc->macrosAllocated);
mc->firstFree = 0;
} else {
mc->macrosAllocated += MACRO_CHUNK_SIZE;
- mc->macroTable = (MacroEntry **)realloc(mc->macroTable, sizeof(*(mc->macroTable)) *
+ mc->macroTable = (MacroEntry **)
+ xrealloc(mc->macroTable, sizeof(*(mc->macroTable)) *
mc->macrosAllocated);
}
memset(&mc->macroTable[mc->firstFree], 0, MACRO_CHUNK_SIZE * sizeof(*(mc->macroTable)));
pushMacro(MacroEntry **mep, const char *n, const char *o, const char *b, int level)
{
MacroEntry *prev = (*mep ? *mep : NULL);
- MacroEntry *me = (MacroEntry *) malloc(sizeof(*me));
+ MacroEntry *me = (MacroEntry *) xmalloc(sizeof(*me));
me->prev = prev;
- me->name = (prev ? prev->name : strdup(n));
- me->opts = (o ? strdup(o) : NULL);
- me->body = strdup(b ? b : "");
+ me->name = (prev ? prev->name : xstrdup(n));
+ me->opts = (o ? xstrdup(o) : NULL);
+ me->body = xstrdup(b ? b : "");
me->used = 0;
me->level = level;
*mep = me;
if (mc == NULL)
mc = &globalMacroContext;
- for (mfile = m = strdup(macrofiles); *mfile; mfile = me) {
+ for (mfile = m = xstrdup(macrofiles); *mfile; mfile = me) {
FILE *fp;
char buf[BUFSIZ];
va_list ap;
if (arg == NULL)
- return strdup("");
+ return xstrdup("");
p = buf;
strcpy(p, arg);
}
va_end(ap);
expandMacros(NULL, NULL, buf, sizeof(buf));
- return strdup(buf);
+ return xstrdup(buf); /* XXX build memory leaks */
}
int
va_list ap;
if (path == NULL)
- return strdup("");
+ return xstrdup("");
p = buf;
strcpy(p, path);
}
va_end(ap);
expandMacros(NULL, NULL, buf, sizeof(buf));
- return strdup(buf);
+ return xstrdup(buf);
}
/* =============================================================== */
#include <limits.h>
#endif
+#if HAVE_ERR_H
+#include <err.h>
+#endif
+
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
+/*@only@*/ void * xmalloc (size_t size);
+/*@only@*/ void * xcalloc (size_t nmemb, size_t size);
+/*@only@*/ void * xrealloc (void *ptr, size_t size);
+/*@only@*/ char * xstrdup (const char *str);
+void *vmefail(void);
+
#if HAVE_MCHECK_H
#include <mcheck.h>
#endif
+
+#if HAVE_MCHECK_H && defined(__GNUC__)
+
+/* Memory allocation via macro defs to get meaningful locations from mtrace() */
+
+#define xmalloc(_size) (malloc(_size) ? : vmefail())
+
+#define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail())
+
+#define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail())
+
+#define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)))
+
+#endif /* HAVE_MCHECK_H && defined(__GNUC__) */
+
#if HAVE_NETDB_H
#ifndef __LCLINT__
#include <netdb.h>
#if 0
if (strcmp(sourcerpm, sfn))
- return strdup(sourcerpm);
+ return xstrdup(sourcerpm);
return NULL;
#else
- return strdup(sourcerpm);
+ return xstrdup(sourcerpm);
#endif
}
/* ================================================================== */
/* XXX stripped down gettext environment */
-#define xstrdup strdup
-#define xmalloc malloc
-#define xrealloc realloc
-
#if !defined(PARAMS)
#define PARAMS(_x) _x
#endif