Replace all rpmError() uses with rpmlog()

This commit is contained in:
Panu Matilainen 2007-10-09 14:06:06 +03:00
parent 46921b2334
commit d709195c3a
38 changed files with 389 additions and 389 deletions

20
build.c
View File

@ -60,7 +60,7 @@ static int isSpecFile(const char * specfile)
fd = Fopen(specfile, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("Unable to open spec file %s: %s\n"),
rpmlog(RPMERR_OPEN, _("Unable to open spec file %s: %s\n"),
specfile, Fstrerror(fd));
return 0;
}
@ -137,7 +137,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
sprintf(cmd, "%s < '%s' | tar xOvf - Specfile 2>&1 > '%s'",
zcmds[res & 0x3], arg, tmpSpecFile);
if (!(fp = popen(cmd, "r"))) {
rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
rpmlog(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
specDir = _free(specDir);
tmpSpecFile = _free(tmpSpecFile);
return 1;
@ -149,14 +149,14 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
sprintf(cmd, "%s < '%s' | tar xOvf - --wildcards \\*.spec 2>&1 > '%s'",
zcmds[res & 0x3], arg, tmpSpecFile);
if (!(fp = popen(cmd, "r"))) {
rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
rpmlog(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
specDir = _free(specDir);
tmpSpecFile = _free(tmpSpecFile);
return 1;
}
if (!fgets(buf, sizeof(buf) - 1, fp)) {
/* Give up */
rpmError(RPMERR_READ, _("Failed to read spec file from %s\n"),
rpmlog(RPMERR_READ, _("Failed to read spec file from %s\n"),
arg);
(void) unlink(tmpSpecFile);
specDir = _free(specDir);
@ -184,7 +184,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
specDir = _free(specDir);
if (res) {
rpmError(RPMERR_RENAME, _("Failed to rename %s to %s: %m\n"),
rpmlog(RPMERR_RENAME, _("Failed to rename %s to %s: %m\n"),
tmpSpecFile, s);
(void) unlink(tmpSpecFile);
tmpSpecFile = _free(tmpSpecFile);
@ -197,7 +197,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
if (*arg != '/') {
if (!getcwd(buf, BUFSIZ)) {
rpmError(RPMERR_STAT, "getcwd failed: %m\n");
rpmlog(RPMERR_STAT, "getcwd failed: %m\n");
return 1;
}
strcat(buf, "/");
@ -218,7 +218,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
if (*specFile != '/') {
char *s = alloca(BUFSIZ);
if (!getcwd(s, BUFSIZ)) {
rpmError(RPMERR_STAT, "getcwd failed: %m\n");
rpmlog(RPMERR_STAT, "getcwd failed: %m\n");
rc = 1;
goto exit;
}
@ -230,12 +230,12 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
if (specut != URL_IS_DASH) {
struct stat st;
if (Stat(specURL, &st) < 0) {
rpmError(RPMERR_STAT, _("failed to stat %s: %m\n"), specURL);
rpmlog(RPMERR_STAT, _("failed to stat %s: %m\n"), specURL);
rc = 1;
goto exit;
}
if (! S_ISREG(st.st_mode)) {
rpmError(RPMERR_NOTREG, _("File %s is not a regular file.\n"),
rpmlog(RPMERR_NOTREG, _("File %s is not a regular file.\n"),
specURL);
rc = 1;
goto exit;
@ -243,7 +243,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
/* Try to verify that the file is actually a specfile */
if (!isSpecFile(specURL)) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("File %s does not appear to be a specfile.\n"), specURL);
rc = 1;
goto exit;

View File

@ -129,7 +129,7 @@ int doScript(rpmSpec spec, int what, const char *name, StringBuf sb, int test)
}
if (makeTempFile(rootURL, &scriptName, &fd) || fd == NULL || Ferror(fd)) {
rpmError(RPMERR_SCRIPT, _("Unable to open temp file.\n"));
rpmlog(RPMERR_SCRIPT, _("Unable to open temp file.\n"));
rc = RPMERR_SCRIPT;
goto exit;
}
@ -221,7 +221,7 @@ fprintf(stderr, "*** addMacros\n");
errno = 0;
(void) execvp(argv[0], (char *const *)argv);
rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"),
rpmlog(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"),
scriptName, name, strerror(errno));
_exit(-1);
@ -230,7 +230,7 @@ fprintf(stderr, "*** addMacros\n");
rc = waitpid(child, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)\n"),
rpmlog(RPMERR_SCRIPT, _("Bad exit status from %s (%s)\n"),
scriptName, name);
rc = RPMERR_SCRIPT;
} else

View File

@ -211,7 +211,7 @@ static int rdToken(ParseState state)
token = TOK_EQ;
p++;
} else {
rpmError(RPMERR_BADSPEC, _("syntax error while parsing ==\n"));
rpmlog(RPMERR_BADSPEC, _("syntax error while parsing ==\n"));
return -1;
}
break;
@ -241,7 +241,7 @@ static int rdToken(ParseState state)
token = TOK_LOGICAL_AND;
p++;
} else {
rpmError(RPMERR_BADSPEC, _("syntax error while parsing &&\n"));
rpmlog(RPMERR_BADSPEC, _("syntax error while parsing &&\n"));
return -1;
}
break;
@ -250,7 +250,7 @@ static int rdToken(ParseState state)
token = TOK_LOGICAL_OR;
p++;
} else {
rpmError(RPMERR_BADSPEC, _("syntax error while parsing ||\n"));
rpmlog(RPMERR_BADSPEC, _("syntax error while parsing ||\n"));
return -1;
}
break;
@ -293,7 +293,7 @@ static int rdToken(ParseState state)
v = valueMakeString( rpmExpand(temp, NULL) );
} else {
rpmError(RPMERR_BADSPEC, _("parse error in expression\n"));
rpmlog(RPMERR_BADSPEC, _("parse error in expression\n"));
return -1;
}
}
@ -325,7 +325,7 @@ static Value doPrimary(ParseState state)
return NULL;
v = doLogical(state);
if (state->nextToken != TOK_CLOSE_P) {
rpmError(RPMERR_BADSPEC, _("unmatched (\n"));
rpmlog(RPMERR_BADSPEC, _("unmatched (\n"));
return NULL;
}
if (rdToken(state))
@ -357,7 +357,7 @@ static Value doPrimary(ParseState state)
return NULL;
if (! valueIsInteger(v)) {
rpmError(RPMERR_BADSPEC, _("- only on numbers\n"));
rpmlog(RPMERR_BADSPEC, _("- only on numbers\n"));
return NULL;
}
@ -373,7 +373,7 @@ static Value doPrimary(ParseState state)
return NULL;
if (! valueIsInteger(v)) {
rpmError(RPMERR_BADSPEC, _("! only on numbers\n"));
rpmlog(RPMERR_BADSPEC, _("! only on numbers\n"));
return NULL;
}
@ -415,7 +415,7 @@ static Value doMultiplyDivide(ParseState state)
return NULL;
if (! valueSameType(v1, v2)) {
rpmError(RPMERR_BADSPEC, _("types must match\n"));
rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
@ -428,7 +428,7 @@ static Value doMultiplyDivide(ParseState state)
else
v1 = valueMakeInteger(i1 / i2);
} else {
rpmError(RPMERR_BADSPEC, _("* / not suported for strings\n"));
rpmlog(RPMERR_BADSPEC, _("* / not suported for strings\n"));
return NULL;
}
}
@ -463,7 +463,7 @@ static Value doAddSubtract(ParseState state)
return NULL;
if (! valueSameType(v1, v2)) {
rpmError(RPMERR_BADSPEC, _("types must match\n"));
rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
@ -479,7 +479,7 @@ static Value doAddSubtract(ParseState state)
char *copy;
if (op == TOK_MINUS) {
rpmError(RPMERR_BADSPEC, _("- not suported for strings\n"));
rpmlog(RPMERR_BADSPEC, _("- not suported for strings\n"));
return NULL;
}
@ -521,7 +521,7 @@ static Value doRelational(ParseState state)
return NULL;
if (! valueSameType(v1, v2)) {
rpmError(RPMERR_BADSPEC, _("types must match\n"));
rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
@ -613,7 +613,7 @@ static Value doLogical(ParseState state)
return NULL;
if (! valueSameType(v1, v2)) {
rpmError(RPMERR_BADSPEC, _("types must match\n"));
rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
@ -626,7 +626,7 @@ static Value doLogical(ParseState state)
else
v1 = valueMakeInteger(i1 || i2);
} else {
rpmError(RPMERR_BADSPEC, _("&& and || not suported for strings\n"));
rpmlog(RPMERR_BADSPEC, _("&& and || not suported for strings\n"));
return NULL;
}
}
@ -659,7 +659,7 @@ int parseExpressionBoolean(rpmSpec spec, const char *expr)
/* 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(RPMERR_BADSPEC, _("syntax error in expression\n"));
state.str = _free(state.str);
return -1;
}
@ -706,7 +706,7 @@ char * parseExpressionString(rpmSpec spec, const char *expr)
/* 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(RPMERR_BADSPEC, _("syntax error in expression\n"));
state.str = _free(state.str);
return NULL;
}

View File

@ -305,7 +305,7 @@ static int parseForVerify(char * buf, FileList fl)
SKIPSPACE(pe);
if (*pe != '(') {
rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -316,7 +316,7 @@ static int parseForVerify(char * buf, FileList fl)
{};
if (*pe == '\0') {
rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -354,7 +354,7 @@ static int parseForVerify(char * buf, FileList fl)
if (!strcmp(p, "not")) {
negated ^= 1;
} else {
rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
rpmlog(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -458,7 +458,7 @@ static int parseForDev(char * buf, FileList fl)
exit:
if (rc) {
rpmError(RPMERR_BADSPEC, _("Missing %s in %s %s\n"), errstr, name, p);
rpmlog(RPMERR_BADSPEC, _("Missing %s in %s %s\n"), errstr, name, p);
fl->processingFailed = 1;
}
return rc;
@ -494,7 +494,7 @@ static int parseForAttr(char * buf, FileList fl)
SKIPSPACE(pe);
if (*pe != '(') {
rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -509,7 +509,7 @@ static int parseForAttr(char * buf, FileList fl)
q++;
SKIPSPACE(q);
if (*q != '\0') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Non-white space follows %s(): %s\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
@ -548,7 +548,7 @@ static int parseForAttr(char * buf, FileList fl)
}
if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') {
rpmError(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q);
rpmlog(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -558,7 +558,7 @@ static int parseForAttr(char * buf, FileList fl)
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(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -570,7 +570,7 @@ static int parseForAttr(char * buf, FileList fl)
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(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -621,7 +621,7 @@ static int parseForConfig(char * buf, FileList fl)
{};
if (*pe == '\0') {
rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -646,7 +646,7 @@ static int parseForConfig(char * buf, FileList fl)
} else if (!strcmp(p, "noreplace")) {
fl->currentFlags |= RPMFILE_NOREPLACE;
} else {
rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
rpmlog(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -680,7 +680,7 @@ static int parseForLang(char * buf, FileList fl)
SKIPSPACE(pe);
if (*pe != '(') {
rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -691,7 +691,7 @@ static int parseForLang(char * buf, FileList fl)
{};
if (*pe == '\0') {
rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -717,7 +717,7 @@ static int parseForLang(char * buf, FileList fl)
/* Sanity check on locale lengths */
if (np < 1 || (np == 1 && *p != 'C') || np >= 32) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Unusual locale length: \"%.*s\" in %%lang(%s)\n"),
(int)np, p, q);
fl->processingFailed = 1;
@ -729,7 +729,7 @@ static int parseForLang(char * buf, FileList fl)
for (i = 0; i < fl->nLangs; i++) {
if (strncmp(fl->currentLangs[i], p, np))
continue;
rpmError(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"),
rpmlog(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"),
(int)np, p, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
@ -844,7 +844,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf,
if (!strcmp(s, "%docdir")) {
s = strtokWithQuotes(NULL, " \t\n");
if (fl->docDirCount == MAXDOCDIR) {
rpmError(RPMERR_INTERNAL, _("Hit limit for %%docdir\n"));
rpmlog(RPMERR_INTERNAL, _("Hit limit for %%docdir\n"));
fl->processingFailed = 1;
res = 1;
}
@ -852,7 +852,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf,
if (s != NULL)
fl->docDirs[fl->docDirCount++] = xstrdup(s);
if (s == NULL || strtokWithQuotes(NULL, " \t\n")) {
rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir\n"));
rpmlog(RPMERR_INTERNAL, _("Only one arg for %%docdir\n"));
fl->processingFailed = 1;
res = 1;
}
@ -883,7 +883,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf,
if (*fileName) {
/* We already got a file -- error */
rpmError(RPMERR_BADSPEC, _("Two files on one line: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Two files on one line: %s\n"),
*fileName);
fl->processingFailed = 1;
res = 1;
@ -900,7 +900,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf,
*fileName = s;
} else {
/* not in %doc, does not begin with / -- error */
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("File must begin with \"/\": %s\n"), s);
fl->processingFailed = 1;
res = 1;
@ -912,7 +912,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf,
if (specialDoc) {
if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Can't mix special %%doc with other forms: %s\n"),
(*fileName ? *fileName : ""));
fl->processingFailed = 1;
@ -931,7 +931,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf,
}
fmt = headerSprintf(pkg->header, _docdir_fmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (!fmt) {
rpmError(RPMERR_BADSPEC, _("illegal _docdir_fmt: %s\n"), errstr);
rpmlog(RPMERR_BADSPEC, _("illegal _docdir_fmt: %s\n"), errstr);
fl->processingFailed = 1;
res = 1;
}
@ -1207,7 +1207,7 @@ static void genCpioListAndHeader(FileList fl,
if (buf[0] == '/' && strcmp(buildRoot, "/") &&
!strncmp(buf, buildRoot, strlen(buildRoot))) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Symlink points to BuildRoot: %s -> %s\n"),
flp->fileURL, buf);
fl->processingFailed = 1;
@ -1413,7 +1413,7 @@ static int addFile(FileList fl, const char * diskURL,
prefixTest++;
}
if (*prefixPtr || (*prefixTest && *prefixTest != '/')) {
rpmError(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"),
rpmlog(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"),
fl->prefix, fileURL);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
@ -1437,7 +1437,7 @@ static int addFile(FileList fl, const char * diskURL,
statp->st_mtime = now;
statp->st_ctime = now;
} else if (Lstat(diskURL, statp)) {
rpmError(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL);
rpmlog(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
@ -1639,24 +1639,24 @@ static int processMetadataFile(Package pkg, FileList fl, const char * fileURL,
switch (tag) {
default:
rpmError(RPMERR_BADSPEC, _("%s: can't load unknown tag (%d).\n"),
rpmlog(RPMERR_BADSPEC, _("%s: can't load unknown tag (%d).\n"),
fn, tag);
goto exit;
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(RPMERR_BADSPEC, _("%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(RPMERR_BADSPEC, _("%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(RPMERR_BADSPEC, _("%s: *.te policy read failed.\n"), fn);
goto exit;
}
apkt = (const char *) pkt; /* XXX unsigned char */
@ -1703,7 +1703,7 @@ static int processBinaryFile(Package pkg, FileList fl,
{ const char * fileName;
(void) urlPath(fileURL, &fileName);
if (*fileName != '/') {
rpmError(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"),
rpmlog(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"),
fileName);
rc = 1;
goto exit;
@ -1727,7 +1727,7 @@ static int processBinaryFile(Package pkg, FileList fl,
/* XXX for %dev marker in file manifest only */
if (fl->noGlob) {
rpmError(RPMERR_BADSPEC, _("Glob not permitted: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Glob not permitted: %s\n"),
diskURL);
rc = 1;
goto exit;
@ -1741,7 +1741,7 @@ static int processBinaryFile(Package pkg, FileList fl,
}
argv = _free(argv);
} else {
rpmError(RPMERR_BADSPEC, _("File not found by glob: %s\n"),
rpmlog(RPMERR_BADSPEC, _("File not found by glob: %s\n"),
diskURL);
rc = 1;
goto exit;
@ -1793,7 +1793,7 @@ static int processPackageFiles(rpmSpec spec, Package pkg,
fd = Fopen(ffn, "r.fpio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open %%files file %s: %s\n"),
ffn, Fstrerror(fd));
return RPMERR_BADFILENAME;
@ -1805,7 +1805,7 @@ static int processPackageFiles(rpmSpec spec, Package pkg,
while (fgets(buf, sizeof(buf), f)) {
handleComments(buf);
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf);
rpmlog(RPMERR_BADSPEC, _("line: %s\n"), buf);
return RPMERR_BADSPEC;
}
appendStringBuf(pkg->fileList, buf);
@ -2188,7 +2188,7 @@ int processSourceFiles(rpmSpec spec)
flp->verifyFlags = RPMVERIFY_ALL;
if (Stat(diskURL, &flp->fl_st)) {
rpmError(RPMERR_BADSPEC, _("Bad file: %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Bad file: %s: %s\n"),
diskURL, strerror(errno));
fl.processingFailed = 1;
}
@ -2212,7 +2212,7 @@ int processSourceFiles(rpmSpec spec)
fl.totalFileSize += flp->fl_size;
if (! (flp->uname && flp->gname)) {
rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL);
rpmlog(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL);
fl.processingFailed = 1;
}

View File

@ -73,10 +73,10 @@ static int cpio_doio(FD_t fdo, Header h, CSA_t csa,
if (rc) {
if (failedFile)
rpmError(RPMERR_CPIO, _("create archive failed on file %s: %s\n"),
rpmlog(RPMERR_CPIO, _("create archive failed on file %s: %s\n"),
failedFile, cpioStrerror(rc));
else
rpmError(RPMERR_CPIO, _("create archive failed: %s\n"),
rpmlog(RPMERR_CPIO, _("create archive failed: %s\n"),
cpioStrerror(rc));
rc = 1;
}
@ -96,14 +96,14 @@ static int cpio_copy(FD_t fdo, CSA_t csa)
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(RPMERR_CPIO, _("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(RPMERR_CPIO, _("cpio_copy read failed: %s\n"),
Fstrerror(csa->cpioFdIn));
return 1;
}
@ -133,7 +133,7 @@ static StringBuf addFileToTagAux(rpmSpec spec,
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(RPMERR_BADSPEC, _("line: %s\n"), buf);
sb = freeStringBuf(sb);
break;
}
@ -191,42 +191,42 @@ static int processScriptFiles(rpmSpec spec, Package pkg)
if (pkg->preInFile) {
if (addFileToTag(spec, pkg->preInFile, pkg->header, RPMTAG_PREIN)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open PreIn file: %s\n"), pkg->preInFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->preUnFile) {
if (addFileToTag(spec, pkg->preUnFile, pkg->header, RPMTAG_PREUN)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open PreUn file: %s\n"), pkg->preUnFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->preTransFile) {
if (addFileToTag(spec, pkg->preTransFile, pkg->header, RPMTAG_PRETRANS)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open PreIn file: %s\n"), pkg->preTransFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->postInFile) {
if (addFileToTag(spec, pkg->postInFile, pkg->header, RPMTAG_POSTIN)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open PostIn file: %s\n"), pkg->postInFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->postUnFile) {
if (addFileToTag(spec, pkg->postUnFile, pkg->header, RPMTAG_POSTUN)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open PostUn file: %s\n"), pkg->postUnFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->postTransFile) {
if (addFileToTag(spec, pkg->postTransFile, pkg->header, RPMTAG_POSTTRANS)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open PostUn file: %s\n"), pkg->postTransFile);
return RPMERR_BADFILENAME;
}
@ -234,7 +234,7 @@ static int processScriptFiles(rpmSpec spec, Package pkg)
if (pkg->verifyFile) {
if (addFileToTag(spec, pkg->verifyFile, pkg->header,
RPMTAG_VERIFYSCRIPT)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open VerifyScript file: %s\n"), pkg->verifyFile);
return RPMERR_BADFILENAME;
}
@ -249,7 +249,7 @@ static int processScriptFiles(rpmSpec spec, Package pkg)
} else if (p->fileName) {
if (addFileToArrayTag(spec, p->fileName, pkg->header,
RPMTAG_TRIGGERSCRIPTS)) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Could not open Trigger script file: %s\n"),
p->fileName);
return RPMERR_BADFILENAME;
@ -278,7 +278,7 @@ int readRPM(const char *fileName, rpmSpec *specp, struct rpmlead *lead,
: fdDup(STDIN_FILENO);
if (fdi == NULL || Ferror(fdi)) {
rpmError(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"),
rpmlog(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"),
(fileName ? fileName : "<stdin>"),
Fstrerror(fdi));
if (fdi) (void) Fclose(fdi);
@ -287,7 +287,7 @@ int readRPM(const char *fileName, rpmSpec *specp, struct rpmlead *lead,
/* Get copy of lead */
if ((rc = Fread(lead, sizeof(char), sizeof(*lead), fdi)) != sizeof(*lead)) {
rpmError(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"),
rpmlog(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"),
(fileName ? fileName : "<stdin>"),
Fstrerror(fdi));
return RPMERR_BADMAGIC;
@ -295,7 +295,7 @@ int readRPM(const char *fileName, rpmSpec *specp, struct rpmlead *lead,
/* XXX FIXME: EPIPE on <stdin> */
if (Fseek(fdi, 0, SEEK_SET) == -1) {
rpmError(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
rpmlog(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
(fileName ? fileName : "<stdin>"), Fstrerror(fdi));
return RPMERR_FSEEK;
}
@ -326,12 +326,12 @@ int readRPM(const char *fileName, rpmSpec *specp, struct rpmlead *lead,
case RPMRC_NOTTRUSTED:
break;
case RPMRC_NOTFOUND:
rpmError(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"),
rpmlog(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"),
(fileName ? fileName : "<stdin>"));
return RPMERR_BADMAGIC;
case RPMRC_FAIL:
default:
rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"),
rpmlog(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"),
(fileName ? fileName : "<stdin>"));
return RPMERR_BADMAGIC;
break;
@ -455,7 +455,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
h = headerReload(h, RPMTAG_HEADERIMMUTABLE);
if (h == NULL) { /* XXX can't happen */
rc = RPMERR_RELOAD;
rpmError(RPMERR_RELOAD, _("Unable to create immutable header region.\n"));
rpmlog(RPMERR_RELOAD, _("Unable to create immutable header region.\n"));
goto exit;
}
/* Re-reference reallocated header. */
@ -467,14 +467,14 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
*/
if (makeTempFile(NULL, &sigtarget, &fd)) {
rc = RPMERR_CREATE;
rpmError(RPMERR_CREATE, _("Unable to open temp file.\n"));
rpmlog(RPMERR_CREATE, _("Unable to open temp file.\n"));
goto exit;
}
fdInitDigest(fd, PGPHASHALGO_SHA1, 0);
if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write temp header\n"));
rpmlog(RPMERR_NOSPACE, _("Unable to write temp header\n"));
} else { /* Write the archive and get the size */
(void) Fflush(fd);
fdFiniDigest(fd, PGPHASHALGO_SHA1, (void **)&SHA1, NULL, 1);
@ -484,7 +484,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
rc = cpio_copy(fd, csa);
} else {
rc = RPMERR_BADARG;
rpmError(RPMERR_BADARG, _("Bad CSA data\n"));
rpmlog(RPMERR_BADARG, _("Bad CSA data\n"));
}
}
rpmio_flags = _free(rpmio_flags);
@ -513,14 +513,14 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
(void) Fflush(fd);
if (Fseek(fd, 0, SEEK_SET) == -1) {
rc = RPMERR_FSEEK;
rpmError(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
rpmlog(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
sigtarget, Fstrerror(fd));
}
fdInitDigest(fd, PGPHASHALGO_SHA1, 0);
if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write final header\n"));
rpmlog(RPMERR_NOSPACE, _("Unable to write final header\n"));
}
(void) Fflush(fd);
fdFiniDigest(fd, PGPHASHALGO_SHA1, (void **)&SHA1, NULL, 1);
@ -558,7 +558,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
sig = headerReload(sig, RPMTAG_HEADERSIGNATURES);
if (sig == NULL) { /* XXX can't happen */
rc = RPMERR_RELOAD;
rpmError(RPMERR_RELOAD, _("Unable to reload signature header.\n"));
rpmlog(RPMERR_RELOAD, _("Unable to reload signature header.\n"));
goto exit;
}
@ -566,7 +566,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
fd = Fopen(fileName, "w.ufdio");
if (fd == NULL || Ferror(fd)) {
rc = RPMERR_CREATE;
rpmError(RPMERR_CREATE, _("Could not open %s: %s\n"),
rpmlog(RPMERR_CREATE, _("Could not open %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
@ -602,7 +602,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
if (writeLead(fd, &lead) != RPMRC_OK) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
rpmlog(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(fd));
goto exit;
}
@ -617,7 +617,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
ifd = Fopen(sigtarget, "r.ufdio");
if (ifd == NULL || Ferror(ifd)) {
rc = RPMERR_READ;
rpmError(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"),
rpmlog(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"),
sigtarget, Fstrerror(ifd));
goto exit;
}
@ -628,7 +628,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
if (nh == NULL) {
rc = RPMERR_READ;
rpmError(RPMERR_READ, _("Unable to read header from %s: %s\n"),
rpmlog(RPMERR_READ, _("Unable to read header from %s: %s\n"),
sigtarget, Fstrerror(ifd));
goto exit;
}
@ -642,7 +642,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
if (rc) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"),
rpmlog(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
@ -652,13 +652,13 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) {
if (count == -1) {
rc = RPMERR_READ;
rpmError(RPMERR_READ, _("Unable to read payload from %s: %s\n"),
rpmlog(RPMERR_READ, _("Unable to read payload from %s: %s\n"),
sigtarget, Fstrerror(ifd));
goto exit;
}
if (Fwrite(buf, sizeof(buf[0]), count, fd) != count) {
rc = RPMERR_NOSPACE;
rpmError(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"),
rpmlog(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
@ -765,7 +765,7 @@ int packageBinaries(rpmSpec spec)
if (binRpm == NULL) {
const char *name;
(void) headerNVR(pkg->header, &name, NULL, NULL);
rpmError(RPMERR_BADFILENAME, _("Could not generate output "
rpmlog(RPMERR_BADFILENAME, _("Could not generate output "
"filename for package %s: %s\n"), name, errorString);
return RPMERR_BADFILENAME;
}
@ -781,7 +781,7 @@ int packageBinaries(rpmSpec spec)
if (Mkdir(dn, 0755) == 0)
break;
default:
rpmError(RPMERR_BADFILENAME,_("cannot create %s: %s\n"),
rpmlog(RPMERR_BADFILENAME,_("cannot create %s: %s\n"),
dn, strerror(errno));
break;
}

View File

@ -29,7 +29,7 @@ int parseBuildInstallClean(rpmSpec spec, rpmParseState parsePart)
}
if (*sbp != NULL) {
rpmError(RPMERR_BADSPEC, _("line %d: second %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: second %s\n"),
spec->lineNum, name);
return RPMERR_BADSPEC;
}

View File

@ -119,7 +119,7 @@ static int addChangelog(Header h, StringBuf sb)
while (*s != '\0') {
if (*s != '*') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("%%changelog entries must start with *\n"));
return RPMERR_BADSPEC;
}
@ -128,7 +128,7 @@ static int addChangelog(Header h, StringBuf sb)
date = s;
while(*s && *s != '\n') s++;
if (! *s) {
rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry\n"));
rpmlog(RPMERR_BADSPEC, _("incomplete %%changelog entry\n"));
return RPMERR_BADSPEC;
}
*s = '\0';
@ -143,11 +143,11 @@ static int addChangelog(Header h, StringBuf sb)
}
SKIPSPACE(date);
if (dateToTimet(date, &time)) {
rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date);
rpmlog(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date);
return RPMERR_BADSPEC;
}
if (lastTime && lastTime < time) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("%%changelog not in descending chronological order\n"));
return RPMERR_BADSPEC;
}
@ -156,7 +156,7 @@ static int addChangelog(Header h, StringBuf sb)
/* skip space to the name */
SKIPSPACE(s);
if (! *s) {
rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
rpmlog(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
return RPMERR_BADSPEC;
}
@ -167,14 +167,14 @@ static int addChangelog(Header h, StringBuf sb)
*s-- = '\0';
}
if (s == name) {
rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
rpmlog(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
return RPMERR_BADSPEC;
}
/* text */
SKIPSPACE(text);
if (! *text) {
rpmError(RPMERR_BADSPEC, _("no description in %%changelog\n"));
rpmlog(RPMERR_BADSPEC, _("no description in %%changelog\n"));
return RPMERR_BADSPEC;
}

View File

@ -36,7 +36,7 @@ int parseDescription(rpmSpec spec)
lang = RPMBUILD_DEFAULT_LANG;
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"),
spec->lineNum, poptStrerror(rc));
return RPMERR_BADSPEC;
}
@ -49,7 +49,7 @@ int parseDescription(rpmSpec spec)
}
if (arg < -1) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
@ -60,7 +60,7 @@ int parseDescription(rpmSpec spec)
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
goto exit;
@ -68,7 +68,7 @@ int parseDescription(rpmSpec spec)
}
if (lookupPackage(spec, name, flag, &pkg)) {
rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
goto exit;
}
@ -78,7 +78,7 @@ int parseDescription(rpmSpec spec)
#if 0
if (headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
rpmError(RPMERR_BADSPEC, _("line %d: Second description\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Second description\n"),
spec->lineNum);
goto exit;
}

View File

@ -31,7 +31,7 @@ int parseFiles(rpmSpec spec)
file = NULL;
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"),
spec->lineNum, poptStrerror(rc));
rc = RPMERR_BADSPEC;
goto exit;
@ -45,7 +45,7 @@ int parseFiles(rpmSpec spec)
}
if (arg < -1) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
@ -57,7 +57,7 @@ int parseFiles(rpmSpec spec)
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
rc = RPMERR_BADSPEC;
@ -66,14 +66,14 @@ int parseFiles(rpmSpec spec)
}
if (lookupPackage(spec, name, flag, &pkg)) {
rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
rc = RPMERR_BADSPEC;
goto exit;
}
if (pkg->fileList != NULL) {
rpmError(RPMERR_BADSPEC, _("line %d: Second %%files list\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Second %%files list\n"),
spec->lineNum);
rc = RPMERR_BADSPEC;
goto exit;

View File

@ -217,22 +217,22 @@ static int checkForValidArchitectures(rpmSpec spec)
if (isMemberInEntry(spec->buildRestrictions,
arch, RPMTAG_EXCLUDEARCH) == 1) {
rpmError(RPMERR_BADSPEC, _("Architecture is excluded: %s\n"), arch);
rpmlog(RPMERR_BADSPEC, _("Architecture is excluded: %s\n"), arch);
return RPMERR_BADSPEC;
}
if (isMemberInEntry(spec->buildRestrictions,
arch, RPMTAG_EXCLUSIVEARCH) == 0) {
rpmError(RPMERR_BADSPEC, _("Architecture is not included: %s\n"), arch);
rpmlog(RPMERR_BADSPEC, _("Architecture is not included: %s\n"), arch);
return RPMERR_BADSPEC;
}
if (isMemberInEntry(spec->buildRestrictions,
os, RPMTAG_EXCLUDEOS) == 1) {
rpmError(RPMERR_BADSPEC, _("OS is excluded: %s\n"), os);
rpmlog(RPMERR_BADSPEC, _("OS is excluded: %s\n"), os);
return RPMERR_BADSPEC;
}
if (isMemberInEntry(spec->buildRestrictions,
os, RPMTAG_EXCLUSIVEOS) == 0) {
rpmError(RPMERR_BADSPEC, _("OS is not included: %s\n"), os);
rpmlog(RPMERR_BADSPEC, _("OS is not included: %s\n"), os);
return RPMERR_BADSPEC;
}
@ -253,7 +253,7 @@ static int checkForRequired(Header h, const char * NVR)
for (p = requiredTags; *p != 0; p++) {
if (!headerIsEntry(h, *p)) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("%s field must be present in package: %s\n"),
rpmTagGetName(*p), NVR);
res = 1;
@ -281,7 +281,7 @@ static int checkForDuplicates(Header h, const char * NVR)
{
if (tag != lastTag)
continue;
rpmError(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"),
rpmTagGetName(tag), NVR);
res = 1;
}
@ -335,7 +335,7 @@ static int readIcon(Header h, const char * file)
fd = Fopen(fn, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"),
fn, Fstrerror(fd));
rc = RPMERR_BADSPEC;
goto exit;
@ -353,7 +353,7 @@ static int readIcon(Header h, const char * file)
nb = Fread(icon, sizeof(icon[0]), iconsize, fd);
if (Ferror(fd) || (size >= 0 && nb != size)) {
rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"),
fn, Fstrerror(fd));
rc = RPMERR_BADSPEC;
}
@ -366,7 +366,7 @@ static int readIcon(Header h, const char * file)
} else if (! strncmp(icon, "/* XPM", sizeof("/* XPM")-1)) {
(void) headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, iconsize);
} else {
rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file);
rpmlog(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file);
rc = RPMERR_BADSPEC;
goto exit;
}
@ -408,7 +408,7 @@ spectag stashSt(rpmSpec spec, Header h, int tag, const char * lang)
#define SINGLE_TOKEN_ONLY \
if (multiToken) { \
rpmError(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \
rpmlog(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \
spec->lineNum, spec->line); \
return RPMERR_BADSPEC; \
}
@ -438,7 +438,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
while ((*field) && (*field != ':'))
field++;
if (*field != ':') {
rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
@ -446,7 +446,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
SKIPSPACE(field);
if (!*field) {
/* Empty field */
rpmError(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
@ -471,14 +471,14 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
/* 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(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
spec->lineNum, "version", spec->line);
return RPMERR_BADSPEC;
}
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(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
spec->lineNum, "release", spec->line);
return RPMERR_BADSPEC;
}
@ -533,7 +533,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
(void) urlPath(buildRootURL, &buildRoot);
if (*buildRoot == '\0') buildRoot = "/";
if (!strcmp(buildRoot, "/")) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("BuildRoot can not be \"/\": %s\n"), spec->buildRootURL);
buildRootURL = _free(buildRootURL);
return RPMERR_BADSPEC;
@ -546,7 +546,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
while (num--) {
len = strlen(array[num]);
if (array[num][len - 1] == '/' && len > 1) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Prefixes must not end with \"/\": %s\n"),
spec->lineNum, spec->line);
array = hfd(array, type);
@ -558,7 +558,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
case RPMTAG_DOCDIR:
SINGLE_TOKEN_ONLY;
if (field[0] != '/') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Docdir must begin with '/': %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -570,7 +570,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
case RPMTAG_EPOCH:
SINGLE_TOKEN_ONLY;
if (parseNum(field, &num)) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Epoch/Serial field must be a number: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -610,7 +610,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
case RPMTAG_BUILDPREREQ:
case RPMTAG_BUILDREQUIRES:
if ((rc = parseBits(lang, buildScriptBits, &tagflags))) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Bad %s: qualifiers: %s\n"),
spec->lineNum, rpmTagGetName(tag), spec->line);
return rc;
@ -621,7 +621,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
case RPMTAG_REQUIREFLAGS:
case RPMTAG_PREREQ:
if ((rc = parseBits(lang, installScriptBits, &tagflags))) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Bad %s: qualifiers: %s\n"),
spec->lineNum, rpmTagGetName(tag), spec->line);
return rc;
@ -647,7 +647,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
if ((rc = poptParseArgvString(field,
&(spec->BACount),
&(spec->BANames)))) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Bad BuildArchitecture format: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -657,7 +657,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag,
break;
default:
rpmError(RPMERR_INTERNAL, _("Internal error: Bogus tag %d\n"), tag);
rpmlog(RPMERR_INTERNAL, _("Internal error: Bogus tag %d\n"), tag);
return RPMERR_INTERNAL;
}
@ -753,7 +753,7 @@ static int findPreambleTag(rpmSpec spec,rpmTag * tag,
if (!(p->token && !xstrncasecmp(spec->line, p->token, p->len)))
continue;
if (p->obsolete) {
rpmError(RPMERR_BADSPEC, _("Legacy syntax is unsupported: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Legacy syntax is unsupported: %s\n"),
p->token);
p = NULL;
}
@ -816,13 +816,13 @@ int parsePreamble(rpmSpec spec, int initialPackage)
if (! initialPackage) {
/* There is one option to %package: <pkg> or -n <pkg> */
if (parseSimplePart(spec->line, &name, &flag)) {
rpmError(RPMERR_BADSPEC, _("Bad package specification: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Bad package specification: %s\n"),
spec->line);
return RPMERR_BADSPEC;
}
if (!lookupPackage(spec, name, flag, NULL)) {
rpmError(RPMERR_BADSPEC, _("Package already exists: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Package already exists: %s\n"),
spec->line);
return RPMERR_BADSPEC;
}
@ -851,7 +851,7 @@ int parsePreamble(rpmSpec spec, int initialPackage)
SKIPSPACE(linep);
if (*linep != '\0') {
if (findPreambleTag(spec, &tag, &macro, lang)) {
rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
@ -873,7 +873,7 @@ int parsePreamble(rpmSpec spec, int initialPackage)
/* Do some final processing on the header */
if (!spec->gotBuildRootURL && spec->buildRootURL) {
rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot\n"));
rpmlog(RPMERR_BADSPEC, _("Spec file can't use BuildRoot\n"));
return RPMERR_BADSPEC;
}

View File

@ -35,12 +35,12 @@ static int checkOwners(const char * urlfn)
struct stat sb;
if (Lstat(urlfn, &sb)) {
rpmError(RPMERR_BADSPEC, _("Bad source: %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Bad source: %s: %s\n"),
urlfn, strerror(errno));
return RPMERR_BADSPEC;
}
if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) {
rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn);
rpmlog(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn);
return RPMERR_BADSPEC;
}
@ -75,7 +75,7 @@ static char *doPatch(rpmSpec spec, int c, int strip, const char *db,
}
}
if (sp == NULL) {
rpmError(RPMERR_BADSPEC, _("No patch number %d\n"), c);
rpmlog(RPMERR_BADSPEC, _("No patch number %d\n"), c);
return NULL;
}
@ -170,7 +170,7 @@ static const char *doUntar(rpmSpec spec, int c, int quietly)
}
}
if (sp == NULL) {
rpmError(RPMERR_BADSPEC, _("No source number %d\n"), c);
rpmlog(RPMERR_BADSPEC, _("No source number %d\n"), c);
return NULL;
}
@ -190,7 +190,7 @@ static const char *doUntar(rpmSpec spec, int c, int quietly)
if (Lstat(urlfn, &st) != 0 && errno == ENOENT &&
urlIsUrl(sp->fullSource) != URL_IS_UNKNOWN) {
if ((rc = urlGetFile(sp->fullSource, urlfn)) != 0) {
rpmError(RPMERR_BADFILENAME,
rpmlog(RPMERR_BADFILENAME,
_("Couldn't download nosource %s: %s\n"),
sp->fullSource, ftpStrerror(rc));
return NULL;
@ -292,7 +292,7 @@ static int doSetupMacro(rpmSpec spec, char *line)
dirName = NULL;
if ((rc = poptParseArgvString(line, &argc, &argv))) {
rpmError(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"),
poptStrerror(rc));
return RPMERR_BADSPEC;
}
@ -307,7 +307,7 @@ static int doSetupMacro(rpmSpec spec, char *line)
/* We only parse -a and -b here */
if (parseNum(optArg, &num)) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"),
spec->lineNum, (optArg ? optArg : "???"));
before = freeStringBuf(before);
after = freeStringBuf(after);
@ -325,7 +325,7 @@ static int doSetupMacro(rpmSpec spec, char *line)
}
if (arg < -1) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(arg));
@ -459,7 +459,7 @@ static int doPatchMacro(rpmSpec spec, char *line)
/* orig suffix */
opt_b = strtok(NULL, " \t\n");
if (! opt_b) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -b: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -468,7 +468,7 @@ static int doPatchMacro(rpmSpec spec, char *line)
/* orig suffix */
opt_b = strtok(NULL, " \t\n");
if (! opt_b) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -z: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -485,7 +485,7 @@ static int doPatchMacro(rpmSpec spec, char *line)
}
opt_F = (fnum ? strtol(fnum, &end, 10) : 0);
if (! opt_F || *end) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Bad arg to %%patch -F: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -497,14 +497,14 @@ static int doPatchMacro(rpmSpec spec, char *line)
} else {
s = strtok(NULL, " \t\n");
if (s == NULL) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -p: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
}
if (parseNum(s, &opt_p)) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Bad arg to %%patch -p: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -512,11 +512,11 @@ static int doPatchMacro(rpmSpec spec, char *line)
} else {
/* Must be a patch num */
if (patch_index == 1024) {
rpmError(RPMERR_BADSPEC, _("Too many patches!\n"));
rpmlog(RPMERR_BADSPEC, _("Too many patches!\n"));
return RPMERR_BADSPEC;
}
if (parseNum(s, &(patch_nums[patch_index]))) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
@ -550,7 +550,7 @@ int parsePrep(rpmSpec spec)
char **lines, **saveLines;
if (spec->prep != NULL) {
rpmError(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum);
rpmlog(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum);
return RPMERR_BADSPEC;
}

View File

@ -96,7 +96,7 @@ int parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
/* Tokens must begin with alphanumeric, _, or / */
if (!(xisalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -124,7 +124,7 @@ int parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
continue;
if (r[0] == '/') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: Versioned file name not permitted: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
@ -155,7 +155,7 @@ int parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN,
if (Flags & RPMSENSE_SENSEMASK) {
if (*v == '\0' || ve == v) {
rpmError(RPMERR_BADSPEC, _("line %d: Version required: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Version required: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}

View File

@ -164,7 +164,7 @@ int parseScript(rpmSpec spec, int parsePart)
/* break line into two */
p = strstr(spec->line, "--");
if (!p) {
rpmError(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
@ -174,7 +174,7 @@ int parseScript(rpmSpec spec, int parsePart)
}
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
return RPMERR_BADSPEC;
}
@ -185,14 +185,14 @@ int parseScript(rpmSpec spec, int parsePart)
case 'p':
if (prog[0] == '<') {
if (prog[strlen(prog)-1] != '>') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: internal script must end "
"with \'>\': %s\n"), spec->lineNum, prog);
rc = RPMERR_BADSPEC;
goto exit;
}
} else if (prog[0] != '/') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: script program must begin "
"with \'/\': %s\n"), spec->lineNum, prog);
rc = RPMERR_BADSPEC;
@ -206,7 +206,7 @@ int parseScript(rpmSpec spec, int parsePart)
}
if (arg < -1) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
@ -218,7 +218,7 @@ int parseScript(rpmSpec spec, int parsePart)
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
rc = RPMERR_BADSPEC;
@ -227,7 +227,7 @@ int parseScript(rpmSpec spec, int parsePart)
}
if (lookupPackage(spec, name, flag, &pkg)) {
rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
rc = RPMERR_BADSPEC;
goto exit;
@ -235,7 +235,7 @@ int parseScript(rpmSpec spec, int parsePart)
if (tag != RPMTAG_TRIGGERSCRIPTS) {
if (headerIsEntry(pkg->header, progtag)) {
rpmError(RPMERR_BADSPEC, _("line %d: Second %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Second %s\n"),
spec->lineNum, partname);
rc = RPMERR_BADSPEC;
goto exit;
@ -243,7 +243,7 @@ int parseScript(rpmSpec spec, int parsePart)
}
if ((rc = poptParseArgvString(prog, &progArgc, &progArgv))) {
rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
rc = RPMERR_BADSPEC;
goto exit;
@ -280,7 +280,7 @@ int parseScript(rpmSpec spec, int parsePart)
} else
#endif
if (progArgv[0][0] == '<') {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("line %d: unsupported internal script: %s\n"),
spec->lineNum, progArgv[0]);
rc = RPMERR_BADSPEC;

View File

@ -171,7 +171,7 @@ static int copyNextLine(rpmSpec spec, OFI_t *ofi, int strip)
/* 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(RPMERR_BADSPEC, _("line %d: %s\n"),
spec->lineNum, spec->lbuf);
return RPMERR_BADSPEC;
}
@ -220,7 +220,7 @@ retry:
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(RPMERR_BADSPEC, _("Unable to open %s: %s\n"),
ofi->fileName, Fstrerror(ofi->fd));
return RPMERR_BADSPEC;
}
@ -234,7 +234,7 @@ retry:
if (f == NULL || !fgets(ofi->readBuf, BUFSIZ, f)) {
/* EOF */
if (spec->readStack->next) {
rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n"));
rpmlog(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n"));
return RPMERR_UNMATCHEDIF;
}
@ -310,7 +310,7 @@ retry:
s += 3;
match = parseExpressionBoolean(spec, s);
if (match < 0) {
rpmError(RPMERR_UNMATCHEDIF,
rpmlog(RPMERR_UNMATCHEDIF,
_("%s:%d: parseExpressionBoolean returns %d\n"),
ofi->fileName, ofi->lineNum, match);
return RPMERR_BADSPEC;
@ -319,7 +319,7 @@ retry:
s += 5;
if (! spec->readStack->next) {
/* Got an else with no %if ! */
rpmError(RPMERR_UNMATCHEDIF,
rpmlog(RPMERR_UNMATCHEDIF,
_("%s:%d: Got a %%else with no %%if\n"),
ofi->fileName, ofi->lineNum);
return RPMERR_UNMATCHEDIF;
@ -331,7 +331,7 @@ retry:
s += 6;
if (! spec->readStack->next) {
/* Got an end with no %if ! */
rpmError(RPMERR_UNMATCHEDIF,
rpmlog(RPMERR_UNMATCHEDIF,
_("%s:%d: Got a %%endif with no %%if\n"),
ofi->fileName, ofi->lineNum);
return RPMERR_UNMATCHEDIF;
@ -346,7 +346,7 @@ retry:
s += 8;
fileName = s;
if (! xisspace(*fileName)) {
rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
rpmlog(RPMERR_BADSPEC, _("malformed %%include statement\n"));
return RPMERR_BADSPEC;
}
SKIPSPACE(fileName);
@ -355,7 +355,7 @@ retry:
p = endFileName;
SKIPSPACE(p);
if (*p != '\0') {
rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
rpmlog(RPMERR_BADSPEC, _("malformed %%include statement\n"));
return RPMERR_BADSPEC;
}
*endFileName = '\0';
@ -427,7 +427,7 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL,
(void) urlPath(buildRootURL, &buildRoot);
if (*buildRoot == '\0') buildRoot = "/";
if (!strcmp(buildRoot, "/")) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("BuildRoot can not be \"/\": %s\n"), buildRootURL);
return RPMERR_BADSPEC;
}
@ -546,7 +546,7 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL,
spec->BACount = index;
if (! index) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("No compatible architectures found for build\n"));
spec = freeSpec(spec);
return RPMERR_BADSPEC;
@ -604,7 +604,7 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL,
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
const char * name;
(void) headerNVR(pkg->header, &name, NULL, NULL);
rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s\n"),
rpmlog(RPMERR_BADSPEC, _("Package has no %%description: %s\n"),
name);
spec = freeSpec(spec);
return RPMERR_BADSPEC;

View File

@ -94,7 +94,7 @@ static void buildArgCallback( poptContext con,
case POPT_RMBUILD: rba->buildAmount |= RPMBUILD_RMBUILD; break;
case POPT_BUILDROOT:
if (rba->buildRootOverride) {
rpmError(RPMERR_BUILDROOT, _("buildroot already specified, ignoring %s\n"), arg);
rpmlog(RPMERR_BUILDROOT, _("buildroot already specified, ignoring %s\n"), arg);
break;
}
rba->buildRootOverride = xstrdup(arg);

View File

@ -119,12 +119,12 @@ static StringBuf getOutputFrom(const char * dir, ARGV_t argv,
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(RPMERR_EXEC, _("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(RPMERR_FORK, _("Couldn't fork %s: %s\n"),
argv[0], strerror(errno));
return NULL;
}
@ -210,11 +210,11 @@ top:
(unsigned)child, (unsigned)reaped, status);
if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) {
rpmError(RPMERR_EXEC, _("%s failed\n"), argv[0]);
rpmlog(RPMERR_EXEC, _("%s failed\n"), argv[0]);
return NULL;
}
if (writeBytesLeft) {
rpmError(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]);
rpmlog(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]);
return NULL;
}
return readBuff;
@ -1233,7 +1233,7 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv, int_16 * fmode)
ms = magic_open(msflags);
if (ms == NULL) {
xx = RPMERR_EXEC;
rpmError(xx, _("magic_open(0x%x) failed: %s\n"),
rpmlog(xx, _("magic_open(0x%x) failed: %s\n"),
msflags, strerror(errno));
assert(ms != NULL); /* XXX figger a proper return path. */
}
@ -1241,7 +1241,7 @@ assert(ms != NULL); /* XXX figger a proper return path. */
xx = magic_load(ms, NULL);
if (xx == -1) {
xx = RPMERR_EXEC;
rpmError(xx, _("magic_load failed: %s\n"), magic_error(ms));
rpmlog(xx, _("magic_load failed: %s\n"), magic_error(ms));
assert(xx != -1); /* XXX figger a proper return path. */
}
@ -1285,7 +1285,7 @@ assert(s != NULL);
if (ftype == NULL) {
xx = RPMERR_EXEC;
rpmError(xx, _("magic_file(ms, \"%s\") failed: mode %06o %s\n"),
rpmlog(xx, _("magic_file(ms, \"%s\") failed: mode %06o %s\n"),
s, mode, magic_error(ms));
assert(ftype != NULL); /* XXX figger a proper return path. */
}
@ -1499,7 +1499,7 @@ static int rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi)
if (sb_stdout == NULL) {
rc = RPMERR_EXEC;
rpmError(rc, _("Failed to find %s:\n"), dm->msg);
rpmlog(rc, _("Failed to find %s:\n"), dm->msg);
break;
}
@ -1508,7 +1508,7 @@ static int rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi)
sb_stdout = freeStringBuf(sb_stdout);
if (rc) {
rpmError(rc, _("Failed to find %s:\n"), dm->msg);
rpmlog(rc, _("Failed to find %s:\n"), dm->msg);
break;
}
}

View File

@ -221,13 +221,13 @@ int parseNoSource(rpmSpec spec, const char * field, int tag)
if (*fe != '\0') fe++;
if (parseNum(f, &num)) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"),
spec->lineNum, f);
return RPMERR_BADSPEC;
}
if (! (p = findSource(spec, num, flag))) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"),
spec->lineNum, name, num);
return RPMERR_BADSPEC;
}
@ -286,7 +286,7 @@ int addSource(rpmSpec spec, Package pkg, const char *field, int tag)
num = 0;
} else {
if (parseNum(buf, &num)) {
rpmError(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"),
rpmlog(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"),
spec->lineNum, name, spec->line);
return RPMERR_BADSPEC;
}
@ -587,7 +587,7 @@ printNewSpecfile(rpmSpec spec)
/* XXX this should use queryHeader(), but prints out tn as well. */
msgstr = headerSprintf(h, fmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (msgstr == NULL) {
rpmError(RPMERR_QFMT, _("can't query %s: %s\n"), tn, errstr);
rpmlog(RPMERR_QFMT, _("can't query %s: %s\n"), tn, errstr);
return;
}
@ -652,7 +652,7 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
cookie, anyarch, force)
|| (spec = rpmtsSetSpec(ts, NULL)) == NULL)
{
rpmError(RPMERR_QUERY,
rpmlog(RPMERR_QUERY,
_("query of specfile %s failed, can't parse\n"), arg);
goto exit;
}

View File

@ -62,7 +62,7 @@ static int getFilesystemList(void)
num = mntctl(MCTL_QUERY, sizeof(size), (char *) &size);
if (num < 0) {
rpmError(RPMERR_MTAB, _("mntctl() failed to return size: %s\n"),
rpmlog(RPMERR_MTAB, _("mntctl() failed to return size: %s\n"),
strerror(errno));
return 1;
}
@ -77,7 +77,7 @@ static int getFilesystemList(void)
buf = alloca(size);
num = mntctl(MCTL_QUERY, size, buf);
if ( num <= 0 ) {
rpmError(RPMERR_MTAB, _("mntctl() failed to return mount points: %s\n"),
rpmlog(RPMERR_MTAB, _("mntctl() failed to return mount points: %s\n"),
strerror(errno));
return 1;
}
@ -102,7 +102,7 @@ static int getFilesystemList(void)
case ESTALE:
continue;
default:
rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), fsnames[i],
rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), fsnames[i],
strerror(errno));
rpmFreeFilesystems();
@ -144,7 +144,7 @@ static int getFilesystemList(void)
mtab = fopen(MOUNTED, "r");
if (!mtab) {
rpmError(RPMERR_MTAB, _("failed to open %s: %s\n"), MOUNTED,
rpmlog(RPMERR_MTAB, _("failed to open %s: %s\n"), MOUNTED,
strerror(errno));
return 1;
}
@ -194,7 +194,7 @@ static int getFilesystemList(void)
# endif
if (stat(mntdir, &sb)) {
rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), mntdir,
rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), mntdir,
strerror(errno));
rpmFreeFilesystems();
@ -305,7 +305,7 @@ int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes, int numFiles
chptr = dirName + strlen(dirName) - 1;
while (stat(dirName, &sb)) {
if (errno != ENOENT) {
rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), buf,
rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), buf,
strerror(errno));
sourceDir = _free(sourceDir);
usages = _free(usages);
@ -327,7 +327,7 @@ int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes, int numFiles
break;
if (j == numFilesystems) {
rpmError(RPMERR_BADDEV,
rpmlog(RPMERR_BADDEV,
_("file %s is on an unknown device\n"), buf);
sourceDir = _free(sourceDir);
usages = _free(usages);

View File

@ -1738,13 +1738,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
break;
/* XXX common error message. */
rpmError(
rpmlog(
(strict_erasures ? RPMERR_RMDIR : RPMDEBUG_RMDIR),
_("%s rmdir of %s failed: Directory not empty\n"),
rpmfiTypeString(fi), fsm->path);
break;
default:
rpmError(
rpmlog(
(strict_erasures ? RPMERR_RMDIR : RPMDEBUG_RMDIR),
_("%s rmdir of %s failed: %s\n"),
rpmfiTypeString(fi), fsm->path, strerror(errno));
@ -1758,7 +1758,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break;
if (fsm->fflags & RPMFILE_MISSINGOK)
break;
default:
rpmError(
rpmlog(
(strict_erasures ? RPMERR_UNLINK : RPMDEBUG_UNLINK),
_("%s unlink of %s failed: %s\n"),
rpmfiTypeString(fi), fsm->path, strerror(errno));

View File

@ -130,7 +130,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag)
fd = Fopen(av[i], "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), av[i],
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), av[i],
Fstrerror(fd));
if (fd != NULL) (void) Fclose(fd);
continue;

View File

@ -37,12 +37,12 @@ rpmRC rpmMkdirPath (const char * dpath, const char * dname)
break;
}
if (rc < 0) {
rpmError(RPMERR_CREATE, _("cannot create %%%s %s\n"), dname, dpath);
rpmlog(RPMERR_CREATE, _("cannot create %%%s %s\n"), dname, dpath);
return RPMRC_FAIL;
}
}
if ((rc = Access(dpath, W_OK))) {
rpmError(RPMERR_CREATE, _("cannot write to %%%s %s\n"), dname, dpath);
rpmlog(RPMERR_CREATE, _("cannot write to %%%s %s\n"), dname, dpath);
return RPMRC_FAIL;
}
return RPMRC_OK;
@ -178,18 +178,18 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr)
case URL_IS_UNKNOWN:
{ struct stat sb, sb2;
if (!stat(tfn, &sb) && S_ISLNK(sb.st_mode)) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
goto errxit;
}
if (sb.st_nlink != 1) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
goto errxit;
}
if (fstat(Fileno(fd), &sb2) == 0) {
if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) {
rpmError(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
goto errxit;
}
}

View File

@ -712,7 +712,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
switch (l->major) {
case 1:
rpmError(RPMERR_NEWPACKAGE,
rpmlog(RPMERR_NEWPACKAGE,
_("packaging version 1 is not supported by this version of RPM\n"));
rc = RPMRC_NOTFOUND;
goto exit;
@ -722,7 +722,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
case 4:
break;
default:
rpmError(RPMERR_NEWPACKAGE, _("only packaging with major numbers <= 4 "
rpmlog(RPMERR_NEWPACKAGE, _("only packaging with major numbers <= 4 "
"is supported by this version of RPM\n"));
rc = RPMRC_NOTFOUND;
goto exit;
@ -734,14 +734,14 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg);
switch (rc) {
default:
rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
break;
case RPMRC_OK:
if (sigh == NULL) {
rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
rc = RPMRC_FAIL;
goto exit;
}
@ -806,7 +806,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
(void) rpmswExit(rpmtsOp(ts, opx), nb);
if (rc != RPMRC_OK || h == NULL) {
rpmError(RPMERR_FREAD, _("%s: headerRead failed: %s"), fn,
rpmlog(RPMERR_FREAD, _("%s: headerRead failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
@ -912,7 +912,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
rpmtsOp(ts, RPMTS_OP_DIGEST)->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(RPMERR_FREAD, _("%s: Fread failed: %s\n"),
fn, Fstrerror(fd));
rc = RPMRC_FAIL;
goto exit;

View File

@ -246,7 +246,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE);
if (!isSource) {
rpmError(RPMERR_NOTSRPM, _("source package expected, binary found\n"));
rpmlog(RPMERR_NOTSRPM, _("source package expected, binary found\n"));
rpmrc = RPMRC_FAIL;
goto exit;
}
@ -357,7 +357,7 @@ fi->fmd5s = hfd(fi->fmd5s, -1);
(void) stpcpy( stpcpy( stpcpy(t, _specdir), "/"), fi->bnl[i]);
specFile = t;
} else {
rpmError(RPMERR_NOSPEC, _("source package contains no .spec file\n"));
rpmlog(RPMERR_NOSPEC, _("source package contains no .spec file\n"));
rpmrc = RPMRC_FAIL;
goto exit;
}
@ -836,7 +836,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
}
if (psm->sq.child == (pid_t)-1) {
rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
rpmlog(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
rc = RPMRC_FAIL;
goto exit;
}
@ -846,18 +846,18 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln,
/* XXX filter order dependent multilib "other" arch helper error. */
if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) {
if (psm->sq.reaped < 0) {
rpmError(RPMERR_SCRIPT,
rpmlog(RPMERR_SCRIPT,
_("%s(%s-%s-%s.%s) scriptlet failed, waitpid(%d) rc %d: %s\n"),
sln, n, v, r, a, psm->sq.child, psm->sq.reaped, strerror(errno));
rc = RPMRC_FAIL;
} else
if (!WIFEXITED(psm->sq.status) || WEXITSTATUS(psm->sq.status)) {
if (WIFSIGNALED(psm->sq.status)) {
rpmError(RPMERR_SCRIPT,
rpmlog(RPMERR_SCRIPT,
_("%s(%s-%s-%s.%s) scriptlet failed, signal %d\n"),
sln, n, v, r, a, WTERMSIG(psm->sq.status));
} else {
rpmError(RPMERR_SCRIPT,
rpmlog(RPMERR_SCRIPT,
_("%s(%s-%s-%s.%s) scriptlet failed, exit status %d\n"),
sln, n, v, r, a, WEXITSTATUS(psm->sq.status));
}
@ -1428,7 +1428,7 @@ assert(psm->mi == NULL);
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPRE)) {
rc = rpmpsmNext(psm, PSM_SCRIPT);
if (rc != RPMRC_OK) {
rpmError(RPMERR_SCRIPT,
rpmlog(RPMERR_SCRIPT,
_("%s: %s scriptlet failed (%d), skipping %s\n"),
psm->stepName, tag2sln(psm->scriptTag), rc,
rpmteNEVR(psm->te));
@ -1523,7 +1523,7 @@ assert(psm->mi == NULL);
rc = writeLead(psm->fd, &lead);
if (rc != RPMRC_OK) {
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
rpmlog(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(psm->fd));
break;
}
@ -1535,7 +1535,7 @@ assert(psm->mi == NULL);
/* Reallocate the signature into one contiguous region. */
sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES);
if (sigh == NULL) {
rpmError(RPMERR_NOSPACE, _("Unable to reload signature header\n"));
rpmlog(RPMERR_NOSPACE, _("Unable to reload signature header\n"));
rc = RPMRC_FAIL;
break;
}
@ -1609,7 +1609,7 @@ assert(psm->mi == NULL);
xx = rpmpsmNext(psm, PSM_NOTIFY);
if (rc) {
rpmError(RPMERR_CPIO,
rpmlog(RPMERR_CPIO,
_("unpacking of archive failed%s%s: %s\n"),
(psm->failedFile != NULL ? _(" on file ") : ""),
(psm->failedFile != NULL ? psm->failedFile : ""),
@ -1798,11 +1798,11 @@ assert(psm->mi == NULL);
if (rc) {
if (psm->failedFile)
rpmError(RPMERR_CPIO,
rpmlog(RPMERR_CPIO,
_("%s failed on file %s: %s\n"),
psm->stepName, psm->failedFile, cpioStrerror(rc));
else
rpmError(RPMERR_CPIO, _("%s failed: %s\n"),
rpmlog(RPMERR_CPIO, _("%s failed: %s\n"),
psm->stepName, cpioStrerror(rc));
/* XXX notify callback on error. */

View File

@ -111,7 +111,7 @@ static inline const char * queryHeader(Header h, const char * qfmt)
str = headerSprintf(h, qfmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (str == NULL)
rpmError(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
rpmlog(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
return str;
}
@ -274,7 +274,7 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h)
sprintf(te, "%s %s", fuser, fgroup);
te += strlen(te);
} else {
rpmError(RPMERR_INTERNAL,
rpmlog(RPMERR_INTERNAL,
_("package has not file owner/group lists\n"));
}
@ -303,7 +303,7 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h)
fuser, fgroup, flink);
te += strlen(te);
} else {
rpmError(RPMERR_INTERNAL,
rpmlog(RPMERR_INTERNAL,
_("package has neither file owner or id lists\n"));
}
}
@ -453,7 +453,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
case RPMQV_GROUP:
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_GROUP, arg, 0);
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO,
rpmlog(RPMERR_QUERYINFO,
_("group %s does not contain any packages\n"), arg);
res = 1;
} else
@ -463,7 +463,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
case RPMQV_TRIGGEREDBY:
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_TRIGGERNAME, arg, 0);
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package triggers %s\n"), arg);
rpmlog(RPMERR_QUERYINFO, _("no package triggers %s\n"), arg);
res = 1;
} else
res = rpmcliShowMatches(qva, ts);
@ -476,7 +476,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 32) {
rpmError(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "pkgid", arg);
rpmlog(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "pkgid", arg);
return 1;
}
@ -486,7 +486,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SIGMD5, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"pkgid", arg);
res = 1;
} else
@ -497,13 +497,13 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 40) {
rpmError(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "hdrid", arg);
rpmlog(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "hdrid", arg);
return 1;
}
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SHA1HEADER, arg, 0);
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"hdrid", arg);
res = 1;
} else
@ -517,7 +517,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 32) {
rpmError(RPMERR_QUERY, _("malformed %s: %s\n"), "fileid", arg);
rpmlog(RPMERR_QUERY, _("malformed %s: %s\n"), "fileid", arg);
return 1;
}
@ -527,7 +527,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEMD5S, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"fileid", arg);
res = 1;
} else
@ -551,12 +551,12 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
}
iid = strtoul(myarg, &end, mybase);
if ((*end) || (end == arg) || (iid == ULONG_MAX)) {
rpmError(RPMERR_QUERY, _("malformed %s: %s\n"), "tid", arg);
rpmlog(RPMERR_QUERY, _("malformed %s: %s\n"), "tid", arg);
return 1;
}
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_INSTALLTID, &iid, sizeof(iid));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"tid", arg);
res = 1;
} else
@ -566,7 +566,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
case RPMQV_WHATREQUIRES:
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_REQUIRENAME, arg, 0);
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package requires %s\n"), arg);
rpmlog(RPMERR_QUERYINFO, _("no package requires %s\n"), arg);
res = 1;
} else
res = rpmcliShowMatches(qva, ts);
@ -577,7 +577,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
provides_checked = 1;
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, arg, 0);
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package provides %s\n"), arg);
rpmlog(RPMERR_QUERYINFO, _("no package provides %s\n"), arg);
res = 1;
} else
res = rpmcliShowMatches(qva, ts);
@ -615,10 +615,10 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
}
if (myerrno != 0) {
rpmError(RPMERR_QUERY, _("file %s: %s\n"), fn, strerror(myerrno));
rpmlog(RPMERR_QUERY, _("file %s: %s\n"), fn, strerror(myerrno));
res = 1;
} else if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO,
rpmlog(RPMERR_QUERYINFO,
_("file %s is not owned by any package\n"), fn);
res = 1;
} else
@ -644,14 +644,14 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
}
recOffset = strtoul(myarg, &end, mybase);
if ((*end) || (end == arg) || (recOffset == ULONG_MAX)) {
rpmError(RPMERR_QUERYINFO, _("invalid package number: %s\n"), arg);
rpmlog(RPMERR_QUERYINFO, _("invalid package number: %s\n"), arg);
return 1;
}
rpmMessage(RPMMESS_DEBUG, _("package record number: %u\n"), recOffset);
/* RPMDBI_PACKAGES */
qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &recOffset, sizeof(recOffset));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO,
rpmlog(RPMERR_QUERYINFO,
_("record %u could not be read\n"), recOffset);
res = 1;
} else
@ -668,7 +668,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
}
rpmdbFreeIterator(mi);
if (! matches) {
rpmError(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg);
rpmlog(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg);
res = 1;
} else {
qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_LABEL, arg, 0);

View File

@ -42,7 +42,7 @@ static int manageFile(FD_t *fdp,
if (*fdp == NULL && fnp != NULL && *fnp != NULL) {
fd = Fopen(*fnp, ((flags & O_WRONLY) ? "w.ufdio" : "r.ufdio"));
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("%s: open failed: %s\n"), *fnp,
rpmlog(RPMERR_OPEN, _("%s: open failed: %s\n"), *fnp,
Fstrerror(fd));
return 1;
}
@ -54,7 +54,7 @@ static int manageFile(FD_t *fdp,
if (*fdp == NULL && (fnp == NULL || *fnp == NULL)) {
fn = NULL;
if (makeTempFile(NULL, (fnp ? &fn : NULL), &fd)) {
rpmError(RPMERR_MAKETEMP, _("makeTempFile failed\n"));
rpmlog(RPMERR_MAKETEMP, _("makeTempFile failed\n"));
return 1;
}
if (fnp != NULL)
@ -90,17 +90,17 @@ static int copyFile(FD_t *sfdp, const char **sfnp,
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(RPMERR_FWRITE, _("%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(RPMERR_FREAD, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp));
goto exit;
}
if (Fflush(*tfdp) != 0) {
rpmError(RPMERR_FWRITE, _("%s: Fflush failed: %s\n"), *tfnp,
rpmlog(RPMERR_FWRITE, _("%s: Fflush failed: %s\n"), *tfnp,
Fstrerror(*tfdp));
}
@ -179,16 +179,16 @@ static int rpmReSign(rpmts ts,
memset(l, 0, sizeof(*l));
rc = readLead(fd, l);
if (rc != RPMRC_OK) {
rpmError(RPMERR_READLEAD, _("%s: not an rpm package\n"), rpm);
rpmlog(RPMERR_READLEAD, _("%s: not an rpm package\n"), rpm);
goto exit;
}
switch (l->major) {
case 1:
rpmError(RPMERR_BADSIGTYPE, _("%s: Can't sign v1 packaging\n"), rpm);
rpmlog(RPMERR_BADSIGTYPE, _("%s: Can't sign v1 packaging\n"), rpm);
goto exit;
break;
case 2:
rpmError(RPMERR_BADSIGTYPE, _("%s: Can't re-sign v2 packaging\n"), rpm);
rpmlog(RPMERR_BADSIGTYPE, _("%s: Can't re-sign v2 packaging\n"), rpm);
goto exit;
break;
default:
@ -199,14 +199,14 @@ static int rpmReSign(rpmts ts,
rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg);
switch (rc) {
default:
rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), rpm,
rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), rpm,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
break;
case RPMRC_OK:
if (sigh == NULL) {
rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm);
rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm);
goto exit;
}
break;
@ -335,13 +335,13 @@ static int rpmReSign(rpmts ts,
l->signature_type = RPMSIGTYPE_HEADERSIG;
rc = writeLead(ofd, l);
if (rc != RPMRC_OK) {
rpmError(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm,
rpmlog(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm,
Fstrerror(ofd));
goto exit;
}
if (rpmWriteSignature(ofd, sigh)) {
rpmError(RPMERR_SIGGEN, _("%s: rpmWriteSignature failed: %s\n"), trpm,
rpmlog(RPMERR_SIGGEN, _("%s: rpmWriteSignature failed: %s\n"), trpm,
Fstrerror(ofd));
goto exit;
}
@ -558,19 +558,19 @@ static int rpmcliImportPubkeys(const rpmts ts,
/* Read pgp packet. */
if ((rc = pgpReadPkts(fn, &pkt, &pktlen)) <= 0) {
rpmError(RPMERR_IMPORT, _("%s: import read failed(%d).\n"), fn, rc);
rpmlog(RPMERR_IMPORT, _("%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(RPMERR_IMPORT, _("%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(RPMERR_IMPORT, _("%s: import failed.\n"), fn);
res++;
continue;
}
@ -602,7 +602,7 @@ static int readFile(FD_t fd, const char * fn, pgpDig dig)
/* Read the header from the package. */
{ Header h = headerRead(fd, HEADER_MAGIC_YES);
if (h == NULL) {
rpmError(RPMERR_FREAD, _("%s: headerRead failed\n"), fn);
rpmlog(RPMERR_FREAD, _("%s: headerRead failed\n"), fn);
goto exit;
}
@ -616,7 +616,7 @@ static int readFile(FD_t fd, const char * fn, pgpDig dig)
|| uh == NULL)
{
h = headerFree(h);
rpmError(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn);
rpmlog(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn);
goto exit;
}
dig->hdrsha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
@ -634,7 +634,7 @@ static int readFile(FD_t fd, const char * fn, pgpDig dig)
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(RPMERR_FREAD, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd));
goto exit;
}
@ -697,13 +697,13 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
memset(l, 0, sizeof(*l));
rc = readLead(fd, l);
if (rc != RPMRC_OK) {
rpmError(RPMERR_READLEAD, _("%s: not an rpm package\n"), fn);
rpmlog(RPMERR_READLEAD, _("%s: not an rpm package\n"), fn);
res++;
goto exit;
}
switch (l->major) {
case 1:
rpmError(RPMERR_BADSIGTYPE, _("%s: No signature available (v1.0 RPM)\n"), fn);
rpmlog(RPMERR_BADSIGTYPE, _("%s: No signature available (v1.0 RPM)\n"), fn);
res++;
goto exit;
break;
@ -715,7 +715,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg);
switch (rc) {
default:
rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
res++;
@ -723,7 +723,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
break;
case RPMRC_OK:
if (sigh == NULL) {
rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
res++;
goto exit;
}
@ -810,7 +810,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
(_print_pkts & rpmIsDebug()));
if (sigp->version != 3 && sigp->version != 4) {
rpmError(RPMERR_SIGVFY,
rpmlog(RPMERR_SIGVFY,
_("skipping package %s with unverifiable V%u signature\n"),
fn, sigp->version);
res++;
@ -972,9 +972,9 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
if (res2) {
if (rpmIsVerbose()) {
rpmError(RPMERR_SIGVFY, "%s", buf);
rpmlog(RPMERR_SIGVFY, "%s", buf);
} else {
rpmError(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
rpmlog(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
_("NOT OK"),
(missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "",
missingKeys,
@ -986,9 +986,9 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
}
} else {
if (rpmIsVerbose()) {
rpmError(RPMERR_SIGVFY, "%s", buf);
rpmlog(RPMERR_SIGVFY, "%s", buf);
} else {
rpmError(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
rpmlog(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
_("OK"),
(missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "",
missingKeys,
@ -1037,7 +1037,7 @@ int rpmcliSign(rpmts ts, QVA_t qva, const char ** argv)
fd = Fopen(arg, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("%s: open failed: %s\n"),
rpmlog(RPMERR_OPEN, _("%s: open failed: %s\n"),
arg, Fstrerror(fd));
res++;
} else if (rpmVerifySignatures(qva, ts, fd, arg)) {

View File

@ -62,7 +62,7 @@ static FD_t rpmgiOpen(const char * path, const char * fmode)
FD_t fd = Fopen(fn, fmode);
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), fn, Fstrerror(fd));
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), fn, Fstrerror(fd));
if (fd != NULL) (void) Fclose(fd);
fd = NULL;
}
@ -320,7 +320,7 @@ fprintf(stderr, "*** gi %p\tmi %p\n", gi, gi->mi);
*ae++ = '\0';
tag = rpmTagGetValue(a);
if (tag < 0) {
rpmError(RPMERR_QUERYINFO, _("unknown tag: \"%s\"\n"), a);
rpmlog(RPMERR_QUERYINFO, _("unknown tag: \"%s\"\n"), a);
res = 1;
}
pat = ae;

View File

@ -93,7 +93,7 @@ void * rpmShowProgress(const void * arg,
fd = Fopen(filename, "r.ufdio");
/* FIX: still necessary? */
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), filename,
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), filename,
Fstrerror(fd));
if (fd != NULL) {
xx = Fclose(fd);
@ -302,7 +302,7 @@ const char * fileURL = NULL;
av = _free(av); ac = 0;
rc = rpmGlob(*eiu->fnp, &ac, &av);
if (rc || ac == 0) {
rpmError(RPMERR_OPEN, _("File not found by glob: %s\n"), *eiu->fnp);
rpmlog(RPMERR_OPEN, _("File not found by glob: %s\n"), *eiu->fnp);
continue;
}
@ -419,7 +419,7 @@ if (fileURL[0] == '=') {
/* Try to read the header from a package file. */
eiu->fd = Fopen(*eiu->fnp, "r.ufdio");
if (eiu->fd == NULL || Ferror(eiu->fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
Fstrerror(eiu->fd));
if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
@ -551,7 +551,7 @@ maybe_manifest:
/* Try to read a package manifest. */
eiu->fd = Fopen(*eiu->fnp, "r.fpio");
if (eiu->fd == NULL || Ferror(eiu->fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
Fstrerror(eiu->fd));
if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
@ -565,7 +565,7 @@ maybe_manifest:
/* FIX: *eiu->argv can be NULL */
rc = rpmReadPackageManifest(eiu->fd, &eiu->argc, &eiu->argv);
if (rc != RPMRC_OK)
rpmError(RPMERR_MANIFEST, _("%s: not an rpm package (or package manifest): %s\n"),
rpmlog(RPMERR_MANIFEST, _("%s: not an rpm package (or package manifest): %s\n"),
*eiu->fnp, Fstrerror(eiu->fd));
xx = Fclose(eiu->fd);
eiu->fd = NULL;

View File

@ -42,7 +42,7 @@ rpmRC readLead(FD_t fd, struct rpmlead *lead)
/* FIX: remove timed read */
if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) {
if (Ferror(fd)) {
rpmError(RPMERR_READ, _("read failed: %s (%d)\n"),
rpmlog(RPMERR_READ, _("read failed: %s (%d)\n"),
Fstrerror(fd), errno);
return RPMRC_FAIL;
}

View File

@ -181,10 +181,10 @@ static int machCompatCacheAdd(char * name, const char * fn, int linenum,
chptr = name;
while (*chptr && *chptr != ':') chptr++;
if (!*chptr) {
rpmError(RPMERR_RPMRC, _("missing second ':' at %s:%d\n"), fn, linenum);
rpmlog(RPMERR_RPMRC, _("missing second ':' at %s:%d\n"), fn, linenum);
return 1;
} else if (chptr == name) {
rpmError(RPMERR_RPMRC, _("missing architecture name at %s:%d\n"), fn,
rpmlog(RPMERR_RPMRC, _("missing architecture name at %s:%d\n"), fn,
linenum);
return 1;
}
@ -329,12 +329,12 @@ static int addCanon(canonEntry * table, int * tableLen, char * line,
tshort_name = strtok(NULL, " \t");
s = strtok(NULL, " \t");
if (! (tname && tshort_name && s)) {
rpmError(RPMERR_RPMRC, _("Incomplete data line at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("Incomplete data line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
if (strtok(NULL, " \t")) {
rpmError(RPMERR_RPMRC, _("Too many args in data line at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("Too many args in data line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
@ -342,7 +342,7 @@ static int addCanon(canonEntry * table, int * tableLen, char * line,
/* LCL: s != NULL here. */
tnum = strtoul(s, &s1, 10);
if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) {
rpmError(RPMERR_RPMRC, _("Bad arch/os number: %s (%s:%d)\n"), s,
rpmlog(RPMERR_RPMRC, _("Bad arch/os number: %s (%s:%d)\n"), s,
fn, lineNum);
return(RPMERR_RPMRC);
}
@ -373,12 +373,12 @@ static int addDefault(defaultEntry * table, int * tableLen, char * line,
t->name = strtok(line, ": \t");
t->defName = strtok(NULL, " \t");
if (! (t->name && t->defName)) {
rpmError(RPMERR_RPMRC, _("Incomplete default line at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("Incomplete default line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
if (strtok(NULL, " \t")) {
rpmError(RPMERR_RPMRC, _("Too many args in default line at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("Too many args in default line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
@ -530,7 +530,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
next[0] = '\0';
rc = Fread(next, sizeof(*next), nb, fd);
if (Ferror(fd) || (size > 0 && rc != nb)) { /* XXX Feof(fd) */
rpmError(RPMERR_RPMRC, _("Failed to read %s: %s.\n"), urlfn,
rpmlog(RPMERR_RPMRC, _("Failed to read %s: %s.\n"), urlfn,
Fstrerror(fd));
rc = 1;
} else
@ -567,7 +567,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
}
if (*se != ':') {
rpmError(RPMERR_RPMRC, _("missing ':' (found 0x%02x) at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("missing ':' (found 0x%02x) at %s:%d\n"),
(unsigned)(0xff & *se), urlfn, linenum);
return 1;
}
@ -584,7 +584,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
arch = val = fn = NULL;
if (*se == '\0') {
rpmError(RPMERR_RPMRC, _("missing argument for %s at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("missing argument for %s at %s:%d\n"),
option->name, urlfn, linenum);
return 1;
}
@ -601,7 +601,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
fn = rpmGetPath(s, NULL);
if (fn == NULL || *fn == '\0') {
rpmError(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\"\n"),
rpmlog(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\"\n"),
option->name, urlfn, linenum, s);
fn = _free(fn);
return 1;
@ -609,7 +609,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
fdinc = Fopen(fn, "r.fpio");
if (fdinc == NULL || Ferror(fdinc)) {
rpmError(RPMERR_RPMRC, _("cannot open %s at %s:%d: %s\n"),
rpmlog(RPMERR_RPMRC, _("cannot open %s at %s:%d: %s\n"),
fn, urlfn, linenum, Fstrerror(fdinc));
rc = 1;
} else {
@ -627,7 +627,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
arch = se;
while (*se && !xisspace(*se)) se++;
if (*se == '\0') {
rpmError(RPMERR_RPMRC,
rpmlog(RPMERR_RPMRC,
_("missing architecture for %s at %s:%d\n"),
option->name, urlfn, linenum);
return 1;
@ -635,7 +635,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
*se++ = '\0';
while (*se && xisspace(*se)) se++;
if (*se == '\0') {
rpmError(RPMERR_RPMRC,
rpmlog(RPMERR_RPMRC,
_("missing argument for %s at %s:%d\n"),
option->name, urlfn, linenum);
return 1;
@ -695,7 +695,7 @@ static int doReadRC( FD_t fd, const char * urlfn)
}
if (!gotit) {
rpmError(RPMERR_RPMRC, _("bad option '%s' at %s:%d\n"),
rpmlog(RPMERR_RPMRC, _("bad option '%s' at %s:%d\n"),
s, urlfn, linenum);
}
}
@ -1663,12 +1663,12 @@ static int rpmReadRC(const char * rcfiles)
/* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
if (rcfiles == defrcfiles && myrcfiles != r)
continue;
rpmError(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
rpmlog(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
rc = 1;
break;
}
if (strlen(home) > (sizeof(fn) - strlen(r))) {
rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
rpmlog(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
r);
rc = 1;
break;
@ -1685,7 +1685,7 @@ static int rpmReadRC(const char * rcfiles)
/* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
if (rcfiles == defrcfiles && myrcfiles != r)
continue;
rpmError(RPMERR_RPMRC, _("Unable to open %s for reading: %s.\n"),
rpmlog(RPMERR_RPMRC, _("Unable to open %s for reading: %s.\n"),
fn, Fstrerror(fd));
rc = 1;
break;

View File

@ -246,7 +246,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
case '(':
/* XXX Fail if nested parens. */
if (level++ != 0) {
rpmError(RPMERR_QFMT, _("extra '(' in package label: %s\n"), keyp);
rpmlog(RPMERR_QFMT, _("extra '(' in package label: %s\n"), keyp);
return NULL;
}
/* Parse explicit epoch. */
@ -264,7 +264,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
case ')':
/* XXX Fail if nested parens. */
if (--level != 0) {
rpmError(RPMERR_QFMT, _("missing '(' in package label: %s\n"), keyp);
rpmlog(RPMERR_QFMT, _("missing '(' in package label: %s\n"), keyp);
return NULL;
}
/* Don't copy trailing ')' */
@ -272,7 +272,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
}
}
if (level) {
rpmError(RPMERR_QFMT, _("missing ')' in package label: %s\n"), keyp);
rpmlog(RPMERR_QFMT, _("missing ')' in package label: %s\n"), keyp);
return NULL;
}
*t = '\0';
@ -582,7 +582,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data)
bh = headerFree(bh);
qfmt = _free(qfmt);
if (str == NULL) {
rpmError(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
rpmlog(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
goto exit;
}
@ -593,7 +593,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data)
h = headerFree(h);
fd = Fopen(str, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), str,
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), str,
Fstrerror(fd));
if (fd != NULL) {
xx = Fclose(fd);

View File

@ -403,7 +403,7 @@ static int makePGPSignature(const char * file, int_32 * sigTagp,
break;
}
}
rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
strerror(errno));
_exit(RPMERR_EXEC);
}
@ -419,14 +419,14 @@ static int makePGPSignature(const char * file, int_32 * sigTagp,
(void)waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
rpmError(RPMERR_SIGGEN, _("pgp failed\n"));
rpmlog(RPMERR_SIGGEN, _("pgp failed\n"));
return 1;
}
if (stat(sigfile, &st)) {
/* PGP failed to write signature */
if (sigfile) (void) unlink(sigfile); /* Just in case */
rpmError(RPMERR_SIGGEN, _("pgp failed to write signature\n"));
rpmlog(RPMERR_SIGGEN, _("pgp failed to write signature\n"));
return 1;
}
@ -445,7 +445,7 @@ static int makePGPSignature(const char * file, int_32 * sigTagp,
}
if (rc != *pktlenp) {
*pktp = _free(*pktp);
rpmError(RPMERR_SIGGEN, _("unable to read the signature\n"));
rpmlog(RPMERR_SIGGEN, _("unable to read the signature\n"));
return 1;
}
}
@ -514,7 +514,7 @@ static int makeGPGSignature(const char * file, int_32 * sigTagp,
if (!rc)
rc = execve(av[0], av+1, environ);
rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
strerror(errno));
_exit(RPMERR_EXEC);
}
@ -531,14 +531,14 @@ static int makeGPGSignature(const char * file, int_32 * sigTagp,
(void) waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
rpmError(RPMERR_SIGGEN, _("gpg exec failed (%d)\n"), WEXITSTATUS(status));
rpmlog(RPMERR_SIGGEN, _("gpg exec failed (%d)\n"), WEXITSTATUS(status));
return 1;
}
if (stat(sigfile, &st)) {
/* GPG failed to write signature */
if (sigfile) (void) unlink(sigfile); /* Just in case */
rpmError(RPMERR_SIGGEN, _("gpg failed to write signature\n"));
rpmlog(RPMERR_SIGGEN, _("gpg failed to write signature\n"));
return 1;
}
@ -557,7 +557,7 @@ static int makeGPGSignature(const char * file, int_32 * sigTagp,
}
if (rc != *pktlenp) {
*pktp = _free(*pktp);
rpmError(RPMERR_SIGGEN, _("unable to read the signature\n"));
rpmlog(RPMERR_SIGGEN, _("unable to read the signature\n"));
return 1;
}
}
@ -807,7 +807,7 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag)
if (!rc)
rc = execve(av[0], av+1, environ);
rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
strerror(errno));
} break;
case RPMSIGTAG_RSA:
@ -840,12 +840,12 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag)
break;
}
}
rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
strerror(errno));
_exit(RPMERR_EXEC);
} break;
default: /* This case should have been screened out long ago. */
rpmError(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
rpmlog(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
_exit(RPMERR_SIGGEN);
break;
}
@ -875,7 +875,7 @@ char * rpmGetPassPhrase(const char * prompt, const int sigTag)
}
if (aok)
break;
rpmError(RPMERR_SIGGEN,
rpmlog(RPMERR_SIGGEN,
_("You must set \"%%_gpg_name\" in your macro file\n"));
break;
case RPMSIGTAG_RSA:
@ -887,14 +887,14 @@ char * rpmGetPassPhrase(const char * prompt, const int sigTag)
}
if (aok)
break;
rpmError(RPMERR_SIGGEN,
rpmlog(RPMERR_SIGGEN,
_("You must set \"%%_pgp_name\" in your macro file\n"));
break;
default:
/* Currently the calling function (rpm.c:main) is checking this and
* doing a better job. This section should never be accessed.
*/
rpmError(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
rpmlog(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
break;
}

View File

@ -146,10 +146,10 @@ static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit)
if (printit && rc) {
if (msg)
rpmError(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
rpmlog(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
dbi->dbi_api, rc, msg, db_strerror(error));
else
rpmError(RPMERR_DBERR, _("db%d error(%d): %s\n"),
rpmlog(RPMERR_DBERR, _("db%d error(%d): %s\n"),
dbi->dbi_api, rc, db_strerror(error));
}
@ -1156,7 +1156,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
(dbi->dbi_eflags & DB_INIT_CDB) &&
!(dbi->dbi_eflags & DB_PRIVATE))
? 0 : 1);
rpmError( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
rpmlog( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
_("cannot get %s lock on %s/%s\n"),
((dbi->dbi_mode & (O_RDWR|O_WRONLY))
? _("exclusive") : _("shared")),

View File

@ -321,7 +321,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
break;
}
if (opt->longName == NULL) {
rpmError(RPMERR_DBCONFIG,
rpmlog(RPMERR_DBCONFIG,
_("unrecognized db option: \"%s\" ignored.\n"), o);
continue;
}
@ -358,7 +358,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
else if (!xstrncasecmp(pe, "Kb", 2))
aLong *= 1024;
else if (*pe != '\0') {
rpmError(RPMERR_DBCONFIG,
rpmlog(RPMERR_DBCONFIG,
_("%s has invalid numeric value, skipped\n"),
opt->longName);
continue;
@ -367,7 +367,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
if ((argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) {
if (aLong == LONG_MIN || aLong == LONG_MAX) {
rpmError(RPMERR_DBCONFIG,
rpmlog(RPMERR_DBCONFIG,
_("%s has too large or too small long value, skipped\n"),
opt->longName);
continue;
@ -376,7 +376,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
break;
} else {
if (aLong > INT_MAX || aLong < INT_MIN) {
rpmError(RPMERR_DBCONFIG,
rpmlog(RPMERR_DBCONFIG,
_("%s has too large or too small integer value, skipped\n"),
opt->longName);
continue;

View File

@ -243,7 +243,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags)
if (rc) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
rpmError(RPMERR_DBOPEN,
rpmlog(RPMERR_DBOPEN,
_("cannot open %s index using db%d - %s (%d)\n"),
rpmTagGetName(rpmtag), _dbapi,
(rc > 0 ? strerror(rc) : ""), rc);
@ -264,7 +264,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags)
if (_dbapi <= 0) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
rpmError(RPMERR_DBOPEN, _("cannot open %s index\n"),
rpmlog(RPMERR_DBOPEN, _("cannot open %s index\n"),
rpmTagGetName(rpmtag));
rc = 1;
goto exit;
@ -900,7 +900,7 @@ rpmdb newRpmdb(const char * root,
db->db_root = rpmGetPath(_DB_ROOT, NULL);
db->db_home = rpmGetPath( (home && *home ? home : _DB_HOME), NULL);
if (!(db->db_home && db->db_home[0] != '%')) {
rpmError(RPMERR_DBOPEN, _("no dbpath has been set\n"));
rpmlog(RPMERR_DBOPEN, _("no dbpath has been set\n"));
db->db_root = _free(db->db_root);
db->db_home = _free(db->db_home);
db = _free(db);
@ -1136,7 +1136,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
}
@ -1261,7 +1261,7 @@ key->size = strlen(name);
if (rc == DB_NOTFOUND) { /* not found */
rc = 0;
} else { /* error */
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
rc = -1;
@ -1311,7 +1311,7 @@ key->size = strlen(name);
if (rc == DB_NOTFOUND) { /* not found */
return RPMRC_NOTFOUND;
} else { /* error */
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
return RPMRC_FAIL;
@ -1496,7 +1496,7 @@ static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi)
(void) blockSignals(dbi->dbi_rpmdb, &signalMask);
rc = dbiPut(dbi, mi->mi_dbc, key, data, DB_KEYLAST);
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record #%d into %s\n"),
rc, mi->mi_prevoffset, rpmTagGetName(dbi->dbi_rpmtag));
}
@ -1597,7 +1597,7 @@ static int miregexec(miRE mire, const char * val)
char msg[256];
(void) regerror(rc, mire->preg, msg, sizeof(msg)-1);
msg[sizeof(msg)-1] = '\0';
rpmError(RPMERR_REGEXEC, "%s: regexec failed: %s\n",
rpmlog(RPMERR_REGEXEC, "%s: regexec failed: %s\n",
mire->pattern, msg);
rc = -1;
}
@ -1778,7 +1778,7 @@ int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag,
char msg[256];
(void) regerror(rc, preg, msg, sizeof(msg)-1);
msg[sizeof(msg)-1] = '\0';
rpmError(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg);
rpmlog(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg);
}
break;
case RPMMIRE_GLOB:
@ -2141,7 +2141,7 @@ if (dbiByteSwapped(dbi) == 1)
mi->mi_h = headerCopyLoad(uh);
#endif
if (mi->mi_h == NULL || !headerIsEntry(mi->mi_h, RPMTAG_NAME)) {
rpmError(RPMERR_BADHEADER,
rpmlog(RPMERR_BADHEADER,
_("rpmdb: damaged header #%u retrieved -- skipping.\n"),
mi->mi_offset);
goto top;
@ -2215,7 +2215,7 @@ static int rpmdbGrowIterator(rpmdbMatchIterator mi, int fpNum)
if (rc) { /* error/not found */
if (rc != DB_NOTFOUND)
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
#ifdef SQLITE_HACK
@ -2334,7 +2334,7 @@ if (key->data && key->size == 0) key->size++; /* XXX "/" fixup. */
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, (key->data ? key->data : "???"), rpmTagGetName(dbi->dbi_rpmtag));
}
@ -2436,7 +2436,7 @@ memset(data, 0, sizeof(*data));
}
if (h == NULL) {
rpmError(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
rpmlog(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
"rpmdbRemove", hdrNum);
return 1;
}
@ -2493,7 +2493,7 @@ if (dbiByteSwapped(dbi) == 1)
rc = dbiCopen(dbi, dbi->dbi_txnid, &dbcursor, DB_WRITECURSOR);
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc) {
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) setting header #%d record for %s removal\n"),
rc, hdrNum, rpmTagGetName(dbi->dbi_rpmtag));
} else
@ -2631,7 +2631,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
} else if (rc == DB_NOTFOUND) { /* not found */
continue;
} else { /* error */
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) setting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@ -2650,7 +2650,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
(void) set2dbt(dbi, data, set);
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record \"%s\" into %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@ -2660,7 +2660,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
} else {
rc = dbiDel(dbi, dbcursor, key, data, 0);
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) removing record \"%s\" from %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@ -2810,7 +2810,7 @@ memset(data, 0, sizeof(*data));
}
if (ret) {
rpmError(RPMERR_DBCORRUPT,
rpmlog(RPMERR_DBCORRUPT,
_("error(%d) allocating new package instance\n"), ret);
goto exit;
}
@ -3046,7 +3046,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
if (!dbi->dbi_permit_dups)
(void) dbt2set(dbi, data, &set);
} else if (rc != DB_NOTFOUND) { /* error */
rpmError(RPMERR_DBGETINDEX,
rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@ -3062,7 +3062,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
rpmError(RPMERR_DBPUTINDEX,
rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record %s into %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@ -3480,7 +3480,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
rootdbpath, newrootdbpath);
if (!access(newrootdbpath, F_OK)) {
rpmError(RPMERR_MKDIR, _("temporary database %s already exists\n"),
rpmlog(RPMERR_MKDIR, _("temporary database %s already exists\n"),
newrootdbpath);
rc = 1;
goto exit;
@ -3488,7 +3488,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
rpmMessage(RPMMESS_DEBUG, _("creating directory %s\n"), newrootdbpath);
if (Mkdir(newrootdbpath, 0755)) {
rpmError(RPMERR_MKDIR, _("creating directory %s: %s\n"),
rpmlog(RPMERR_MKDIR, _("creating directory %s: %s\n"),
newrootdbpath, strerror(errno));
rc = 1;
goto exit;
@ -3534,7 +3534,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_BUILDTIME)))
{
rpmError(RPMERR_INTERNAL,
rpmlog(RPMERR_INTERNAL,
_("header #%u in the database is bad -- skipping.\n"),
_RECNUM);
continue;
@ -3572,7 +3572,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
}
if (rc) {
rpmError(RPMERR_INTERNAL,
rpmlog(RPMERR_INTERNAL,
_("cannot add record originally at %u\n"), _RECNUM);
failed = 1;
break;

View File

@ -519,7 +519,7 @@ doShellEscape(MacroBuf mb, const char * cmd, size_t clen)
int c;
if (clen >= sizeof(pcmd)) {
rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
return 1;
}
@ -578,7 +578,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody)
SKIPBLANK(s, c);
if (c == '{') { /* XXX permit silent {...} grouping */
if ((se = matchchar(s, c, '}')) == NULL) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Macro %%%s has unterminated body\n"), n);
se = s; /* XXX W2DO? */
return se;
@ -616,7 +616,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody)
*be = '\0';
if (bc || pc) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Macro %%%s has unterminated body\n"), n);
se = s; /* XXX W2DO? */
return se;
@ -635,24 +635,24 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody)
/* 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(RPMERR_BADSPEC,
_("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(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n);
return se;
}
if ((be - b) < 1) {
rpmError(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n);
rpmlog(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n);
return se;
}
if (expandbody && expandU(mb, b, (&buf[sizeof(buf)] - b))) {
rpmError(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n);
rpmlog(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n);
return se;
}
@ -683,7 +683,7 @@ doUndefine(rpmMacroContext mc, const char * se)
/* 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(RPMERR_BADSPEC,
_("Macro %%%s has illegal name (%%undefine)\n"), n);
return se;
}
@ -784,7 +784,7 @@ freeArgs(MacroBuf mb)
skiptest = 1; /* XXX skip test for %# %* %0 */
} else if (!skiptest && me->used <= 0) {
#if NOTYET
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Macro %%%s (%s) was not used below level %d\n"),
me->name, me->body, me->level);
#endif
@ -904,7 +904,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
while((c = getopt(argc, (char **)argv, opts)) != -1)
{
if (c == '?' || (o = strchr(opts, c)) == NULL) {
rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"),
rpmlog(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"),
(char)c, me->name, opts);
return se;
}
@ -949,7 +949,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
/**
* Perform macro message output
* @param mb macro expansion state
* @param waserror use rpmError()?
* @param waserror use rpmlog()?
* @param msg message to ouput
* @param msglen no. of bytes in message
*/
@ -959,14 +959,14 @@ doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen)
char buf[BUFSIZ];
if (msglen >= sizeof(buf)) {
rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
msglen = sizeof(buf) - 1;
}
strncpy(buf, msg, msglen);
buf[msglen] = '\0';
(void) expandU(mb, buf, sizeof(buf));
if (waserror)
rpmError(RPMERR_BADSPEC, "%s\n", buf);
rpmlog(RPMERR_BADSPEC, "%s\n", buf);
else
fprintf(stderr, "%s", buf);
}
@ -990,7 +990,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
buf[0] = '\0';
if (g != NULL) {
if (gn >= sizeof(buf)) {
rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
gn = sizeof(buf) - 1;
}
strncpy(buf, g, gn);
@ -1095,7 +1095,7 @@ expandMacro(MacroBuf mb)
int chkexist;
if (++mb->depth > max_macro_depth) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Recursion depth(%d) greater than max(%d)\n"),
mb->depth, max_macro_depth);
mb->depth--;
@ -1164,7 +1164,7 @@ expandMacro(MacroBuf mb)
break;
case '(': /* %(...) shell escape */
if ((se = matchchar(s, c, ')')) == NULL) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Unterminated %c: %s\n"), (char)c, s);
rc = 1;
continue;
@ -1181,7 +1181,7 @@ expandMacro(MacroBuf mb)
break;
case '{': /* %{...}/%{...:...} substitution */
if ((se = matchchar(s, c, '}')) == NULL) {
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Unterminated %c: %s\n"), (char)c, s);
rc = 1;
continue;
@ -1222,7 +1222,7 @@ expandMacro(MacroBuf mb)
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
#if 0
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("A %% is followed by an unparseable macro\n"));
#endif
s = se;
@ -1378,7 +1378,7 @@ expandMacro(MacroBuf mb)
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
#else
rpmError(RPMERR_BADSPEC,
rpmlog(RPMERR_BADSPEC,
_("Macro %%%.*s not found, skipping\n"), fn, f);
s = se;
#endif
@ -1695,7 +1695,7 @@ expandMacros(void * spec, rpmMacroContext mc, char * sbuf, size_t slen)
rc = expandMacro(mb);
if (mb->nb == 0)
rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
tbuf[slen] = '\0'; /* XXX just in case */
strncpy(sbuf, tbuf, (slen - mb->nb + 1));
@ -1898,16 +1898,16 @@ int isCompressed(const char * file, rpmCompressedMagic * compressed)
fd = Fopen(file, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
/* XXX Fstrerror */
rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
rpmlog(RPMERR_BADSPEC, _("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(RPMERR_BADSPEC, _("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(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"),
file, (unsigned)sizeof(magic));
rc = 0;
}

View File

@ -810,7 +810,7 @@ static FD_t urlOpen(const char * url, int flags, mode_t mode)
wait = waitpid(pid, &rc, 0);
if (!WIFEXITED(rc) || WEXITSTATUS(rc)) {
rpmError(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"),
rpmlog(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"),
cmd, WEXITSTATUS(rc));
} else {
fd = fdOpen(dest, flags, mode);

View File

@ -446,7 +446,7 @@ int rpmluaCheckScript(rpmlua _lua, const char *script, const char *name)
if (name == NULL)
name = "<lua>";
if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {
rpmError(RPMERR_SCRIPT,
rpmlog(RPMERR_SCRIPT,
_("invalid syntax in lua scriptlet: %s\n"),
lua_tostring(L, -1));
ret = -1;
@ -463,12 +463,12 @@ int rpmluaRunScript(rpmlua _lua, const char *script, const char *name)
if (name == NULL)
name = "<lua>";
if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {
rpmError(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"),
rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
} else if (lua_pcall(L, 0, 0, 0) != 0) {
rpmError(RPMERR_SCRIPT, _("lua script failed: %s\n"),
rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
@ -482,12 +482,12 @@ int rpmluaRunScriptFile(rpmlua _lua, const char *filename)
lua_State *L = lua->L;
int ret = 0;
if (luaL_loadfile(L, filename) != 0) {
rpmError(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"),
rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
} else if (lua_pcall(L, 0, 0, 0) != 0) {
rpmError(RPMERR_SCRIPT, _("lua script failed: %s\n"),
rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
@ -617,7 +617,7 @@ static int rpmluaHookWrapper(rpmhookArgs args, void *data)
}
}
if (lua_pcall(L, 1, 1, 0) != 0) {
rpmError(RPMERR_SCRIPT, _("lua hook failed: %s\n"),
rpmlog(RPMERR_SCRIPT, _("lua hook failed: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
} else {

View File

@ -116,7 +116,7 @@ restart:
/* Try to read the header from a package file. */
fd = Fopen(*fnp, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
Fstrerror(fd));
if (fd) {
Fclose(fd);
@ -153,7 +153,7 @@ maybe_manifest:
/* Try to read a package manifest. */
fd = Fopen(*fnp, "r.fpio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
Fstrerror(fd));
if (fd) {
Fclose(fd);
@ -166,7 +166,7 @@ maybe_manifest:
/* Read list of packages from manifest. */
rc = rpmReadPackageManifest(fd, &argc, &argv);
if (rc)
rpmError(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"),
rpmlog(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"),
fileURL, Fstrerror(fd));
Fclose(fd);
fd = NULL;