RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 11-Oct-2007 15:04:28
Branch: HEAD Handle: 2007101114042503
Modified files:
rpm CHANGES
rpm/build expression.c files.c pack.c
parseBuildInstallClean.c parseChangelog.c
parseDescription.c parseFiles.c parsePreamble.c
parsePrep.c parseReqs.c parseScript.c parseSpec.c
spec.c
rpm/lib fs.c misc.c package.c psm.c rpmchecksig.c rpmfc.c
rpm/rpmdb db3.c dbconfig.c rpmdb.c signature.c
rpm/rpmio macro.c rpmmg.c
Log:
- start eliminating rpmError.
Summary:
Revision Changes Path
1.1664 +1 -0 rpm/CHANGES
2.31 +16 -16 rpm/build/expression.c
1.263 +56 -56 rpm/build/files.c
2.230 +39 -40 rpm/build/pack.c
2.22 +2 -2 rpm/build/parseBuildInstallClean.c
2.32 +14 -14 rpm/build/parseChangelog.c
2.30 +9 -9 rpm/build/parseDescription.c
2.29 +10 -10 rpm/build/parseFiles.c
2.131 +53 -53 rpm/build/parsePreamble.c
2.90 +39 -39 rpm/build/parsePrep.c
2.48 +6 -6 rpm/build/parseReqs.c
2.49 +21 -21 rpm/build/parseScript.c
2.103 +14 -14 rpm/build/parseSpec.c
2.155 +6 -6 rpm/build/spec.c
2.56 +1 -1 rpm/lib/fs.c
2.145 +1 -1 rpm/lib/misc.c
2.167 +2 -2 rpm/lib/package.c
2.234 +6 -6 rpm/lib/psm.c
1.150 +9 -9 rpm/lib/rpmchecksig.c
1.19 +4 -4 rpm/lib/rpmfc.c
1.75 +4 -4 rpm/rpmdb/db3.c
1.46 +4 -4 rpm/rpmdb/dbconfig.c
1.169 +18 -18 rpm/rpmdb/rpmdb.c
1.4 +4 -4 rpm/rpmdb/signature.c
2.147 +22 -22 rpm/rpmio/macro.c
2.4 +4 -4 rpm/rpmio/rpmmg.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1663 -r1.1664 CHANGES
--- rpm/CHANGES 11 Oct 2007 02:04:38 -0000 1.1663
+++ rpm/CHANGES 11 Oct 2007 13:04:25 -0000 1.1664
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - jbj: start eliminating rpmError.
- jbj: fail empty and non-printable manifests.
- jbj: headerGetExtension: handle lookup failure cases too.
- jbj: headerGetExtension: include \0 when dup'ing string.
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/expression.c
============================================================================
$ cvs diff -u -r2.30 -r2.31 expression.c
--- rpm/build/expression.c 16 Jul 2007 01:32:26 -0000 2.30
+++ rpm/build/expression.c 11 Oct 2007 13:04:26 -0000 2.31
@@ -226,7 +226,7 @@
token = TOK_EQ;
p++;
} else {
- rpmError(RPMERR_BADSPEC, _("syntax error while parsing ==\n"));
+ rpmlog(RPMLOG_ERR, _("syntax error while parsing ==\n"));
return -1;
}
break;
@@ -256,7 +256,7 @@
token = TOK_LOGICAL_AND;
p++;
} else {
- rpmError(RPMERR_BADSPEC, _("syntax error while parsing &&\n"));
+ rpmlog(RPMLOG_ERR, _("syntax error while parsing &&\n"));
return -1;
}
break;
@@ -265,7 +265,7 @@
token = TOK_LOGICAL_OR;
p++;
} else {
- rpmError(RPMERR_BADSPEC, _("syntax error while parsing ||\n"));
+ rpmlog(RPMLOG_ERR, _("syntax error while parsing ||\n"));
return -1;
}
break;
@@ -308,7 +308,7 @@
v = valueMakeString( rpmExpand(temp, NULL) );
} else {
- rpmError(RPMERR_BADSPEC, _("parse error in expression\n"));
+ rpmlog(RPMLOG_ERR, _("parse error in expression\n"));
return -1;
}
}
@@ -350,7 +350,7 @@
return NULL;
v = doLogical(state);
if (state->nextToken != TOK_CLOSE_P) {
- rpmError(RPMERR_BADSPEC, _("unmatched (\n"));
+ rpmlog(RPMLOG_ERR, _("unmatched (\n"));
return NULL;
}
if (rdToken(state))
@@ -382,7 +382,7 @@
return NULL;
if (! valueIsInteger(v)) {
- rpmError(RPMERR_BADSPEC, _("- only on numbers\n"));
+ rpmlog(RPMLOG_ERR, _("- only on numbers\n"));
return NULL;
}
@@ -398,7 +398,7 @@
return NULL;
if (! valueIsInteger(v)) {
- rpmError(RPMERR_BADSPEC, _("! only on numbers\n"));
+ rpmlog(RPMLOG_ERR, _("! only on numbers\n"));
return NULL;
}
@@ -446,7 +446,7 @@
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMLOG_ERR, _("types must match\n"));
return NULL;
}
@@ -459,7 +459,7 @@
else
v1 = valueMakeInteger(i1 / i2);
} else {
- rpmError(RPMERR_BADSPEC, _("* / not suported for strings\n"));
+ rpmlog(RPMLOG_ERR, _("* / not suported for strings\n"));
return NULL;
}
}
@@ -501,7 +501,7 @@
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMLOG_ERR, _("types must match\n"));
return NULL;
}
@@ -517,7 +517,7 @@
char *copy;
if (op == TOK_MINUS) {
- rpmError(RPMERR_BADSPEC, _("- not suported for strings\n"));
+ rpmlog(RPMLOG_ERR, _("- not suported for strings\n"));
return NULL;
}
@@ -566,7 +566,7 @@
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMLOG_ERR, _("types must match\n"));
return NULL;
}
@@ -663,7 +663,7 @@
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMLOG_ERR, _("types must match\n"));
return NULL;
}
@@ -676,7 +676,7 @@
else
v1 = valueMakeInteger(i1 || i2);
} else {
- rpmError(RPMERR_BADSPEC, _("&& and || not suported for strings\n"));
+ rpmlog(RPMLOG_ERR, _("&& and || not suported for strings\n"));
return NULL;
}
}
@@ -710,7 +710,7 @@
/* If the next token is not TOK_EOF, we have a syntax error. */
if (state.nextToken != TOK_EOF) {
- rpmError(RPMERR_BADSPEC, _("syntax error in expression\n"));
+ rpmlog(RPMLOG_ERR, _("syntax error in expression\n"));
state.str = _free(state.str);
return -1;
}
@@ -759,7 +759,7 @@
/* If the next token is not TOK_EOF, we have a syntax error. */
if (state.nextToken != TOK_EOF) {
- rpmError(RPMERR_BADSPEC, _("syntax error in expression\n"));
+ rpmlog(RPMLOG_ERR, _("syntax error in expression\n"));
state.str = _free(state.str);
return NULL;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/files.c
============================================================================
$ cvs diff -u -r1.262 -r1.263 files.c
--- rpm/build/files.c 19 Aug 2007 17:43:01 -0000 1.262
+++ rpm/build/files.c 11 Oct 2007 13:04:26 -0000 1.263
@@ -349,9 +349,9 @@
SKIPSPACE(pe);
if (*pe != '(') {
- rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
+ rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Bracket %*verify args */
@@ -360,9 +360,9 @@
{};
if (*pe == '\0') {
- rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
+ rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Localize. Erase parsed string */
@@ -398,9 +398,9 @@
if (!strcmp(p, "not")) {
negated ^= 1;
} else {
- rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
+ rpmlog(RPMLOG_ERR, _("Invalid %s token: %s\n"), name, p);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
}
@@ -427,7 +427,7 @@
const char * name;
const char * errstr = NULL;
char *p, *pe, *q;
- int rc = RPMERR_BADSPEC; /* assume error */
+ int rc = RPMRC_FAIL; /* assume error */
if ((p = strstr(buf, (name = "%dev"))) == NULL)
return 0;
@@ -508,7 +508,7 @@
exit:
if (rc) {
- rpmError(RPMERR_BADSPEC, _("Missing %s in %s %s\n"), errstr, name, p);
+ rpmlog(RPMLOG_ERR, _("Missing %s in %s %s\n"), errstr, name, p);
fl->processingFailed = 1;
}
return rc;
@@ -549,9 +549,9 @@
SKIPSPACE(pe);
if (*pe != '(') {
- rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
+ rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Bracket %*attr args */
@@ -564,10 +564,10 @@
q++;
SKIPSPACE(q);
if (*q != '\0') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Non-white space follows %s(): %s\n"), name, q);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
}
@@ -603,9 +603,9 @@
}
if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') {
- rpmError(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q);
+ rpmlog(RPMLOG_ERR, _("Bad syntax: %s(%s)\n"), name, q);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Do a quick test on the mode argument and adjust for "-" */
@@ -613,9 +613,9 @@
unsigned int ui;
x = sscanf(ar->ar_fmodestr, "%o", &ui);
if ((x == 0) || (ar->ar_fmode & ~MYALLPERMS)) {
- rpmError(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)\n"), name, q);
+ rpmlog(RPMLOG_ERR, _("Bad mode spec: %s(%s)\n"), name, q);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMLOG_ERR;
}
ar->ar_fmode = ui;
} else
@@ -625,9 +625,9 @@
unsigned int ui;
x = sscanf(ar->ar_dmodestr, "%o", &ui);
if ((x == 0) || (ar->ar_dmode & ~MYALLPERMS)) {
- rpmError(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)\n"), name, q);
+ rpmlog(RPMLOG_ERR, _("Bad dirmode spec: %s(%s)\n"), name, q);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
ar->ar_dmode = ui;
} else
@@ -679,9 +679,9 @@
{};
if (*pe == '\0') {
- rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
+ rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Localize. Erase parsed string. */
@@ -704,9 +704,9 @@
} else if (!strcmp(p, "noreplace")) {
fl->currentFlags |= RPMFILE_NOREPLACE;
} else {
- rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
+ rpmlog(RPMLOG_ERR, _("Invalid %s token: %s\n"), name, p);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
}
@@ -745,9 +745,9 @@
SKIPSPACE(pe);
if (*pe != '(') {
- rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
+ rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Bracket %lang args */
@@ -756,9 +756,9 @@
{};
if (*pe == '\0') {
- rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
+ rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Localize. Erase parsed string. */
@@ -782,11 +782,11 @@
/* Sanity check on locale lengths */
if (np < 1 || (np == 1 && *p != 'C') || np >= 32) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Unusual locale length: \"%.*s\" in %%lang(%s)\n"),
(int)np, p, q);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMLOG_ERR;
}
/* Check for duplicate locales */
@@ -794,10 +794,10 @@
for (i = 0; i < fl->nLangs; i++) {
if (strncmp(fl->currentLangs[i], p, np))
/*@innercontinue@*/ continue;
- rpmError(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"),
+ rpmlog(RPMLOG_ERR, _("Duplicate locale %.*s in %%lang(%s)\n"),
(int)np, p, q);
fl->processingFailed = 1;
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Add new locale */
@@ -966,7 +966,7 @@
if (*fileName) {
/* We already got a file -- error */
- rpmError(RPMERR_BADSPEC, _("Two files on one line: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Two files on one line: %s\n"),
*fileName);
fl->processingFailed = 1;
res = 1;
@@ -987,7 +987,7 @@
int urltype = urlPath(s, &sfn);
switch (urltype) {
default: /* relative path, not in %doc and not a URL */
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("File must begin with \"/\": %s\n"), s);
fl->processingFailed = 1;
res = 1;
@@ -1005,7 +1005,7 @@
if (specialDoc) {
if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Can't mix special %%doc with other forms: %s\n"),
(*fileName ? *fileName : ""));
fl->processingFailed = 1;
@@ -1023,7 +1023,7 @@
}
fmt = headerSprintf(pkg->header, _docdir_fmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (!fmt) {
- rpmError(RPMERR_BADSPEC, _("illegal _docdir_fmt: %s\n"), errstr);
+ rpmlog(RPMLOG_ERR, _("illegal _docdir_fmt: %s\n"), errstr);
fl->processingFailed = 1;
res = 1;
}
@@ -1483,7 +1483,7 @@
if (buf[0] == '/' && strcmp(buildRoot, "/") &&
!strncmp(buf, buildRoot, strlen(buildRoot))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Symlink points to BuildRoot: %s -> %s\n"),
flp->fileURL, buf);
fl->processingFailed = 1;
@@ -1745,10 +1745,10 @@
prefixTest++;
}
if (*prefixPtr || (*prefixTest && *prefixTest != '/')) {
- rpmError(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"),
+ rpmlog(RPMLOG_ERR, _("File doesn't match prefix (%s): %s\n"),
fl->prefix, fileURL);
fl->processingFailed = 1;
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
}
@@ -1770,9 +1770,9 @@
statp->st_mtime = now;
statp->st_ctime = now;
} else if (Lstat(diskURL, statp)) {
- rpmError(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL);
+ rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskURL);
fl->processingFailed = 1;
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
}
@@ -1908,7 +1908,7 @@
FTS * ftsp;
FTSENT * fts;
int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL);
- int rc = RPMERR_BADSPEC;
+ int rc = RPMRC_FAIL;
fl->inFtw = 1; /* Flag to indicate file has buildRootURL prefixed */
fl->isDir = 1; /* Keep it from following myftw() again */
@@ -1937,7 +1937,7 @@
case FTS_INIT: /* initialized only */
case FTS_W: /* whiteout object */
default:
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
/*@switchbreak@*/ break;
}
if (rc)
@@ -1988,24 +1988,24 @@
/*@-branchstate@*/
switch (tag) {
default:
- rpmError(RPMERR_BADSPEC, _("%s: can't load unknown tag (%d).\n"),
+ rpmlog(RPMLOG_ERR, _("%s: can't load unknown tag (%d).\n"),
fn, tag);
goto exit;
/*@notreached@*/ break;
case RPMTAG_PUBKEYS:
if ((rc = pgpReadPkts(fn, (const byte **)&pkt, (size_t *)&pktlen)) <= 0) {
- rpmError(RPMERR_BADSPEC, _("%s: public key read failed.\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: public key read failed.\n"), fn);
goto exit;
}
if (rc != PGPARMOR_PUBKEY) {
- rpmError(RPMERR_BADSPEC, _("%s: not an armored public key.\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: not an armored public key.\n"), fn);
goto exit;
}
apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen);
break;
case RPMTAG_POLICIES:
if ((rc = rpmioSlurp(fn, &pkt, &pktlen)) != 0) {
- rpmError(RPMERR_BADSPEC, _("%s: *.te policy read failed.\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: *.te policy read failed.\n"), fn);
goto exit;
}
apkt = (const char *) pkt; /* XXX unsigned char */
@@ -2027,7 +2027,7 @@
fn = _free(fn);
if (rc) {
fl->processingFailed = 1;
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
}
return rc;
}
@@ -2058,7 +2058,7 @@
{ const char * fileName;
(void) urlPath(fileURL, &fileName);
if (*fileName != '/') {
- rpmError(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"),
+ rpmlog(RPMLOG_ERR, _("File needs leading \"/\": %s\n"),
fileName);
rc = 1;
goto exit;
@@ -2082,7 +2082,7 @@
/* XXX for %dev marker in file manifest only */
if (fl->noGlob) {
- rpmError(RPMERR_BADSPEC, _("Glob not permitted: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Glob not permitted: %s\n"),
diskURL);
rc = 1;
goto exit;
@@ -2099,7 +2099,7 @@
}
argv = _free(argv);
} else {
- rpmError(RPMERR_BADSPEC, _("File not found by glob: %s\n"),
+ rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"),
diskURL);
rc = 1;
goto exit;
@@ -2113,7 +2113,7 @@
diskURL = _free(diskURL);
if (rc) {
fl->processingFailed = 1;
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
}
return rc;
}
@@ -2158,10 +2158,10 @@
fd = Fopen(ffn, "r.fpio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open %%files file %s: %s\n"),
ffn, Fstrerror(fd));
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
ffn = _free(ffn);
@@ -2170,8 +2170,8 @@
while (fgets(buf, sizeof(buf), f)) {
handleComments(buf);
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
- rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf);
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("line: %s\n"), buf);
+ return RPMRC_FAIL;
}
appendStringBuf(pkg->fileList, buf);
}
@@ -2555,7 +2555,7 @@
flp->verifyFlags = RPMVERIFY_ALL;
if (Stat(diskURL, &flp->fl_st)) {
- rpmError(RPMERR_BADSPEC, _("Bad file: %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Bad file: %s: %s\n"),
diskURL, strerror(errno));
rc = fl.processingFailed = 1;
}
@@ -2567,7 +2567,7 @@
fl.totalFileSize += flp->fl_size;
if (! (flp->uname && flp->gname)) {
- rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL);
+ rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskURL);
rc = fl.processingFailed = 1;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/pack.c
============================================================================
$ cvs diff -u -r2.229 -r2.230 pack.c
--- rpm/build/pack.c 30 Sep 2007 22:38:28 -0000 2.229
+++ rpm/build/pack.c 11 Oct 2007 13:04:26 -0000 2.230
@@ -91,10 +91,10 @@
if (rc) {
if (failedFile)
- rpmError(RPMERR_CPIO, _("create archive failed on file %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("create archive failed on file %s: %s\n"),
failedFile, cpioStrerror(rc));
else
- rpmError(RPMERR_CPIO, _("create archive failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("create archive failed: %s\n"),
cpioStrerror(rc));
rc = 1;
}
@@ -116,14 +116,14 @@
while((nb = Fread(buf, sizeof(buf[0]), sizeof(buf), csa->cpioFdIn)) > 0) {
if (Fwrite(buf, sizeof(buf[0]), nb, fdo) != nb) {
- rpmError(RPMERR_CPIO, _("cpio_copy write failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("cpio_copy write failed: %s\n"),
Fstrerror(fdo));
return 1;
}
csa->cpioArchiveSize += nb;
}
if (Ferror(csa->cpioFdIn)) {
- rpmError(RPMERR_CPIO, _("cpio_copy read failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("cpio_copy read failed: %s\n"),
Fstrerror(csa->cpioFdIn));
return 1;
}
@@ -156,7 +156,7 @@
while (fgets(buf, sizeof(buf), f)) {
/* XXX display fn in error msg */
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
- rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf);
+ rpmlog(RPMLOG_ERR, _("line: %s\n"), buf);
sb = freeStringBuf(sb);
break;
}
@@ -219,52 +219,52 @@
if (pkg->preInFile) {
if (addFileToTag(spec, pkg->preInFile, pkg->header, RPMTAG_PREIN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open PreIn file: %s\n"), pkg->preInFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
if (pkg->preUnFile) {
if (addFileToTag(spec, pkg->preUnFile, pkg->header, RPMTAG_PREUN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open PreUn file: %s\n"), pkg->preUnFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
if (pkg->preTransFile) {
if (addFileToTag(spec, pkg->preTransFile, pkg->header, RPMTAG_PRETRANS)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open PreIn file: %s\n"), pkg->preTransFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
if (pkg->postInFile) {
if (addFileToTag(spec, pkg->postInFile, pkg->header, RPMTAG_POSTIN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open PostIn file: %s\n"), pkg->postInFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
if (pkg->postUnFile) {
if (addFileToTag(spec, pkg->postUnFile, pkg->header, RPMTAG_POSTUN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open PostUn file: %s\n"), pkg->postUnFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
if (pkg->postTransFile) {
if (addFileToTag(spec, pkg->postTransFile, pkg->header, RPMTAG_POSTTRANS)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open PostUn file: %s\n"), pkg->postTransFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
if (pkg->verifyFile) {
if (addFileToTag(spec, pkg->verifyFile, pkg->header,
RPMTAG_VERIFYSCRIPT)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open VerifyScript file: %s\n"), pkg->verifyFile);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
}
@@ -277,10 +277,10 @@
} else if (p->fileName) {
if (addFileToArrayTag(spec, p->fileName, pkg->header,
RPMTAG_TRIGGERSCRIPTS)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMLOG_ERR,
_("Could not open Trigger script file: %s\n"),
p->fileName);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
} else {
/* This is dumb. When the header supports NULL string */
@@ -309,11 +309,11 @@
: fdDup(STDIN_FILENO);
if (fdi == NULL || Ferror(fdi)) {
- rpmError(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("readRPM: open %s: %s\n"),
(fileName ? fileName : "<stdin>"),
Fstrerror(fdi));
if (fdi) (void) Fclose(fdi);
- return RPMERR_BADMAGIC;
+ return RPMRC_FAIL;
}
{ const char item[] = "Lead";
@@ -332,17 +332,17 @@
}
if (rc != RPMRC_OK) {
- rpmError(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("readRPM: read %s: %s\n"),
(fileName ? fileName : "<stdin>"), msg);
- return RPMERR_BADMAGIC;
+ return RPMRC_FAIL;
}
/*@=sizeoftype@*/
/* XXX FIXME: EPIPE on <stdin> */
if (Fseek(fdi, 0, SEEK_SET) == -1) {
- rpmError(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("%s: Fseek failed: %s\n"),
(fileName ? fileName : "<stdin>"), Fstrerror(fdi));
- return RPMERR_FSEEK;
+ return RPMRC_FAIL;
}
/* Reallocate build data structures */
@@ -372,14 +372,14 @@
case RPMRC_NOTTRUSTED:
break;
case RPMRC_NOTFOUND:
- rpmError(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"),
+ rpmlog(RPMLOG_ERR, _("readRPM: %s is not an RPM package\n"),
(fileName ? fileName : "<stdin>"));
- return RPMERR_BADMAGIC;
+ return RPMRC_FAIL;
case RPMRC_FAIL:
default:
- rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"),
+ rpmlog(RPMLOG_ERR, _("readRPM: reading header from %s\n"),
(fileName ? fileName : "<stdin>"));
- return RPMERR_BADMAGIC;
+ return RPMRC_FAIL;
/*@notreached@*/ break;
}
@@ -620,8 +620,8 @@
*/
sigtarget = NULL;
if (rpmTempFile(NULL, &sigtarget, &fd)) {
- rc = RPMERR_CREATE;
- rpmError(RPMERR_CREATE, _("Unable to open temp file.\n"));
+ rc = RPMRC_FAIL;
+ rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n"));
goto exit;
}
@@ -637,8 +637,7 @@
} else if (Fileno(csa->cpioFdIn) >= 0) {
rc = cpio_copy(fd, csa);
} else {
- rc = RPMERR_BADARG;
- rpmError(RPMERR_BADARG, _("Bad CSA data\n"));
+assert(0);
}
}
rpmio_flags = _free(rpmio_flags);
@@ -694,8 +693,8 @@
/* Open the output file */
fd = Fopen(fileName, "w.fdio");
if (fd == NULL || Ferror(fd)) {
- rc = RPMERR_CREATE;
- rpmError(RPMERR_CREATE, _("Could not open %s: %s\n"),
+ rc = RPMRC_FAIL;
+ rpmlog(RPMLOG_ERR, _("Could not open %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
@@ -888,10 +887,10 @@
const char *NVRA = NULL;
(void) headerGetExtension(pkg->header, RPMTAG_NVRA,
NULL, &NVRA, NULL);
- rpmError(RPMERR_BADFILENAME, _("Could not generate output "
+ rpmlog(RPMLOG_ERR, _("Could not generate output "
"filename for package %s: %s\n"), NVRA, errorString);
NVRA = _free(NVRA);
- return RPMERR_BADFILENAME;
+ return RPMRC_FAIL;
}
fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
if ((binDir = strchr(binRpm, '/')) != NULL) {
@@ -906,7 +905,7 @@
/*@switchbreak@*/ break;
/*@fallthrough@*/
default:
- rpmError(RPMERR_BADFILENAME,_("cannot create %s: %s\n"),
+ rpmlog(RPMLOG_ERR,_("cannot create %s: %s\n"),
dn, strerror(errno));
/*@switchbreak@*/ break;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseBuildInstallClean.c
============================================================================
$ cvs diff -u -r2.21 -r2.22 parseBuildInstallClean.c
--- rpm/build/parseBuildInstallClean.c 16 Jul 2007 01:32:26 -0000 2.21
+++ rpm/build/parseBuildInstallClean.c 11 Oct 2007 13:04:26 -0000 2.22
@@ -34,9 +34,9 @@
/*@=branchstate@*/
if (*sbp != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: second %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: second %s\n"),
spec->lineNum, name);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
*sbp = newStringBuf();
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseChangelog.c
============================================================================
$ cvs diff -u -r2.31 -r2.32 parseChangelog.c
--- rpm/build/parseChangelog.c 16 Jul 2007 01:32:26 -0000 2.31
+++ rpm/build/parseChangelog.c 11 Oct 2007 13:04:26 -0000 2.32
@@ -152,17 +152,17 @@
while (*s != '\0') {
if (*s != '*') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("%%changelog entries must start with *\n"));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* find end of line */
date = s;
while(*s && *s != '\n') s++;
if (! *s) {
- rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("incomplete %%changelog entry\n"));
+ return RPMRC_FAIL;
}
/*@-modobserver@*/
*s = '\0';
@@ -178,21 +178,21 @@
}
mySKIPSPACE(date);
if (dateToTimet(date, &time)) {
- rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date);
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("bad date in %%changelog: %s\n"), date);
+ return RPMRC_FAIL;
}
if (lastTime && lastTime < time) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("%%changelog not in descending chronological order\n"));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
lastTime = time;
/* skip space to the name */
mySKIPSPACE(s);
if (! *s) {
- rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("missing name in %%changelog\n"));
+ return RPMRC_FAIL;
}
/* name */
@@ -202,15 +202,15 @@
*s-- = '\0';
if (s == name) {
- rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("missing name in %%changelog\n"));
+ return RPMRC_FAIL;
}
/* text */
mySKIPSPACE(text);
if (! *text) {
- rpmError(RPMERR_BADSPEC, _("no description in %%changelog\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("no description in %%changelog\n"));
+ return RPMRC_FAIL;
}
/* find the next leading '*' (or eos) */
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseDescription.c
============================================================================
$ cvs diff -u -r2.29 -r2.30 parseDescription.c
--- rpm/build/parseDescription.c 16 Jul 2007 01:32:26 -0000 2.29
+++ rpm/build/parseDescription.c 11 Oct 2007 13:04:26 -0000 2.30
@@ -31,7 +31,7 @@
/*@globals name, lang @*/
/*@modifies name, lang @*/
{
- int nextPart = RPMERR_BADSPEC; /* assume error */
+ int nextPart = RPMRC_FAIL; /* assume error */
StringBuf sb;
int flag = PART_SUBNAME;
Package pkg;
@@ -45,9 +45,9 @@
lang = RPMBUILD_DEFAULT_LANG;
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%description: %s\n"),
spec->lineNum, poptStrerror(rc));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
@@ -58,7 +58,7 @@
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
@@ -69,7 +69,7 @@
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
goto exit;
@@ -77,7 +77,7 @@
}
if (lookupPackage(spec, name, flag, &pkg)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
goto exit;
}
@@ -87,7 +87,7 @@
#if 0
if (headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Second description\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Second description\n"),
spec->lineNum);
goto exit;
}
@@ -101,7 +101,7 @@
nextPart = PART_NONE;
} else {
if (rc) {
- nextPart = RPMERR_BADSPEC;
+ nextPart = RPMRC_FAIL;
goto exit;
}
while (! (nextPart = isPart(spec->line))) {
@@ -113,7 +113,7 @@
break;
}
if (rc) {
- nextPart = RPMERR_BADSPEC;
+ nextPart = RPMRC_FAIL;
goto exit;
}
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseFiles.c
============================================================================
$ cvs diff -u -r2.28 -r2.29 parseFiles.c
--- rpm/build/parseFiles.c 16 Jul 2007 01:32:26 -0000 2.28
+++ rpm/build/parseFiles.c 11 Oct 2007 13:04:26 -0000 2.29
@@ -40,9 +40,9 @@
/*@=mods@*/
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"),
spec->lineNum, poptStrerror(rc));
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
@@ -54,11 +54,11 @@
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
@@ -68,25 +68,25 @@
name = poptGetArg(optCon);
/*@=mods@*/
if (poptPeekArg(optCon)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
}
if (lookupPackage(spec, name, flag, &pkg)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
if (pkg->fileList != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: Second %%files list\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Second %%files list\n"),
spec->lineNum);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parsePreamble.c
============================================================================
$ cvs diff -u -r2.130 -r2.131 parsePreamble.c
--- rpm/build/parsePreamble.c 19 Aug 2007 17:43:01 -0000 2.130
+++ rpm/build/parsePreamble.c 11 Oct 2007 13:04:26 -0000 2.131
@@ -186,7 +186,7 @@
}
}
if (c == 0 && bp) *bp = bits;
- return (c ? RPMERR_BADSPEC : 0);
+ return (c ? RPMRC_FAIL : RPMRC_OK);
}
/*@=boundswrite@*/
@@ -237,22 +237,22 @@
{
const char *arch = rpmExpand("%{_target_cpu}", NULL);
const char *os = rpmExpand("%{_target_os}", NULL);
- int rc = RPMERR_BADSPEC; /* assume failure. */
+ int rc = RPMRC_FAIL; /* assume failure. */
if (isMemberInEntry(spec->sourceHeader, arch, RPMTAG_EXCLUDEARCH) == 1) {
- rpmError(RPMERR_BADSPEC, _("Architecture is excluded: %s\n"), arch);
+ rpmlog(RPMLOG_ERR, _("Architecture is excluded: %s\n"), arch);
goto exit;
}
if (isMemberInEntry(spec->sourceHeader, arch, RPMTAG_EXCLUSIVEARCH) == 0) {
- rpmError(RPMERR_BADSPEC, _("Architecture is not included: %s\n"), arch);
+ rpmlog(RPMLOG_ERR, _("Architecture is not included: %s\n"), arch);
goto exit;
}
if (isMemberInEntry(spec->sourceHeader, os, RPMTAG_EXCLUDEOS) == 1) {
- rpmError(RPMERR_BADSPEC, _("OS is excluded: %s\n"), os);
+ rpmlog(RPMLOG_ERR, _("OS is excluded: %s\n"), os);
goto exit;
}
if (isMemberInEntry(spec->sourceHeader, os, RPMTAG_EXCLUSIVEOS) == 0) {
- rpmError(RPMERR_BADSPEC, _("OS is not included: %s\n"), os);
+ rpmlog(RPMLOG_ERR, _("OS is not included: %s\n"), os);
goto exit;
}
rc = 0;
@@ -277,7 +277,7 @@
/*@-boundsread@*/
for (p = requiredTags; *p != 0; p++) {
if (!headerIsEntry(h, *p)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("%s field must be present in package: %s\n"),
tagName(*p), NVR);
res = 1;
@@ -307,7 +307,7 @@
{
if (tag != lastTag)
continue;
- rpmError(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Duplicate %s entries in package: %s\n"),
tagName(tag), NVR);
res = 1;
}
@@ -364,7 +364,7 @@
size_t nb;
char *icon = alloca(iconsize+1);
FD_t fd = NULL;
- int rc = RPMERR_BADSPEC; /* assume error */
+ int rc = RPMRC_FAIL; /* assume error */
int urltype;
int xx;
@@ -373,7 +373,7 @@
break;
}
if (sp == NULL) {
- rpmError(RPMERR_BADSPEC, _("No icon file in sources\n"));
+ rpmlog(RPMLOG_ERR, _("No icon file in sources\n"));
goto exit;
}
@@ -390,28 +390,28 @@
break;
case URL_IS_DASH:
case URL_IS_HKP:
- rpmError(RPMERR_BADSPEC, _("Invalid icon URL: %s\n"), Lurlfn);
+ rpmlog(RPMLOG_ERR, _("Invalid icon URL: %s\n"), Lurlfn);
goto exit;
/*@notreached@*/ break;
}
fd = Fopen(fn, "r.fdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Unable to open icon %s: %s\n"),
fn, Fstrerror(fd));
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
*icon = '\0';
nb = Fread(icon, sizeof(icon[0]), iconsize, fd);
if (Ferror(fd) || nb == 0) {
- rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Unable to read icon %s: %s\n"),
fn, Fstrerror(fd));
goto exit;
}
if (nb >= iconsize) {
- rpmError(RPMERR_BADSPEC, _("Icon %s is too big (max. %d bytes)\n"),
+ rpmlog(RPMLOG_ERR, _("Icon %s is too big (max. %d bytes)\n"),
fn, iconsize);
goto exit;
}
@@ -421,7 +421,7 @@
else if (!strncmp(icon, "/* XPM", sizeof("/* XPM")-1))
xx = headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, nb);
else {
- rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), fn);
+ rpmlog(RPMLOG_ERR, _("Unknown icon type: %s\n"), fn);
goto exit;
}
rc = 0;
@@ -469,9 +469,9 @@
#define SINGLE_TOKEN_ONLY \
if (multiToken) { \
- rpmError(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \
+ rpmlog(RPMLOG_ERR, _("line %d: Tag takes single token only: %s\n"), \
spec->lineNum, spec->line); \
- return RPMERR_BADSPEC; \
+ return RPMRC_FAIL; \
}
/*@-redecl@*/
@@ -504,22 +504,22 @@
int rc;
int xx;
- if (field == NULL) return RPMERR_BADSPEC; /* XXX can't happen */
+ if (field == NULL) return RPMRC_FAIL; /* XXX can't happen */
/* Find the start of the "field" and strip trailing space */
while ((*field) && (*field != ':'))
field++;
if (*field != ':') {
- rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Malformed tag: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
field++;
SKIPSPACE(field);
if (!*field) {
/* Empty field */
- rpmError(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Empty tag: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
end = findLastChar(field);
@@ -541,16 +541,16 @@
/* These macros are for backward compatibility */
if (tag == RPMTAG_VERSION) {
if (strchr(field, '-') != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"),
spec->lineNum, "version", spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
addMacro(spec->macros, "PACKAGE_VERSION", NULL, field, RMIL_OLDSPEC);
} else if (tag == RPMTAG_RELEASE) {
if (strchr(field, '-') != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"),
spec->lineNum, "release", spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
addMacro(spec->macros, "PACKAGE_RELEASE", NULL, field, RMIL_OLDSPEC-1);
}
@@ -580,10 +580,10 @@
if (*buildRoot == '\0') buildRoot = "/";
/*@=branchstate@*/
if (!strcmp(buildRoot, "/")) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("BuildRoot can not be \"/\": %s\n"), spec->buildRootURL);
buildRootURL = _free(buildRootURL);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
buildRootURL = _free(buildRootURL);
#endif
@@ -596,19 +596,19 @@
if (tag == RPMTAG_PREFIXES)
while (num--) {
if (array[num][0] != '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Prefixes must begin with \"/\": %s\n"),
spec->lineNum, spec->line);
array = hfd(array, type);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
len = strlen(array[num]);
if (array[num][len - 1] == '/' && len > 1) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Prefixes must not end with \"/\": %s\n"),
spec->lineNum, spec->line);
array = hfd(array, type);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
}
array = hfd(array, type);
@@ -616,10 +616,10 @@
case RPMTAG_DOCDIR:
SINGLE_TOKEN_ONLY;
if (field[0] != '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Docdir must begin with '/': %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
macro = NULL;
delMacro(NULL, "_docdir");
@@ -630,10 +630,10 @@
case RPMTAG_EPOCH:
SINGLE_TOKEN_ONLY;
if (parseNum(field, &num)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: %s takes an integer value: %s\n"),
spec->lineNum, tagName(tag), spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
xx = headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1);
break;
@@ -672,7 +672,7 @@
case RPMTAG_BUILDPREREQ:
case RPMTAG_BUILDREQUIRES:
if ((rc = parseBits(lang, buildScriptBits, &tagflags))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Bad %s: qualifiers: %s\n"),
spec->lineNum, tagName(tag), spec->line);
return rc;
@@ -683,7 +683,7 @@
case RPMTAG_PREREQ:
case RPMTAG_REQUIREFLAGS:
if ((rc = parseBits(lang, installScriptBits, &tagflags))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Bad %s: qualifiers: %s\n"),
spec->lineNum, tagName(tag), spec->line);
return rc;
@@ -727,10 +727,10 @@
if ((rc = poptParseArgvString(field,
&(spec->BACount),
&(spec->BANames)))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Bad BuildArchitecture format: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (!spec->BACount)
spec->BANames = _free(spec->BANames);
@@ -866,7 +866,7 @@
if (!(p->token && !xstrncasecmp(spec->line, p->token, len)))
continue;
if (p->obsolete) {
- rpmError(RPMERR_BADSPEC, _("Legacy syntax is unsupported: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Legacy syntax is unsupported: %s\n"),
p->token);
p = NULL;
}
@@ -921,7 +921,7 @@
/*@=boundswrite@*/
/*@-boundswrite@*/
-/* XXX should return rpmParseState, but RPMERR_BADSPEC forces int return. */
+/* XXX should return rpmParseState, but RPMRC_FAIL forces int return. */
int parsePreamble(Spec spec, int initialPackage)
{
rpmParseState nextPart;
@@ -940,15 +940,15 @@
/* There is one option to %package: <pkg> or -n <pkg> */
flag = PART_NONE;
if (parseSimplePart(spec->line, &name, &flag)) {
- rpmError(RPMERR_BADSPEC, _("Bad package specification: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Bad package specification: %s\n"),
spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (!lookupPackage(spec, name, flag, NULL)) {
- rpmError(RPMERR_BADSPEC, _("Package already exists: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Package already exists: %s\n"),
spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
/* Construct the package */
@@ -976,12 +976,12 @@
SKIPSPACE(linep);
if (*linep != '\0') {
if (findPreambleTag(spec, &tag, ¯o, lang)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Unknown tag: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (handlePreambleTag(spec, pkg, tag, macro, lang))
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
if (spec->BANames && !spec->recursing)
return PART_BUILDARCHITECTURES;
}
@@ -999,20 +999,20 @@
/* XXX Skip valid arch check if not building binary package */
if (!spec->anyarch && checkForValidArchitectures(spec))
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
if (pkg == spec->packages)
fillOutMainPackage(pkg->header);
if (checkForDuplicates(pkg->header, NVR))
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
if (pkg != spec->packages)
headerCopyTags(spec->packages->header, pkg->header,
(int_32 *)copyTagsDuringParse);
if (checkForRequired(pkg->header, NVR))
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
return nextPart;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parsePrep.c
============================================================================
$ cvs diff -u -r2.89 -r2.90 parsePrep.c
--- rpm/build/parsePrep.c 19 Aug 2007 17:43:01 -0000 2.89
+++ rpm/build/parsePrep.c 11 Oct 2007 13:04:26 -0000 2.90
@@ -42,13 +42,13 @@
struct stat sb;
if (Lstat(urlfn, &sb)) {
- rpmError(RPMERR_BADSPEC, _("Bad source: %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Bad source: %s: %s\n"),
urlfn, strerror(errno));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) {
- rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn);
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn);
+ return RPMRC_FAIL;
}
return 0;
@@ -101,7 +101,7 @@
break;
}
if (sp == NULL) {
- rpmError(RPMERR_BADSPEC, _("No patch number %d\n"), c);
+ rpmlog(RPMLOG_ERR, _("No patch number %d\n"), c);
return NULL;
}
@@ -208,7 +208,7 @@
}
}
if (sp == NULL) {
- rpmError(RPMERR_BADSPEC, _("No source number %d\n"), c);
+ rpmlog(RPMLOG_ERR, _("No source number %d\n"), c);
return NULL;
}
@@ -336,9 +336,9 @@
/*@=mods@*/
if ((rc = poptParseArgvString(line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Error parsing %%setup: %s\n"),
poptStrerror(rc));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
before = newStringBuf();
@@ -351,25 +351,25 @@
/* We only parse -a and -b here */
if (parseNum(optArg, &num)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%setup: %s\n"),
spec->lineNum, (optArg ? optArg : "???"));
before = freeStringBuf(before);
after = freeStringBuf(after);
optCon = poptFreeContext(optCon);
argv = _free(argv);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
{ const char *chptr = doUntar(spec, num, quietly);
if (chptr == NULL)
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
appendLineStringBuf((arg == 'a' ? after : before), chptr);
}
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad %%setup option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(arg));
@@ -377,7 +377,7 @@
after = freeStringBuf(after);
optCon = poptFreeContext(optCon);
argv = _free(argv);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (dirName) {
@@ -425,7 +425,7 @@
if (!createDir && !skipDefaultAction) {
const char *chptr = doUntar(spec, 0, quietly);
if (!chptr)
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
appendLineStringBuf(spec->prep, chptr);
}
@@ -440,7 +440,7 @@
if (createDir && !skipDefaultAction) {
const char * chptr = doUntar(spec, 0, quietly);
if (chptr == NULL)
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
appendLineStringBuf(spec->prep, chptr);
}
@@ -518,19 +518,19 @@
/* orig suffix */
opt_b = strtok(NULL, " \t\n");
if (! opt_b) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Need arg to %%patch -b: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
} else if (!strcmp(s, "-z")) {
/* orig suffix */
opt_b = strtok(NULL, " \t\n");
if (! opt_b) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Need arg to %%patch -z: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
} else if (!strcmp(s, "-F")) {
/* fuzz factor */
@@ -540,19 +540,19 @@
opt_F = (fnum ? strtol(fnum, &end, 10) : 0);
if (! opt_F || *end) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Bad arg to %%patch -F: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
} else if (!strcmp(s, "-d")) {
/* subdirectory */
opt_d = strtok(NULL, " \t\n");
if (! opt_d) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Need arg to %%patch -d: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
} else if (!strncmp(s, "-p", sizeof("-p")-1)) {
/* unfortunately, we must support -pX */
@@ -561,28 +561,28 @@
} else {
s = strtok(NULL, " \t\n");
if (s == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Need arg to %%patch -p: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
}
if (parseNum(s, &opt_p)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Bad arg to %%patch -p: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
} else {
/* Must be a patch num */
if (patch_index == 1024) {
- rpmError(RPMERR_BADSPEC, _("Too many patches!\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("Too many patches!\n"));
+ return RPMRC_FAIL;
}
if (parseNum(s, &(patch_nums[patch_index]))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%patch: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
patch_index++;
}
@@ -594,14 +594,14 @@
if (! opt_P) {
s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E, opt_F, opt_d);
if (s == NULL)
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
appendLineStringBuf(spec->prep, s);
}
for (x = 0; x < patch_index; x++) {
s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E, opt_F, opt_d);
if (s == NULL)
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
appendLineStringBuf(spec->prep, s);
}
@@ -674,7 +674,7 @@
goto bottom;
if (errno != ENOENT) {
ec++;
- rpmError(RPMERR_BADFILENAME, _("Missing %s%d %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Missing %s%d %s: %s\n"),
((sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch"),
sp->num, sp->source, strerror(ENOENT));
goto bottom;
@@ -682,7 +682,7 @@
Rurlfn = rpmGenPath(NULL, Rmacro, sp->source);
if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Rurlfn, "/") || !strcmp(Lurlfn, Rurlfn)) {
- rpmError(RPMERR_BADFILENAME, _("file %s missing: %s\n"),
+ rpmlog(RPMLOG_ERR, _("file %s missing: %s\n"),
Lurlfn, strerror(errno));
ec++;
goto bottom;
@@ -690,7 +690,7 @@
rc = urlGetFile(Rurlfn, Lurlfn);
if (rc != 0) {
- rpmError(RPMERR_BADFILENAME, _("Fetching %s failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Fetching %s failed: %s\n"),
Rurlfn, ftpStrerror(rc));
ec++;
goto bottom;
@@ -713,8 +713,8 @@
char *cp;
if (spec->prep != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum);
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("line %d: second %%prep\n"), spec->lineNum);
+ return RPMRC_FAIL;
}
spec->prep = newStringBuf();
@@ -729,7 +729,7 @@
if (verify) {
rc = prepFetch(spec);
if (rc)
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
sb = newStringBuf();
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseReqs.c
============================================================================
$ cvs diff -u -r2.47 -r2.48 parseReqs.c
--- rpm/build/parseReqs.c 16 Jul 2007 01:32:26 -0000 2.47
+++ rpm/build/parseReqs.c 11 Oct 2007 13:04:26 -0000 2.48
@@ -98,10 +98,10 @@
|| (nr > 2 && r[0] == '!')
|| (nr > 3 && r[0] == '%' && r[1] == '{' && r[nr-1] == '}')))
{
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Dependency \"%s\" must begin with alpha-numeric, '_' or '/': %s\n"),
spec->lineNum, spec->line, r);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
re = r;
@@ -122,10 +122,10 @@
if (ve > v) {
rpmsenseFlags F = rpmEVRflags(v, &ve);
if (F && r[0] == '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: Versioned file name not permitted: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (F) {
/* now parse EVR */
@@ -141,9 +141,9 @@
/*@-branchstate@*/
if (Flags & RPMSENSE_SENSEMASK) {
if (*v == '\0' || ve == v) {
- rpmError(RPMERR_BADSPEC, _("line %d: Version required: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Version required: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
EVR = xmalloc((ve-v) + 1);
strncpy(EVR, v, (ve-v));
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseScript.c
============================================================================
$ cvs diff -u -r2.48 -r2.49 parseScript.c
--- rpm/build/parseScript.c 16 Jul 2007 01:32:26 -0000 2.48
+++ rpm/build/parseScript.c 11 Oct 2007 13:04:26 -0000 2.49
@@ -186,9 +186,9 @@
/* break line into two */
p = strstr(spec->line, "--");
if (!p) {
- rpmError(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: triggers must have --: %s\n"),
spec->lineNum, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
*p = '\0';
@@ -196,9 +196,9 @@
}
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
@@ -207,19 +207,19 @@
case 'p':
if (prog[0] == '<') {
if (prog[strlen(prog)-1] != '>') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: internal script must end "
"with \'>\': %s\n"), spec->lineNum, prog);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
} else if (prog[0] == '%') {
/* XXX check well-formed macro? */
} else if (prog[0] != '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: script program must begin "
"with \'/\': %s\n"), spec->lineNum, prog);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
/*@switchbreak@*/ break;
@@ -230,11 +230,11 @@
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
@@ -244,34 +244,34 @@
name = poptGetArg(optCon);
/*@=mods@*/
if (poptPeekArg(optCon)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
}
if (lookupPackage(spec, name, flag, &pkg)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
if (tag != RPMTAG_TRIGGERSCRIPTS) {
if (headerIsEntry(pkg->header, progtag)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Second %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Second %s\n"),
spec->lineNum, partname);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
}
if ((rc = poptParseArgvString(prog, &progArgc, &progArgv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
@@ -298,7 +298,7 @@
if (!strcmp(progArgv[0], "<lua>")) {
rpmlua lua = NULL; /* Global state. */
if (rpmluaCheckScript(lua, p, partname) != RPMRC_OK) {
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
}
(void) rpmlibNeedsFeature(pkg->header,
@@ -306,10 +306,10 @@
} else
#endif
if (progArgv[0][0] == '<') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("line %d: unsupported internal script: %s\n"),
spec->lineNum, progArgv[0]);
- rc = RPMERR_BADSPEC;
+ rc = RPMRC_FAIL;
goto exit;
} else {
(void) addReqProv(spec, pkg->header, RPMTAG_REQUIRENAME,
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseSpec.c
============================================================================
$ cvs diff -u -r2.102 -r2.103 parseSpec.c
--- rpm/build/parseSpec.c 19 Aug 2007 17:43:02 -0000 2.102
+++ rpm/build/parseSpec.c 11 Oct 2007 13:04:26 -0000 2.103
@@ -199,9 +199,9 @@
/* Don't expand macros (eg. %define) in false branch of %if clause */
if (spec->readStack->reading &&
expandMacros(spec, spec->macros, spec->lbuf, sizeof(spec->lbuf))) {
- rpmError(RPMERR_BADSPEC, _("line %d: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: %s\n"),
spec->lineNum, spec->lbuf);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
spec->nextline = spec->lbuf;
}
@@ -251,9 +251,9 @@
ofi->fd = Fopen(ofi->fileName, "r.fpio");
if (ofi->fd == NULL || Ferror(ofi->fd)) {
/* XXX Fstrerror */
- rpmError(RPMERR_BADSPEC, _("Unable to open %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Unable to open %s: %s\n"),
ofi->fileName, Fstrerror(ofi->fd));
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
spec->lineNum = ofi->lineNum = 0;
}
@@ -339,7 +339,7 @@
rpmError(RPMERR_UNMATCHEDIF,
_("%s:%d: parseExpressionBoolean returns %d\n"),
ofi->fileName, ofi->lineNum, match);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
} else if (! strncmp("%else", s, sizeof("%else")-1)) {
s += 5;
@@ -372,8 +372,8 @@
s += 8;
fileName = s;
if (! xisspace(*fileName)) {
- rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("malformed %%include statement\n"));
+ return RPMRC_FAIL;
}
SKIPSPACE(fileName);
endFileName = fileName;
@@ -381,8 +381,8 @@
p = endFileName;
SKIPSPACE(p);
if (*p != '\0') {
- rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
- return RPMERR_BADSPEC;
+ rpmlog(RPMLOG_ERR, _("malformed %%include statement\n"));
+ return RPMRC_FAIL;
}
*endFileName = '\0';
@@ -549,7 +549,7 @@
spec->BACount = index;
/*@-nullstate@*/
spec = freeSpec(spec);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
/*@=nullstate@*/
}
@@ -560,11 +560,11 @@
spec->BACount = index;
if (! index) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("No compatible architectures found for build\n"));
/*@-nullstate@*/
spec = freeSpec(spec);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
/*@=nullstate@*/
}
@@ -603,11 +603,11 @@
const char * NVRA = NULL;
(void) headerGetExtension(pkg->header, RPMTAG_NVRA,
NULL, &NVRA, NULL);
- rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Package has no %%description: %s\n"),
NVRA);
NVRA = _free(NVRA);
spec = freeSpec(spec);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
(void) headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1);
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/spec.c
============================================================================
$ cvs diff -u -r2.154 -r2.155 spec.c
--- rpm/build/spec.c 27 Aug 2007 11:44:39 -0000 2.154
+++ rpm/build/spec.c 11 Oct 2007 13:04:26 -0000 2.155
@@ -284,15 +284,15 @@
if (*fe != '\0') fe++;
if (parseNum(f, &num)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad number: %s\n"),
spec->lineNum, f);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
if (! (p = findSource(spec, num, flag))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad no%s number: %d\n"),
spec->lineNum, name, num);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
p->flags |= RPMFILE_GHOST;
@@ -358,9 +358,9 @@
if (nump == NULL || *nump == '\0')
num = 0;
else if (parseNum(buf, &num)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"),
+ rpmlog(RPMLOG_ERR, _("line %d: Bad %s number: %s\n"),
spec->lineNum, name, spec->line);
- return RPMERR_BADSPEC;
+ return RPMRC_FAIL;
}
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/fs.c
============================================================================
$ cvs diff -u -r2.55 -r2.56 fs.c
--- rpm/lib/fs.c 30 Sep 2007 20:38:25 -0000 2.55
+++ rpm/lib/fs.c 11 Oct 2007 13:04:27 -0000 2.56
@@ -355,7 +355,7 @@
/*@innerbreak@*/ break;
if (j == numFilesystems) {
- rpmError(RPMERR_BADDEV,
+ rpmlog(RPMLOG_ERR,
_("file %s is on an unknown device\n"), buf);
sourceDir = _free(sourceDir);
usages = _free(usages);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/misc.c
============================================================================
$ cvs diff -u -r2.144 -r2.145 misc.c
--- rpm/lib/misc.c 30 Sep 2007 22:38:28 -0000 2.144
+++ rpm/lib/misc.c 11 Oct 2007 13:04:27 -0000 2.145
@@ -38,7 +38,7 @@
break;
}
if (rc < 0) {
- rpmError(RPMERR_CREATE, _("cannot create %%%s %s\n"), dname, dpath);
+ rpmlog(RPMLOG_ERR, _("cannot create %%%s %s\n"), dname, dpath);
return RPMRC_FAIL;
}
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/package.c
============================================================================
$ cvs diff -u -r2.166 -r2.167 package.c
--- rpm/lib/package.c 7 Oct 2007 14:00:13 -0000 2.166
+++ rpm/lib/package.c 11 Oct 2007 13:04:27 -0000 2.167
@@ -328,7 +328,7 @@
}
if (rc != RPMRC_OK || h == NULL) {
- rpmError(RPMERR_FREAD, _("%s: headerRead failed: %s"), fn,
+ rpmlog(RPMLOG_ERR, _("%s: headerRead failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
@@ -453,7 +453,7 @@
op->count--; /* XXX one too many */
dig->nbytes += nb; /* XXX include size of header blob. */
if (count < 0) {
- rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"),
fn, Fstrerror(fd));
rc = RPMRC_FAIL;
goto exit;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/psm.c
============================================================================
$ cvs diff -u -r2.233 -r2.234 psm.c
--- rpm/lib/psm.c 30 Sep 2007 22:38:28 -0000 2.233
+++ rpm/lib/psm.c 11 Oct 2007 13:04:27 -0000 2.234
@@ -285,7 +285,7 @@
goto exit;
}
if (Access(_sourcedir, W_OK)) {
- rpmError(RPMERR_CREATE, _("cannot write to %%%s %s\n"),
+ rpmlog(RPMLOG_ERR, _("cannot write to %%%s %s\n"),
"_sourcedir", _sourcedir);
rpmrc = RPMRC_FAIL;
goto exit;
@@ -298,7 +298,7 @@
goto exit;
}
if (Access(_specdir, W_OK)) {
- rpmError(RPMERR_CREATE, _("cannot write to %%%s %s\n"),
+ rpmlog(RPMLOG_ERR, _("cannot write to %%%s %s\n"),
"_specdir", _specdir);
rpmrc = RPMRC_FAIL;
goto exit;
@@ -861,7 +861,7 @@
}
if (psm->sq.child == (pid_t)-1) {
- rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
+ rpmlog(RPMLOG_ERR, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
goto exit;
}
@@ -1898,7 +1898,7 @@
xx = rpmpsmNext(psm, PSM_NOTIFY);
if (rc) {
- rpmError(RPMERR_CPIO,
+ rpmlog(RPMLOG_ERR,
_("unpacking of archive failed%s%s: %s\n"),
(psm->failedFile != NULL ? _(" on file ") : ""),
(psm->failedFile != NULL ? psm->failedFile : ""),
@@ -2077,11 +2077,11 @@
if (rc) {
if (psm->failedFile)
- rpmError(RPMERR_CPIO,
+ rpmlog(RPMLOG_ERR,
_("%s failed on file %s: %s\n"),
psm->stepName, psm->failedFile, cpioStrerror(rc));
else
- rpmError(RPMERR_CPIO, _("%s failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("%s failed: %s\n"),
psm->stepName, cpioStrerror(rc));
/* XXX notify callback on error. */
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmchecksig.c
============================================================================
$ cvs diff -u -r1.149 -r1.150 rpmchecksig.c
--- rpm/lib/rpmchecksig.c 7 Oct 2007 14:00:13 -0000 1.149
+++ rpm/lib/rpmchecksig.c 11 Oct 2007 13:04:27 -0000 1.150
@@ -108,17 +108,17 @@
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), *sfdp)) > 0)
{
if (Fwrite(buf, sizeof(buf[0]), count, *tfdp) != count) {
- rpmError(RPMERR_FWRITE, _("%s: Fwrite failed: %s\n"), *tfnp,
+ rpmlog(RPMLOG_ERR, _("%s: Fwrite failed: %s\n"), *tfnp,
Fstrerror(*tfdp));
goto exit;
}
}
if (count < 0) {
- rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp));
+ rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp));
goto exit;
}
if (Fflush(*tfdp) != 0) {
- rpmError(RPMERR_FWRITE, _("%s: Fflush failed: %s\n"), *tfnp,
+ rpmlog(RPMLOG_ERR, _("%s: Fflush failed: %s\n"), *tfnp,
Fstrerror(*tfdp));
goto exit;
}
@@ -631,19 +631,19 @@
/* Read pgp packet. */
if ((rc = pgpReadPkts(fn, &pkt, &pktlen)) <= 0) {
- rpmError(RPMERR_IMPORT, _("%s: import read failed(%d).\n"), fn, rc);
+ rpmlog(RPMLOG_ERR, _("%s: import read failed(%d).\n"), fn, rc);
res++;
continue;
}
if (rc != PGPARMOR_PUBKEY) {
- rpmError(RPMERR_IMPORT, _("%s: not an armored public key.\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: not an armored public key.\n"), fn);
res++;
continue;
}
/* Import pubkey packet(s). */
if ((rpmrc = rpmcliImportPubkey(ts, pkt, pktlen)) != RPMRC_OK) {
- rpmError(RPMERR_IMPORT, _("%s: import failed.\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: import failed.\n"), fn);
res++;
continue;
}
@@ -673,7 +673,7 @@
/* Read the header from the package. */
{ Header h = headerRead(fd);
if (h == NULL) {
- rpmError(RPMERR_FREAD, _("%s: headerRead failed\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: headerRead failed\n"), fn);
goto exit;
}
@@ -689,7 +689,7 @@
|| uh == NULL)
{
h = headerFree(h);
- rpmError(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn);
+ rpmlog(RPMLOG_ERR, _("%s: headerGetEntry failed\n"), fn);
goto exit;
}
(void) headerGetMagic(NULL, &hmagic, &nmagic);
@@ -710,7 +710,7 @@
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0)
dig->nbytes += count;
if (count < 0) {
- rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd));
+ rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd));
goto exit;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmfc.c
============================================================================
$ cvs diff -u -r1.18 -r1.19 rpmfc.c
--- rpm/lib/rpmfc.c 6 Oct 2007 21:33:48 -0000 1.18
+++ rpm/lib/rpmfc.c 11 Oct 2007 13:04:27 -0000 1.19
@@ -96,12 +96,12 @@
unsetenv("MALLOC_CHECK_");
(void) execvp(argv[0], (char *const *)argv);
/* XXX this error message is probably not seen. */
- rpmError(RPMERR_EXEC, _("Couldn't exec %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Couldn't exec %s: %s\n"),
argv[0], strerror(errno));
_exit(RPMERR_EXEC);
}
if (child < 0) {
- rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("Couldn't fork %s: %s\n"),
argv[0], strerror(errno));
return NULL;
}
@@ -191,12 +191,12 @@
const char *cmd = argvJoin(argv);
int rc = (WIFEXITED(status) ? WEXITSTATUS(status) : -1);
- rpmError(RPMERR_EXEC, _("Command \"%s\" failed, exit(%d)\n"), cmd, rc);
+ rpmlog(RPMLOG_ERR, _("Command \"%s\" failed, exit(%d)\n"), cmd, rc);
cmd = _free(cmd);
return NULL;
}
if (writeBytesLeft) {
- rpmError(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]);
+ rpmlog(RPMLOG_ERR, _("failed to write all data to %s\n"), argv[0]);
return NULL;
}
return readBuff;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/db3.c
============================================================================
$ cvs diff -u -r1.74 -r1.75 db3.c
--- rpm/rpmdb/db3.c 4 Oct 2007 07:20:43 -0000 1.74
+++ rpm/rpmdb/db3.c 11 Oct 2007 13:04:28 -0000 1.75
@@ -160,10 +160,10 @@
if (printit && rc) {
/*@-moduncon@*/ /* FIX: annotate db3 methods */
if (msg)
- rpmError(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
+ rpmlog(RPMLOG_ERR, _("db%d error(%d) from %s: %s\n"),
DB_VERSION_MAJOR, rc, msg, db_strerror(error));
else
- rpmError(RPMERR_DBERR, _("db%d error(%d): %s\n"),
+ rpmlog(RPMLOG_ERR, _("db%d error(%d): %s\n"),
DB_VERSION_MAJOR, rc, db_strerror(error));
/*@=moduncon@*/
}
@@ -1281,7 +1281,7 @@
break;
case DB_RUNRECOVERY:
- rpmError(RPMERR_DBERR, _("Runnning db->verify ...\n"));
+ rpmlog(RPMLOG_ERR, _("Runnning db->verify ...\n"));
rpmdb = rpmdbLink(rpmdb, "DB_RUNRECOVERY");
rpmdb->db_remove_env = 1;
rpmdb->db_verifying = 1;
@@ -1580,7 +1580,7 @@
(dbi->dbi_eflags & DB_INIT_CDB) &&
!(dbi->dbi_eflags & DB_PRIVATE))
? 0 : 1);
- rpmError( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
+ rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
_("cannot get %s lock on %s/%s\n"),
((dbi->dbi_mode & (O_RDWR|O_WRONLY))
? _("exclusive") : _("shared")),
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/dbconfig.c
============================================================================
$ cvs diff -u -r1.45 -r1.46 dbconfig.c
--- rpm/rpmdb/dbconfig.c 30 Sep 2007 17:29:05 -0000 1.45
+++ rpm/rpmdb/dbconfig.c 11 Oct 2007 13:04:28 -0000 1.46
@@ -708,7 +708,7 @@
/*@innerbreak@*/ break;
}
if (opt->longName == NULL) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMLOG_ERR,
_("unrecognized db option: \"%s\" ignored.\n"), o);
continue;
}
@@ -748,7 +748,7 @@
else if (!xstrncasecmp(pe, "Kb", 2))
aLong *= 1024;
else if (*pe != '\0') {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMLOG_ERR,
_("%s has invalid numeric value, skipped\n"),
opt->longName);
continue;
@@ -757,7 +757,7 @@
if ((argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) {
if (aLong == LONG_MIN || aLong == LONG_MAX) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMLOG_ERR,
_("%s has too large or too small long value, skipped\n"),
opt->longName);
continue;
@@ -766,7 +766,7 @@
/*@switchbreak@*/ break;
} else {
if (aLong > INT_MAX || aLong < INT_MIN) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMLOG_ERR,
_("%s has too large or too small integer value, skipped\n"),
opt->longName);
continue;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmdb.c
============================================================================
$ cvs diff -u -r1.168 -r1.169 rpmdb.c
--- rpm/rpmdb/rpmdb.c 8 Oct 2007 05:44:22 -0000 1.168
+++ rpm/rpmdb/rpmdb.c 11 Oct 2007 13:04:28 -0000 1.169
@@ -370,7 +370,7 @@
if (rc) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
- rpmError(RPMERR_DBOPEN,
+ rpmlog(RPMLOG_ERR,
_("cannot open %s index using db%d - %s (%d)\n"),
tagName(rpmtag), _dbapi,
(rc > 0 ? strerror(rc) : ""), rc);
@@ -391,7 +391,7 @@
if (_dbapi <= 0) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
- rpmError(RPMERR_DBOPEN, _("cannot open %s index\n"),
+ rpmlog(RPMLOG_ERR, _("cannot open %s index\n"),
tagName(rpmtag));
rc = 1;
goto exit;
@@ -1155,7 +1155,7 @@
db->db_home = rpmdbURIPath( (home && *home ? home : _DB_HOME) );
if (!(db->db_home && db->db_home[0])) {
- rpmError(RPMERR_DBOPEN, _("no dbpath has been set\n"));
+ rpmlog(RPMLOG_ERR, _("no dbpath has been set\n"));
db->db_root = _free(db->db_root);
db->db_home = _free(db->db_home);
db = _free(db);
@@ -1452,7 +1452,7 @@
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
}
@@ -1589,7 +1589,7 @@
if (rc == DB_NOTFOUND) { /* not found */
rc = 0;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
rc = -1;
@@ -1645,7 +1645,7 @@
if (rc == DB_NOTFOUND) { /* not found */
return RPMRC_NOTFOUND;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
return RPMRC_FAIL;
@@ -1868,7 +1868,7 @@
(void) blockSignals(dbi->dbi_rpmdb, &signalMask);
rc = dbiPut(dbi, mi->mi_dbc, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) storing record #%d into %s\n"),
rc, mi->mi_prevoffset, tagName(dbi->dbi_rpmtag));
}
@@ -2457,7 +2457,7 @@
mi->mi_h = headerCopyLoad(uh);
#endif
if (mi->mi_h == NULL || !headerIsEntry(mi->mi_h, RPMTAG_NAME)) {
- rpmError(RPMERR_BADHEADER,
+ rpmlog(RPMLOG_ERR,
_("rpmdb: damaged header #%u retrieved -- skipping.\n"),
mi->mi_offset);
goto top;
@@ -2544,7 +2544,7 @@
if (rc) { /* error/not found */
if (rc != DB_NOTFOUND)
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
#ifdef SQLITE_HACK
@@ -2694,7 +2694,7 @@
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
/*@=nullstate@*/
if (rc > 0) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, (key->data ? key->data : "???"), tagName(dbi->dbi_rpmtag));
}
@@ -2794,7 +2794,7 @@
}
if (h == NULL) {
- rpmError(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
+ rpmlog(RPMLOG_ERR, _("%s: cannot read header at 0x%x\n"),
"rpmdbRemove", hdrNum);
return 1;
}
@@ -2868,7 +2868,7 @@
rc = dbiCopen(dbi, dbi->dbi_txnid, &dbcursor, DB_WRITECURSOR);
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) setting header #%d record for %s removal\n"),
rc, hdrNum, tagName(dbi->dbi_rpmtag));
} else
@@ -3011,7 +3011,7 @@
} else if (rc == DB_NOTFOUND) { /* not found */
/*@innercontinue@*/ continue;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) setting \"%s\" records from %s index\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
ret += 1;
@@ -3032,7 +3032,7 @@
(void) set2dbt(dbi, data, set);
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) storing record \"%s\" into %s\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
ret += 1;
@@ -3042,7 +3042,7 @@
} else {
rc = dbiDel(dbi, dbcursor, key, data, 0);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) removing record \"%s\" from %s\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
ret += 1;
@@ -3215,7 +3215,7 @@
}
if (ret) {
- rpmError(RPMERR_DBCORRUPT,
+ rpmlog(RPMLOG_ERR,
_("error(%d) allocating new package instance\n"), ret);
goto exit;
}
@@ -3488,7 +3488,7 @@
if (!dbi->dbi_permit_dups)
(void) dbt2set(dbi, data, &set);
} else if (rc != DB_NOTFOUND) { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
ret += 1;
@@ -3507,7 +3507,7 @@
/*@=compmempass@*/
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMLOG_ERR,
_("error(%d) storing record %s into %s\n"),
rc, key->data, tagName(dbi->dbi_rpmtag));
ret += 1;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/signature.c
============================================================================
$ cvs diff -u -r1.3 -r1.4 signature.c
--- rpm/rpmdb/signature.c 7 Oct 2007 14:00:13 -0000 1.3
+++ rpm/rpmdb/signature.c 11 Oct 2007 13:04:28 -0000 1.4
@@ -276,7 +276,7 @@
break;
}
}
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
+ rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "pgp",
strerror(errno));
_exit(RPMERR_EXEC);
}
@@ -391,7 +391,7 @@
if (!rc)
rc = execve(av[0], av+1, environ);
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
+ rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "gpg",
strerror(errno));
_exit(RPMERR_EXEC);
}
@@ -748,7 +748,7 @@
/*@innerbreak@*/ break;
}
}
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
+ rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "pgp",
strerror(errno));
_exit(RPMERR_EXEC);
} else
@@ -763,7 +763,7 @@
if (!rc)
rc = execve(av[0], av+1, environ);
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
+ rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "gpg",
strerror(errno));
}
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/macro.c
============================================================================
$ cvs diff -u -r2.146 -r2.147 macro.c
--- rpm/rpmio/macro.c 6 Oct 2007 19:40:23 -0000 2.146
+++ rpm/rpmio/macro.c 11 Oct 2007 13:04:28 -0000 2.147
@@ -22,9 +22,9 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#define rpmError fprintf
+#define rpmlog fprintf
#define rpmIsVerbose() (0)
-#define RPMERR_BADSPEC stderr
+#define RPMLOG_ERR stderr
#undef _
#define _(x) x
@@ -661,7 +661,7 @@
SKIPBLANK(s, c);
if (c == '{') { /* XXX permit silent {...} grouping */
if ((se = matchchar(s, c, '}')) == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Macro %%%s has unterminated body\n"), n);
se = s; /* XXX W2DO? */
return se;
@@ -699,7 +699,7 @@
*be = '\0';
if (bc || pc) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Macro %%%s has unterminated body\n"), n);
se = s; /* XXX W2DO? */
return se;
@@ -720,25 +720,25 @@
/* Names must start with alphabetic or _ and be at least 3 chars */
if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Macro %%%s has illegal name (%%define)\n"), n);
return se;
}
/* Options must be terminated with ')' */
if (o && oc != ')') {
- rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n);
+ rpmlog(RPMLOG_ERR, _("Macro %%%s has unterminated opts\n"), n);
return se;
}
if ((be - b) < 1) {
- rpmError(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n);
+ rpmlog(RPMLOG_ERR, _("Macro %%%s has empty body\n"), n);
return se;
}
/*@-modfilesys@*/
if (expandbody && expandU(mb, b, (&buf[bufn] - b))) {
- rpmError(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n);
+ rpmlog(RPMLOG_ERR, _("Macro %%%s failed to expand\n"), n);
return se;
}
/*@=modfilesys@*/
@@ -777,7 +777,7 @@
/* Names must start with alphabetic or _ and be at least 3 chars */
if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Macro %%%s has illegal name (%%undefine)\n"), n);
return se;
}
@@ -893,7 +893,7 @@
skiptest = 1; /* XXX skip test for %# %* %0 */
} else if (!skiptest && me->used <= 0) {
#if NOTYET
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Macro %%%s (%s) was not used below level %d\n"),
me->name, me->body, me->level);
#endif
@@ -1022,7 +1022,7 @@
/*@=nullstate@*/
{
if (c == '?' || (o = strchr(opts, c)) == NULL) {
- rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"),
+ rpmlog(RPMLOG_ERR, _("Unknown option %c in %s(%s)\n"),
(char)c, me->name, opts);
return se;
}
@@ -1084,7 +1084,7 @@
buf[msglen] = '\0';
(void) expandU(mb, buf, bufn);
if (waserror)
- rpmError(RPMERR_BADSPEC, "%s\n", buf);
+ rpmlog(RPMLOG_ERR, "%s\n", buf);
else
fprintf(stderr, "%s", buf);
}
@@ -1249,7 +1249,7 @@
int chkexist;
if (++mb->depth > max_macro_depth) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Recursion depth(%d) greater than max(%d)\n"),
mb->depth, max_macro_depth);
mb->depth--;
@@ -1321,7 +1321,7 @@
/*@switchbreak@*/ break;
case '(': /* %(...) shell escape */
if ((se = matchchar(s, c, ')')) == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Unterminated %c: %s\n"), (char)c, s);
rc = 1;
continue;
@@ -1338,7 +1338,7 @@
/*@notreached@*/ /*@switchbreak@*/ break;
case '{': /* %{...}/%{...:...} substitution */
if ((se = matchchar(s, c, '}')) == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Unterminated %c: %s\n"), (char)c, s);
rc = 1;
continue;
@@ -1380,7 +1380,7 @@
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
#if 0
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("A %% is followed by an unparseable macro\n"));
#endif
s = se;
@@ -1566,7 +1566,7 @@
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
} else {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMLOG_ERR,
_("Macro %%%.*s not found, skipping\n"), fn, f);
s = se;
}
@@ -1895,7 +1895,7 @@
tbuf[slen] = '\0';
if (mb->nb == 0)
- rpmError(RPMERR_BADSPEC, _("Macro expansion too big for target buffer\n"));
+ rpmlog(RPMLOG_ERR, _("Macro expansion too big for target buffer\n"));
else
strncpy(sbuf, tbuf, (slen - mb->nb + 1));
@@ -1929,7 +1929,7 @@
if (*mep && (*mep)->flags && !(n[0] == '.' && n[1] == '.')) {
/* XXX avoid error message for %buildroot */
if (strcmp((*mep)->name, "buildroot"))
- rpmError(RPMERR_BADSPEC, _("Macro '%s' is readonly and cannot be changed.\n"), n);
+ rpmlog(RPMLOG_ERR, _("Macro '%s' is readonly and cannot be changed.\n"), n);
return;
}
/* Push macro over previous definition */
@@ -2136,16 +2136,16 @@
fd = Fopen(file, "r");
if (fd == NULL || Ferror(fd)) {
/* XXX Fstrerror */
- rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
+ rpmlog(RPMLOG_ERR, _("File %s: %s\n"), file, Fstrerror(fd));
if (fd) (void) Fclose(fd);
return 1;
}
nb = Fread(magic, sizeof(magic[0]), sizeof(magic), fd);
if (nb < 0) {
- rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
+ rpmlog(RPMLOG_ERR, _("File %s: %s\n"), file, Fstrerror(fd));
rc = 1;
} else if (nb < sizeof(magic)) {
- rpmError(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"),
+ rpmlog(RPMLOG_ERR, _("File %s is smaller than %u bytes\n"),
file, (unsigned)sizeof(magic));
rc = 0;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmmg.c
============================================================================
$ cvs diff -u -r2.3 -r2.4 rpmmg.c
--- rpm/rpmio/rpmmg.c 6 Oct 2007 19:40:23 -0000 2.3
+++ rpm/rpmio/rpmmg.c 11 Oct 2007 13:04:28 -0000 2.4
@@ -46,13 +46,13 @@
mg->flags = (flags ? flags : MAGIC_CHECK);/* XXX MAGIC_COMPRESS flag? */
mg->ms = magic_open(flags);
if (mg->ms == NULL) {
- rpmError(RPMERR_EXEC, _("magic_open(0x%x) failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("magic_open(0x%x) failed: %s\n"),
flags, strerror(errno));
return rpmmgFree(mg);
}
xx = magic_load(mg->ms, mg->fn);
if (xx == -1) {
- rpmError(RPMERR_EXEC, _("magic_load(ms, %s) failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("magic_load(ms, %s) failed: %s\n"),
(fn ? fn : "(nil)"), magic_error(mg->ms));
return rpmmgFree(mg);
}
@@ -71,7 +71,7 @@
if (mg->ms) {
t = magic_file(mg->ms, fn);
if (t == NULL) {
- rpmError(RPMERR_EXEC, _("magic_file(ms, %s) failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("magic_file(ms, %s) failed: %s\n"),
(fn ? fn : "(nil)"), magic_error(mg->ms));
}
}
@@ -93,7 +93,7 @@
if (mg->ms) {
t = magic_buffer(mg->ms, b, nb);
if (t == NULL) {
- rpmError(RPMERR_EXEC, _("magic_buffer(ms, %p[%u]) failed: %s\n"),
+ rpmlog(RPMLOG_ERR, _("magic_buffer(ms, %p[%u]) failed: %s\n"),
b, (unsigned)nb, magic_error(mg->ms));
}
}
@@ .
Received on Thu Oct 11 15:04:28 2007