From 43c5de66fb90cbc59dc23eb0774d66c66d34b37d Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 19 Nov 2007 16:25:24 +0200 Subject: [PATCH] Replace all RPMERR_* etc uses with corresponding RPMLOG_* levels --- build.c | 20 +++--- build/build.c | 14 ++-- build/expression.c | 32 ++++----- build/files.c | 116 ++++++++++++++++----------------- build/pack.c | 116 ++++++++++++++++----------------- build/parseBuildInstallClean.c | 4 +- build/parseChangelog.c | 28 ++++---- build/parseDescription.c | 18 ++--- build/parseFiles.c | 20 +++--- build/parsePreamble.c | 112 +++++++++++++++---------------- build/parsePrep.c | 68 +++++++++---------- build/parseReqs.c | 12 ++-- build/parseScript.c | 42 ++++++------ build/parseSpec.c | 50 +++++++------- build/poptBT.c | 2 +- build/rpmfc.c | 18 ++--- build/spec.c | 16 ++--- lib/fs.c | 14 ++-- lib/fsm.c | 6 +- lib/idtx.c | 2 +- lib/misc.c | 10 +-- lib/package.c | 12 ++-- lib/psm.c | 24 +++---- lib/query.c | 40 ++++++------ lib/rpmchecksig.c | 56 ++++++++-------- lib/rpmgi.c | 4 +- lib/rpminstall.c | 10 +-- lib/rpmlead.c | 2 +- lib/rpmrc.c | 46 ++++++------- lib/rpmts.c | 10 +-- lib/signature.c | 36 +++++----- rpmdb/db3.c | 6 +- rpmdb/dbconfig.c | 8 +-- rpmdb/rpmdb.c | 48 +++++++------- rpmio/macro.c | 44 ++++++------- rpmio/rpmio.c | 2 +- rpmio/rpmlua.c | 12 ++-- tools/rpmgraph.c | 6 +- tools/rpmsort.c | 6 +- 39 files changed, 546 insertions(+), 546 deletions(-) diff --git a/build.c b/build.c index f1c153b2f..13eab991c 100644 --- a/build.c +++ b/build.c @@ -56,7 +56,7 @@ static int isSpecFile(const char * specfile) fd = Fopen(specfile, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("Unable to open spec file %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Unable to open spec file %s: %s\n"), specfile, Fstrerror(fd)); return 0; } @@ -133,7 +133,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"))) { - rpmlog(RPMERR_POPEN, _("Failed to open tar pipe: %m\n")); + rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n")); specDir = _free(specDir); tmpSpecFile = _free(tmpSpecFile); return 1; @@ -145,14 +145,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"))) { - rpmlog(RPMERR_POPEN, _("Failed to open tar pipe: %m\n")); + rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n")); specDir = _free(specDir); tmpSpecFile = _free(tmpSpecFile); return 1; } if (!fgets(buf, sizeof(buf) - 1, fp)) { /* Give up */ - rpmlog(RPMERR_READ, _("Failed to read spec file from %s\n"), + rpmlog(RPMLOG_ERR, _("Failed to read spec file from %s\n"), arg); (void) unlink(tmpSpecFile); specDir = _free(specDir); @@ -180,7 +180,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) specDir = _free(specDir); if (res) { - rpmlog(RPMERR_RENAME, _("Failed to rename %s to %s: %m\n"), + rpmlog(RPMLOG_ERR, _("Failed to rename %s to %s: %m\n"), tmpSpecFile, s); (void) unlink(tmpSpecFile); tmpSpecFile = _free(tmpSpecFile); @@ -193,7 +193,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) if (*arg != '/') { if (!getcwd(buf, BUFSIZ)) { - rpmlog(RPMERR_STAT, "getcwd failed: %m\n"); + rpmlog(RPMLOG_ERR, "getcwd failed: %m\n"); return 1; } strcat(buf, "/"); @@ -214,7 +214,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) if (*specFile != '/') { char *s = alloca(BUFSIZ); if (!getcwd(s, BUFSIZ)) { - rpmlog(RPMERR_STAT, "getcwd failed: %m\n"); + rpmlog(RPMLOG_ERR, "getcwd failed: %m\n"); rc = 1; goto exit; } @@ -226,12 +226,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) { - rpmlog(RPMERR_STAT, _("failed to stat %s: %m\n"), specURL); + rpmlog(RPMLOG_ERR, _("failed to stat %s: %m\n"), specURL); rc = 1; goto exit; } if (! S_ISREG(st.st_mode)) { - rpmlog(RPMERR_NOTREG, _("File %s is not a regular file.\n"), + rpmlog(RPMLOG_ERR, _("File %s is not a regular file.\n"), specURL); rc = 1; goto exit; @@ -239,7 +239,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)) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("File %s does not appear to be a specfile.\n"), specURL); rc = 1; goto exit; diff --git a/build/build.c b/build/build.c index f6f9cf33d..cb6a7cbe1 100644 --- a/build/build.c +++ b/build/build.c @@ -129,8 +129,8 @@ int doScript(rpmSpec spec, rpmBuildFlags what, const char *name, StringBuf sb, i } if (makeTempFile(rootURL, &scriptName, &fd) || fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_SCRIPT, _("Unable to open temp file.\n")); - rc = RPMERR_SCRIPT; + rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n")); + rc = RPMLOG_ERR; goto exit; } @@ -140,7 +140,7 @@ int doScript(rpmSpec spec, rpmBuildFlags what, const char *name, StringBuf sb, i xfd = fd; if ((fp = fdGetFILE(xfd)) == NULL) { - rc = RPMERR_SCRIPT; + rc = RPMLOG_ERR; goto exit; } @@ -176,7 +176,7 @@ if (_build_debug) fprintf(stderr, "*** rootURL %s buildDirURL %s\n", rootURL, buildDirURL); if (buildDirURL && buildDirURL[0] != '/' && (urlSplit(buildDirURL, &u) != 0)) { - rc = RPMERR_SCRIPT; + rc = RPMLOG_ERR; goto exit; } if (u != NULL) { @@ -209,7 +209,7 @@ fprintf(stderr, "*** addMacros\n"); errno = 0; (void) execvp(argv[0], (char *const *)argv); - rpmlog(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"), + rpmlog(RPMLOG_ERR, _("Exec of %s failed (%s): %s\n"), scriptName, name, strerror(errno)); _exit(-1); @@ -218,9 +218,9 @@ fprintf(stderr, "*** addMacros\n"); rc = waitpid(child, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rpmlog(RPMERR_SCRIPT, _("Bad exit status from %s (%s)\n"), + rpmlog(RPMLOG_ERR, _("Bad exit status from %s (%s)\n"), scriptName, name); - rc = RPMERR_SCRIPT; + rc = RPMLOG_ERR; } else rc = 0; diff --git a/build/expression.c b/build/expression.c index 9a44e79ac..3591a8165 100644 --- a/build/expression.c +++ b/build/expression.c @@ -212,7 +212,7 @@ static int rdToken(ParseState state) token = TOK_EQ; p++; } else { - rpmlog(RPMERR_BADSPEC, _("syntax error while parsing ==\n")); + rpmlog(RPMLOG_ERR, _("syntax error while parsing ==\n")); return -1; } break; @@ -242,7 +242,7 @@ static int rdToken(ParseState state) token = TOK_LOGICAL_AND; p++; } else { - rpmlog(RPMERR_BADSPEC, _("syntax error while parsing &&\n")); + rpmlog(RPMLOG_ERR, _("syntax error while parsing &&\n")); return -1; } break; @@ -251,7 +251,7 @@ static int rdToken(ParseState state) token = TOK_LOGICAL_OR; p++; } else { - rpmlog(RPMERR_BADSPEC, _("syntax error while parsing ||\n")); + rpmlog(RPMLOG_ERR, _("syntax error while parsing ||\n")); return -1; } break; @@ -294,7 +294,7 @@ static int rdToken(ParseState state) v = valueMakeString( rpmExpand(temp, NULL) ); } else { - rpmlog(RPMERR_BADSPEC, _("parse error in expression\n")); + rpmlog(RPMLOG_ERR, _("parse error in expression\n")); return -1; } } @@ -326,7 +326,7 @@ static Value doPrimary(ParseState state) return NULL; v = doLogical(state); if (state->nextToken != TOK_CLOSE_P) { - rpmlog(RPMERR_BADSPEC, _("unmatched (\n")); + rpmlog(RPMLOG_ERR, _("unmatched (\n")); return NULL; } if (rdToken(state)) @@ -358,7 +358,7 @@ static Value doPrimary(ParseState state) return NULL; if (! valueIsInteger(v)) { - rpmlog(RPMERR_BADSPEC, _("- only on numbers\n")); + rpmlog(RPMLOG_ERR, _("- only on numbers\n")); return NULL; } @@ -374,7 +374,7 @@ static Value doPrimary(ParseState state) return NULL; if (! valueIsInteger(v)) { - rpmlog(RPMERR_BADSPEC, _("! only on numbers\n")); + rpmlog(RPMLOG_ERR, _("! only on numbers\n")); return NULL; } @@ -416,7 +416,7 @@ static Value doMultiplyDivide(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmlog(RPMERR_BADSPEC, _("types must match\n")); + rpmlog(RPMLOG_ERR, _("types must match\n")); return NULL; } @@ -429,7 +429,7 @@ static Value doMultiplyDivide(ParseState state) else v1 = valueMakeInteger(i1 / i2); } else { - rpmlog(RPMERR_BADSPEC, _("* / not suported for strings\n")); + rpmlog(RPMLOG_ERR, _("* / not suported for strings\n")); return NULL; } } @@ -464,7 +464,7 @@ static Value doAddSubtract(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmlog(RPMERR_BADSPEC, _("types must match\n")); + rpmlog(RPMLOG_ERR, _("types must match\n")); return NULL; } @@ -480,7 +480,7 @@ static Value doAddSubtract(ParseState state) char *copy; if (op == TOK_MINUS) { - rpmlog(RPMERR_BADSPEC, _("- not suported for strings\n")); + rpmlog(RPMLOG_ERR, _("- not suported for strings\n")); return NULL; } @@ -522,7 +522,7 @@ static Value doRelational(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmlog(RPMERR_BADSPEC, _("types must match\n")); + rpmlog(RPMLOG_ERR, _("types must match\n")); return NULL; } @@ -614,7 +614,7 @@ static Value doLogical(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmlog(RPMERR_BADSPEC, _("types must match\n")); + rpmlog(RPMLOG_ERR, _("types must match\n")); return NULL; } @@ -627,7 +627,7 @@ static Value doLogical(ParseState state) else v1 = valueMakeInteger(i1 || i2); } else { - rpmlog(RPMERR_BADSPEC, _("&& and || not suported for strings\n")); + rpmlog(RPMLOG_ERR, _("&& and || not suported for strings\n")); return NULL; } } @@ -660,7 +660,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) { - rpmlog(RPMERR_BADSPEC, _("syntax error in expression\n")); + rpmlog(RPMLOG_ERR, _("syntax error in expression\n")); state.str = _free(state.str); return -1; } @@ -707,7 +707,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) { - rpmlog(RPMERR_BADSPEC, _("syntax error in expression\n")); + rpmlog(RPMLOG_ERR, _("syntax error in expression\n")); state.str = _free(state.str); return NULL; } diff --git a/build/files.c b/build/files.c index c8b02433d..7ced1bf54 100644 --- a/build/files.c +++ b/build/files.c @@ -308,9 +308,9 @@ static int parseForVerify(char * buf, FileList fl) SKIPSPACE(pe); if (*pe != '(') { - rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe); + rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Bracket %*verify args */ @@ -319,9 +319,9 @@ static int parseForVerify(char * buf, FileList fl) {}; if (*pe == '\0') { - rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p); + rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Localize. Erase parsed string */ @@ -357,9 +357,9 @@ static int parseForVerify(char * buf, FileList fl) if (!strcmp(p, "not")) { negated ^= 1; } else { - rpmlog(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p); + rpmlog(RPMLOG_ERR, _("Invalid %s token: %s\n"), name, p); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } @@ -382,7 +382,7 @@ static int parseForDev(char * buf, FileList fl) const char * name; const char * errstr = NULL; char *p, *pe, *q; - int rc = RPMERR_BADSPEC; /* assume error */ + int rc = RPMLOG_ERR; /* assume error */ if ((p = strstr(buf, (name = "%dev"))) == NULL) return 0; @@ -461,7 +461,7 @@ static int parseForDev(char * buf, FileList fl) exit: if (rc) { - rpmlog(RPMERR_BADSPEC, _("Missing %s in %s %s\n"), errstr, name, p); + rpmlog(RPMLOG_ERR, _("Missing %s in %s %s\n"), errstr, name, p); fl->processingFailed = 1; } return rc; @@ -497,9 +497,9 @@ static int parseForAttr(char * buf, FileList fl) SKIPSPACE(pe); if (*pe != '(') { - rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe); + rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Bracket %*attr args */ @@ -512,10 +512,10 @@ static int parseForAttr(char * buf, FileList fl) q++; SKIPSPACE(q); if (*q != '\0') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Non-white space follows %s(): %s\n"), name, q); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } @@ -551,9 +551,9 @@ static int parseForAttr(char * buf, FileList fl) } if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') { - rpmlog(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q); + rpmlog(RPMLOG_ERR, _("Bad syntax: %s(%s)\n"), name, q); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Do a quick test on the mode argument and adjust for "-" */ @@ -561,9 +561,9 @@ static int parseForAttr(char * buf, FileList fl) unsigned int ui; x = sscanf(ar->ar_fmodestr, "%o", &ui); if ((x == 0) || (ar->ar_fmode & ~MYALLPERMS)) { - rpmlog(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)\n"), name, q); + rpmlog(RPMLOG_ERR, _("Bad mode spec: %s(%s)\n"), name, q); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } ar->ar_fmode = ui; } else @@ -573,9 +573,9 @@ static int parseForAttr(char * buf, FileList fl) unsigned int ui; x = sscanf(ar->ar_dmodestr, "%o", &ui); if ((x == 0) || (ar->ar_dmode & ~MYALLPERMS)) { - rpmlog(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)\n"), name, q); + rpmlog(RPMLOG_ERR, _("Bad dirmode spec: %s(%s)\n"), name, q); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } ar->ar_dmode = ui; } else @@ -624,9 +624,9 @@ static int parseForConfig(char * buf, FileList fl) {}; if (*pe == '\0') { - rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p); + rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Localize. Erase parsed string. */ @@ -649,9 +649,9 @@ static int parseForConfig(char * buf, FileList fl) } else if (!strcmp(p, "noreplace")) { fl->currentFlags |= RPMFILE_NOREPLACE; } else { - rpmlog(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p); + rpmlog(RPMLOG_ERR, _("Invalid %s token: %s\n"), name, p); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } @@ -683,9 +683,9 @@ static int parseForLang(char * buf, FileList fl) SKIPSPACE(pe); if (*pe != '(') { - rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe); + rpmlog(RPMLOG_ERR, _("Missing '(' in %s %s\n"), name, pe); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Bracket %lang args */ @@ -694,9 +694,9 @@ static int parseForLang(char * buf, FileList fl) {}; if (*pe == '\0') { - rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p); + rpmlog(RPMLOG_ERR, _("Missing ')' in %s(%s\n"), name, p); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Localize. Erase parsed string. */ @@ -720,11 +720,11 @@ static int parseForLang(char * buf, FileList fl) /* Sanity check on locale lengths */ if (np < 1 || (np == 1 && *p != 'C') || np >= 32) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Unusual locale length: \"%.*s\" in %%lang(%s)\n"), (int)np, p, q); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Check for duplicate locales */ @@ -732,10 +732,10 @@ static int parseForLang(char * buf, FileList fl) for (i = 0; i < fl->nLangs; i++) { if (strncmp(fl->currentLangs[i], p, np)) continue; - rpmlog(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"), + rpmlog(RPMLOG_ERR, _("Duplicate locale %.*s in %%lang(%s)\n"), (int)np, p, q); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Add new locale */ @@ -847,7 +847,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf, if (!strcmp(s, "%docdir")) { s = strtokWithQuotes(NULL, " \t\n"); if (fl->docDirCount == MAXDOCDIR) { - rpmlog(RPMERR_INTERNAL, _("Hit limit for %%docdir\n")); + rpmlog(RPMLOG_ERR, _("Hit limit for %%docdir\n")); fl->processingFailed = 1; res = 1; } @@ -855,7 +855,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")) { - rpmlog(RPMERR_INTERNAL, _("Only one arg for %%docdir\n")); + rpmlog(RPMLOG_ERR, _("Only one arg for %%docdir\n")); fl->processingFailed = 1; res = 1; } @@ -886,7 +886,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf, if (*fileName) { /* We already got a file -- error */ - rpmlog(RPMERR_BADSPEC, _("Two files on one line: %s\n"), + rpmlog(RPMLOG_ERR, _("Two files on one line: %s\n"), *fileName); fl->processingFailed = 1; res = 1; @@ -903,7 +903,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf, *fileName = s; } else { /* not in %doc, does not begin with / -- error */ - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("File must begin with \"/\": %s\n"), s); fl->processingFailed = 1; res = 1; @@ -915,7 +915,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf, if (specialDoc) { if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Can't mix special %%doc with other forms: %s\n"), (*fileName ? *fileName : "")); fl->processingFailed = 1; @@ -934,7 +934,7 @@ static int parseForSimple(rpmSpec spec, Package pkg, char * buf, } fmt = headerSprintf(pkg->header, _docdir_fmt, rpmTagTable, rpmHeaderFormats, &errstr); if (!fmt) { - rpmlog(RPMERR_BADSPEC, _("illegal _docdir_fmt: %s\n"), errstr); + rpmlog(RPMLOG_ERR, _("illegal _docdir_fmt: %s\n"), errstr); fl->processingFailed = 1; res = 1; } @@ -1210,7 +1210,7 @@ static void genCpioListAndHeader(FileList fl, if (buf[0] == '/' && strcmp(buildRoot, "/") && !strncmp(buf, buildRoot, strlen(buildRoot))) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Symlink points to BuildRoot: %s -> %s\n"), flp->fileURL, buf); fl->processingFailed = 1; @@ -1416,10 +1416,10 @@ static int addFile(FileList fl, const char * diskURL, prefixTest++; } if (*prefixPtr || (*prefixTest && *prefixTest != '/')) { - rpmlog(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"), + rpmlog(RPMLOG_ERR, _("File doesn't match prefix (%s): %s\n"), fl->prefix, fileURL); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } @@ -1440,9 +1440,9 @@ static int addFile(FileList fl, const char * diskURL, statp->st_mtime = now; statp->st_ctime = now; } else if (Lstat(diskURL, statp)) { - rpmlog(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL); + rpmlog(RPMLOG_ERR, _("File not found: %s\n"), diskURL); fl->processingFailed = 1; - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } @@ -1570,7 +1570,7 @@ static int recurseDir(FileList fl, const char * diskURL) FTS * ftsp; FTSENT * fts; int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL); - int rc = RPMERR_BADSPEC; + int rc = RPMLOG_ERR; fl->inFtw = 1; /* Flag to indicate file has buildRootURL prefixed */ fl->isDir = 1; /* Keep it from following myftw() again */ @@ -1599,7 +1599,7 @@ static int recurseDir(FileList fl, const char * diskURL) case FTS_INIT: /* initialized only */ case FTS_W: /* whiteout object */ default: - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; break; } if (rc) @@ -1642,24 +1642,24 @@ static int processMetadataFile(Package pkg, FileList fl, const char * fileURL, switch (tag) { default: - rpmlog(RPMERR_BADSPEC, _("%s: can't load unknown tag (%d).\n"), + rpmlog(RPMLOG_ERR, _("%s: can't load unknown tag (%d).\n"), fn, tag); goto exit; break; case RPMTAG_PUBKEYS: if ((rc = pgpReadPkts(fn, (const byte **)&pkt, (size_t *)&pktlen)) <= 0) { - rpmlog(RPMERR_BADSPEC, _("%s: public key read failed.\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: public key read failed.\n"), fn); goto exit; } if (rc != PGPARMOR_PUBKEY) { - rpmlog(RPMERR_BADSPEC, _("%s: not an armored public key.\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: not an armored public key.\n"), fn); goto exit; } apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen); break; case RPMTAG_POLICIES: if ((rc = rpmioSlurp(fn, &pkt, &pktlen)) != 0) { - rpmlog(RPMERR_BADSPEC, _("%s: *.te policy read failed.\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: *.te policy read failed.\n"), fn); goto exit; } apkt = (const char *) pkt; /* XXX unsigned char */ @@ -1680,7 +1680,7 @@ exit: fn = _free(fn); if (rc) { fl->processingFailed = 1; - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; } return rc; } @@ -1706,7 +1706,7 @@ static int processBinaryFile(Package pkg, FileList fl, { const char * fileName; (void) urlPath(fileURL, &fileName); if (*fileName != '/') { - rpmlog(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"), + rpmlog(RPMLOG_ERR, _("File needs leading \"/\": %s\n"), fileName); rc = 1; goto exit; @@ -1730,7 +1730,7 @@ static int processBinaryFile(Package pkg, FileList fl, /* XXX for %dev marker in file manifest only */ if (fl->noGlob) { - rpmlog(RPMERR_BADSPEC, _("Glob not permitted: %s\n"), + rpmlog(RPMLOG_ERR, _("Glob not permitted: %s\n"), diskURL); rc = 1; goto exit; @@ -1744,7 +1744,7 @@ static int processBinaryFile(Package pkg, FileList fl, } argv = _free(argv); } else { - rpmlog(RPMERR_BADSPEC, _("File not found by glob: %s\n"), + rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), diskURL); rc = 1; goto exit; @@ -1757,7 +1757,7 @@ exit: diskURL = _free(diskURL); if (rc) { fl->processingFailed = 1; - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; } return rc; } @@ -1796,10 +1796,10 @@ static int processPackageFiles(rpmSpec spec, Package pkg, fd = Fopen(ffn, "r.fpio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open %%files file %s: %s\n"), ffn, Fstrerror(fd)); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } ffn = _free(ffn); @@ -1808,8 +1808,8 @@ static int processPackageFiles(rpmSpec spec, Package pkg, while (fgets(buf, sizeof(buf), f)) { handleComments(buf); if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { - rpmlog(RPMERR_BADSPEC, _("line: %s\n"), buf); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("line: %s\n"), buf); + return RPMLOG_ERR; } appendStringBuf(pkg->fileList, buf); } @@ -2191,7 +2191,7 @@ int processSourceFiles(rpmSpec spec) flp->verifyFlags = RPMVERIFY_ALL; if (Stat(diskURL, &flp->fl_st)) { - rpmlog(RPMERR_BADSPEC, _("Bad file: %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Bad file: %s: %s\n"), diskURL, strerror(errno)); fl.processingFailed = 1; } @@ -2215,7 +2215,7 @@ int processSourceFiles(rpmSpec spec) fl.totalFileSize += flp->fl_size; if (! (flp->uname && flp->gname)) { - rpmlog(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL); + rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskURL); fl.processingFailed = 1; } diff --git a/build/pack.c b/build/pack.c index ec5183eef..aa1588a82 100644 --- a/build/pack.c +++ b/build/pack.c @@ -74,10 +74,10 @@ static int cpio_doio(FD_t fdo, Header h, CSA_t csa, if (rc) { if (failedFile) - rpmlog(RPMERR_CPIO, _("create archive failed on file %s: %s\n"), + rpmlog(RPMLOG_ERR, _("create archive failed on file %s: %s\n"), failedFile, cpioStrerror(rc)); else - rpmlog(RPMERR_CPIO, _("create archive failed: %s\n"), + rpmlog(RPMLOG_ERR, _("create archive failed: %s\n"), cpioStrerror(rc)); rc = 1; } @@ -97,14 +97,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) { - rpmlog(RPMERR_CPIO, _("cpio_copy write failed: %s\n"), + rpmlog(RPMLOG_ERR, _("cpio_copy write failed: %s\n"), Fstrerror(fdo)); return 1; } csa->cpioArchiveSize += nb; } if (Ferror(csa->cpioFdIn)) { - rpmlog(RPMERR_CPIO, _("cpio_copy read failed: %s\n"), + rpmlog(RPMLOG_ERR, _("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))) { - rpmlog(RPMERR_BADSPEC, _("line: %s\n"), buf); + rpmlog(RPMLOG_ERR, _("line: %s\n"), buf); sb = freeStringBuf(sb); break; } @@ -191,52 +191,52 @@ static int processScriptFiles(rpmSpec spec, Package pkg) if (pkg->preInFile) { if (addFileToTag(spec, pkg->preInFile, pkg->header, RPMTAG_PREIN)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open PreIn file: %s\n"), pkg->preInFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } if (pkg->preUnFile) { if (addFileToTag(spec, pkg->preUnFile, pkg->header, RPMTAG_PREUN)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open PreUn file: %s\n"), pkg->preUnFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } if (pkg->preTransFile) { if (addFileToTag(spec, pkg->preTransFile, pkg->header, RPMTAG_PRETRANS)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open PreIn file: %s\n"), pkg->preTransFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } if (pkg->postInFile) { if (addFileToTag(spec, pkg->postInFile, pkg->header, RPMTAG_POSTIN)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open PostIn file: %s\n"), pkg->postInFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } if (pkg->postUnFile) { if (addFileToTag(spec, pkg->postUnFile, pkg->header, RPMTAG_POSTUN)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open PostUn file: %s\n"), pkg->postUnFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } if (pkg->postTransFile) { if (addFileToTag(spec, pkg->postTransFile, pkg->header, RPMTAG_POSTTRANS)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open PostUn file: %s\n"), pkg->postTransFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } if (pkg->verifyFile) { if (addFileToTag(spec, pkg->verifyFile, pkg->header, RPMTAG_VERIFYSCRIPT)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open VerifyScript file: %s\n"), pkg->verifyFile); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } @@ -249,10 +249,10 @@ static int processScriptFiles(rpmSpec spec, Package pkg) } else if (p->fileName) { if (addFileToArrayTag(spec, p->fileName, pkg->header, RPMTAG_TRIGGERSCRIPTS)) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Could not open Trigger script file: %s\n"), p->fileName); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } } else { /* This is dumb. When the header supports NULL string */ @@ -278,26 +278,26 @@ int readRPM(const char *fileName, rpmSpec *specp, struct rpmlead *lead, : fdDup(STDIN_FILENO); if (fdi == NULL || Ferror(fdi)) { - rpmlog(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"), + rpmlog(RPMLOG_ERR, _("readRPM: open %s: %s\n"), (fileName ? fileName : ""), Fstrerror(fdi)); if (fdi) (void) Fclose(fdi); - return RPMERR_BADMAGIC; + return RPMLOG_ERR; } /* Get copy of lead */ if ((rc = Fread(lead, sizeof(char), sizeof(*lead), fdi)) != sizeof(*lead)) { - rpmlog(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"), + rpmlog(RPMLOG_ERR, _("readRPM: read %s: %s\n"), (fileName ? fileName : ""), Fstrerror(fdi)); - return RPMERR_BADMAGIC; + return RPMLOG_ERR; } /* XXX FIXME: EPIPE on */ if (Fseek(fdi, 0, SEEK_SET) == -1) { - rpmlog(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"), + rpmlog(RPMLOG_ERR, _("%s: Fseek failed: %s\n"), (fileName ? fileName : ""), Fstrerror(fdi)); - return RPMERR_FSEEK; + return RPMLOG_ERR; } /* Reallocate build data structures */ @@ -326,14 +326,14 @@ int readRPM(const char *fileName, rpmSpec *specp, struct rpmlead *lead, case RPMRC_NOTTRUSTED: break; case RPMRC_NOTFOUND: - rpmlog(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"), + rpmlog(RPMLOG_ERR, _("readRPM: %s is not an RPM package\n"), (fileName ? fileName : "")); - return RPMERR_BADMAGIC; + return RPMLOG_ERR; case RPMRC_FAIL: default: - rpmlog(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"), + rpmlog(RPMLOG_ERR, _("readRPM: reading header from %s\n"), (fileName ? fileName : "")); - return RPMERR_BADMAGIC; + return RPMLOG_ERR; break; } @@ -445,8 +445,8 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, /* Reallocate the header into one contiguous region. */ h = headerReload(h, RPMTAG_HEADERIMMUTABLE); if (h == NULL) { /* XXX can't happen */ - rc = RPMERR_RELOAD; - rpmlog(RPMERR_RELOAD, _("Unable to create immutable header region.\n")); + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to create immutable header region.\n")); goto exit; } /* Re-reference reallocated header. */ @@ -457,15 +457,15 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, * archive (after compression) can be added to the header. */ if (makeTempFile(NULL, &sigtarget, &fd)) { - rc = RPMERR_CREATE; - rpmlog(RPMERR_CREATE, _("Unable to open temp file.\n")); + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n")); goto exit; } fdInitDigest(fd, PGPHASHALGO_SHA1, 0); if (headerWrite(fd, h, HEADER_MAGIC_YES)) { - rc = RPMERR_NOSPACE; - rpmlog(RPMERR_NOSPACE, _("Unable to write temp header\n")); + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("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); @@ -474,8 +474,8 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, } else if (Fileno(csa->cpioFdIn) >= 0) { rc = cpio_copy(fd, csa); } else { - rc = RPMERR_BADARG; - rpmlog(RPMERR_BADARG, _("Bad CSA data\n")); + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Bad CSA data\n")); } } rpmio_flags = _free(rpmio_flags); @@ -514,16 +514,16 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, /* Reallocate the signature into one contiguous region. */ sig = headerReload(sig, RPMTAG_HEADERSIGNATURES); if (sig == NULL) { /* XXX can't happen */ - rc = RPMERR_RELOAD; - rpmlog(RPMERR_RELOAD, _("Unable to reload signature header.\n")); + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to reload signature header.\n")); goto exit; } /* Open the output file */ fd = Fopen(fileName, "w.ufdio"); if (fd == NULL || Ferror(fd)) { - rc = RPMERR_CREATE; - rpmlog(RPMERR_CREATE, _("Could not open %s: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Could not open %s: %s\n"), fileName, Fstrerror(fd)); goto exit; } @@ -558,8 +558,8 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, } if (writeLead(fd, &lead) != RPMRC_OK) { - rc = RPMERR_NOSPACE; - rpmlog(RPMERR_NOSPACE, _("Unable to write package: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to write package: %s\n"), Fstrerror(fd)); goto exit; } @@ -573,8 +573,8 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, /* Append the header and archive */ ifd = Fopen(sigtarget, "r.ufdio"); if (ifd == NULL || Ferror(ifd)) { - rc = RPMERR_READ; - rpmlog(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to open sigtarget %s: %s\n"), sigtarget, Fstrerror(ifd)); goto exit; } @@ -584,8 +584,8 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, { Header nh = headerRead(ifd, HEADER_MAGIC_YES); if (nh == NULL) { - rc = RPMERR_READ; - rpmlog(RPMERR_READ, _("Unable to read header from %s: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to read header from %s: %s\n"), sigtarget, Fstrerror(ifd)); goto exit; } @@ -598,8 +598,8 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, nh = headerFree(nh); if (rc) { - rc = RPMERR_NOSPACE; - rpmlog(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to write header to %s: %s\n"), fileName, Fstrerror(fd)); goto exit; } @@ -608,14 +608,14 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, /* Write the payload into the package. */ while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) { if (count == -1) { - rc = RPMERR_READ; - rpmlog(RPMERR_READ, _("Unable to read payload from %s: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("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; - rpmlog(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"), + rc = RPMLOG_ERR; + rpmlog(RPMLOG_ERR, _("Unable to write payload to %s: %s\n"), fileName, Fstrerror(fd)); goto exit; } @@ -722,9 +722,9 @@ int packageBinaries(rpmSpec spec) if (binRpm == NULL) { const char *name; (void) headerNVR(pkg->header, &name, NULL, NULL); - rpmlog(RPMERR_BADFILENAME, _("Could not generate output " + rpmlog(RPMLOG_ERR, _("Could not generate output " "filename for package %s: %s\n"), name, errorString); - return RPMERR_BADFILENAME; + return RPMLOG_ERR; } fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); if ((binDir = strchr(binRpm, '/')) != NULL) { @@ -738,7 +738,7 @@ int packageBinaries(rpmSpec spec) if (Mkdir(dn, 0755) == 0) break; default: - rpmlog(RPMERR_BADFILENAME,_("cannot create %s: %s\n"), + rpmlog(RPMLOG_ERR,_("cannot create %s: %s\n"), dn, strerror(errno)); break; } diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c index 681d943ae..7ee86d40f 100644 --- a/build/parseBuildInstallClean.c +++ b/build/parseBuildInstallClean.c @@ -30,9 +30,9 @@ int parseBuildInstallClean(rpmSpec spec, rpmParseState parsePart) } if (*sbp != NULL) { - rpmlog(RPMERR_BADSPEC, _("line %d: second %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: second %s\n"), spec->lineNum, name); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } *sbp = newStringBuf(); diff --git a/build/parseChangelog.c b/build/parseChangelog.c index 24bbbea6c..218ee7ff8 100644 --- a/build/parseChangelog.c +++ b/build/parseChangelog.c @@ -123,17 +123,17 @@ static int addChangelog(Header h, StringBuf sb) while (*s != '\0') { if (*s != '*') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("%%changelog entries must start with *\n")); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* find end of line */ date = s; while(*s && *s != '\n') s++; if (! *s) { - rpmlog(RPMERR_BADSPEC, _("incomplete %%changelog entry\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("incomplete %%changelog entry\n")); + return RPMLOG_ERR; } *s = '\0'; text = s + 1; @@ -147,21 +147,21 @@ static int addChangelog(Header h, StringBuf sb) } SKIPSPACE(date); if (dateToTimet(date, &time)) { - rpmlog(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("bad date in %%changelog: %s\n"), date); + return RPMLOG_ERR; } if (lastTime && lastTime < time) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("%%changelog not in descending chronological order\n")); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } lastTime = time; /* skip space to the name */ SKIPSPACE(s); if (! *s) { - rpmlog(RPMERR_BADSPEC, _("missing name in %%changelog\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("missing name in %%changelog\n")); + return RPMLOG_ERR; } /* name */ @@ -171,15 +171,15 @@ static int addChangelog(Header h, StringBuf sb) *s-- = '\0'; } if (s == name) { - rpmlog(RPMERR_BADSPEC, _("missing name in %%changelog\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("missing name in %%changelog\n")); + return RPMLOG_ERR; } /* text */ SKIPSPACE(text); if (! *text) { - rpmlog(RPMERR_BADSPEC, _("no description in %%changelog\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("no description in %%changelog\n")); + return RPMLOG_ERR; } /* find the next leading '*' (or eos) */ diff --git a/build/parseDescription.c b/build/parseDescription.c index 41fcf3cbc..2d32d7b10 100644 --- a/build/parseDescription.c +++ b/build/parseDescription.c @@ -23,7 +23,7 @@ extern int noLang; int parseDescription(rpmSpec spec) { - int nextPart = RPMERR_BADSPEC; /* assume error */ + int nextPart = RPMLOG_ERR; /* assume error */ StringBuf sb; int flag = PART_SUBNAME; Package pkg; @@ -37,9 +37,9 @@ int parseDescription(rpmSpec spec) lang = RPMBUILD_DEFAULT_LANG; if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { - rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%description: %s\n"), spec->lineNum, poptStrerror(rc)); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); @@ -50,7 +50,7 @@ int parseDescription(rpmSpec spec) } if (arg < -1) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), spec->line); @@ -61,7 +61,7 @@ int parseDescription(rpmSpec spec) if (name == NULL) name = poptGetArg(optCon); if (poptPeekArg(optCon)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"), spec->lineNum, spec->line); goto exit; @@ -69,7 +69,7 @@ int parseDescription(rpmSpec spec) } if (lookupPackage(spec, name, flag, &pkg)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), spec->lineNum, spec->line); goto exit; } @@ -79,7 +79,7 @@ int parseDescription(rpmSpec spec) #if 0 if (headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Second description\n"), + rpmlog(RPMLOG_ERR, _("line %d: Second description\n"), spec->lineNum); goto exit; } @@ -93,7 +93,7 @@ int parseDescription(rpmSpec spec) nextPart = PART_NONE; } else { if (rc) { - nextPart = RPMERR_BADSPEC; + nextPart = RPMLOG_ERR; goto exit; } while (! (nextPart = isPart(spec->line))) { @@ -105,7 +105,7 @@ int parseDescription(rpmSpec spec) break; } if (rc) { - nextPart = RPMERR_BADSPEC; + nextPart = RPMLOG_ERR; goto exit; } } diff --git a/build/parseFiles.c b/build/parseFiles.c index 1fdb883d7..5d5295240 100644 --- a/build/parseFiles.c +++ b/build/parseFiles.c @@ -32,9 +32,9 @@ int parseFiles(rpmSpec spec) file = NULL; if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { - rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"), spec->lineNum, poptStrerror(rc)); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } @@ -46,11 +46,11 @@ int parseFiles(rpmSpec spec) } if (arg < -1) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), spec->line); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } @@ -58,25 +58,25 @@ int parseFiles(rpmSpec spec) if (name == NULL) name = poptGetArg(optCon); if (poptPeekArg(optCon)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"), spec->lineNum, spec->line); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } } if (lookupPackage(spec, name, flag, &pkg)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), spec->lineNum, spec->line); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } if (pkg->fileList != NULL) { - rpmlog(RPMERR_BADSPEC, _("line %d: Second %%files list\n"), + rpmlog(RPMLOG_ERR, _("line %d: Second %%files list\n"), spec->lineNum); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } diff --git a/build/parsePreamble.c b/build/parsePreamble.c index f7ae33d1c..f5957bea8 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -165,7 +165,7 @@ static int parseBits(const char * s, const tokenBits tokbits, } } if (c == 0 && bp) *bp = bits; - return (c ? RPMERR_BADSPEC : 0); + return (c ? RPMLOG_ERR : 0); } /** @@ -212,23 +212,23 @@ static int checkForValidArchitectures(rpmSpec spec) if (isMemberInEntry(spec->buildRestrictions, arch, RPMTAG_EXCLUDEARCH) == 1) { - rpmlog(RPMERR_BADSPEC, _("Architecture is excluded: %s\n"), arch); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("Architecture is excluded: %s\n"), arch); + return RPMLOG_ERR; } if (isMemberInEntry(spec->buildRestrictions, arch, RPMTAG_EXCLUSIVEARCH) == 0) { - rpmlog(RPMERR_BADSPEC, _("Architecture is not included: %s\n"), arch); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("Architecture is not included: %s\n"), arch); + return RPMLOG_ERR; } if (isMemberInEntry(spec->buildRestrictions, os, RPMTAG_EXCLUDEOS) == 1) { - rpmlog(RPMERR_BADSPEC, _("OS is excluded: %s\n"), os); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("OS is excluded: %s\n"), os); + return RPMLOG_ERR; } if (isMemberInEntry(spec->buildRestrictions, os, RPMTAG_EXCLUSIVEOS) == 0) { - rpmlog(RPMERR_BADSPEC, _("OS is not included: %s\n"), os); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("OS is not included: %s\n"), os); + return RPMLOG_ERR; } arch = _free(arch); @@ -251,7 +251,7 @@ static int checkForRequired(Header h, const char * NVR) for (p = requiredTags; *p != 0; p++) { if (!headerIsEntry(h, *p)) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("%s field must be present in package: %s\n"), rpmTagGetName(*p), NVR); res = 1; @@ -279,7 +279,7 @@ static int checkForDuplicates(Header h, const char * NVR) { if (tag != lastTag) continue; - rpmlog(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"), + rpmlog(RPMLOG_ERR, _("Duplicate %s entries in package: %s\n"), rpmTagGetName(tag), NVR); res = 1; } @@ -333,9 +333,9 @@ static int readIcon(Header h, const char * file) fd = Fopen(fn, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Unable to open icon %s: %s\n"), fn, Fstrerror(fd)); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } size = fdSize(fd); @@ -351,9 +351,9 @@ static int readIcon(Header h, const char * file) nb = Fread(icon, sizeof(icon[0]), iconsize, fd); if (Ferror(fd) || (size >= 0 && nb != size)) { - rpmlog(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Unable to read icon %s: %s\n"), fn, Fstrerror(fd)); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; } (void) Fclose(fd); if (rc) @@ -364,8 +364,8 @@ 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 { - rpmlog(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file); - rc = RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("Unknown icon type: %s\n"), file); + rc = RPMLOG_ERR; goto exit; } icon = _free(icon); @@ -406,9 +406,9 @@ spectag stashSt(rpmSpec spec, Header h, int tag, const char * lang) #define SINGLE_TOKEN_ONLY \ if (multiToken) { \ - rpmlog(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \ + rpmlog(RPMLOG_ERR, _("line %d: Tag takes single token only: %s\n"), \ spec->lineNum, spec->line); \ - return RPMERR_BADSPEC; \ + return RPMLOG_ERR; \ } extern int noLang; @@ -431,22 +431,22 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, int rc; int xx; - if (field == NULL) return RPMERR_BADSPEC; /* XXX can't happen */ + if (field == NULL) return RPMLOG_ERR; /* XXX can't happen */ /* Find the start of the "field" and strip trailing space */ while ((*field) && (*field != ':')) field++; if (*field != ':') { - rpmlog(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Malformed tag: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } field++; SKIPSPACE(field); if (!*field) { /* Empty field */ - rpmlog(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Empty tag: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } end = findLastChar(field); *(end+1) = '\0'; @@ -469,16 +469,16 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, /* These macros are for backward compatibility */ if (tag == RPMTAG_VERSION) { if (strchr(field, '-') != NULL) { - rpmlog(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"), spec->lineNum, "version", spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } addMacro(spec->macros, "PACKAGE_VERSION", NULL, field, RMIL_OLDSPEC); } else if (tag == RPMTAG_RELEASE) { if (strchr(field, '-') != NULL) { - rpmlog(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Illegal char '-' in %s: %s\n"), spec->lineNum, "release", spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } addMacro(spec->macros, "PACKAGE_RELEASE", NULL, field, RMIL_OLDSPEC-1); } @@ -531,10 +531,10 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, (void) urlPath(buildRootURL, &buildRoot); if (*buildRoot == '\0') buildRoot = "/"; if (!strcmp(buildRoot, "/")) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("BuildRoot can not be \"/\": %s\n"), spec->buildRootURL); buildRootURL = _free(buildRootURL); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } buildRootURL = _free(buildRootURL); } break; @@ -544,11 +544,11 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, while (num--) { len = strlen(array[num]); if (array[num][len - 1] == '/' && len > 1) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Prefixes must not end with \"/\": %s\n"), spec->lineNum, spec->line); array = hfd(array, type); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } array = hfd(array, type); @@ -556,10 +556,10 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, case RPMTAG_DOCDIR: SINGLE_TOKEN_ONLY; if (field[0] != '/') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Docdir must begin with '/': %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } macro = NULL; delMacro(NULL, "_docdir"); @@ -568,10 +568,10 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, case RPMTAG_EPOCH: SINGLE_TOKEN_ONLY; if (parseNum(field, &num)) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Epoch/Serial field must be a number: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } xx = headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); break; @@ -597,7 +597,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, if ((rc = addSource(spec, pkg, field, tag))) return rc; if ((rc = readIcon(pkg->header, field))) - return RPMERR_BADSPEC; + return RPMLOG_ERR; break; case RPMTAG_NOSOURCE: case RPMTAG_NOPATCH: @@ -608,7 +608,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, case RPMTAG_BUILDPREREQ: case RPMTAG_BUILDREQUIRES: if ((rc = parseBits(lang, buildScriptBits, &tagflags))) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Bad %s: qualifiers: %s\n"), spec->lineNum, rpmTagGetName(tag), spec->line); return rc; @@ -619,7 +619,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, case RPMTAG_REQUIREFLAGS: case RPMTAG_PREREQ: if ((rc = parseBits(lang, installScriptBits, &tagflags))) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Bad %s: qualifiers: %s\n"), spec->lineNum, rpmTagGetName(tag), spec->line); return rc; @@ -645,18 +645,18 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, if ((rc = poptParseArgvString(field, &(spec->BACount), &(spec->BANames)))) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Bad BuildArchitecture format: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } if (!spec->BACount) spec->BANames = _free(spec->BANames); break; default: - rpmlog(RPMERR_INTERNAL, _("Internal error: Bogus tag %d\n"), tag); - return RPMERR_INTERNAL; + rpmlog(RPMLOG_ERR, _("Internal error: Bogus tag %d\n"), tag); + return RPMLOG_ERR; } if (macro) @@ -751,7 +751,7 @@ static int findPreambleTag(rpmSpec spec,rpmTag * tag, if (!(p->token && !xstrncasecmp(spec->line, p->token, p->len))) continue; if (p->obsolete) { - rpmlog(RPMERR_BADSPEC, _("Legacy syntax is unsupported: %s\n"), + rpmlog(RPMLOG_ERR, _("Legacy syntax is unsupported: %s\n"), p->token); p = NULL; } @@ -814,15 +814,15 @@ int parsePreamble(rpmSpec spec, int initialPackage) if (! initialPackage) { /* There is one option to %package: or -n */ if (parseSimplePart(spec->line, &name, &flag)) { - rpmlog(RPMERR_BADSPEC, _("Bad package specification: %s\n"), + rpmlog(RPMLOG_ERR, _("Bad package specification: %s\n"), spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } if (!lookupPackage(spec, name, flag, NULL)) { - rpmlog(RPMERR_BADSPEC, _("Package already exists: %s\n"), + rpmlog(RPMLOG_ERR, _("Package already exists: %s\n"), spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* Construct the package */ @@ -849,12 +849,12 @@ int parsePreamble(rpmSpec spec, int initialPackage) SKIPSPACE(linep); if (*linep != '\0') { if (findPreambleTag(spec, &tag, ¯o, lang)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Unknown tag: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } if (handlePreambleTag(spec, pkg, tag, macro, lang)) - return RPMERR_BADSPEC; + return RPMLOG_ERR; if (spec->BANames && !spec->recursing) return PART_BUILDARCHITECTURES; } @@ -871,26 +871,26 @@ int parsePreamble(rpmSpec spec, int initialPackage) /* Do some final processing on the header */ if (!spec->gotBuildRootURL && spec->buildRootURL) { - rpmlog(RPMERR_BADSPEC, _("Spec file can't use BuildRoot\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("Spec file can't use BuildRoot\n")); + return RPMLOG_ERR; } /* XXX Skip valid arch check if not building binary package */ if (!spec->anyarch && checkForValidArchitectures(spec)) - return RPMERR_BADSPEC; + return RPMLOG_ERR; if (pkg == spec->packages) fillOutMainPackage(pkg->header); if (checkForDuplicates(pkg->header, NVR)) - return RPMERR_BADSPEC; + return RPMLOG_ERR; if (pkg != spec->packages) headerCopyTags(spec->packages->header, pkg->header, (int32_t *)copyTagsDuringParse); if (checkForRequired(pkg->header, NVR)) - return RPMERR_BADSPEC; + return RPMLOG_ERR; return nextPart; } diff --git a/build/parsePrep.c b/build/parsePrep.c index 2b39581a5..8ce0fa2cd 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -35,13 +35,13 @@ static int checkOwners(const char * urlfn) struct stat sb; if (Lstat(urlfn, &sb)) { - rpmlog(RPMERR_BADSPEC, _("Bad source: %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Bad source: %s: %s\n"), urlfn, strerror(errno)); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) { - rpmlog(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn); + return RPMLOG_ERR; } return 0; @@ -75,7 +75,7 @@ static char *doPatch(rpmSpec spec, int c, int strip, const char *db, } } if (sp == NULL) { - rpmlog(RPMERR_BADSPEC, _("No patch number %d\n"), c); + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_BADSPEC, _("No source number %d\n"), c); + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_BADFILENAME, + rpmlog(RPMLOG_ERR, _("Couldn't download nosource %s: %s\n"), sp->fullSource, ftpStrerror(rc)); return NULL; @@ -295,9 +295,9 @@ static int doSetupMacro(rpmSpec spec, char *line) dirName = NULL; if ((rc = poptParseArgvString(line, &argc, &argv))) { - rpmlog(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"), + rpmlog(RPMLOG_ERR, _("Error parsing %%setup: %s\n"), poptStrerror(rc)); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } before = newStringBuf(); @@ -310,25 +310,25 @@ static int doSetupMacro(rpmSpec spec, char *line) /* We only parse -a and -b here */ if (parseNum(optArg, &num)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%setup: %s\n"), spec->lineNum, (optArg ? optArg : "???")); before = freeStringBuf(before); after = freeStringBuf(after); optCon = poptFreeContext(optCon); argv = _free(argv); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } { const char *chptr = doUntar(spec, num, quietly); if (chptr == NULL) - return RPMERR_BADSPEC; + return RPMLOG_ERR; appendLineStringBuf((arg == 'a' ? after : before), chptr); } } if (arg < -1) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad %%setup option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), poptStrerror(arg)); @@ -336,7 +336,7 @@ static int doSetupMacro(rpmSpec spec, char *line) after = freeStringBuf(after); optCon = poptFreeContext(optCon); argv = _free(argv); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } if (dirName) { @@ -379,7 +379,7 @@ static int doSetupMacro(rpmSpec spec, char *line) if (!createDir && !skipDefaultAction) { const char *chptr = doUntar(spec, 0, quietly); if (!chptr) - return RPMERR_BADSPEC; + return RPMLOG_ERR; appendLineStringBuf(spec->prep, chptr); } @@ -394,7 +394,7 @@ static int doSetupMacro(rpmSpec spec, char *line) if (createDir && !skipDefaultAction) { const char * chptr = doUntar(spec, 0, quietly); if (chptr == NULL) - return RPMERR_BADSPEC; + return RPMLOG_ERR; appendLineStringBuf(spec->prep, chptr); } @@ -462,19 +462,19 @@ static int doPatchMacro(rpmSpec spec, char *line) /* orig suffix */ opt_b = strtok(NULL, " \t\n"); if (! opt_b) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Need arg to %%patch -b: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } else if (!strcmp(s, "-z")) { /* orig suffix */ opt_b = strtok(NULL, " \t\n"); if (! opt_b) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Need arg to %%patch -z: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } else if (!strncmp(s, "-F", strlen("-F"))) { /* fuzz factor */ @@ -488,10 +488,10 @@ static int doPatchMacro(rpmSpec spec, char *line) } opt_F = (fnum ? strtol(fnum, &end, 10) : 0); if (! opt_F || *end) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%patch -F: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } else if (!strncmp(s, "-p", sizeof("-p")-1)) { /* unfortunately, we must support -pX */ @@ -500,28 +500,28 @@ static int doPatchMacro(rpmSpec spec, char *line) } else { s = strtok(NULL, " \t\n"); if (s == NULL) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Need arg to %%patch -p: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } if (parseNum(s, &opt_p)) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%patch -p: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } else { /* Must be a patch num */ if (patch_index == 1024) { - rpmlog(RPMERR_BADSPEC, _("Too many patches!\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("Too many patches!\n")); + return RPMLOG_ERR; } if (parseNum(s, &(patch_nums[patch_index]))) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad arg to %%patch: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } patch_index++; } @@ -532,14 +532,14 @@ static int doPatchMacro(rpmSpec spec, char *line) if (! opt_P) { s = doPatch(spec, 0, opt_p, opt_b, opt_R, opt_E, opt_F); if (s == NULL) - return RPMERR_BADSPEC; + return RPMLOG_ERR; appendLineStringBuf(spec->prep, s); } for (x = 0; x < patch_index; x++) { s = doPatch(spec, patch_nums[x], opt_p, opt_b, opt_R, opt_E, opt_F); if (s == NULL) - return RPMERR_BADSPEC; + return RPMLOG_ERR; appendLineStringBuf(spec->prep, s); } @@ -553,8 +553,8 @@ int parsePrep(rpmSpec spec) char **lines, **saveLines; if (spec->prep != NULL) { - rpmlog(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("line %d: second %%prep\n"), spec->lineNum); + return RPMLOG_ERR; } spec->prep = newStringBuf(); diff --git a/build/parseReqs.c b/build/parseReqs.c index 2d7066657..0b3e77e72 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -97,10 +97,10 @@ 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] == '/')) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } re = r; @@ -125,10 +125,10 @@ int parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN, continue; if (r[0] == '/') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: Versioned file name not permitted: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } switch(tagN) { @@ -156,9 +156,9 @@ int parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTag tagN, if (Flags & RPMSENSE_SENSEMASK) { if (*v == '\0' || ve == v) { - rpmlog(RPMERR_BADSPEC, _("line %d: Version required: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Version required: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } EVR = xmalloc((ve-v) + 1); strncpy(EVR, v, (ve-v)); diff --git a/build/parseScript.c b/build/parseScript.c index 5c286cffe..44c1d572c 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -165,9 +165,9 @@ int parseScript(rpmSpec spec, int parsePart) /* break line into two */ p = strstr(spec->line, "--"); if (!p) { - rpmlog(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: triggers must have --: %s\n"), spec->lineNum, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } *p = '\0'; @@ -175,9 +175,9 @@ int parseScript(rpmSpec spec, int parsePart) } if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { - rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"), spec->lineNum, partname, poptStrerror(rc)); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } optCon = poptGetContext(NULL, argc, argv, optionsTable, 0); @@ -186,17 +186,17 @@ int parseScript(rpmSpec spec, int parsePart) case 'p': if (prog[0] == '<') { if (prog[strlen(prog)-1] != '>') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: internal script must end " "with \'>\': %s\n"), spec->lineNum, prog); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } } else if (prog[0] != '/') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: script program must begin " "with \'/\': %s\n"), spec->lineNum, prog); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } break; @@ -207,11 +207,11 @@ int parseScript(rpmSpec spec, int parsePart) } if (arg < -1) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), spec->line); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } @@ -219,34 +219,34 @@ int parseScript(rpmSpec spec, int parsePart) if (name == NULL) name = poptGetArg(optCon); if (poptPeekArg(optCon)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Too many names: %s\n"), spec->lineNum, spec->line); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } } if (lookupPackage(spec, name, flag, &pkg)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), spec->lineNum, spec->line); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } if (tag != RPMTAG_TRIGGERSCRIPTS) { if (headerIsEntry(pkg->header, progtag)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Second %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Second %s\n"), spec->lineNum, partname); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } } if ((rc = poptParseArgvString(prog, &progArgc, &progArgv))) { - rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Error parsing %s: %s\n"), spec->lineNum, partname, poptStrerror(rc)); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } @@ -273,7 +273,7 @@ int parseScript(rpmSpec spec, int parsePart) if (!strcmp(progArgv[0], "")) { rpmlua lua = NULL; /* Global state. */ if (rpmluaCheckScript(lua, p, partname) != RPMRC_OK) { - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } (void) rpmlibNeedsFeature(pkg->header, @@ -281,10 +281,10 @@ int parseScript(rpmSpec spec, int parsePart) } else #endif if (progArgv[0][0] == '<') { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("line %d: unsupported internal script: %s\n"), spec->lineNum, progArgv[0]); - rc = RPMERR_BADSPEC; + rc = RPMLOG_ERR; goto exit; } else { (void) addReqProv(spec, pkg->header, RPMTAG_REQUIRENAME, diff --git a/build/parseSpec.c b/build/parseSpec.c index 72effbd8b..461bc5bc6 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -167,16 +167,16 @@ static int copyNextLine(rpmSpec spec, OFI_t *ofi, int strip) * error code for this. */ if (pc || bc || nc ) { spec->nextline = ""; - return RPMERR_UNMATCHEDIF; + return RPMLOG_ERR; } spec->lbufPtr = spec->lbuf; /* 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))) { - rpmlog(RPMERR_BADSPEC, _("line %d: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: %s\n"), spec->lineNum, spec->lbuf); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } spec->nextline = spec->lbuf; } @@ -219,9 +219,9 @@ retry: ofi->fd = Fopen(ofi->fileName, "r.fpio"); if (ofi->fd == NULL || Ferror(ofi->fd)) { /* XXX Fstrerror */ - rpmlog(RPMERR_BADSPEC, _("Unable to open %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Unable to open %s: %s\n"), ofi->fileName, Fstrerror(ofi->fd)); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } spec->lineNum = ofi->lineNum = 0; } @@ -232,8 +232,8 @@ retry: if (f == NULL || !fgets(ofi->readBuf, BUFSIZ, f)) { /* EOF */ if (spec->readStack->next) { - rpmlog(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n")); - return RPMERR_UNMATCHEDIF; + rpmlog(RPMLOG_ERR, _("Unclosed %%if\n")); + return RPMLOG_ERR; } /* remove this file from the stack */ @@ -266,7 +266,7 @@ retry: /* Copy next file line into the spec line buffer */ if ((rc = copyNextLine(spec, ofi, strip)) != 0) { - if (rc == RPMERR_UNMATCHEDIF) + if (rc == RPMLOG_ERR) goto retry; return rc; } @@ -301,19 +301,19 @@ retry: s += 3; match = parseExpressionBoolean(spec, s); if (match < 0) { - rpmlog(RPMERR_UNMATCHEDIF, + rpmlog(RPMLOG_ERR, _("%s:%d: parseExpressionBoolean returns %d\n"), ofi->fileName, ofi->lineNum, match); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } else if (! strncmp("%else", s, sizeof("%else")-1)) { s += 5; if (! spec->readStack->next) { /* Got an else with no %if ! */ - rpmlog(RPMERR_UNMATCHEDIF, + rpmlog(RPMLOG_ERR, _("%s:%d: Got a %%else with no %%if\n"), ofi->fileName, ofi->lineNum); - return RPMERR_UNMATCHEDIF; + return RPMLOG_ERR; } spec->readStack->reading = spec->readStack->next->reading && ! spec->readStack->reading; @@ -322,10 +322,10 @@ retry: s += 6; if (! spec->readStack->next) { /* Got an end with no %if ! */ - rpmlog(RPMERR_UNMATCHEDIF, + rpmlog(RPMLOG_ERR, _("%s:%d: Got a %%endif with no %%if\n"), ofi->fileName, ofi->lineNum); - return RPMERR_UNMATCHEDIF; + return RPMLOG_ERR; } rl = spec->readStack; spec->readStack = spec->readStack->next; @@ -337,8 +337,8 @@ retry: s += 8; fileName = s; if (! xisspace(*fileName)) { - rpmlog(RPMERR_BADSPEC, _("malformed %%include statement\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("malformed %%include statement\n")); + return RPMLOG_ERR; } SKIPSPACE(fileName); endFileName = fileName; @@ -346,8 +346,8 @@ retry: p = endFileName; SKIPSPACE(p); if (*p != '\0') { - rpmlog(RPMERR_BADSPEC, _("malformed %%include statement\n")); - return RPMERR_BADSPEC; + rpmlog(RPMLOG_ERR, _("malformed %%include statement\n")); + return RPMLOG_ERR; } *endFileName = '\0'; @@ -415,9 +415,9 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL, (void) urlPath(buildRootURL, &buildRoot); if (*buildRoot == '\0') buildRoot = "/"; if (!strcmp(buildRoot, "/")) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("BuildRoot can not be \"/\": %s\n"), buildRootURL); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } spec->gotBuildRootURL = 1; spec->buildRootURL = xstrdup(buildRootURL); @@ -515,7 +515,7 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL, { spec->BACount = index; spec = freeSpec(spec); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } delMacro(NULL, "_target_cpu"); index++; @@ -523,10 +523,10 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL, spec->BACount = index; if (! index) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("No compatible architectures found for build\n")); spec = freeSpec(spec); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } /* @@ -561,10 +561,10 @@ 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); - rpmlog(RPMERR_BADSPEC, _("Package has no %%description: %s\n"), + rpmlog(RPMLOG_ERR, _("Package has no %%description: %s\n"), name); spec = freeSpec(spec); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } (void) headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1); diff --git a/build/poptBT.c b/build/poptBT.c index a8487b284..dce01d085 100644 --- a/build/poptBT.c +++ b/build/poptBT.c @@ -93,7 +93,7 @@ static void buildArgCallback( poptContext con, case POPT_RMBUILD: rba->buildAmount |= RPMBUILD_RMBUILD; break; case POPT_BUILDROOT: if (rba->buildRootOverride) { - rpmlog(RPMERR_BUILDROOT, _("buildroot already specified, ignoring %s\n"), arg); + rpmlog(RPMLOG_ERR, _("buildroot already specified, ignoring %s\n"), arg); break; } rba->buildRootOverride = xstrdup(arg); diff --git a/build/rpmfc.c b/build/rpmfc.c index 0724fbb12..ff995d7b5 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -125,12 +125,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. */ - rpmlog(RPMERR_EXEC, _("Couldn't exec %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Couldn't exec %s: %s\n"), argv[0], strerror(errno)); - _exit(RPMERR_EXEC); + _exit(RPMLOG_ERR); } if (child < 0) { - rpmlog(RPMERR_FORK, _("Couldn't fork %s: %s\n"), + rpmlog(RPMLOG_ERR, _("Couldn't fork %s: %s\n"), argv[0], strerror(errno)); return NULL; } @@ -216,11 +216,11 @@ top: (unsigned)child, (unsigned)reaped, status); if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) { - rpmlog(RPMERR_EXEC, _("%s failed\n"), argv[0]); + rpmlog(RPMLOG_ERR, _("%s failed\n"), argv[0]); return NULL; } if (writeBytesLeft) { - rpmlog(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]); + rpmlog(RPMLOG_ERR, _("failed to write all data to %s\n"), argv[0]); return NULL; } return readBuff; @@ -1238,7 +1238,7 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv, int16_t * fmode) ms = magic_open(msflags); if (ms == NULL) { - xx = RPMERR_EXEC; + xx = RPMLOG_ERR; rpmlog(xx, _("magic_open(0x%x) failed: %s\n"), msflags, strerror(errno)); assert(ms != NULL); /* XXX figger a proper return path. */ @@ -1246,7 +1246,7 @@ assert(ms != NULL); /* XXX figger a proper return path. */ xx = magic_load(ms, NULL); if (xx == -1) { - xx = RPMERR_EXEC; + xx = RPMLOG_ERR; rpmlog(xx, _("magic_load failed: %s\n"), magic_error(ms)); assert(xx != -1); /* XXX figger a proper return path. */ } @@ -1290,7 +1290,7 @@ assert(s != NULL); ftype = magic_file(ms, s); if (ftype == NULL) { - xx = RPMERR_EXEC; + xx = RPMLOG_ERR; 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. */ @@ -1495,7 +1495,7 @@ static int rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi) s = _free(s); if (sb_stdout == NULL) { - rc = RPMERR_EXEC; + rc = RPMLOG_ERR; rpmlog(rc, _("Failed to find %s:\n"), dm->msg); break; } diff --git a/build/spec.c b/build/spec.c index 1fd31b728..f8b17eb37 100644 --- a/build/spec.c +++ b/build/spec.c @@ -223,15 +223,15 @@ int parseNoSource(rpmSpec spec, const char * field, int tag) if (*fe != '\0') fe++; if (parseNum(f, &num)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad number: %s\n"), spec->lineNum, f); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } if (! (p = findSource(spec, num, flag))) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad no%s number: %d\n"), spec->lineNum, name, num); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } p->flags |= RPMBUILD_ISNO; @@ -288,9 +288,9 @@ int addSource(rpmSpec spec, Package pkg, const char *field, int tag) num = 0; } else { if (parseNum(buf, &num)) { - rpmlog(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"), + rpmlog(RPMLOG_ERR, _("line %d: Bad %s number: %s\n"), spec->lineNum, name, spec->line); - return RPMERR_BADSPEC; + return RPMLOG_ERR; } } } @@ -589,7 +589,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) { - rpmlog(RPMERR_QFMT, _("can't query %s: %s\n"), tn, errstr); + rpmlog(RPMLOG_ERR, _("can't query %s: %s\n"), tn, errstr); return; } @@ -654,7 +654,7 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) cookie, anyarch, force) || (spec = rpmtsSetSpec(ts, NULL)) == NULL) { - rpmlog(RPMERR_QUERY, + rpmlog(RPMLOG_ERR, _("query of specfile %s failed, can't parse\n"), arg); goto exit; } diff --git a/lib/fs.c b/lib/fs.c index 604fdce61..59ed57859 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -63,7 +63,7 @@ static int getFilesystemList(void) num = mntctl(MCTL_QUERY, sizeof(size), (char *) &size); if (num < 0) { - rpmlog(RPMERR_MTAB, _("mntctl() failed to return size: %s\n"), + rpmlog(RPMLOG_ERR, _("mntctl() failed to return size: %s\n"), strerror(errno)); return 1; } @@ -78,7 +78,7 @@ static int getFilesystemList(void) buf = alloca(size); num = mntctl(MCTL_QUERY, size, buf); if ( num <= 0 ) { - rpmlog(RPMERR_MTAB, _("mntctl() failed to return mount points: %s\n"), + rpmlog(RPMLOG_ERR, _("mntctl() failed to return mount points: %s\n"), strerror(errno)); return 1; } @@ -103,7 +103,7 @@ static int getFilesystemList(void) case ESTALE: continue; default: - rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), fsnames[i], + rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), fsnames[i], strerror(errno)); rpmFreeFilesystems(); @@ -145,7 +145,7 @@ static int getFilesystemList(void) mtab = fopen(MOUNTED, "r"); if (!mtab) { - rpmlog(RPMERR_MTAB, _("failed to open %s: %s\n"), MOUNTED, + rpmlog(RPMLOG_ERR, _("failed to open %s: %s\n"), MOUNTED, strerror(errno)); return 1; } @@ -195,7 +195,7 @@ static int getFilesystemList(void) # endif if (stat(mntdir, &sb)) { - rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), mntdir, + rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), mntdir, strerror(errno)); rpmFreeFilesystems(); @@ -306,7 +306,7 @@ int rpmGetFilesystemUsage(const char ** fileList, int32_t * fssizes, int numFile chptr = dirName + strlen(dirName) - 1; while (stat(dirName, &sb)) { if (errno != ENOENT) { - rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), buf, + rpmlog(RPMLOG_ERR, _("failed to stat %s: %s\n"), buf, strerror(errno)); sourceDir = _free(sourceDir); usages = _free(usages); @@ -328,7 +328,7 @@ int rpmGetFilesystemUsage(const char ** fileList, int32_t * fssizes, int numFile break; if (j == numFilesystems) { - rpmlog(RPMERR_BADDEV, + rpmlog(RPMLOG_ERR, _("file %s is on an unknown device\n"), buf); sourceDir = _free(sourceDir); usages = _free(usages); diff --git a/lib/fsm.c b/lib/fsm.c index 1e62586ca..20c7b5f58 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -1740,13 +1740,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; /* XXX common error message. */ rpmlog( - (strict_erasures ? RPMERR_RMDIR : RPMDEBUG_RMDIR), + (strict_erasures ? RPMLOG_ERR : RPMLOG_DEBUG), _("%s rmdir of %s failed: Directory not empty\n"), rpmfiTypeString(fi), fsm->path); break; default: rpmlog( - (strict_erasures ? RPMERR_RMDIR : RPMDEBUG_RMDIR), + (strict_erasures ? RPMLOG_ERR : RPMLOG_DEBUG), _("%s rmdir of %s failed: %s\n"), rpmfiTypeString(fi), fsm->path, strerror(errno)); break; @@ -1760,7 +1760,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; break; default: rpmlog( - (strict_erasures ? RPMERR_UNLINK : RPMDEBUG_UNLINK), + (strict_erasures ? RPMLOG_ERR : RPMLOG_DEBUG), _("%s unlink of %s failed: %s\n"), rpmfiTypeString(fi), fsm->path, strerror(errno)); break; diff --git a/lib/idtx.c b/lib/idtx.c index 6559ec0b7..8d2aca4c3 100644 --- a/lib/idtx.c +++ b/lib/idtx.c @@ -131,7 +131,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag) fd = Fopen(av[i], "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), av[i], + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), av[i], Fstrerror(fd)); if (fd != NULL) (void) Fclose(fd); continue; diff --git a/lib/misc.c b/lib/misc.c index 8a59a56f1..1a01f252e 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -36,12 +36,12 @@ rpmRC rpmMkdirPath (const char * dpath, const char * dname) break; } if (rc < 0) { - rpmlog(RPMERR_CREATE, _("cannot create %%%s %s\n"), dname, dpath); + rpmlog(RPMLOG_ERR, _("cannot create %%%s %s\n"), dname, dpath); return RPMRC_FAIL; } } if ((rc = Access(dpath, W_OK))) { - rpmlog(RPMERR_CREATE, _("cannot write to %%%s %s\n"), dname, dpath); + rpmlog(RPMLOG_ERR, _("cannot write to %%%s %s\n"), dname, dpath); return RPMRC_FAIL; } return RPMRC_OK; @@ -177,18 +177,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)) { - rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn); + rpmlog(RPMLOG_ERR, _("error creating temporary file %s\n"), tfn); goto errxit; } if (sb.st_nlink != 1) { - rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn); + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn); + rpmlog(RPMLOG_ERR, _("error creating temporary file %s\n"), tfn); goto errxit; } } diff --git a/lib/package.c b/lib/package.c index fa585ec18..1a179a068 100644 --- a/lib/package.c +++ b/lib/package.c @@ -700,7 +700,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) switch (l->major) { case 1: - rpmlog(RPMERR_NEWPACKAGE, + rpmlog(RPMLOG_ERR, _("packaging version 1 is not supported by this version of RPM\n")); rc = RPMRC_NOTFOUND; goto exit; @@ -710,7 +710,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) case 4: break; default: - rpmlog(RPMERR_NEWPACKAGE, _("only packaging with major numbers <= 4 " + rpmlog(RPMLOG_ERR, _("only packaging with major numbers <= 4 " "is supported by this version of RPM\n")); rc = RPMRC_NOTFOUND; goto exit; @@ -722,14 +722,14 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg); switch (rc) { default: - rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn, + rpmlog(RPMLOG_ERR, _("%s: rpmReadSignature failed: %s"), fn, (msg && *msg ? msg : "\n")); msg = _free(msg); goto exit; break; case RPMRC_OK: if (sigh == NULL) { - rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: No signature available\n"), fn); rc = RPMRC_FAIL; goto exit; } @@ -794,7 +794,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) { - rpmlog(RPMERR_FREAD, _("%s: headerRead failed: %s"), fn, + rpmlog(RPMLOG_ERR, _("%s: headerRead failed: %s"), fn, (msg && *msg ? msg : "\n")); msg = _free(msg); goto exit; @@ -900,7 +900,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) { - rpmlog(RPMERR_FREAD, _("%s: Fread failed: %s\n"), + rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd)); rc = RPMRC_FAIL; goto exit; diff --git a/lib/psm.c b/lib/psm.c index b4412da22..91fdcb8b9 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -247,7 +247,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE); if (!isSource) { - rpmlog(RPMERR_NOTSRPM, _("source package expected, binary found\n")); + rpmlog(RPMLOG_ERR, _("source package expected, binary found\n")); rpmrc = RPMRC_FAIL; goto exit; } @@ -358,7 +358,7 @@ fi->fmd5s = hfd(fi->fmd5s, -1); (void) stpcpy( stpcpy( stpcpy(t, _specdir), "/"), fi->bnl[i]); specFile = t; } else { - rpmlog(RPMERR_NOSPEC, _("source package contains no .spec file\n")); + rpmlog(RPMLOG_ERR, _("source package contains no .spec file\n")); rpmrc = RPMRC_FAIL; goto exit; } @@ -823,7 +823,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, } if (psm->sq.child == (pid_t)-1) { - rpmlog(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno)); + rpmlog(RPMLOG_ERR, _("Couldn't fork %s: %s\n"), sln, strerror(errno)); rc = RPMRC_FAIL; goto exit; } @@ -833,18 +833,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) { - rpmlog(RPMERR_SCRIPT, + rpmlog(RPMLOG_ERR, _("%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)) { - rpmlog(RPMERR_SCRIPT, + rpmlog(RPMLOG_ERR, _("%s(%s-%s-%s.%s) scriptlet failed, signal %d\n"), sln, n, v, r, a, WTERMSIG(psm->sq.status)); } else { - rpmlog(RPMERR_SCRIPT, + rpmlog(RPMLOG_ERR, _("%s(%s-%s-%s.%s) scriptlet failed, exit status %d\n"), sln, n, v, r, a, WEXITSTATUS(psm->sq.status)); } @@ -1415,7 +1415,7 @@ assert(psm->mi == NULL); if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPRE)) { rc = rpmpsmNext(psm, PSM_SCRIPT); if (rc != RPMRC_OK) { - rpmlog(RPMERR_SCRIPT, + rpmlog(RPMLOG_ERR, _("%s: %s scriptlet failed (%d), skipping %s\n"), psm->stepName, tag2sln(psm->scriptTag), rc, rpmteNEVR(psm->te)); @@ -1510,7 +1510,7 @@ assert(psm->mi == NULL); rc = writeLead(psm->fd, &lead); if (rc != RPMRC_OK) { - rpmlog(RPMERR_NOSPACE, _("Unable to write package: %s\n"), + rpmlog(RPMLOG_ERR, _("Unable to write package: %s\n"), Fstrerror(psm->fd)); break; } @@ -1522,7 +1522,7 @@ assert(psm->mi == NULL); /* Reallocate the signature into one contiguous region. */ sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES); if (sigh == NULL) { - rpmlog(RPMERR_NOSPACE, _("Unable to reload signature header\n")); + rpmlog(RPMLOG_ERR, _("Unable to reload signature header\n")); rc = RPMRC_FAIL; break; } @@ -1596,7 +1596,7 @@ assert(psm->mi == NULL); xx = rpmpsmNext(psm, PSM_NOTIFY); if (rc) { - rpmlog(RPMERR_CPIO, + rpmlog(RPMLOG_ERR, _("unpacking of archive failed%s%s: %s\n"), (psm->failedFile != NULL ? _(" on file ") : ""), (psm->failedFile != NULL ? psm->failedFile : ""), @@ -1778,11 +1778,11 @@ assert(psm->mi == NULL); if (rc) { if (psm->failedFile) - rpmlog(RPMERR_CPIO, + rpmlog(RPMLOG_ERR, _("%s failed on file %s: %s\n"), psm->stepName, psm->failedFile, cpioStrerror(rc)); else - rpmlog(RPMERR_CPIO, _("%s failed: %s\n"), + rpmlog(RPMLOG_ERR, _("%s failed: %s\n"), psm->stepName, cpioStrerror(rc)); /* XXX notify callback on error. */ diff --git a/lib/query.c b/lib/query.c index 83d77f961..457f61376 100644 --- a/lib/query.c +++ b/lib/query.c @@ -111,7 +111,7 @@ static inline const char * queryHeader(Header h, const char * qfmt) str = headerSprintf(h, qfmt, rpmTagTable, rpmHeaderFormats, &errstr); if (str == NULL) - rpmlog(RPMERR_QFMT, _("incorrect format: %s\n"), errstr); + rpmlog(RPMLOG_ERR, _("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 { - rpmlog(RPMERR_INTERNAL, + rpmlog(RPMLOG_ERR, _("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 { - rpmlog(RPMERR_INTERNAL, + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_QUERYINFO, + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("no package triggers %s\n"), arg); + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "pkgid", arg); + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"), + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "hdrid", arg); + rpmlog(RPMLOG_NOTICE, _("malformed %s: %s\n"), "hdrid", arg); return 1; } qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SHA1HEADER, arg, 0); if (qva->qva_mi == NULL) { - rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"), + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERY, _("malformed %s: %s\n"), "fileid", arg); + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"), + rpmlog(RPMLOG_NOTICE, _("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)) { - rpmlog(RPMERR_QUERY, _("malformed %s: %s\n"), "tid", arg); + rpmlog(RPMLOG_ERR, _("malformed %s: %s\n"), "tid", arg); return 1; } qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_INSTALLTID, &iid, sizeof(iid)); if (qva->qva_mi == NULL) { - rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"), + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("no package requires %s\n"), arg); + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("no package provides %s\n"), arg); + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERY, _("file %s: %s\n"), fn, strerror(myerrno)); + rpmlog(RPMLOG_ERR, _("file %s: %s\n"), fn, strerror(myerrno)); res = 1; } else if (qva->qva_mi == NULL) { - rpmlog(RPMERR_QUERYINFO, + rpmlog(RPMLOG_NOTICE, _("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)) { - rpmlog(RPMERR_QUERYINFO, _("invalid package number: %s\n"), arg); + rpmlog(RPMLOG_NOTICE, _("invalid package number: %s\n"), arg); return 1; } rpmlog(RPMLOG_DEBUG, _("package record number: %u\n"), recOffset); /* RPMDBI_PACKAGES */ qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &recOffset, sizeof(recOffset)); if (qva->qva_mi == NULL) { - rpmlog(RPMERR_QUERYINFO, + rpmlog(RPMLOG_NOTICE, _("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) { - rpmlog(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg); + rpmlog(RPMLOG_NOTICE, _("package %s is not installed\n"), arg); res = 1; } else { qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_LABEL, arg, 0); diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 51a400cfe..b2114ecd6 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -44,7 +44,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)) { - rpmlog(RPMERR_OPEN, _("%s: open failed: %s\n"), *fnp, + rpmlog(RPMLOG_ERR, _("%s: open failed: %s\n"), *fnp, Fstrerror(fd)); return 1; } @@ -56,7 +56,7 @@ static int manageFile(FD_t *fdp, if (*fdp == NULL && (fnp == NULL || *fnp == NULL)) { fn = NULL; if (makeTempFile(NULL, (fnp ? &fn : NULL), &fd)) { - rpmlog(RPMERR_MAKETEMP, _("makeTempFile failed\n")); + rpmlog(RPMLOG_ERR, _("makeTempFile failed\n")); return 1; } if (fnp != NULL) @@ -92,17 +92,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) { - rpmlog(RPMERR_FWRITE, _("%s: Fwrite failed: %s\n"), *tfnp, + rpmlog(RPMLOG_ERR, _("%s: Fwrite failed: %s\n"), *tfnp, Fstrerror(*tfdp)); goto exit; } } if (count < 0) { - rpmlog(RPMERR_FREAD, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp)); + rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp)); goto exit; } if (Fflush(*tfdp) != 0) { - rpmlog(RPMERR_FWRITE, _("%s: Fflush failed: %s\n"), *tfnp, + rpmlog(RPMLOG_ERR, _("%s: Fflush failed: %s\n"), *tfnp, Fstrerror(*tfdp)); } @@ -181,16 +181,16 @@ static int rpmReSign(rpmts ts, memset(l, 0, sizeof(*l)); rc = readLead(fd, l); if (rc != RPMRC_OK) { - rpmlog(RPMERR_READLEAD, _("%s: not an rpm package\n"), rpm); + rpmlog(RPMLOG_ERR, _("%s: not an rpm package\n"), rpm); goto exit; } switch (l->major) { case 1: - rpmlog(RPMERR_BADSIGTYPE, _("%s: Can't sign v1 packaging\n"), rpm); + rpmlog(RPMLOG_ERR, _("%s: Can't sign v1 packaging\n"), rpm); goto exit; break; case 2: - rpmlog(RPMERR_BADSIGTYPE, _("%s: Can't re-sign v2 packaging\n"), rpm); + rpmlog(RPMLOG_ERR, _("%s: Can't re-sign v2 packaging\n"), rpm); goto exit; break; default: @@ -201,14 +201,14 @@ static int rpmReSign(rpmts ts, rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg); switch (rc) { default: - rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), rpm, + rpmlog(RPMLOG_ERR, _("%s: rpmReadSignature failed: %s"), rpm, (msg && *msg ? msg : "\n")); msg = _free(msg); goto exit; break; case RPMRC_OK: if (sigh == NULL) { - rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm); + rpmlog(RPMLOG_ERR, _("%s: No signature available\n"), rpm); goto exit; } break; @@ -341,13 +341,13 @@ static int rpmReSign(rpmts ts, l->signature_type = RPMSIGTYPE_HEADERSIG; rc = writeLead(ofd, l); if (rc != RPMRC_OK) { - rpmlog(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm, + rpmlog(RPMLOG_ERR, _("%s: writeLead failed: %s\n"), trpm, Fstrerror(ofd)); goto exit; } if (rpmWriteSignature(ofd, sigh)) { - rpmlog(RPMERR_SIGGEN, _("%s: rpmWriteSignature failed: %s\n"), trpm, + rpmlog(RPMLOG_ERR, _("%s: rpmWriteSignature failed: %s\n"), trpm, Fstrerror(ofd)); goto exit; } @@ -432,19 +432,19 @@ static int rpmcliImportPubkeys(const rpmts ts, /* Read pgp packet. */ if ((rc = pgpReadPkts(fn, &pkt, &pktlen)) <= 0) { - rpmlog(RPMERR_IMPORT, _("%s: import read failed(%d).\n"), fn, rc); + rpmlog(RPMLOG_ERR, _("%s: import read failed(%d).\n"), fn, rc); res++; continue; } if (rc != PGPARMOR_PUBKEY) { - rpmlog(RPMERR_IMPORT, _("%s: not an armored public key.\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: not an armored public key.\n"), fn); res++; continue; } /* Import pubkey packet(s). */ if ((rpmrc = rpmtsImportPubkey(ts, pkt, pktlen)) != RPMRC_OK) { - rpmlog(RPMERR_IMPORT, _("%s: import failed.\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: import failed.\n"), fn); res++; continue; } @@ -475,7 +475,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) { - rpmlog(RPMERR_FREAD, _("%s: headerRead failed\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: headerRead failed\n"), fn); goto exit; } @@ -489,7 +489,7 @@ static int readFile(FD_t fd, const char * fn, pgpDig dig) || uh == NULL) { h = headerFree(h); - rpmlog(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: headerGetEntry failed\n"), fn); goto exit; } dig->hdrsha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE); @@ -507,7 +507,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) { - rpmlog(RPMERR_FREAD, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd)); + rpmlog(RPMLOG_ERR, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd)); goto exit; } fdStealDigest(fd, dig); @@ -546,13 +546,13 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, memset(l, 0, sizeof(*l)); rc = readLead(fd, l); if (rc != RPMRC_OK) { - rpmlog(RPMERR_READLEAD, _("%s: not an rpm package\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: not an rpm package\n"), fn); res++; goto exit; } switch (l->major) { case 1: - rpmlog(RPMERR_BADSIGTYPE, _("%s: No signature available (v1.0 RPM)\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: No signature available (v1.0 RPM)\n"), fn); res++; goto exit; break; @@ -564,7 +564,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg); switch (rc) { default: - rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn, + rpmlog(RPMLOG_ERR, _("%s: rpmReadSignature failed: %s"), fn, (msg && *msg ? msg : "\n")); msg = _free(msg); res++; @@ -572,7 +572,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, break; case RPMRC_OK: if (sigh == NULL) { - rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), fn); + rpmlog(RPMLOG_ERR, _("%s: No signature available\n"), fn); res++; goto exit; } @@ -659,7 +659,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, (_print_pkts & rpmIsDebug())); if (sigp->version != 3 && sigp->version != 4) { - rpmlog(RPMERR_SIGVFY, + rpmlog(RPMLOG_NOTICE, _("skipping package %s with unverifiable V%u signature\n"), fn, sigp->version); res++; @@ -821,9 +821,9 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, if (res2) { if (rpmIsVerbose()) { - rpmlog(RPMERR_SIGVFY, "%s", buf); + rpmlog(RPMLOG_NOTICE, "%s", buf); } else { - rpmlog(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf, + rpmlog(RPMLOG_NOTICE, "%s%s%s%s%s%s%s%s\n", buf, _("NOT OK"), (missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "", missingKeys, @@ -835,9 +835,9 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, } } else { if (rpmIsVerbose()) { - rpmlog(RPMERR_SIGVFY, "%s", buf); + rpmlog(RPMLOG_NOTICE, "%s", buf); } else { - rpmlog(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf, + rpmlog(RPMLOG_NOTICE, "%s%s%s%s%s%s%s%s\n", buf, _("OK"), (missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "", missingKeys, @@ -886,7 +886,7 @@ int rpmcliSign(rpmts ts, QVA_t qva, const char ** argv) fd = Fopen(arg, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("%s: open failed: %s\n"), + rpmlog(RPMLOG_ERR, _("%s: open failed: %s\n"), arg, Fstrerror(fd)); res++; } else if (rpmVerifySignatures(qva, ts, fd, arg)) { diff --git a/lib/rpmgi.c b/lib/rpmgi.c index 17f773a32..ff115fbf3 100644 --- a/lib/rpmgi.c +++ b/lib/rpmgi.c @@ -61,7 +61,7 @@ static FD_t rpmgiOpen(const char * path, const char * fmode) FD_t fd = Fopen(fn, fmode); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), fn, Fstrerror(fd)); + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), fn, Fstrerror(fd)); if (fd != NULL) (void) Fclose(fd); fd = NULL; } @@ -319,7 +319,7 @@ fprintf(stderr, "*** gi %p\tmi %p\n", gi, gi->mi); *ae++ = '\0'; tag = rpmTagGetValue(a); if (tag < 0) { - rpmlog(RPMERR_QUERYINFO, _("unknown tag: \"%s\"\n"), a); + rpmlog(RPMLOG_NOTICE, _("unknown tag: \"%s\"\n"), a); res = 1; } pat = ae; diff --git a/lib/rpminstall.c b/lib/rpminstall.c index af38ca50d..059d33644 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -92,7 +92,7 @@ void * rpmShowProgress(const void * arg, fd = Fopen(filename, "r.ufdio"); /* FIX: still necessary? */ if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), filename, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), filename, Fstrerror(fd)); if (fd != NULL) { xx = Fclose(fd); @@ -300,7 +300,7 @@ const char * fileURL = NULL; av = _free(av); ac = 0; rc = rpmGlob(*eiu->fnp, &ac, &av); if (rc || ac == 0) { - rpmlog(RPMERR_OPEN, _("File not found by glob: %s\n"), *eiu->fnp); + rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), *eiu->fnp); continue; } @@ -421,7 +421,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)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *eiu->fnp, Fstrerror(eiu->fd)); if (eiu->fd != NULL) { xx = Fclose(eiu->fd); @@ -553,7 +553,7 @@ maybe_manifest: /* Try to read a package manifest. */ eiu->fd = Fopen(*eiu->fnp, "r.fpio"); if (eiu->fd == NULL || Ferror(eiu->fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *eiu->fnp, Fstrerror(eiu->fd)); if (eiu->fd != NULL) { xx = Fclose(eiu->fd); @@ -567,7 +567,7 @@ maybe_manifest: /* FIX: *eiu->argv can be NULL */ rc = rpmReadPackageManifest(eiu->fd, &eiu->argc, &eiu->argv); if (rc != RPMRC_OK) - rpmlog(RPMERR_MANIFEST, _("%s: not an rpm package (or package manifest): %s\n"), + rpmlog(RPMLOG_NOTICE, _("%s: not an rpm package (or package manifest): %s\n"), *eiu->fnp, Fstrerror(eiu->fd)); xx = Fclose(eiu->fd); eiu->fd = NULL; diff --git a/lib/rpmlead.c b/lib/rpmlead.c index 554662cf1..b556ab703 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -43,7 +43,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)) { - rpmlog(RPMERR_READ, _("read failed: %s (%d)\n"), + rpmlog(RPMLOG_ERR, _("read failed: %s (%d)\n"), Fstrerror(fd), errno); return RPMRC_FAIL; } diff --git a/lib/rpmrc.c b/lib/rpmrc.c index d4190e457..a46bd48fb 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -189,10 +189,10 @@ static int machCompatCacheAdd(char * name, const char * fn, int linenum, chptr = name; while (*chptr && *chptr != ':') chptr++; if (!*chptr) { - rpmlog(RPMERR_RPMRC, _("missing second ':' at %s:%d\n"), fn, linenum); + rpmlog(RPMLOG_ERR, _("missing second ':' at %s:%d\n"), fn, linenum); return 1; } else if (chptr == name) { - rpmlog(RPMERR_RPMRC, _("missing architecture name at %s:%d\n"), fn, + rpmlog(RPMLOG_ERR, _("missing architecture name at %s:%d\n"), fn, linenum); return 1; } @@ -337,22 +337,22 @@ static int addCanon(canonEntry * table, int * tableLen, char * line, tshort_name = strtok(NULL, " \t"); s = strtok(NULL, " \t"); if (! (tname && tshort_name && s)) { - rpmlog(RPMERR_RPMRC, _("Incomplete data line at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("Incomplete data line at %s:%d\n"), fn, lineNum); - return RPMERR_RPMRC; + return RPMLOG_ERR; } if (strtok(NULL, " \t")) { - rpmlog(RPMERR_RPMRC, _("Too many args in data line at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("Too many args in data line at %s:%d\n"), fn, lineNum); - return RPMERR_RPMRC; + return RPMLOG_ERR; } /* LCL: s != NULL here. */ tnum = strtoul(s, &s1, 10); if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) { - rpmlog(RPMERR_RPMRC, _("Bad arch/os number: %s (%s:%d)\n"), s, + rpmlog(RPMLOG_ERR, _("Bad arch/os number: %s (%s:%d)\n"), s, fn, lineNum); - return(RPMERR_RPMRC); + return(RPMLOG_ERR); } t[0].name = xstrdup(tname); @@ -381,14 +381,14 @@ static int addDefault(defaultEntry * table, int * tableLen, char * line, t->name = strtok(line, ": \t"); t->defName = strtok(NULL, " \t"); if (! (t->name && t->defName)) { - rpmlog(RPMERR_RPMRC, _("Incomplete default line at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("Incomplete default line at %s:%d\n"), fn, lineNum); - return RPMERR_RPMRC; + return RPMLOG_ERR; } if (strtok(NULL, " \t")) { - rpmlog(RPMERR_RPMRC, _("Too many args in default line at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("Too many args in default line at %s:%d\n"), fn, lineNum); - return RPMERR_RPMRC; + return RPMLOG_ERR; } t->name = xstrdup(t->name); @@ -516,7 +516,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) */ - rpmlog(RPMERR_RPMRC, _("Failed to read %s: %s.\n"), urlfn, + rpmlog(RPMLOG_ERR, _("Failed to read %s: %s.\n"), urlfn, Fstrerror(fd)); rc = 1; } else @@ -553,7 +553,7 @@ static int doReadRC( FD_t fd, const char * urlfn) } if (*se != ':') { - rpmlog(RPMERR_RPMRC, _("missing ':' (found 0x%02x) at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("missing ':' (found 0x%02x) at %s:%d\n"), (unsigned)(0xff & *se), urlfn, linenum); return 1; } @@ -570,7 +570,7 @@ static int doReadRC( FD_t fd, const char * urlfn) arch = val = fn = NULL; if (*se == '\0') { - rpmlog(RPMERR_RPMRC, _("missing argument for %s at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("missing argument for %s at %s:%d\n"), option->name, urlfn, linenum); return 1; } @@ -587,7 +587,7 @@ static int doReadRC( FD_t fd, const char * urlfn) fn = rpmGetPath(s, NULL); if (fn == NULL || *fn == '\0') { - rpmlog(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\"\n"), + rpmlog(RPMLOG_ERR, _("%s expansion failed at %s:%d \"%s\"\n"), option->name, urlfn, linenum, s); fn = _free(fn); return 1; @@ -595,7 +595,7 @@ static int doReadRC( FD_t fd, const char * urlfn) fdinc = Fopen(fn, "r.fpio"); if (fdinc == NULL || Ferror(fdinc)) { - rpmlog(RPMERR_RPMRC, _("cannot open %s at %s:%d: %s\n"), + rpmlog(RPMLOG_ERR, _("cannot open %s at %s:%d: %s\n"), fn, urlfn, linenum, Fstrerror(fdinc)); rc = 1; } else { @@ -613,7 +613,7 @@ static int doReadRC( FD_t fd, const char * urlfn) arch = se; while (*se && !xisspace(*se)) se++; if (*se == '\0') { - rpmlog(RPMERR_RPMRC, + rpmlog(RPMLOG_ERR, _("missing architecture for %s at %s:%d\n"), option->name, urlfn, linenum); return 1; @@ -621,7 +621,7 @@ static int doReadRC( FD_t fd, const char * urlfn) *se++ = '\0'; while (*se && xisspace(*se)) se++; if (*se == '\0') { - rpmlog(RPMERR_RPMRC, + rpmlog(RPMLOG_ERR, _("missing argument for %s at %s:%d\n"), option->name, urlfn, linenum); return 1; @@ -681,7 +681,7 @@ static int doReadRC( FD_t fd, const char * urlfn) } if (!gotit) { - rpmlog(RPMERR_RPMRC, _("bad option '%s' at %s:%d\n"), + rpmlog(RPMLOG_ERR, _("bad option '%s' at %s:%d\n"), s, urlfn, linenum); } } @@ -1630,12 +1630,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; - rpmlog(RPMERR_RPMRC, _("Cannot expand %s\n"), r); + rpmlog(RPMLOG_ERR, _("Cannot expand %s\n"), r); rc = 1; break; } if (strlen(home) > (sizeof(fn) - strlen(r))) { - rpmlog(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"), + rpmlog(RPMLOG_ERR, _("Cannot read %s, HOME is too large.\n"), r); rc = 1; break; @@ -1652,7 +1652,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; - rpmlog(RPMERR_RPMRC, _("Unable to open %s for reading: %s.\n"), + rpmlog(RPMLOG_ERR, _("Unable to open %s for reading: %s.\n"), fn, Fstrerror(fd)); rc = 1; break; diff --git a/lib/rpmts.c b/lib/rpmts.c index bc0cc46ce..3ede23269 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -264,7 +264,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, case '(': /* XXX Fail if nested parens. */ if (level++ != 0) { - rpmlog(RPMERR_QFMT, _("extra '(' in package label: %s\n"), keyp); + rpmlog(RPMLOG_ERR, _("extra '(' in package label: %s\n"), keyp); return NULL; } /* Parse explicit epoch. */ @@ -282,7 +282,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, case ')': /* XXX Fail if nested parens. */ if (--level != 0) { - rpmlog(RPMERR_QFMT, _("missing '(' in package label: %s\n"), keyp); + rpmlog(RPMLOG_ERR, _("missing '(' in package label: %s\n"), keyp); return NULL; } /* Don't copy trailing ')' */ @@ -290,7 +290,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, } } if (level) { - rpmlog(RPMERR_QFMT, _("missing ')' in package label: %s\n"), keyp); + rpmlog(RPMLOG_ERR, _("missing ')' in package label: %s\n"), keyp); return NULL; } *t = '\0'; @@ -728,7 +728,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) bh = headerFree(bh); qfmt = _free(qfmt); if (str == NULL) { - rpmlog(RPMERR_QFMT, _("incorrect format: %s\n"), errstr); + rpmlog(RPMLOG_ERR, _("incorrect format: %s\n"), errstr); goto exit; } @@ -739,7 +739,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) h = headerFree(h); fd = Fopen(str, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), str, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), str, Fstrerror(fd)); if (fd != NULL) { xx = Fclose(fd); diff --git a/lib/signature.c b/lib/signature.c index a9f2da417..19a0d1bda 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -404,9 +404,9 @@ static int makePGPSignature(const char * file, int32_t * sigTagp, break; } } - rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp", + rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "pgp", strerror(errno)); - _exit(RPMERR_EXEC); + _exit(RPMLOG_ERR); } delMacro(NULL, "__plaintext_filename"); @@ -420,14 +420,14 @@ static int makePGPSignature(const char * file, int32_t * sigTagp, (void)waitpid(pid, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rpmlog(RPMERR_SIGGEN, _("pgp failed\n")); + rpmlog(RPMLOG_ERR, _("pgp failed\n")); return 1; } if (stat(sigfile, &st)) { /* PGP failed to write signature */ if (sigfile) (void) unlink(sigfile); /* Just in case */ - rpmlog(RPMERR_SIGGEN, _("pgp failed to write signature\n")); + rpmlog(RPMLOG_ERR, _("pgp failed to write signature\n")); return 1; } @@ -446,7 +446,7 @@ static int makePGPSignature(const char * file, int32_t * sigTagp, } if (rc != *pktlenp) { *pktp = _free(*pktp); - rpmlog(RPMERR_SIGGEN, _("unable to read the signature\n")); + rpmlog(RPMLOG_ERR, _("unable to read the signature\n")); return 1; } } @@ -515,9 +515,9 @@ static int makeGPGSignature(const char * file, int32_t * sigTagp, if (!rc) rc = execve(av[0], av+1, environ); - rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg", + rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "gpg", strerror(errno)); - _exit(RPMERR_EXEC); + _exit(RPMLOG_ERR); } delMacro(NULL, "__plaintext_filename"); @@ -532,14 +532,14 @@ static int makeGPGSignature(const char * file, int32_t * sigTagp, (void) waitpid(pid, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rpmlog(RPMERR_SIGGEN, _("gpg exec failed (%d)\n"), WEXITSTATUS(status)); + rpmlog(RPMLOG_ERR, _("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 */ - rpmlog(RPMERR_SIGGEN, _("gpg failed to write signature\n")); + rpmlog(RPMLOG_ERR, _("gpg failed to write signature\n")); return 1; } @@ -558,7 +558,7 @@ static int makeGPGSignature(const char * file, int32_t * sigTagp, } if (rc != *pktlenp) { *pktp = _free(*pktp); - rpmlog(RPMERR_SIGGEN, _("unable to read the signature\n")); + rpmlog(RPMLOG_ERR, _("unable to read the signature\n")); return 1; } } @@ -808,7 +808,7 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag) if (!rc) rc = execve(av[0], av+1, environ); - rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg", + rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "gpg", strerror(errno)); } break; case RPMSIGTAG_RSA: @@ -841,13 +841,13 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag) break; } } - rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp", + rpmlog(RPMLOG_ERR, _("Could not exec %s: %s\n"), "pgp", strerror(errno)); - _exit(RPMERR_EXEC); + _exit(RPMLOG_ERR); } break; default: /* This case should have been screened out long ago. */ - rpmlog(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n")); - _exit(RPMERR_SIGGEN); + rpmlog(RPMLOG_ERR, _("Invalid %%_signature spec in macro file\n")); + _exit(RPMLOG_ERR); break; } } @@ -876,7 +876,7 @@ char * rpmGetPassPhrase(const char * prompt, const int sigTag) } if (aok) break; - rpmlog(RPMERR_SIGGEN, + rpmlog(RPMLOG_ERR, _("You must set \"%%_gpg_name\" in your macro file\n")); break; case RPMSIGTAG_RSA: @@ -888,14 +888,14 @@ char * rpmGetPassPhrase(const char * prompt, const int sigTag) } if (aok) break; - rpmlog(RPMERR_SIGGEN, + rpmlog(RPMLOG_ERR, _("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. */ - rpmlog(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n")); + rpmlog(RPMLOG_ERR, _("Invalid %%_signature spec in macro file\n")); break; } diff --git a/rpmdb/db3.c b/rpmdb/db3.c index 5112499f5..486a540ca 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -147,10 +147,10 @@ static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit) if (printit && rc) { if (msg) - rpmlog(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"), + rpmlog(RPMLOG_ERR, _("db%d error(%d) from %s: %s\n"), dbi->dbi_api, rc, msg, db_strerror(error)); else - rpmlog(RPMERR_DBERR, _("db%d error(%d): %s\n"), + rpmlog(RPMLOG_ERR, _("db%d error(%d): %s\n"), dbi->dbi_api, rc, db_strerror(error)); } @@ -1157,7 +1157,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) (dbi->dbi_eflags & DB_INIT_CDB) && !(dbi->dbi_eflags & DB_PRIVATE)) ? 0 : 1); - rpmlog( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK), + rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING), _("cannot get %s lock on %s/%s\n"), ((dbi->dbi_mode & (O_RDWR|O_WRONLY)) ? _("exclusive") : _("shared")), diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c index c7c1984da..a4ac5f2fe 100644 --- a/rpmdb/dbconfig.c +++ b/rpmdb/dbconfig.c @@ -322,7 +322,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) break; } if (opt->longName == NULL) { - rpmlog(RPMERR_DBCONFIG, + rpmlog(RPMLOG_ERR, _("unrecognized db option: \"%s\" ignored.\n"), o); continue; } @@ -359,7 +359,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) else if (!xstrncasecmp(pe, "Kb", 2)) aLong *= 1024; else if (*pe != '\0') { - rpmlog(RPMERR_DBCONFIG, + rpmlog(RPMLOG_ERR, _("%s has invalid numeric value, skipped\n"), opt->longName); continue; @@ -368,7 +368,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) if ((argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) { if (aLong == LONG_MIN || aLong == LONG_MAX) { - rpmlog(RPMERR_DBCONFIG, + rpmlog(RPMLOG_ERR, _("%s has too large or too small long value, skipped\n"), opt->longName); continue; @@ -377,7 +377,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) break; } else { if (aLong > INT_MAX || aLong < INT_MIN) { - rpmlog(RPMERR_DBCONFIG, + rpmlog(RPMLOG_ERR, _("%s has too large or too small integer value, skipped\n"), opt->longName); continue; diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index c4154dc36..8857daa2a 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -246,7 +246,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags) if (rc) { static int _printed[32]; if (!_printed[dbix & 0x1f]++) - rpmlog(RPMERR_DBOPEN, + rpmlog(RPMLOG_ERR, _("cannot open %s index using db%d - %s (%d)\n"), rpmTagGetName(rpmtag), _dbapi, (rc > 0 ? strerror(rc) : ""), rc); @@ -267,7 +267,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags) if (_dbapi <= 0) { static int _printed[32]; if (!_printed[dbix & 0x1f]++) - rpmlog(RPMERR_DBOPEN, _("cannot open %s index\n"), + rpmlog(RPMLOG_ERR, _("cannot open %s index\n"), rpmTagGetName(rpmtag)); rc = 1; goto exit; @@ -903,7 +903,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] != '%')) { - rpmlog(RPMERR_DBOPEN, _("no dbpath has been set\n")); + rpmlog(RPMLOG_ERR, _("no dbpath has been set\n")); db->db_root = _free(db->db_root); db->db_home = _free(db->db_home); db = _free(db); @@ -1139,7 +1139,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ rc = dbiGet(dbi, dbcursor, key, data, DB_SET); if (rc > 0) { - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) getting \"%s\" records from %s index\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); } @@ -1264,7 +1264,7 @@ key->size = strlen(name); if (rc == DB_NOTFOUND) { /* not found */ rc = 0; } else { /* error */ - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) getting \"%s\" records from %s index\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); rc = -1; @@ -1314,7 +1314,7 @@ key->size = strlen(name); if (rc == DB_NOTFOUND) { /* not found */ return RPMRC_NOTFOUND; } else { /* error */ - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) getting \"%s\" records from %s index\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); return RPMRC_FAIL; @@ -1499,7 +1499,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) { - rpmlog(RPMERR_DBPUTINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) storing record #%d into %s\n"), rc, mi->mi_prevoffset, rpmTagGetName(dbi->dbi_rpmtag)); } @@ -1600,7 +1600,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'; - rpmlog(RPMERR_REGEXEC, "%s: regexec failed: %s\n", + rpmlog(RPMLOG_ERR, "%s: regexec failed: %s\n", mire->pattern, msg); rc = -1; } @@ -1781,7 +1781,7 @@ int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag, char msg[256]; (void) regerror(rc, preg, msg, sizeof(msg)-1); msg[sizeof(msg)-1] = '\0'; - rpmlog(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg); + rpmlog(RPMLOG_ERR, "%s: regcomp failed: %s\n", allpat, msg); } break; case RPMMIRE_GLOB: @@ -2144,7 +2144,7 @@ if (dbiByteSwapped(dbi) == 1) mi->mi_h = headerCopyLoad(uh); #endif if (mi->mi_h == NULL || !headerIsEntry(mi->mi_h, RPMTAG_NAME)) { - rpmlog(RPMERR_BADHEADER, + rpmlog(RPMLOG_ERR, _("rpmdb: damaged header #%u retrieved -- skipping.\n"), mi->mi_offset); goto top; @@ -2218,7 +2218,7 @@ static int rpmdbGrowIterator(rpmdbMatchIterator mi, int fpNum) if (rc) { /* error/not found */ if (rc != DB_NOTFOUND) - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) getting \"%s\" records from %s index\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); #ifdef SQLITE_HACK @@ -2337,7 +2337,7 @@ if (key->data && key->size == 0) key->size++; /* XXX "/" fixup. */ rc = dbiGet(dbi, dbcursor, key, data, DB_SET); if (rc > 0) { - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) getting \"%s\" records from %s index\n"), rc, (key->data ? key->data : "???"), rpmTagGetName(dbi->dbi_rpmtag)); } @@ -2439,7 +2439,7 @@ memset(data, 0, sizeof(*data)); } if (h == NULL) { - rpmlog(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"), + rpmlog(RPMLOG_ERR, _("%s: cannot read header at 0x%x\n"), "rpmdbRemove", hdrNum); return 1; } @@ -2496,7 +2496,7 @@ if (dbiByteSwapped(dbi) == 1) rc = dbiCopen(dbi, dbi->dbi_txnid, &dbcursor, DB_WRITECURSOR); rc = dbiGet(dbi, dbcursor, key, data, DB_SET); if (rc) { - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) setting header #%d record for %s removal\n"), rc, hdrNum, rpmTagGetName(dbi->dbi_rpmtag)); } else @@ -2627,7 +2627,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ } else if (rc == DB_NOTFOUND) { /* not found */ continue; } else { /* error */ - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) setting \"%s\" records from %s index\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); ret += 1; @@ -2646,7 +2646,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ (void) set2dbt(dbi, data, set); rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST); if (rc) { - rpmlog(RPMERR_DBPUTINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) storing record \"%s\" into %s\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); ret += 1; @@ -2656,7 +2656,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ } else { rc = dbiDel(dbi, dbcursor, key, data, 0); if (rc) { - rpmlog(RPMERR_DBPUTINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) removing record \"%s\" from %s\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); ret += 1; @@ -2806,7 +2806,7 @@ memset(data, 0, sizeof(*data)); } if (ret) { - rpmlog(RPMERR_DBCORRUPT, + rpmlog(RPMLOG_ERR, _("error(%d) allocating new package instance\n"), ret); goto exit; } @@ -3035,7 +3035,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 */ - rpmlog(RPMERR_DBGETINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) getting \"%s\" records from %s index\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); ret += 1; @@ -3051,7 +3051,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST); if (rc) { - rpmlog(RPMERR_DBPUTINDEX, + rpmlog(RPMLOG_ERR, _("error(%d) storing record %s into %s\n"), rc, key->data, rpmTagGetName(dbi->dbi_rpmtag)); ret += 1; @@ -3469,7 +3469,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, rootdbpath, newrootdbpath); if (!access(newrootdbpath, F_OK)) { - rpmlog(RPMERR_MKDIR, _("temporary database %s already exists\n"), + rpmlog(RPMLOG_ERR, _("temporary database %s already exists\n"), newrootdbpath); rc = 1; goto exit; @@ -3477,7 +3477,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, rpmlog(RPMLOG_DEBUG, _("creating directory %s\n"), newrootdbpath); if (Mkdir(newrootdbpath, 0755)) { - rpmlog(RPMERR_MKDIR, _("creating directory %s: %s\n"), + rpmlog(RPMLOG_ERR, _("creating directory %s: %s\n"), newrootdbpath, strerror(errno)); rc = 1; goto exit; @@ -3523,7 +3523,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, headerIsEntry(h, RPMTAG_RELEASE) && headerIsEntry(h, RPMTAG_BUILDTIME))) { - rpmlog(RPMERR_INTERNAL, + rpmlog(RPMLOG_ERR, _("header #%u in the database is bad -- skipping.\n"), _RECNUM); continue; @@ -3561,7 +3561,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, } if (rc) { - rpmlog(RPMERR_INTERNAL, + rpmlog(RPMLOG_ERR, _("cannot add record originally at %u\n"), _RECNUM); failed = 1; break; diff --git a/rpmio/macro.c b/rpmio/macro.c index fc31367aa..57c5703aa 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -485,7 +485,7 @@ doShellEscape(MacroBuf mb, const char * cmd, size_t clen) int c; if (clen >= sizeof(pcmd)) { - rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMLOG_ERR, _("Target buffer overflow\n")); return 1; } @@ -544,7 +544,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) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Macro %%%s has unterminated body\n"), n); se = s; /* XXX W2DO? */ return se; @@ -582,7 +582,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody) *be = '\0'; if (bc || pc) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Macro %%%s has unterminated body\n"), n); se = s; /* XXX W2DO? */ return se; @@ -601,24 +601,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)) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Macro %%%s has illegal name (%%define)\n"), n); return se; } /* Options must be terminated with ')' */ if (o && oc != ')') { - rpmlog(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n); + rpmlog(RPMLOG_ERR, _("Macro %%%s has unterminated opts\n"), n); return se; } if ((be - b) < 1) { - rpmlog(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n); + rpmlog(RPMLOG_ERR, _("Macro %%%s has empty body\n"), n); return se; } if (expandbody && expandU(mb, b, (&buf[sizeof(buf)] - b))) { - rpmlog(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n); + rpmlog(RPMLOG_ERR, _("Macro %%%s failed to expand\n"), n); return se; } @@ -649,7 +649,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)) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Macro %%%s has illegal name (%%undefine)\n"), n); return se; } @@ -750,7 +750,7 @@ freeArgs(MacroBuf mb) skiptest = 1; /* XXX skip test for %# %* %0 */ } else if (!skiptest && me->used <= 0) { #if NOTYET - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Macro %%%s (%s) was not used below level %d\n"), me->name, me->body, me->level); #endif @@ -870,7 +870,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) { - rpmlog(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"), + rpmlog(RPMLOG_ERR, _("Unknown option %c in %s(%s)\n"), (char)c, me->name, opts); return se; } @@ -925,14 +925,14 @@ doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen) char buf[BUFSIZ]; if (msglen >= sizeof(buf)) { - rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMLOG_ERR, _("Target buffer overflow\n")); msglen = sizeof(buf) - 1; } strncpy(buf, msg, msglen); buf[msglen] = '\0'; (void) expandU(mb, buf, sizeof(buf)); if (waserror) - rpmlog(RPMERR_BADSPEC, "%s\n", buf); + rpmlog(RPMLOG_ERR, "%s\n", buf); else fprintf(stderr, "%s", buf); } @@ -956,7 +956,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn, buf[0] = '\0'; if (g != NULL) { if (gn >= sizeof(buf)) { - rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMLOG_ERR, _("Target buffer overflow\n")); gn = sizeof(buf) - 1; } strncpy(buf, g, gn); @@ -1064,7 +1064,7 @@ expandMacro(MacroBuf mb) int chkexist; if (++mb->depth > max_macro_depth) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Recursion depth(%d) greater than max(%d)\n"), mb->depth, max_macro_depth); mb->depth--; @@ -1133,7 +1133,7 @@ expandMacro(MacroBuf mb) break; case '(': /* %(...) shell escape */ if ((se = matchchar(s, c, ')')) == NULL) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Unterminated %c: %s\n"), (char)c, s); rc = 1; continue; @@ -1150,7 +1150,7 @@ expandMacro(MacroBuf mb) break; case '{': /* %{...}/%{...:...} substitution */ if ((se = matchchar(s, c, '}')) == NULL) { - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Unterminated %c: %s\n"), (char)c, s); rc = 1; continue; @@ -1191,7 +1191,7 @@ expandMacro(MacroBuf mb) c = '%'; /* XXX only need to save % */ SAVECHAR(mb, c); #if 0 - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("A %% is followed by an unparseable macro\n")); #endif s = se; @@ -1347,7 +1347,7 @@ expandMacro(MacroBuf mb) c = '%'; /* XXX only need to save % */ SAVECHAR(mb, c); #else - rpmlog(RPMERR_BADSPEC, + rpmlog(RPMLOG_ERR, _("Macro %%%.*s not found, skipping\n"), fn, f); s = se; #endif @@ -1664,7 +1664,7 @@ expandMacros(void * spec, rpmMacroContext mc, char * sbuf, size_t slen) rc = expandMacro(mb); if (mb->nb == 0) - rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMLOG_ERR, _("Target buffer overflow\n")); tbuf[slen] = '\0'; /* XXX just in case */ strncpy(sbuf, tbuf, (slen - mb->nb + 1)); @@ -1867,16 +1867,16 @@ int isCompressed(const char * file, rpmCompressedMagic * compressed) fd = Fopen(file, "r.ufdio"); if (fd == NULL || Ferror(fd)) { /* XXX Fstrerror */ - rpmlog(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); + rpmlog(RPMLOG_ERR, _("File %s: %s\n"), file, Fstrerror(fd)); if (fd) (void) Fclose(fd); return 1; } nb = Fread(magic, sizeof(magic[0]), sizeof(magic), fd); if (nb < 0) { - rpmlog(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); + rpmlog(RPMLOG_ERR, _("File %s: %s\n"), file, Fstrerror(fd)); rc = 1; } else if (nb < sizeof(magic)) { - rpmlog(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"), + rpmlog(RPMLOG_ERR, _("File %s is smaller than %u bytes\n"), file, (unsigned)sizeof(magic)); rc = 0; } diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 2f2085d14..c4aae2941 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -813,7 +813,7 @@ static FD_t urlOpen(const char * url, int flags, mode_t mode) wait = waitpid(pid, &rc, 0); if (!WIFEXITED(rc) || WEXITSTATUS(rc)) { - rpmlog(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"), + rpmlog(RPMLOG_ERR, _("URL helper failed: %s (%d)\n"), cmd, WEXITSTATUS(rc)); } else { fd = fdOpen(dest, flags, mode); diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c index 8f2c8c6b3..d73dc0e95 100644 --- a/rpmio/rpmlua.c +++ b/rpmio/rpmlua.c @@ -447,7 +447,7 @@ int rpmluaCheckScript(rpmlua _lua, const char *script, const char *name) if (name == NULL) name = ""; if (luaL_loadbuffer(L, script, strlen(script), name) != 0) { - rpmlog(RPMERR_SCRIPT, + rpmlog(RPMLOG_ERR, _("invalid syntax in lua scriptlet: %s\n"), lua_tostring(L, -1)); ret = -1; @@ -464,12 +464,12 @@ int rpmluaRunScript(rpmlua _lua, const char *script, const char *name) if (name == NULL) name = ""; if (luaL_loadbuffer(L, script, strlen(script), name) != 0) { - rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"), + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"), + rpmlog(RPMLOG_ERR, _("lua script failed: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); ret = -1; @@ -483,12 +483,12 @@ int rpmluaRunScriptFile(rpmlua _lua, const char *filename) lua_State *L = lua->L; int ret = 0; if (luaL_loadfile(L, filename) != 0) { - rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"), + rpmlog(RPMLOG_ERR, _("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) { - rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"), + rpmlog(RPMLOG_ERR, _("lua script failed: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); ret = -1; @@ -618,7 +618,7 @@ static int rpmluaHookWrapper(rpmhookArgs args, void *data) } } if (lua_pcall(L, 1, 1, 0) != 0) { - rpmlog(RPMERR_SCRIPT, _("lua hook failed: %s\n"), + rpmlog(RPMLOG_ERR, _("lua hook failed: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); } else { diff --git a/tools/rpmgraph.c b/tools/rpmgraph.c index 63f95fa00..cb804f4dc 100644 --- a/tools/rpmgraph.c +++ b/tools/rpmgraph.c @@ -115,7 +115,7 @@ restart: /* Try to read the header from a package file. */ fd = Fopen(*fnp, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *fnp, Fstrerror(fd)); if (fd) { Fclose(fd); @@ -152,7 +152,7 @@ maybe_manifest: /* Try to read a package manifest. */ fd = Fopen(*fnp, "r.fpio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *fnp, Fstrerror(fd)); if (fd) { Fclose(fd); @@ -165,7 +165,7 @@ maybe_manifest: /* Read list of packages from manifest. */ rc = rpmReadPackageManifest(fd, &argc, &argv); if (rc) - rpmlog(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"), + rpmlog(RPMLOG_NOTICE, _("%s: read manifest failed: %s\n"), fileURL, Fstrerror(fd)); Fclose(fd); fd = NULL; diff --git a/tools/rpmsort.c b/tools/rpmsort.c index 31b2cd065..15bada78a 100644 --- a/tools/rpmsort.c +++ b/tools/rpmsort.c @@ -155,7 +155,7 @@ restart: /* Try to read the header from a package file. */ fd = Fopen(*fnp, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *fnp, Fstrerror(fd)); if (fd) Fclose(fd); numFailed++; *fnp = NULL; @@ -180,7 +180,7 @@ restart: /* Try to read a package manifest. */ fd = Fopen(*fnp, "r.fpio"); if (fd == NULL || Ferror(fd)) { - rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp, + rpmlog(RPMLOG_ERR, _("open of %s failed: %s\n"), *fnp, Fstrerror(fd)); if (fd) Fclose(fd); numFailed++; *fnp = NULL; @@ -190,7 +190,7 @@ restart: /* Read list of packages from manifest. */ rc = rpmReadPackageManifest(fd, &argc, &argv); if (rc) - rpmlog(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"), + rpmlog(RPMLOG_NOTICE, _("%s: read manifest failed: %s\n"), fileURL, Fstrerror(fd)); Fclose(fd);