fd = Fopen(specfile, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("Unable to open spec file %s: %s\n"),
+ rpmlog(RPMERR_OPEN, _("Unable to open spec file %s: %s\n"),
specfile, Fstrerror(fd));
return 0;
}
sprintf(cmd, "%s < '%s' | tar xOvf - Specfile 2>&1 > '%s'",
zcmds[res & 0x3], arg, tmpSpecFile);
if (!(fp = popen(cmd, "r"))) {
- rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
+ rpmlog(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
specDir = _free(specDir);
tmpSpecFile = _free(tmpSpecFile);
return 1;
sprintf(cmd, "%s < '%s' | tar xOvf - --wildcards \\*.spec 2>&1 > '%s'",
zcmds[res & 0x3], arg, tmpSpecFile);
if (!(fp = popen(cmd, "r"))) {
- rpmError(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
+ rpmlog(RPMERR_POPEN, _("Failed to open tar pipe: %m\n"));
specDir = _free(specDir);
tmpSpecFile = _free(tmpSpecFile);
return 1;
}
if (!fgets(buf, sizeof(buf) - 1, fp)) {
/* Give up */
- rpmError(RPMERR_READ, _("Failed to read spec file from %s\n"),
+ rpmlog(RPMERR_READ, _("Failed to read spec file from %s\n"),
arg);
(void) unlink(tmpSpecFile);
specDir = _free(specDir);
specDir = _free(specDir);
if (res) {
- rpmError(RPMERR_RENAME, _("Failed to rename %s to %s: %m\n"),
+ rpmlog(RPMERR_RENAME, _("Failed to rename %s to %s: %m\n"),
tmpSpecFile, s);
(void) unlink(tmpSpecFile);
tmpSpecFile = _free(tmpSpecFile);
if (*arg != '/') {
if (!getcwd(buf, BUFSIZ)) {
- rpmError(RPMERR_STAT, "getcwd failed: %m\n");
+ rpmlog(RPMERR_STAT, "getcwd failed: %m\n");
return 1;
}
strcat(buf, "/");
if (*specFile != '/') {
char *s = alloca(BUFSIZ);
if (!getcwd(s, BUFSIZ)) {
- rpmError(RPMERR_STAT, "getcwd failed: %m\n");
+ rpmlog(RPMERR_STAT, "getcwd failed: %m\n");
rc = 1;
goto exit;
}
if (specut != URL_IS_DASH) {
struct stat st;
if (Stat(specURL, &st) < 0) {
- rpmError(RPMERR_STAT, _("failed to stat %s: %m\n"), specURL);
+ rpmlog(RPMERR_STAT, _("failed to stat %s: %m\n"), specURL);
rc = 1;
goto exit;
}
if (! S_ISREG(st.st_mode)) {
- rpmError(RPMERR_NOTREG, _("File %s is not a regular file.\n"),
+ rpmlog(RPMERR_NOTREG, _("File %s is not a regular file.\n"),
specURL);
rc = 1;
goto exit;
/* Try to verify that the file is actually a specfile */
if (!isSpecFile(specURL)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("File %s does not appear to be a specfile.\n"), specURL);
rc = 1;
goto exit;
}
if (makeTempFile(rootURL, &scriptName, &fd) || fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_SCRIPT, _("Unable to open temp file.\n"));
+ rpmlog(RPMERR_SCRIPT, _("Unable to open temp file.\n"));
rc = RPMERR_SCRIPT;
goto exit;
}
errno = 0;
(void) execvp(argv[0], (char *const *)argv);
- rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"),
+ rpmlog(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"),
scriptName, name, strerror(errno));
_exit(-1);
rc = waitpid(child, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
- rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)\n"),
+ rpmlog(RPMERR_SCRIPT, _("Bad exit status from %s (%s)\n"),
scriptName, name);
rc = RPMERR_SCRIPT;
} else
token = TOK_EQ;
p++;
} else {
- rpmError(RPMERR_BADSPEC, _("syntax error while parsing ==\n"));
+ rpmlog(RPMERR_BADSPEC, _("syntax error while parsing ==\n"));
return -1;
}
break;
token = TOK_LOGICAL_AND;
p++;
} else {
- rpmError(RPMERR_BADSPEC, _("syntax error while parsing &&\n"));
+ rpmlog(RPMERR_BADSPEC, _("syntax error while parsing &&\n"));
return -1;
}
break;
token = TOK_LOGICAL_OR;
p++;
} else {
- rpmError(RPMERR_BADSPEC, _("syntax error while parsing ||\n"));
+ rpmlog(RPMERR_BADSPEC, _("syntax error while parsing ||\n"));
return -1;
}
break;
v = valueMakeString( rpmExpand(temp, NULL) );
} else {
- rpmError(RPMERR_BADSPEC, _("parse error in expression\n"));
+ rpmlog(RPMERR_BADSPEC, _("parse error in expression\n"));
return -1;
}
}
return NULL;
v = doLogical(state);
if (state->nextToken != TOK_CLOSE_P) {
- rpmError(RPMERR_BADSPEC, _("unmatched (\n"));
+ rpmlog(RPMERR_BADSPEC, _("unmatched (\n"));
return NULL;
}
if (rdToken(state))
return NULL;
if (! valueIsInteger(v)) {
- rpmError(RPMERR_BADSPEC, _("- only on numbers\n"));
+ rpmlog(RPMERR_BADSPEC, _("- only on numbers\n"));
return NULL;
}
return NULL;
if (! valueIsInteger(v)) {
- rpmError(RPMERR_BADSPEC, _("! only on numbers\n"));
+ rpmlog(RPMERR_BADSPEC, _("! only on numbers\n"));
return NULL;
}
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
else
v1 = valueMakeInteger(i1 / i2);
} else {
- rpmError(RPMERR_BADSPEC, _("* / not suported for strings\n"));
+ rpmlog(RPMERR_BADSPEC, _("* / not suported for strings\n"));
return NULL;
}
}
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
char *copy;
if (op == TOK_MINUS) {
- rpmError(RPMERR_BADSPEC, _("- not suported for strings\n"));
+ rpmlog(RPMERR_BADSPEC, _("- not suported for strings\n"));
return NULL;
}
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
return NULL;
if (! valueSameType(v1, v2)) {
- rpmError(RPMERR_BADSPEC, _("types must match\n"));
+ rpmlog(RPMERR_BADSPEC, _("types must match\n"));
return NULL;
}
else
v1 = valueMakeInteger(i1 || i2);
} else {
- rpmError(RPMERR_BADSPEC, _("&& and || not suported for strings\n"));
+ rpmlog(RPMERR_BADSPEC, _("&& and || not suported for strings\n"));
return NULL;
}
}
/* If the next token is not TOK_EOF, we have a syntax error. */
if (state.nextToken != TOK_EOF) {
- rpmError(RPMERR_BADSPEC, _("syntax error in expression\n"));
+ rpmlog(RPMERR_BADSPEC, _("syntax error in expression\n"));
state.str = _free(state.str);
return -1;
}
/* If the next token is not TOK_EOF, we have a syntax error. */
if (state.nextToken != TOK_EOF) {
- rpmError(RPMERR_BADSPEC, _("syntax error in expression\n"));
+ rpmlog(RPMERR_BADSPEC, _("syntax error in expression\n"));
state.str = _free(state.str);
return NULL;
}
SKIPSPACE(pe);
if (*pe != '(') {
- rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
+ rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
{};
if (*pe == '\0') {
- rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
+ rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
if (!strcmp(p, "not")) {
negated ^= 1;
} else {
- rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
+ rpmlog(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
exit:
if (rc) {
- rpmError(RPMERR_BADSPEC, _("Missing %s in %s %s\n"), errstr, name, p);
+ rpmlog(RPMERR_BADSPEC, _("Missing %s in %s %s\n"), errstr, name, p);
fl->processingFailed = 1;
}
return rc;
SKIPSPACE(pe);
if (*pe != '(') {
- rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
+ rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
q++;
SKIPSPACE(q);
if (*q != '\0') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Non-white space follows %s(): %s\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') {
- rpmError(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q);
+ rpmlog(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
unsigned int ui;
x = sscanf(ar->ar_fmodestr, "%o", &ui);
if ((x == 0) || (ar->ar_fmode & ~MYALLPERMS)) {
- rpmError(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)\n"), name, q);
+ rpmlog(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
unsigned int ui;
x = sscanf(ar->ar_dmodestr, "%o", &ui);
if ((x == 0) || (ar->ar_dmode & ~MYALLPERMS)) {
- rpmError(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)\n"), name, q);
+ rpmlog(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)\n"), name, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
{};
if (*pe == '\0') {
- rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
+ rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
} else if (!strcmp(p, "noreplace")) {
fl->currentFlags |= RPMFILE_NOREPLACE;
} else {
- rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
+ rpmlog(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
SKIPSPACE(pe);
if (*pe != '(') {
- rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
+ rpmlog(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
{};
if (*pe == '\0') {
- rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
+ rpmlog(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
/* Sanity check on locale lengths */
if (np < 1 || (np == 1 && *p != 'C') || np >= 32) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Unusual locale length: \"%.*s\" in %%lang(%s)\n"),
(int)np, p, q);
fl->processingFailed = 1;
for (i = 0; i < fl->nLangs; i++) {
if (strncmp(fl->currentLangs[i], p, np))
continue;
- rpmError(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"),
+ rpmlog(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"),
(int)np, p, q);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
if (!strcmp(s, "%docdir")) {
s = strtokWithQuotes(NULL, " \t\n");
if (fl->docDirCount == MAXDOCDIR) {
- rpmError(RPMERR_INTERNAL, _("Hit limit for %%docdir\n"));
+ rpmlog(RPMERR_INTERNAL, _("Hit limit for %%docdir\n"));
fl->processingFailed = 1;
res = 1;
}
if (s != NULL)
fl->docDirs[fl->docDirCount++] = xstrdup(s);
if (s == NULL || strtokWithQuotes(NULL, " \t\n")) {
- rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir\n"));
+ rpmlog(RPMERR_INTERNAL, _("Only one arg for %%docdir\n"));
fl->processingFailed = 1;
res = 1;
}
if (*fileName) {
/* We already got a file -- error */
- rpmError(RPMERR_BADSPEC, _("Two files on one line: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Two files on one line: %s\n"),
*fileName);
fl->processingFailed = 1;
res = 1;
*fileName = s;
} else {
/* not in %doc, does not begin with / -- error */
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("File must begin with \"/\": %s\n"), s);
fl->processingFailed = 1;
res = 1;
if (specialDoc) {
if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Can't mix special %%doc with other forms: %s\n"),
(*fileName ? *fileName : ""));
fl->processingFailed = 1;
}
fmt = headerSprintf(pkg->header, _docdir_fmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (!fmt) {
- rpmError(RPMERR_BADSPEC, _("illegal _docdir_fmt: %s\n"), errstr);
+ rpmlog(RPMERR_BADSPEC, _("illegal _docdir_fmt: %s\n"), errstr);
fl->processingFailed = 1;
res = 1;
}
if (buf[0] == '/' && strcmp(buildRoot, "/") &&
!strncmp(buf, buildRoot, strlen(buildRoot))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Symlink points to BuildRoot: %s -> %s\n"),
flp->fileURL, buf);
fl->processingFailed = 1;
prefixTest++;
}
if (*prefixPtr || (*prefixTest && *prefixTest != '/')) {
- rpmError(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"),
fl->prefix, fileURL);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
statp->st_mtime = now;
statp->st_ctime = now;
} else if (Lstat(diskURL, statp)) {
- rpmError(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL);
+ rpmlog(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL);
fl->processingFailed = 1;
return RPMERR_BADSPEC;
}
switch (tag) {
default:
- rpmError(RPMERR_BADSPEC, _("%s: can't load unknown tag (%d).\n"),
+ rpmlog(RPMERR_BADSPEC, _("%s: can't load unknown tag (%d).\n"),
fn, tag);
goto exit;
break;
case RPMTAG_PUBKEYS:
if ((rc = pgpReadPkts(fn, (const byte **)&pkt, (size_t *)&pktlen)) <= 0) {
- rpmError(RPMERR_BADSPEC, _("%s: public key read failed.\n"), fn);
+ rpmlog(RPMERR_BADSPEC, _("%s: public key read failed.\n"), fn);
goto exit;
}
if (rc != PGPARMOR_PUBKEY) {
- rpmError(RPMERR_BADSPEC, _("%s: not an armored public key.\n"), fn);
+ rpmlog(RPMERR_BADSPEC, _("%s: not an armored public key.\n"), fn);
goto exit;
}
apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen);
break;
case RPMTAG_POLICIES:
if ((rc = rpmioSlurp(fn, &pkt, &pktlen)) != 0) {
- rpmError(RPMERR_BADSPEC, _("%s: *.te policy read failed.\n"), fn);
+ rpmlog(RPMERR_BADSPEC, _("%s: *.te policy read failed.\n"), fn);
goto exit;
}
apkt = (const char *) pkt; /* XXX unsigned char */
{ const char * fileName;
(void) urlPath(fileURL, &fileName);
if (*fileName != '/') {
- rpmError(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"),
fileName);
rc = 1;
goto exit;
/* XXX for %dev marker in file manifest only */
if (fl->noGlob) {
- rpmError(RPMERR_BADSPEC, _("Glob not permitted: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Glob not permitted: %s\n"),
diskURL);
rc = 1;
goto exit;
}
argv = _free(argv);
} else {
- rpmError(RPMERR_BADSPEC, _("File not found by glob: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("File not found by glob: %s\n"),
diskURL);
rc = 1;
goto exit;
fd = Fopen(ffn, "r.fpio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open %%files file %s: %s\n"),
ffn, Fstrerror(fd));
return RPMERR_BADFILENAME;
while (fgets(buf, sizeof(buf), f)) {
handleComments(buf);
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
- rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf);
+ rpmlog(RPMERR_BADSPEC, _("line: %s\n"), buf);
return RPMERR_BADSPEC;
}
appendStringBuf(pkg->fileList, buf);
flp->verifyFlags = RPMVERIFY_ALL;
if (Stat(diskURL, &flp->fl_st)) {
- rpmError(RPMERR_BADSPEC, _("Bad file: %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Bad file: %s: %s\n"),
diskURL, strerror(errno));
fl.processingFailed = 1;
}
fl.totalFileSize += flp->fl_size;
if (! (flp->uname && flp->gname)) {
- rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL);
+ rpmlog(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL);
fl.processingFailed = 1;
}
if (rc) {
if (failedFile)
- rpmError(RPMERR_CPIO, _("create archive failed on file %s: %s\n"),
+ rpmlog(RPMERR_CPIO, _("create archive failed on file %s: %s\n"),
failedFile, cpioStrerror(rc));
else
- rpmError(RPMERR_CPIO, _("create archive failed: %s\n"),
+ rpmlog(RPMERR_CPIO, _("create archive failed: %s\n"),
cpioStrerror(rc));
rc = 1;
}
while((nb = Fread(buf, sizeof(buf[0]), sizeof(buf), csa->cpioFdIn)) > 0) {
if (Fwrite(buf, sizeof(buf[0]), nb, fdo) != nb) {
- rpmError(RPMERR_CPIO, _("cpio_copy write failed: %s\n"),
+ rpmlog(RPMERR_CPIO, _("cpio_copy write failed: %s\n"),
Fstrerror(fdo));
return 1;
}
csa->cpioArchiveSize += nb;
}
if (Ferror(csa->cpioFdIn)) {
- rpmError(RPMERR_CPIO, _("cpio_copy read failed: %s\n"),
+ rpmlog(RPMERR_CPIO, _("cpio_copy read failed: %s\n"),
Fstrerror(csa->cpioFdIn));
return 1;
}
while (fgets(buf, sizeof(buf), f)) {
/* XXX display fn in error msg */
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
- rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf);
+ rpmlog(RPMERR_BADSPEC, _("line: %s\n"), buf);
sb = freeStringBuf(sb);
break;
}
if (pkg->preInFile) {
if (addFileToTag(spec, pkg->preInFile, pkg->header, RPMTAG_PREIN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open PreIn file: %s\n"), pkg->preInFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->preUnFile) {
if (addFileToTag(spec, pkg->preUnFile, pkg->header, RPMTAG_PREUN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open PreUn file: %s\n"), pkg->preUnFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->preTransFile) {
if (addFileToTag(spec, pkg->preTransFile, pkg->header, RPMTAG_PRETRANS)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open PreIn file: %s\n"), pkg->preTransFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->postInFile) {
if (addFileToTag(spec, pkg->postInFile, pkg->header, RPMTAG_POSTIN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open PostIn file: %s\n"), pkg->postInFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->postUnFile) {
if (addFileToTag(spec, pkg->postUnFile, pkg->header, RPMTAG_POSTUN)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open PostUn file: %s\n"), pkg->postUnFile);
return RPMERR_BADFILENAME;
}
}
if (pkg->postTransFile) {
if (addFileToTag(spec, pkg->postTransFile, pkg->header, RPMTAG_POSTTRANS)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open PostUn file: %s\n"), pkg->postTransFile);
return RPMERR_BADFILENAME;
}
if (pkg->verifyFile) {
if (addFileToTag(spec, pkg->verifyFile, pkg->header,
RPMTAG_VERIFYSCRIPT)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open VerifyScript file: %s\n"), pkg->verifyFile);
return RPMERR_BADFILENAME;
}
} else if (p->fileName) {
if (addFileToArrayTag(spec, p->fileName, pkg->header,
RPMTAG_TRIGGERSCRIPTS)) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Could not open Trigger script file: %s\n"),
p->fileName);
return RPMERR_BADFILENAME;
: fdDup(STDIN_FILENO);
if (fdi == NULL || Ferror(fdi)) {
- rpmError(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"),
+ rpmlog(RPMERR_BADMAGIC, _("readRPM: open %s: %s\n"),
(fileName ? fileName : "<stdin>"),
Fstrerror(fdi));
if (fdi) (void) Fclose(fdi);
/* Get copy of lead */
if ((rc = Fread(lead, sizeof(char), sizeof(*lead), fdi)) != sizeof(*lead)) {
- rpmError(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"),
+ rpmlog(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"),
(fileName ? fileName : "<stdin>"),
Fstrerror(fdi));
return RPMERR_BADMAGIC;
/* XXX FIXME: EPIPE on <stdin> */
if (Fseek(fdi, 0, SEEK_SET) == -1) {
- rpmError(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
+ rpmlog(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
(fileName ? fileName : "<stdin>"), Fstrerror(fdi));
return RPMERR_FSEEK;
}
case RPMRC_NOTTRUSTED:
break;
case RPMRC_NOTFOUND:
- rpmError(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"),
+ rpmlog(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"),
(fileName ? fileName : "<stdin>"));
return RPMERR_BADMAGIC;
case RPMRC_FAIL:
default:
- rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"),
+ rpmlog(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"),
(fileName ? fileName : "<stdin>"));
return RPMERR_BADMAGIC;
break;
h = headerReload(h, RPMTAG_HEADERIMMUTABLE);
if (h == NULL) { /* XXX can't happen */
rc = RPMERR_RELOAD;
- rpmError(RPMERR_RELOAD, _("Unable to create immutable header region.\n"));
+ rpmlog(RPMERR_RELOAD, _("Unable to create immutable header region.\n"));
goto exit;
}
/* Re-reference reallocated header. */
*/
if (makeTempFile(NULL, &sigtarget, &fd)) {
rc = RPMERR_CREATE;
- rpmError(RPMERR_CREATE, _("Unable to open temp file.\n"));
+ rpmlog(RPMERR_CREATE, _("Unable to open temp file.\n"));
goto exit;
}
fdInitDigest(fd, PGPHASHALGO_SHA1, 0);
if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE;
- rpmError(RPMERR_NOSPACE, _("Unable to write temp header\n"));
+ rpmlog(RPMERR_NOSPACE, _("Unable to write temp header\n"));
} else { /* Write the archive and get the size */
(void) Fflush(fd);
fdFiniDigest(fd, PGPHASHALGO_SHA1, (void **)&SHA1, NULL, 1);
rc = cpio_copy(fd, csa);
} else {
rc = RPMERR_BADARG;
- rpmError(RPMERR_BADARG, _("Bad CSA data\n"));
+ rpmlog(RPMERR_BADARG, _("Bad CSA data\n"));
}
}
rpmio_flags = _free(rpmio_flags);
(void) Fflush(fd);
if (Fseek(fd, 0, SEEK_SET) == -1) {
rc = RPMERR_FSEEK;
- rpmError(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
+ rpmlog(RPMERR_FSEEK, _("%s: Fseek failed: %s\n"),
sigtarget, Fstrerror(fd));
}
fdInitDigest(fd, PGPHASHALGO_SHA1, 0);
if (headerWrite(fd, h, HEADER_MAGIC_YES)) {
rc = RPMERR_NOSPACE;
- rpmError(RPMERR_NOSPACE, _("Unable to write final header\n"));
+ rpmlog(RPMERR_NOSPACE, _("Unable to write final header\n"));
}
(void) Fflush(fd);
fdFiniDigest(fd, PGPHASHALGO_SHA1, (void **)&SHA1, NULL, 1);
sig = headerReload(sig, RPMTAG_HEADERSIGNATURES);
if (sig == NULL) { /* XXX can't happen */
rc = RPMERR_RELOAD;
- rpmError(RPMERR_RELOAD, _("Unable to reload signature header.\n"));
+ rpmlog(RPMERR_RELOAD, _("Unable to reload signature header.\n"));
goto exit;
}
fd = Fopen(fileName, "w.ufdio");
if (fd == NULL || Ferror(fd)) {
rc = RPMERR_CREATE;
- rpmError(RPMERR_CREATE, _("Could not open %s: %s\n"),
+ rpmlog(RPMERR_CREATE, _("Could not open %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
if (writeLead(fd, &lead) != RPMRC_OK) {
rc = RPMERR_NOSPACE;
- rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
+ rpmlog(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(fd));
goto exit;
}
ifd = Fopen(sigtarget, "r.ufdio");
if (ifd == NULL || Ferror(ifd)) {
rc = RPMERR_READ;
- rpmError(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"),
+ rpmlog(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"),
sigtarget, Fstrerror(ifd));
goto exit;
}
if (nh == NULL) {
rc = RPMERR_READ;
- rpmError(RPMERR_READ, _("Unable to read header from %s: %s\n"),
+ rpmlog(RPMERR_READ, _("Unable to read header from %s: %s\n"),
sigtarget, Fstrerror(ifd));
goto exit;
}
if (rc) {
rc = RPMERR_NOSPACE;
- rpmError(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"),
+ rpmlog(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) {
if (count == -1) {
rc = RPMERR_READ;
- rpmError(RPMERR_READ, _("Unable to read payload from %s: %s\n"),
+ rpmlog(RPMERR_READ, _("Unable to read payload from %s: %s\n"),
sigtarget, Fstrerror(ifd));
goto exit;
}
if (Fwrite(buf, sizeof(buf[0]), count, fd) != count) {
rc = RPMERR_NOSPACE;
- rpmError(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"),
+ rpmlog(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"),
fileName, Fstrerror(fd));
goto exit;
}
if (binRpm == NULL) {
const char *name;
(void) headerNVR(pkg->header, &name, NULL, NULL);
- rpmError(RPMERR_BADFILENAME, _("Could not generate output "
+ rpmlog(RPMERR_BADFILENAME, _("Could not generate output "
"filename for package %s: %s\n"), name, errorString);
return RPMERR_BADFILENAME;
}
if (Mkdir(dn, 0755) == 0)
break;
default:
- rpmError(RPMERR_BADFILENAME,_("cannot create %s: %s\n"),
+ rpmlog(RPMERR_BADFILENAME,_("cannot create %s: %s\n"),
dn, strerror(errno));
break;
}
}
if (*sbp != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: second %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: second %s\n"),
spec->lineNum, name);
return RPMERR_BADSPEC;
}
while (*s != '\0') {
if (*s != '*') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("%%changelog entries must start with *\n"));
return RPMERR_BADSPEC;
}
date = s;
while(*s && *s != '\n') s++;
if (! *s) {
- rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry\n"));
+ rpmlog(RPMERR_BADSPEC, _("incomplete %%changelog entry\n"));
return RPMERR_BADSPEC;
}
*s = '\0';
}
SKIPSPACE(date);
if (dateToTimet(date, &time)) {
- rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date);
+ rpmlog(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date);
return RPMERR_BADSPEC;
}
if (lastTime && lastTime < time) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("%%changelog not in descending chronological order\n"));
return RPMERR_BADSPEC;
}
/* skip space to the name */
SKIPSPACE(s);
if (! *s) {
- rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
+ rpmlog(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
return RPMERR_BADSPEC;
}
*s-- = '\0';
}
if (s == name) {
- rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
+ rpmlog(RPMERR_BADSPEC, _("missing name in %%changelog\n"));
return RPMERR_BADSPEC;
}
/* text */
SKIPSPACE(text);
if (! *text) {
- rpmError(RPMERR_BADSPEC, _("no description in %%changelog\n"));
+ rpmlog(RPMERR_BADSPEC, _("no description in %%changelog\n"));
return RPMERR_BADSPEC;
}
lang = RPMBUILD_DEFAULT_LANG;
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"),
spec->lineNum, poptStrerror(rc));
return RPMERR_BADSPEC;
}
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
goto exit;
}
if (lookupPackage(spec, name, flag, &pkg)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
goto exit;
}
#if 0
if (headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Second description\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Second description\n"),
spec->lineNum);
goto exit;
}
file = NULL;
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"),
spec->lineNum, poptStrerror(rc));
rc = RPMERR_BADSPEC;
goto exit;
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
rc = RPMERR_BADSPEC;
}
if (lookupPackage(spec, name, flag, &pkg)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
rc = RPMERR_BADSPEC;
goto exit;
}
if (pkg->fileList != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: Second %%files list\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Second %%files list\n"),
spec->lineNum);
rc = RPMERR_BADSPEC;
goto exit;
if (isMemberInEntry(spec->buildRestrictions,
arch, RPMTAG_EXCLUDEARCH) == 1) {
- rpmError(RPMERR_BADSPEC, _("Architecture is excluded: %s\n"), arch);
+ rpmlog(RPMERR_BADSPEC, _("Architecture is excluded: %s\n"), arch);
return RPMERR_BADSPEC;
}
if (isMemberInEntry(spec->buildRestrictions,
arch, RPMTAG_EXCLUSIVEARCH) == 0) {
- rpmError(RPMERR_BADSPEC, _("Architecture is not included: %s\n"), arch);
+ rpmlog(RPMERR_BADSPEC, _("Architecture is not included: %s\n"), arch);
return RPMERR_BADSPEC;
}
if (isMemberInEntry(spec->buildRestrictions,
os, RPMTAG_EXCLUDEOS) == 1) {
- rpmError(RPMERR_BADSPEC, _("OS is excluded: %s\n"), os);
+ rpmlog(RPMERR_BADSPEC, _("OS is excluded: %s\n"), os);
return RPMERR_BADSPEC;
}
if (isMemberInEntry(spec->buildRestrictions,
os, RPMTAG_EXCLUSIVEOS) == 0) {
- rpmError(RPMERR_BADSPEC, _("OS is not included: %s\n"), os);
+ rpmlog(RPMERR_BADSPEC, _("OS is not included: %s\n"), os);
return RPMERR_BADSPEC;
}
for (p = requiredTags; *p != 0; p++) {
if (!headerIsEntry(h, *p)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("%s field must be present in package: %s\n"),
rpmTagGetName(*p), NVR);
res = 1;
{
if (tag != lastTag)
continue;
- rpmError(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"),
rpmTagGetName(tag), NVR);
res = 1;
}
fd = Fopen(fn, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"),
fn, Fstrerror(fd));
rc = RPMERR_BADSPEC;
goto exit;
nb = Fread(icon, sizeof(icon[0]), iconsize, fd);
if (Ferror(fd) || (size >= 0 && nb != size)) {
- rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"),
fn, Fstrerror(fd));
rc = RPMERR_BADSPEC;
}
} else if (! strncmp(icon, "/* XPM", sizeof("/* XPM")-1)) {
(void) headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, iconsize);
} else {
- rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file);
+ rpmlog(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file);
rc = RPMERR_BADSPEC;
goto exit;
}
#define SINGLE_TOKEN_ONLY \
if (multiToken) { \
- rpmError(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \
+ rpmlog(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \
spec->lineNum, spec->line); \
return RPMERR_BADSPEC; \
}
while ((*field) && (*field != ':'))
field++;
if (*field != ':') {
- rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
SKIPSPACE(field);
if (!*field) {
/* Empty field */
- rpmError(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
/* These macros are for backward compatibility */
if (tag == RPMTAG_VERSION) {
if (strchr(field, '-') != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
spec->lineNum, "version", spec->line);
return RPMERR_BADSPEC;
}
addMacro(spec->macros, "PACKAGE_VERSION", NULL, field, RMIL_OLDSPEC);
} else if (tag == RPMTAG_RELEASE) {
if (strchr(field, '-') != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"),
spec->lineNum, "release", spec->line);
return RPMERR_BADSPEC;
}
(void) urlPath(buildRootURL, &buildRoot);
if (*buildRoot == '\0') buildRoot = "/";
if (!strcmp(buildRoot, "/")) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("BuildRoot can not be \"/\": %s\n"), spec->buildRootURL);
buildRootURL = _free(buildRootURL);
return RPMERR_BADSPEC;
while (num--) {
len = strlen(array[num]);
if (array[num][len - 1] == '/' && len > 1) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Prefixes must not end with \"/\": %s\n"),
spec->lineNum, spec->line);
array = hfd(array, type);
case RPMTAG_DOCDIR:
SINGLE_TOKEN_ONLY;
if (field[0] != '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Docdir must begin with '/': %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
case RPMTAG_EPOCH:
SINGLE_TOKEN_ONLY;
if (parseNum(field, &num)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Epoch/Serial field must be a number: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
case RPMTAG_BUILDPREREQ:
case RPMTAG_BUILDREQUIRES:
if ((rc = parseBits(lang, buildScriptBits, &tagflags))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Bad %s: qualifiers: %s\n"),
spec->lineNum, rpmTagGetName(tag), spec->line);
return rc;
case RPMTAG_REQUIREFLAGS:
case RPMTAG_PREREQ:
if ((rc = parseBits(lang, installScriptBits, &tagflags))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Bad %s: qualifiers: %s\n"),
spec->lineNum, rpmTagGetName(tag), spec->line);
return rc;
if ((rc = poptParseArgvString(field,
&(spec->BACount),
&(spec->BANames)))) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Bad BuildArchitecture format: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
break;
default:
- rpmError(RPMERR_INTERNAL, _("Internal error: Bogus tag %d\n"), tag);
+ rpmlog(RPMERR_INTERNAL, _("Internal error: Bogus tag %d\n"), tag);
return RPMERR_INTERNAL;
}
if (!(p->token && !xstrncasecmp(spec->line, p->token, p->len)))
continue;
if (p->obsolete) {
- rpmError(RPMERR_BADSPEC, _("Legacy syntax is unsupported: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Legacy syntax is unsupported: %s\n"),
p->token);
p = NULL;
}
if (! initialPackage) {
/* There is one option to %package: <pkg> or -n <pkg> */
if (parseSimplePart(spec->line, &name, &flag)) {
- rpmError(RPMERR_BADSPEC, _("Bad package specification: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Bad package specification: %s\n"),
spec->line);
return RPMERR_BADSPEC;
}
if (!lookupPackage(spec, name, flag, NULL)) {
- rpmError(RPMERR_BADSPEC, _("Package already exists: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Package already exists: %s\n"),
spec->line);
return RPMERR_BADSPEC;
}
SKIPSPACE(linep);
if (*linep != '\0') {
if (findPreambleTag(spec, &tag, ¯o, lang)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
/* Do some final processing on the header */
if (!spec->gotBuildRootURL && spec->buildRootURL) {
- rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot\n"));
+ rpmlog(RPMERR_BADSPEC, _("Spec file can't use BuildRoot\n"));
return RPMERR_BADSPEC;
}
struct stat sb;
if (Lstat(urlfn, &sb)) {
- rpmError(RPMERR_BADSPEC, _("Bad source: %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Bad source: %s: %s\n"),
urlfn, strerror(errno));
return RPMERR_BADSPEC;
}
if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) {
- rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn);
+ rpmlog(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn);
return RPMERR_BADSPEC;
}
}
}
if (sp == NULL) {
- rpmError(RPMERR_BADSPEC, _("No patch number %d\n"), c);
+ rpmlog(RPMERR_BADSPEC, _("No patch number %d\n"), c);
return NULL;
}
}
}
if (sp == NULL) {
- rpmError(RPMERR_BADSPEC, _("No source number %d\n"), c);
+ rpmlog(RPMERR_BADSPEC, _("No source number %d\n"), c);
return NULL;
}
if (Lstat(urlfn, &st) != 0 && errno == ENOENT &&
urlIsUrl(sp->fullSource) != URL_IS_UNKNOWN) {
if ((rc = urlGetFile(sp->fullSource, urlfn)) != 0) {
- rpmError(RPMERR_BADFILENAME,
+ rpmlog(RPMERR_BADFILENAME,
_("Couldn't download nosource %s: %s\n"),
sp->fullSource, ftpStrerror(rc));
return NULL;
dirName = NULL;
if ((rc = poptParseArgvString(line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"),
poptStrerror(rc));
return RPMERR_BADSPEC;
}
/* We only parse -a and -b here */
if (parseNum(optArg, &num)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"),
spec->lineNum, (optArg ? optArg : "???"));
before = freeStringBuf(before);
after = freeStringBuf(after);
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
poptStrerror(arg));
/* orig suffix */
opt_b = strtok(NULL, " \t\n");
if (! opt_b) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -b: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
/* orig suffix */
opt_b = strtok(NULL, " \t\n");
if (! opt_b) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -z: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
opt_F = (fnum ? strtol(fnum, &end, 10) : 0);
if (! opt_F || *end) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Bad arg to %%patch -F: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
} else {
s = strtok(NULL, " \t\n");
if (s == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Need arg to %%patch -p: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
}
if (parseNum(s, &opt_p)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Bad arg to %%patch -p: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
} else {
/* Must be a patch num */
if (patch_index == 1024) {
- rpmError(RPMERR_BADSPEC, _("Too many patches!\n"));
+ rpmlog(RPMERR_BADSPEC, _("Too many patches!\n"));
return RPMERR_BADSPEC;
}
if (parseNum(s, &(patch_nums[patch_index]))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
char **lines, **saveLines;
if (spec->prep != NULL) {
- rpmError(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum);
+ rpmlog(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum);
return RPMERR_BADSPEC;
}
/* Tokens must begin with alphanumeric, _, or / */
if (!(xisalnum(r[0]) || r[0] == '_' || r[0] == '/')) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
continue;
if (r[0] == '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: Versioned file name not permitted: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
if (Flags & RPMSENSE_SENSEMASK) {
if (*v == '\0' || ve == v) {
- rpmError(RPMERR_BADSPEC, _("line %d: Version required: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Version required: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
/* break line into two */
p = strstr(spec->line, "--");
if (!p) {
- rpmError(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"),
spec->lineNum, spec->line);
return RPMERR_BADSPEC;
}
}
if ((rc = poptParseArgvString(spec->line, &argc, &argv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
return RPMERR_BADSPEC;
}
case 'p':
if (prog[0] == '<') {
if (prog[strlen(prog)-1] != '>') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: internal script must end "
"with \'>\': %s\n"), spec->lineNum, prog);
rc = RPMERR_BADSPEC;
goto exit;
}
} else if (prog[0] != '/') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: script program must begin "
"with \'/\': %s\n"), spec->lineNum, prog);
rc = RPMERR_BADSPEC;
}
if (arg < -1) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"),
spec->lineNum,
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
spec->line);
if (name == NULL)
name = poptGetArg(optCon);
if (poptPeekArg(optCon)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"),
spec->lineNum,
spec->line);
rc = RPMERR_BADSPEC;
}
if (lookupPackage(spec, name, flag, &pkg)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"),
spec->lineNum, spec->line);
rc = RPMERR_BADSPEC;
goto exit;
if (tag != RPMTAG_TRIGGERSCRIPTS) {
if (headerIsEntry(pkg->header, progtag)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Second %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Second %s\n"),
spec->lineNum, partname);
rc = RPMERR_BADSPEC;
goto exit;
}
if ((rc = poptParseArgvString(prog, &progArgc, &progArgv))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"),
spec->lineNum, partname, poptStrerror(rc));
rc = RPMERR_BADSPEC;
goto exit;
} else
#endif
if (progArgv[0][0] == '<') {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("line %d: unsupported internal script: %s\n"),
spec->lineNum, progArgv[0]);
rc = RPMERR_BADSPEC;
/* Don't expand macros (eg. %define) in false branch of %if clause */
if (spec->readStack->reading &&
expandMacros(spec, spec->macros, spec->lbuf, sizeof(spec->lbuf))) {
- rpmError(RPMERR_BADSPEC, _("line %d: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: %s\n"),
spec->lineNum, spec->lbuf);
return RPMERR_BADSPEC;
}
ofi->fd = Fopen(ofi->fileName, "r.fpio");
if (ofi->fd == NULL || Ferror(ofi->fd)) {
/* XXX Fstrerror */
- rpmError(RPMERR_BADSPEC, _("Unable to open %s: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Unable to open %s: %s\n"),
ofi->fileName, Fstrerror(ofi->fd));
return RPMERR_BADSPEC;
}
if (f == NULL || !fgets(ofi->readBuf, BUFSIZ, f)) {
/* EOF */
if (spec->readStack->next) {
- rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n"));
+ rpmlog(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n"));
return RPMERR_UNMATCHEDIF;
}
s += 3;
match = parseExpressionBoolean(spec, s);
if (match < 0) {
- rpmError(RPMERR_UNMATCHEDIF,
+ rpmlog(RPMERR_UNMATCHEDIF,
_("%s:%d: parseExpressionBoolean returns %d\n"),
ofi->fileName, ofi->lineNum, match);
return RPMERR_BADSPEC;
s += 5;
if (! spec->readStack->next) {
/* Got an else with no %if ! */
- rpmError(RPMERR_UNMATCHEDIF,
+ rpmlog(RPMERR_UNMATCHEDIF,
_("%s:%d: Got a %%else with no %%if\n"),
ofi->fileName, ofi->lineNum);
return RPMERR_UNMATCHEDIF;
s += 6;
if (! spec->readStack->next) {
/* Got an end with no %if ! */
- rpmError(RPMERR_UNMATCHEDIF,
+ rpmlog(RPMERR_UNMATCHEDIF,
_("%s:%d: Got a %%endif with no %%if\n"),
ofi->fileName, ofi->lineNum);
return RPMERR_UNMATCHEDIF;
s += 8;
fileName = s;
if (! xisspace(*fileName)) {
- rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
+ rpmlog(RPMERR_BADSPEC, _("malformed %%include statement\n"));
return RPMERR_BADSPEC;
}
SKIPSPACE(fileName);
p = endFileName;
SKIPSPACE(p);
if (*p != '\0') {
- rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
+ rpmlog(RPMERR_BADSPEC, _("malformed %%include statement\n"));
return RPMERR_BADSPEC;
}
*endFileName = '\0';
(void) urlPath(buildRootURL, &buildRoot);
if (*buildRoot == '\0') buildRoot = "/";
if (!strcmp(buildRoot, "/")) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("BuildRoot can not be \"/\": %s\n"), buildRootURL);
return RPMERR_BADSPEC;
}
spec->BACount = index;
if (! index) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("No compatible architectures found for build\n"));
spec = freeSpec(spec);
return RPMERR_BADSPEC;
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
const char * name;
(void) headerNVR(pkg->header, &name, NULL, NULL);
- rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("Package has no %%description: %s\n"),
name);
spec = freeSpec(spec);
return RPMERR_BADSPEC;
case POPT_RMBUILD: rba->buildAmount |= RPMBUILD_RMBUILD; break;
case POPT_BUILDROOT:
if (rba->buildRootOverride) {
- rpmError(RPMERR_BUILDROOT, _("buildroot already specified, ignoring %s\n"), arg);
+ rpmlog(RPMERR_BUILDROOT, _("buildroot already specified, ignoring %s\n"), arg);
break;
}
rba->buildRootOverride = xstrdup(arg);
unsetenv("MALLOC_CHECK_");
(void) execvp(argv[0], (char *const *)argv);
/* XXX this error message is probably not seen. */
- rpmError(RPMERR_EXEC, _("Couldn't exec %s: %s\n"),
+ rpmlog(RPMERR_EXEC, _("Couldn't exec %s: %s\n"),
argv[0], strerror(errno));
_exit(RPMERR_EXEC);
}
if (child < 0) {
- rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"),
+ rpmlog(RPMERR_FORK, _("Couldn't fork %s: %s\n"),
argv[0], strerror(errno));
return NULL;
}
(unsigned)child, (unsigned)reaped, status);
if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) {
- rpmError(RPMERR_EXEC, _("%s failed\n"), argv[0]);
+ rpmlog(RPMERR_EXEC, _("%s failed\n"), argv[0]);
return NULL;
}
if (writeBytesLeft) {
- rpmError(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]);
+ rpmlog(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]);
return NULL;
}
return readBuff;
ms = magic_open(msflags);
if (ms == NULL) {
xx = RPMERR_EXEC;
- rpmError(xx, _("magic_open(0x%x) failed: %s\n"),
+ rpmlog(xx, _("magic_open(0x%x) failed: %s\n"),
msflags, strerror(errno));
assert(ms != NULL); /* XXX figger a proper return path. */
}
xx = magic_load(ms, NULL);
if (xx == -1) {
xx = RPMERR_EXEC;
- rpmError(xx, _("magic_load failed: %s\n"), magic_error(ms));
+ rpmlog(xx, _("magic_load failed: %s\n"), magic_error(ms));
assert(xx != -1); /* XXX figger a proper return path. */
}
if (ftype == NULL) {
xx = RPMERR_EXEC;
- rpmError(xx, _("magic_file(ms, \"%s\") failed: mode %06o %s\n"),
+ rpmlog(xx, _("magic_file(ms, \"%s\") failed: mode %06o %s\n"),
s, mode, magic_error(ms));
assert(ftype != NULL); /* XXX figger a proper return path. */
}
if (sb_stdout == NULL) {
rc = RPMERR_EXEC;
- rpmError(rc, _("Failed to find %s:\n"), dm->msg);
+ rpmlog(rc, _("Failed to find %s:\n"), dm->msg);
break;
}
sb_stdout = freeStringBuf(sb_stdout);
if (rc) {
- rpmError(rc, _("Failed to find %s:\n"), dm->msg);
+ rpmlog(rc, _("Failed to find %s:\n"), dm->msg);
break;
}
}
if (*fe != '\0') fe++;
if (parseNum(f, &num)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"),
spec->lineNum, f);
return RPMERR_BADSPEC;
}
if (! (p = findSource(spec, num, flag))) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"),
spec->lineNum, name, num);
return RPMERR_BADSPEC;
}
num = 0;
} else {
if (parseNum(buf, &num)) {
- rpmError(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"),
+ rpmlog(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"),
spec->lineNum, name, spec->line);
return RPMERR_BADSPEC;
}
/* XXX this should use queryHeader(), but prints out tn as well. */
msgstr = headerSprintf(h, fmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (msgstr == NULL) {
- rpmError(RPMERR_QFMT, _("can't query %s: %s\n"), tn, errstr);
+ rpmlog(RPMERR_QFMT, _("can't query %s: %s\n"), tn, errstr);
return;
}
cookie, anyarch, force)
|| (spec = rpmtsSetSpec(ts, NULL)) == NULL)
{
- rpmError(RPMERR_QUERY,
+ rpmlog(RPMERR_QUERY,
_("query of specfile %s failed, can't parse\n"), arg);
goto exit;
}
num = mntctl(MCTL_QUERY, sizeof(size), (char *) &size);
if (num < 0) {
- rpmError(RPMERR_MTAB, _("mntctl() failed to return size: %s\n"),
+ rpmlog(RPMERR_MTAB, _("mntctl() failed to return size: %s\n"),
strerror(errno));
return 1;
}
buf = alloca(size);
num = mntctl(MCTL_QUERY, size, buf);
if ( num <= 0 ) {
- rpmError(RPMERR_MTAB, _("mntctl() failed to return mount points: %s\n"),
+ rpmlog(RPMERR_MTAB, _("mntctl() failed to return mount points: %s\n"),
strerror(errno));
return 1;
}
case ESTALE:
continue;
default:
- rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), fsnames[i],
+ rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), fsnames[i],
strerror(errno));
rpmFreeFilesystems();
mtab = fopen(MOUNTED, "r");
if (!mtab) {
- rpmError(RPMERR_MTAB, _("failed to open %s: %s\n"), MOUNTED,
+ rpmlog(RPMERR_MTAB, _("failed to open %s: %s\n"), MOUNTED,
strerror(errno));
return 1;
}
# endif
if (stat(mntdir, &sb)) {
- rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), mntdir,
+ rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), mntdir,
strerror(errno));
rpmFreeFilesystems();
chptr = dirName + strlen(dirName) - 1;
while (stat(dirName, &sb)) {
if (errno != ENOENT) {
- rpmError(RPMERR_STAT, _("failed to stat %s: %s\n"), buf,
+ rpmlog(RPMERR_STAT, _("failed to stat %s: %s\n"), buf,
strerror(errno));
sourceDir = _free(sourceDir);
usages = _free(usages);
break;
if (j == numFilesystems) {
- rpmError(RPMERR_BADDEV,
+ rpmlog(RPMERR_BADDEV,
_("file %s is on an unknown device\n"), buf);
sourceDir = _free(sourceDir);
usages = _free(usages);
break;
/* XXX common error message. */
- rpmError(
+ rpmlog(
(strict_erasures ? RPMERR_RMDIR : RPMDEBUG_RMDIR),
_("%s rmdir of %s failed: Directory not empty\n"),
rpmfiTypeString(fi), fsm->path);
break;
default:
- rpmError(
+ rpmlog(
(strict_erasures ? RPMERR_RMDIR : RPMDEBUG_RMDIR),
_("%s rmdir of %s failed: %s\n"),
rpmfiTypeString(fi), fsm->path, strerror(errno));
if (fsm->fflags & RPMFILE_MISSINGOK)
break;
default:
- rpmError(
+ rpmlog(
(strict_erasures ? RPMERR_UNLINK : RPMDEBUG_UNLINK),
_("%s unlink of %s failed: %s\n"),
rpmfiTypeString(fi), fsm->path, strerror(errno));
fd = Fopen(av[i], "r.ufdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), av[i],
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), av[i],
Fstrerror(fd));
if (fd != NULL) (void) Fclose(fd);
continue;
break;
}
if (rc < 0) {
- rpmError(RPMERR_CREATE, _("cannot create %%%s %s\n"), dname, dpath);
+ rpmlog(RPMERR_CREATE, _("cannot create %%%s %s\n"), dname, dpath);
return RPMRC_FAIL;
}
}
if ((rc = Access(dpath, W_OK))) {
- rpmError(RPMERR_CREATE, _("cannot write to %%%s %s\n"), dname, dpath);
+ rpmlog(RPMERR_CREATE, _("cannot write to %%%s %s\n"), dname, dpath);
return RPMRC_FAIL;
}
return RPMRC_OK;
case URL_IS_UNKNOWN:
{ struct stat sb, sb2;
if (!stat(tfn, &sb) && S_ISLNK(sb.st_mode)) {
- rpmError(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
+ rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
goto errxit;
}
if (sb.st_nlink != 1) {
- rpmError(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
+ rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
goto errxit;
}
if (fstat(Fileno(fd), &sb2) == 0) {
if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) {
- rpmError(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
+ rpmlog(RPMERR_SCRIPT, _("error creating temporary file %s\n"), tfn);
goto errxit;
}
}
switch (l->major) {
case 1:
- rpmError(RPMERR_NEWPACKAGE,
+ rpmlog(RPMERR_NEWPACKAGE,
_("packaging version 1 is not supported by this version of RPM\n"));
rc = RPMRC_NOTFOUND;
goto exit;
case 4:
break;
default:
- rpmError(RPMERR_NEWPACKAGE, _("only packaging with major numbers <= 4 "
+ rpmlog(RPMERR_NEWPACKAGE, _("only packaging with major numbers <= 4 "
"is supported by this version of RPM\n"));
rc = RPMRC_NOTFOUND;
goto exit;
rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg);
switch (rc) {
default:
- rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
+ rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
break;
case RPMRC_OK:
if (sigh == NULL) {
- rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
+ rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
rc = RPMRC_FAIL;
goto exit;
}
(void) rpmswExit(rpmtsOp(ts, opx), nb);
if (rc != RPMRC_OK || h == NULL) {
- rpmError(RPMERR_FREAD, _("%s: headerRead failed: %s"), fn,
+ rpmlog(RPMERR_FREAD, _("%s: headerRead failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
rpmtsOp(ts, RPMTS_OP_DIGEST)->count--; /* XXX one too many */
dig->nbytes += nb; /* XXX include size of header blob. */
if (count < 0) {
- rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"),
+ rpmlog(RPMERR_FREAD, _("%s: Fread failed: %s\n"),
fn, Fstrerror(fd));
rc = RPMRC_FAIL;
goto exit;
isSource = headerIsEntry(h, RPMTAG_SOURCEPACKAGE);
if (!isSource) {
- rpmError(RPMERR_NOTSRPM, _("source package expected, binary found\n"));
+ rpmlog(RPMERR_NOTSRPM, _("source package expected, binary found\n"));
rpmrc = RPMRC_FAIL;
goto exit;
}
(void) stpcpy( stpcpy( stpcpy(t, _specdir), "/"), fi->bnl[i]);
specFile = t;
} else {
- rpmError(RPMERR_NOSPEC, _("source package contains no .spec file\n"));
+ rpmlog(RPMERR_NOSPEC, _("source package contains no .spec file\n"));
rpmrc = RPMRC_FAIL;
goto exit;
}
}
if (psm->sq.child == (pid_t)-1) {
- rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
+ rpmlog(RPMERR_FORK, _("Couldn't fork %s: %s\n"), sln, strerror(errno));
rc = RPMRC_FAIL;
goto exit;
}
/* XXX filter order dependent multilib "other" arch helper error. */
if (!(psm->sq.reaped >= 0 && !strcmp(argv[0], "/usr/sbin/glibc_post_upgrade") && WEXITSTATUS(psm->sq.status) == 110)) {
if (psm->sq.reaped < 0) {
- rpmError(RPMERR_SCRIPT,
+ rpmlog(RPMERR_SCRIPT,
_("%s(%s-%s-%s.%s) scriptlet failed, waitpid(%d) rc %d: %s\n"),
sln, n, v, r, a, psm->sq.child, psm->sq.reaped, strerror(errno));
rc = RPMRC_FAIL;
} else
if (!WIFEXITED(psm->sq.status) || WEXITSTATUS(psm->sq.status)) {
if (WIFSIGNALED(psm->sq.status)) {
- rpmError(RPMERR_SCRIPT,
+ rpmlog(RPMERR_SCRIPT,
_("%s(%s-%s-%s.%s) scriptlet failed, signal %d\n"),
sln, n, v, r, a, WTERMSIG(psm->sq.status));
} else {
- rpmError(RPMERR_SCRIPT,
+ rpmlog(RPMERR_SCRIPT,
_("%s(%s-%s-%s.%s) scriptlet failed, exit status %d\n"),
sln, n, v, r, a, WEXITSTATUS(psm->sq.status));
}
if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_NOPRE)) {
rc = rpmpsmNext(psm, PSM_SCRIPT);
if (rc != RPMRC_OK) {
- rpmError(RPMERR_SCRIPT,
+ rpmlog(RPMERR_SCRIPT,
_("%s: %s scriptlet failed (%d), skipping %s\n"),
psm->stepName, tag2sln(psm->scriptTag), rc,
rpmteNEVR(psm->te));
rc = writeLead(psm->fd, &lead);
if (rc != RPMRC_OK) {
- rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
+ rpmlog(RPMERR_NOSPACE, _("Unable to write package: %s\n"),
Fstrerror(psm->fd));
break;
}
/* Reallocate the signature into one contiguous region. */
sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES);
if (sigh == NULL) {
- rpmError(RPMERR_NOSPACE, _("Unable to reload signature header\n"));
+ rpmlog(RPMERR_NOSPACE, _("Unable to reload signature header\n"));
rc = RPMRC_FAIL;
break;
}
xx = rpmpsmNext(psm, PSM_NOTIFY);
if (rc) {
- rpmError(RPMERR_CPIO,
+ rpmlog(RPMERR_CPIO,
_("unpacking of archive failed%s%s: %s\n"),
(psm->failedFile != NULL ? _(" on file ") : ""),
(psm->failedFile != NULL ? psm->failedFile : ""),
if (rc) {
if (psm->failedFile)
- rpmError(RPMERR_CPIO,
+ rpmlog(RPMERR_CPIO,
_("%s failed on file %s: %s\n"),
psm->stepName, psm->failedFile, cpioStrerror(rc));
else
- rpmError(RPMERR_CPIO, _("%s failed: %s\n"),
+ rpmlog(RPMERR_CPIO, _("%s failed: %s\n"),
psm->stepName, cpioStrerror(rc));
/* XXX notify callback on error. */
str = headerSprintf(h, qfmt, rpmTagTable, rpmHeaderFormats, &errstr);
if (str == NULL)
- rpmError(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
+ rpmlog(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
return str;
}
sprintf(te, "%s %s", fuser, fgroup);
te += strlen(te);
} else {
- rpmError(RPMERR_INTERNAL,
+ rpmlog(RPMERR_INTERNAL,
_("package has not file owner/group lists\n"));
}
fuser, fgroup, flink);
te += strlen(te);
} else {
- rpmError(RPMERR_INTERNAL,
+ rpmlog(RPMERR_INTERNAL,
_("package has neither file owner or id lists\n"));
}
}
case RPMQV_GROUP:
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_GROUP, arg, 0);
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO,
+ rpmlog(RPMERR_QUERYINFO,
_("group %s does not contain any packages\n"), arg);
res = 1;
} else
case RPMQV_TRIGGEREDBY:
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_TRIGGERNAME, arg, 0);
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package triggers %s\n"), arg);
+ rpmlog(RPMERR_QUERYINFO, _("no package triggers %s\n"), arg);
res = 1;
} else
res = rpmcliShowMatches(qva, ts);
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 32) {
- rpmError(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "pkgid", arg);
+ rpmlog(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "pkgid", arg);
return 1;
}
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SIGMD5, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
+ rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"pkgid", arg);
res = 1;
} else
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 40) {
- rpmError(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "hdrid", arg);
+ rpmlog(RPMERR_QUERYINFO, _("malformed %s: %s\n"), "hdrid", arg);
return 1;
}
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SHA1HEADER, arg, 0);
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
+ rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"hdrid", arg);
res = 1;
} else
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 32) {
- rpmError(RPMERR_QUERY, _("malformed %s: %s\n"), "fileid", arg);
+ rpmlog(RPMERR_QUERY, _("malformed %s: %s\n"), "fileid", arg);
return 1;
}
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEMD5S, MD5, sizeof(MD5));
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
+ rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"fileid", arg);
res = 1;
} else
}
iid = strtoul(myarg, &end, mybase);
if ((*end) || (end == arg) || (iid == ULONG_MAX)) {
- rpmError(RPMERR_QUERY, _("malformed %s: %s\n"), "tid", arg);
+ rpmlog(RPMERR_QUERY, _("malformed %s: %s\n"), "tid", arg);
return 1;
}
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_INSTALLTID, &iid, sizeof(iid));
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
+ rpmlog(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"tid", arg);
res = 1;
} else
case RPMQV_WHATREQUIRES:
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_REQUIRENAME, arg, 0);
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package requires %s\n"), arg);
+ rpmlog(RPMERR_QUERYINFO, _("no package requires %s\n"), arg);
res = 1;
} else
res = rpmcliShowMatches(qva, ts);
provides_checked = 1;
qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, arg, 0);
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO, _("no package provides %s\n"), arg);
+ rpmlog(RPMERR_QUERYINFO, _("no package provides %s\n"), arg);
res = 1;
} else
res = rpmcliShowMatches(qva, ts);
}
if (myerrno != 0) {
- rpmError(RPMERR_QUERY, _("file %s: %s\n"), fn, strerror(myerrno));
+ rpmlog(RPMERR_QUERY, _("file %s: %s\n"), fn, strerror(myerrno));
res = 1;
} else if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO,
+ rpmlog(RPMERR_QUERYINFO,
_("file %s is not owned by any package\n"), fn);
res = 1;
} else
}
recOffset = strtoul(myarg, &end, mybase);
if ((*end) || (end == arg) || (recOffset == ULONG_MAX)) {
- rpmError(RPMERR_QUERYINFO, _("invalid package number: %s\n"), arg);
+ rpmlog(RPMERR_QUERYINFO, _("invalid package number: %s\n"), arg);
return 1;
}
rpmMessage(RPMMESS_DEBUG, _("package record number: %u\n"), recOffset);
/* RPMDBI_PACKAGES */
qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &recOffset, sizeof(recOffset));
if (qva->qva_mi == NULL) {
- rpmError(RPMERR_QUERYINFO,
+ rpmlog(RPMERR_QUERYINFO,
_("record %u could not be read\n"), recOffset);
res = 1;
} else
}
rpmdbFreeIterator(mi);
if (! matches) {
- rpmError(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg);
+ rpmlog(RPMERR_QUERYINFO, _("package %s is not installed\n"), arg);
res = 1;
} else {
qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_LABEL, arg, 0);
if (*fdp == NULL && fnp != NULL && *fnp != NULL) {
fd = Fopen(*fnp, ((flags & O_WRONLY) ? "w.ufdio" : "r.ufdio"));
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("%s: open failed: %s\n"), *fnp,
+ rpmlog(RPMERR_OPEN, _("%s: open failed: %s\n"), *fnp,
Fstrerror(fd));
return 1;
}
if (*fdp == NULL && (fnp == NULL || *fnp == NULL)) {
fn = NULL;
if (makeTempFile(NULL, (fnp ? &fn : NULL), &fd)) {
- rpmError(RPMERR_MAKETEMP, _("makeTempFile failed\n"));
+ rpmlog(RPMERR_MAKETEMP, _("makeTempFile failed\n"));
return 1;
}
if (fnp != NULL)
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), *sfdp)) > 0)
{
if (Fwrite(buf, sizeof(buf[0]), count, *tfdp) != count) {
- rpmError(RPMERR_FWRITE, _("%s: Fwrite failed: %s\n"), *tfnp,
+ rpmlog(RPMERR_FWRITE, _("%s: Fwrite failed: %s\n"), *tfnp,
Fstrerror(*tfdp));
goto exit;
}
}
if (count < 0) {
- rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp));
+ rpmlog(RPMERR_FREAD, _("%s: Fread failed: %s\n"), *sfnp, Fstrerror(*sfdp));
goto exit;
}
if (Fflush(*tfdp) != 0) {
- rpmError(RPMERR_FWRITE, _("%s: Fflush failed: %s\n"), *tfnp,
+ rpmlog(RPMERR_FWRITE, _("%s: Fflush failed: %s\n"), *tfnp,
Fstrerror(*tfdp));
}
memset(l, 0, sizeof(*l));
rc = readLead(fd, l);
if (rc != RPMRC_OK) {
- rpmError(RPMERR_READLEAD, _("%s: not an rpm package\n"), rpm);
+ rpmlog(RPMERR_READLEAD, _("%s: not an rpm package\n"), rpm);
goto exit;
}
switch (l->major) {
case 1:
- rpmError(RPMERR_BADSIGTYPE, _("%s: Can't sign v1 packaging\n"), rpm);
+ rpmlog(RPMERR_BADSIGTYPE, _("%s: Can't sign v1 packaging\n"), rpm);
goto exit;
break;
case 2:
- rpmError(RPMERR_BADSIGTYPE, _("%s: Can't re-sign v2 packaging\n"), rpm);
+ rpmlog(RPMERR_BADSIGTYPE, _("%s: Can't re-sign v2 packaging\n"), rpm);
goto exit;
break;
default:
rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg);
switch (rc) {
default:
- rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), rpm,
+ rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), rpm,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
goto exit;
break;
case RPMRC_OK:
if (sigh == NULL) {
- rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm);
+ rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), rpm);
goto exit;
}
break;
l->signature_type = RPMSIGTYPE_HEADERSIG;
rc = writeLead(ofd, l);
if (rc != RPMRC_OK) {
- rpmError(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm,
+ rpmlog(RPMERR_WRITELEAD, _("%s: writeLead failed: %s\n"), trpm,
Fstrerror(ofd));
goto exit;
}
if (rpmWriteSignature(ofd, sigh)) {
- rpmError(RPMERR_SIGGEN, _("%s: rpmWriteSignature failed: %s\n"), trpm,
+ rpmlog(RPMERR_SIGGEN, _("%s: rpmWriteSignature failed: %s\n"), trpm,
Fstrerror(ofd));
goto exit;
}
/* Read pgp packet. */
if ((rc = pgpReadPkts(fn, &pkt, &pktlen)) <= 0) {
- rpmError(RPMERR_IMPORT, _("%s: import read failed(%d).\n"), fn, rc);
+ rpmlog(RPMERR_IMPORT, _("%s: import read failed(%d).\n"), fn, rc);
res++;
continue;
}
if (rc != PGPARMOR_PUBKEY) {
- rpmError(RPMERR_IMPORT, _("%s: not an armored public key.\n"), fn);
+ rpmlog(RPMERR_IMPORT, _("%s: not an armored public key.\n"), fn);
res++;
continue;
}
/* Import pubkey packet(s). */
if ((rpmrc = rpmcliImportPubkey(ts, pkt, pktlen)) != RPMRC_OK) {
- rpmError(RPMERR_IMPORT, _("%s: import failed.\n"), fn);
+ rpmlog(RPMERR_IMPORT, _("%s: import failed.\n"), fn);
res++;
continue;
}
/* Read the header from the package. */
{ Header h = headerRead(fd, HEADER_MAGIC_YES);
if (h == NULL) {
- rpmError(RPMERR_FREAD, _("%s: headerRead failed\n"), fn);
+ rpmlog(RPMERR_FREAD, _("%s: headerRead failed\n"), fn);
goto exit;
}
|| uh == NULL)
{
h = headerFree(h);
- rpmError(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn);
+ rpmlog(RPMERR_FREAD, _("%s: headerGetEntry failed\n"), fn);
goto exit;
}
dig->hdrsha1ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), fd)) > 0)
dig->nbytes += count;
if (count < 0) {
- rpmError(RPMERR_FREAD, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd));
+ rpmlog(RPMERR_FREAD, _("%s: Fread failed: %s\n"), fn, Fstrerror(fd));
goto exit;
}
memset(l, 0, sizeof(*l));
rc = readLead(fd, l);
if (rc != RPMRC_OK) {
- rpmError(RPMERR_READLEAD, _("%s: not an rpm package\n"), fn);
+ rpmlog(RPMERR_READLEAD, _("%s: not an rpm package\n"), fn);
res++;
goto exit;
}
switch (l->major) {
case 1:
- rpmError(RPMERR_BADSIGTYPE, _("%s: No signature available (v1.0 RPM)\n"), fn);
+ rpmlog(RPMERR_BADSIGTYPE, _("%s: No signature available (v1.0 RPM)\n"), fn);
res++;
goto exit;
break;
rc = rpmReadSignature(fd, &sigh, l->signature_type, &msg);
switch (rc) {
default:
- rpmError(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
+ rpmlog(RPMERR_SIGGEN, _("%s: rpmReadSignature failed: %s"), fn,
(msg && *msg ? msg : "\n"));
msg = _free(msg);
res++;
break;
case RPMRC_OK:
if (sigh == NULL) {
- rpmError(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
+ rpmlog(RPMERR_SIGGEN, _("%s: No signature available\n"), fn);
res++;
goto exit;
}
(_print_pkts & rpmIsDebug()));
if (sigp->version != 3 && sigp->version != 4) {
- rpmError(RPMERR_SIGVFY,
+ rpmlog(RPMERR_SIGVFY,
_("skipping package %s with unverifiable V%u signature\n"),
fn, sigp->version);
res++;
if (res2) {
if (rpmIsVerbose()) {
- rpmError(RPMERR_SIGVFY, "%s", buf);
+ rpmlog(RPMERR_SIGVFY, "%s", buf);
} else {
- rpmError(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
+ rpmlog(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
_("NOT OK"),
(missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "",
missingKeys,
}
} else {
if (rpmIsVerbose()) {
- rpmError(RPMERR_SIGVFY, "%s", buf);
+ rpmlog(RPMERR_SIGVFY, "%s", buf);
} else {
- rpmError(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
+ rpmlog(RPMERR_SIGVFY, "%s%s%s%s%s%s%s%s\n", buf,
_("OK"),
(missingKeys[0] != '\0') ? _(" (MISSING KEYS:") : "",
missingKeys,
fd = Fopen(arg, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("%s: open failed: %s\n"),
+ rpmlog(RPMERR_OPEN, _("%s: open failed: %s\n"),
arg, Fstrerror(fd));
res++;
} else if (rpmVerifySignatures(qva, ts, fd, arg)) {
FD_t fd = Fopen(fn, fmode);
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), fn, Fstrerror(fd));
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), fn, Fstrerror(fd));
if (fd != NULL) (void) Fclose(fd);
fd = NULL;
}
*ae++ = '\0';
tag = rpmTagGetValue(a);
if (tag < 0) {
- rpmError(RPMERR_QUERYINFO, _("unknown tag: \"%s\"\n"), a);
+ rpmlog(RPMERR_QUERYINFO, _("unknown tag: \"%s\"\n"), a);
res = 1;
}
pat = ae;
fd = Fopen(filename, "r.ufdio");
/* FIX: still necessary? */
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), filename,
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), filename,
Fstrerror(fd));
if (fd != NULL) {
xx = Fclose(fd);
av = _free(av); ac = 0;
rc = rpmGlob(*eiu->fnp, &ac, &av);
if (rc || ac == 0) {
- rpmError(RPMERR_OPEN, _("File not found by glob: %s\n"), *eiu->fnp);
+ rpmlog(RPMERR_OPEN, _("File not found by glob: %s\n"), *eiu->fnp);
continue;
}
/* Try to read the header from a package file. */
eiu->fd = Fopen(*eiu->fnp, "r.ufdio");
if (eiu->fd == NULL || Ferror(eiu->fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
Fstrerror(eiu->fd));
if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
/* Try to read a package manifest. */
eiu->fd = Fopen(*eiu->fnp, "r.fpio");
if (eiu->fd == NULL || Ferror(eiu->fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
Fstrerror(eiu->fd));
if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
/* FIX: *eiu->argv can be NULL */
rc = rpmReadPackageManifest(eiu->fd, &eiu->argc, &eiu->argv);
if (rc != RPMRC_OK)
- rpmError(RPMERR_MANIFEST, _("%s: not an rpm package (or package manifest): %s\n"),
+ rpmlog(RPMERR_MANIFEST, _("%s: not an rpm package (or package manifest): %s\n"),
*eiu->fnp, Fstrerror(eiu->fd));
xx = Fclose(eiu->fd);
eiu->fd = NULL;
/* FIX: remove timed read */
if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) {
if (Ferror(fd)) {
- rpmError(RPMERR_READ, _("read failed: %s (%d)\n"),
+ rpmlog(RPMERR_READ, _("read failed: %s (%d)\n"),
Fstrerror(fd), errno);
return RPMRC_FAIL;
}
chptr = name;
while (*chptr && *chptr != ':') chptr++;
if (!*chptr) {
- rpmError(RPMERR_RPMRC, _("missing second ':' at %s:%d\n"), fn, linenum);
+ rpmlog(RPMERR_RPMRC, _("missing second ':' at %s:%d\n"), fn, linenum);
return 1;
} else if (chptr == name) {
- rpmError(RPMERR_RPMRC, _("missing architecture name at %s:%d\n"), fn,
+ rpmlog(RPMERR_RPMRC, _("missing architecture name at %s:%d\n"), fn,
linenum);
return 1;
}
tshort_name = strtok(NULL, " \t");
s = strtok(NULL, " \t");
if (! (tname && tshort_name && s)) {
- rpmError(RPMERR_RPMRC, _("Incomplete data line at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("Incomplete data line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
if (strtok(NULL, " \t")) {
- rpmError(RPMERR_RPMRC, _("Too many args in data line at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("Too many args in data line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
/* LCL: s != NULL here. */
tnum = strtoul(s, &s1, 10);
if ((*s1) || (s1 == s) || (tnum == ULONG_MAX)) {
- rpmError(RPMERR_RPMRC, _("Bad arch/os number: %s (%s:%d)\n"), s,
+ rpmlog(RPMERR_RPMRC, _("Bad arch/os number: %s (%s:%d)\n"), s,
fn, lineNum);
return(RPMERR_RPMRC);
}
t->name = strtok(line, ": \t");
t->defName = strtok(NULL, " \t");
if (! (t->name && t->defName)) {
- rpmError(RPMERR_RPMRC, _("Incomplete default line at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("Incomplete default line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
if (strtok(NULL, " \t")) {
- rpmError(RPMERR_RPMRC, _("Too many args in default line at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("Too many args in default line at %s:%d\n"),
fn, lineNum);
return RPMERR_RPMRC;
}
next[0] = '\0';
rc = Fread(next, sizeof(*next), nb, fd);
if (Ferror(fd) || (size > 0 && rc != nb)) { /* XXX Feof(fd) */
- rpmError(RPMERR_RPMRC, _("Failed to read %s: %s.\n"), urlfn,
+ rpmlog(RPMERR_RPMRC, _("Failed to read %s: %s.\n"), urlfn,
Fstrerror(fd));
rc = 1;
} else
}
if (*se != ':') {
- rpmError(RPMERR_RPMRC, _("missing ':' (found 0x%02x) at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("missing ':' (found 0x%02x) at %s:%d\n"),
(unsigned)(0xff & *se), urlfn, linenum);
return 1;
}
arch = val = fn = NULL;
if (*se == '\0') {
- rpmError(RPMERR_RPMRC, _("missing argument for %s at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("missing argument for %s at %s:%d\n"),
option->name, urlfn, linenum);
return 1;
}
fn = rpmGetPath(s, NULL);
if (fn == NULL || *fn == '\0') {
- rpmError(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\"\n"),
+ rpmlog(RPMERR_RPMRC, _("%s expansion failed at %s:%d \"%s\"\n"),
option->name, urlfn, linenum, s);
fn = _free(fn);
return 1;
fdinc = Fopen(fn, "r.fpio");
if (fdinc == NULL || Ferror(fdinc)) {
- rpmError(RPMERR_RPMRC, _("cannot open %s at %s:%d: %s\n"),
+ rpmlog(RPMERR_RPMRC, _("cannot open %s at %s:%d: %s\n"),
fn, urlfn, linenum, Fstrerror(fdinc));
rc = 1;
} else {
arch = se;
while (*se && !xisspace(*se)) se++;
if (*se == '\0') {
- rpmError(RPMERR_RPMRC,
+ rpmlog(RPMERR_RPMRC,
_("missing architecture for %s at %s:%d\n"),
option->name, urlfn, linenum);
return 1;
*se++ = '\0';
while (*se && xisspace(*se)) se++;
if (*se == '\0') {
- rpmError(RPMERR_RPMRC,
+ rpmlog(RPMERR_RPMRC,
_("missing argument for %s at %s:%d\n"),
option->name, urlfn, linenum);
return 1;
}
if (!gotit) {
- rpmError(RPMERR_RPMRC, _("bad option '%s' at %s:%d\n"),
+ rpmlog(RPMERR_RPMRC, _("bad option '%s' at %s:%d\n"),
s, urlfn, linenum);
}
}
/* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
if (rcfiles == defrcfiles && myrcfiles != r)
continue;
- rpmError(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
+ rpmlog(RPMERR_RPMRC, _("Cannot expand %s\n"), r);
rc = 1;
break;
}
if (strlen(home) > (sizeof(fn) - strlen(r))) {
- rpmError(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
+ rpmlog(RPMERR_RPMRC, _("Cannot read %s, HOME is too large.\n"),
r);
rc = 1;
break;
/* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
if (rcfiles == defrcfiles && myrcfiles != r)
continue;
- rpmError(RPMERR_RPMRC, _("Unable to open %s for reading: %s.\n"),
+ rpmlog(RPMERR_RPMRC, _("Unable to open %s for reading: %s.\n"),
fn, Fstrerror(fd));
rc = 1;
break;
case '(':
/* XXX Fail if nested parens. */
if (level++ != 0) {
- rpmError(RPMERR_QFMT, _("extra '(' in package label: %s\n"), keyp);
+ rpmlog(RPMERR_QFMT, _("extra '(' in package label: %s\n"), keyp);
return NULL;
}
/* Parse explicit epoch. */
case ')':
/* XXX Fail if nested parens. */
if (--level != 0) {
- rpmError(RPMERR_QFMT, _("missing '(' in package label: %s\n"), keyp);
+ rpmlog(RPMERR_QFMT, _("missing '(' in package label: %s\n"), keyp);
return NULL;
}
/* Don't copy trailing ')' */
}
}
if (level) {
- rpmError(RPMERR_QFMT, _("missing ')' in package label: %s\n"), keyp);
+ rpmlog(RPMERR_QFMT, _("missing ')' in package label: %s\n"), keyp);
return NULL;
}
*t = '\0';
bh = headerFree(bh);
qfmt = _free(qfmt);
if (str == NULL) {
- rpmError(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
+ rpmlog(RPMERR_QFMT, _("incorrect format: %s\n"), errstr);
goto exit;
}
h = headerFree(h);
fd = Fopen(str, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), str,
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), str,
Fstrerror(fd));
if (fd != NULL) {
xx = Fclose(fd);
break;
}
}
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
+ rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
strerror(errno));
_exit(RPMERR_EXEC);
}
(void)waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
- rpmError(RPMERR_SIGGEN, _("pgp failed\n"));
+ rpmlog(RPMERR_SIGGEN, _("pgp failed\n"));
return 1;
}
if (stat(sigfile, &st)) {
/* PGP failed to write signature */
if (sigfile) (void) unlink(sigfile); /* Just in case */
- rpmError(RPMERR_SIGGEN, _("pgp failed to write signature\n"));
+ rpmlog(RPMERR_SIGGEN, _("pgp failed to write signature\n"));
return 1;
}
}
if (rc != *pktlenp) {
*pktp = _free(*pktp);
- rpmError(RPMERR_SIGGEN, _("unable to read the signature\n"));
+ rpmlog(RPMERR_SIGGEN, _("unable to read the signature\n"));
return 1;
}
}
if (!rc)
rc = execve(av[0], av+1, environ);
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
+ rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
strerror(errno));
_exit(RPMERR_EXEC);
}
(void) waitpid(pid, &status, 0);
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
- rpmError(RPMERR_SIGGEN, _("gpg exec failed (%d)\n"), WEXITSTATUS(status));
+ rpmlog(RPMERR_SIGGEN, _("gpg exec failed (%d)\n"), WEXITSTATUS(status));
return 1;
}
if (stat(sigfile, &st)) {
/* GPG failed to write signature */
if (sigfile) (void) unlink(sigfile); /* Just in case */
- rpmError(RPMERR_SIGGEN, _("gpg failed to write signature\n"));
+ rpmlog(RPMERR_SIGGEN, _("gpg failed to write signature\n"));
return 1;
}
}
if (rc != *pktlenp) {
*pktp = _free(*pktp);
- rpmError(RPMERR_SIGGEN, _("unable to read the signature\n"));
+ rpmlog(RPMERR_SIGGEN, _("unable to read the signature\n"));
return 1;
}
}
if (!rc)
rc = execve(av[0], av+1, environ);
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
+ rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "gpg",
strerror(errno));
} break;
case RPMSIGTAG_RSA:
break;
}
}
- rpmError(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
+ rpmlog(RPMERR_EXEC, _("Could not exec %s: %s\n"), "pgp",
strerror(errno));
_exit(RPMERR_EXEC);
} break;
default: /* This case should have been screened out long ago. */
- rpmError(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
+ rpmlog(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
_exit(RPMERR_SIGGEN);
break;
}
}
if (aok)
break;
- rpmError(RPMERR_SIGGEN,
+ rpmlog(RPMERR_SIGGEN,
_("You must set \"%%_gpg_name\" in your macro file\n"));
break;
case RPMSIGTAG_RSA:
}
if (aok)
break;
- rpmError(RPMERR_SIGGEN,
+ rpmlog(RPMERR_SIGGEN,
_("You must set \"%%_pgp_name\" in your macro file\n"));
break;
default:
/* Currently the calling function (rpm.c:main) is checking this and
* doing a better job. This section should never be accessed.
*/
- rpmError(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
+ rpmlog(RPMERR_SIGGEN, _("Invalid %%_signature spec in macro file\n"));
break;
}
if (printit && rc) {
if (msg)
- rpmError(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
+ rpmlog(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
dbi->dbi_api, rc, msg, db_strerror(error));
else
- rpmError(RPMERR_DBERR, _("db%d error(%d): %s\n"),
+ rpmlog(RPMERR_DBERR, _("db%d error(%d): %s\n"),
dbi->dbi_api, rc, db_strerror(error));
}
(dbi->dbi_eflags & DB_INIT_CDB) &&
!(dbi->dbi_eflags & DB_PRIVATE))
? 0 : 1);
- rpmError( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
+ rpmlog( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
_("cannot get %s lock on %s/%s\n"),
((dbi->dbi_mode & (O_RDWR|O_WRONLY))
? _("exclusive") : _("shared")),
break;
}
if (opt->longName == NULL) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("unrecognized db option: \"%s\" ignored.\n"), o);
continue;
}
else if (!xstrncasecmp(pe, "Kb", 2))
aLong *= 1024;
else if (*pe != '\0') {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("%s has invalid numeric value, skipped\n"),
opt->longName);
continue;
if ((argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) {
if (aLong == LONG_MIN || aLong == LONG_MAX) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("%s has too large or too small long value, skipped\n"),
opt->longName);
continue;
break;
} else {
if (aLong > INT_MAX || aLong < INT_MIN) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("%s has too large or too small integer value, skipped\n"),
opt->longName);
continue;
if (rc) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
- rpmError(RPMERR_DBOPEN,
+ rpmlog(RPMERR_DBOPEN,
_("cannot open %s index using db%d - %s (%d)\n"),
rpmTagGetName(rpmtag), _dbapi,
(rc > 0 ? strerror(rc) : ""), rc);
if (_dbapi <= 0) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
- rpmError(RPMERR_DBOPEN, _("cannot open %s index\n"),
+ rpmlog(RPMERR_DBOPEN, _("cannot open %s index\n"),
rpmTagGetName(rpmtag));
rc = 1;
goto exit;
db->db_root = rpmGetPath(_DB_ROOT, NULL);
db->db_home = rpmGetPath( (home && *home ? home : _DB_HOME), NULL);
if (!(db->db_home && db->db_home[0] != '%')) {
- rpmError(RPMERR_DBOPEN, _("no dbpath has been set\n"));
+ rpmlog(RPMERR_DBOPEN, _("no dbpath has been set\n"));
db->db_root = _free(db->db_root);
db->db_home = _free(db->db_home);
db = _free(db);
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
}
if (rc == DB_NOTFOUND) { /* not found */
rc = 0;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
rc = -1;
if (rc == DB_NOTFOUND) { /* not found */
return RPMRC_NOTFOUND;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
return RPMRC_FAIL;
(void) blockSignals(dbi->dbi_rpmdb, &signalMask);
rc = dbiPut(dbi, mi->mi_dbc, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record #%d into %s\n"),
rc, mi->mi_prevoffset, rpmTagGetName(dbi->dbi_rpmtag));
}
char msg[256];
(void) regerror(rc, mire->preg, msg, sizeof(msg)-1);
msg[sizeof(msg)-1] = '\0';
- rpmError(RPMERR_REGEXEC, "%s: regexec failed: %s\n",
+ rpmlog(RPMERR_REGEXEC, "%s: regexec failed: %s\n",
mire->pattern, msg);
rc = -1;
}
char msg[256];
(void) regerror(rc, preg, msg, sizeof(msg)-1);
msg[sizeof(msg)-1] = '\0';
- rpmError(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg);
+ rpmlog(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg);
}
break;
case RPMMIRE_GLOB:
mi->mi_h = headerCopyLoad(uh);
#endif
if (mi->mi_h == NULL || !headerIsEntry(mi->mi_h, RPMTAG_NAME)) {
- rpmError(RPMERR_BADHEADER,
+ rpmlog(RPMERR_BADHEADER,
_("rpmdb: damaged header #%u retrieved -- skipping.\n"),
mi->mi_offset);
goto top;
if (rc) { /* error/not found */
if (rc != DB_NOTFOUND)
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
#ifdef SQLITE_HACK
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, (key->data ? key->data : "???"), rpmTagGetName(dbi->dbi_rpmtag));
}
}
if (h == NULL) {
- rpmError(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
+ rpmlog(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
"rpmdbRemove", hdrNum);
return 1;
}
rc = dbiCopen(dbi, dbi->dbi_txnid, &dbcursor, DB_WRITECURSOR);
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) setting header #%d record for %s removal\n"),
rc, hdrNum, rpmTagGetName(dbi->dbi_rpmtag));
} else
} else if (rc == DB_NOTFOUND) { /* not found */
continue;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) setting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
(void) set2dbt(dbi, data, set);
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record \"%s\" into %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
} else {
rc = dbiDel(dbi, dbcursor, key, data, 0);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) removing record \"%s\" from %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
}
if (ret) {
- rpmError(RPMERR_DBCORRUPT,
+ rpmlog(RPMERR_DBCORRUPT,
_("error(%d) allocating new package instance\n"), ret);
goto exit;
}
if (!dbi->dbi_permit_dups)
(void) dbt2set(dbi, data, &set);
} else if (rc != DB_NOTFOUND) { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record %s into %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
rootdbpath, newrootdbpath);
if (!access(newrootdbpath, F_OK)) {
- rpmError(RPMERR_MKDIR, _("temporary database %s already exists\n"),
+ rpmlog(RPMERR_MKDIR, _("temporary database %s already exists\n"),
newrootdbpath);
rc = 1;
goto exit;
rpmMessage(RPMMESS_DEBUG, _("creating directory %s\n"), newrootdbpath);
if (Mkdir(newrootdbpath, 0755)) {
- rpmError(RPMERR_MKDIR, _("creating directory %s: %s\n"),
+ rpmlog(RPMERR_MKDIR, _("creating directory %s: %s\n"),
newrootdbpath, strerror(errno));
rc = 1;
goto exit;
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_BUILDTIME)))
{
- rpmError(RPMERR_INTERNAL,
+ rpmlog(RPMERR_INTERNAL,
_("header #%u in the database is bad -- skipping.\n"),
_RECNUM);
continue;
}
if (rc) {
- rpmError(RPMERR_INTERNAL,
+ rpmlog(RPMERR_INTERNAL,
_("cannot add record originally at %u\n"), _RECNUM);
failed = 1;
break;
int c;
if (clen >= sizeof(pcmd)) {
- rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
+ rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
return 1;
}
SKIPBLANK(s, c);
if (c == '{') { /* XXX permit silent {...} grouping */
if ((se = matchchar(s, c, '}')) == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Macro %%%s has unterminated body\n"), n);
se = s; /* XXX W2DO? */
return se;
*be = '\0';
if (bc || pc) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Macro %%%s has unterminated body\n"), n);
se = s; /* XXX W2DO? */
return se;
/* Names must start with alphabetic or _ and be at least 3 chars */
if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Macro %%%s has illegal name (%%define)\n"), n);
return se;
}
/* Options must be terminated with ')' */
if (o && oc != ')') {
- rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n);
+ rpmlog(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n);
return se;
}
if ((be - b) < 1) {
- rpmError(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n);
+ rpmlog(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n);
return se;
}
if (expandbody && expandU(mb, b, (&buf[sizeof(buf)] - b))) {
- rpmError(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n);
+ rpmlog(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n);
return se;
}
/* Names must start with alphabetic or _ and be at least 3 chars */
if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Macro %%%s has illegal name (%%undefine)\n"), n);
return se;
}
skiptest = 1; /* XXX skip test for %# %* %0 */
} else if (!skiptest && me->used <= 0) {
#if NOTYET
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Macro %%%s (%s) was not used below level %d\n"),
me->name, me->body, me->level);
#endif
while((c = getopt(argc, (char **)argv, opts)) != -1)
{
if (c == '?' || (o = strchr(opts, c)) == NULL) {
- rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"),
+ rpmlog(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"),
(char)c, me->name, opts);
return se;
}
/**
* Perform macro message output
* @param mb macro expansion state
- * @param waserror use rpmError()?
+ * @param waserror use rpmlog()?
* @param msg message to ouput
* @param msglen no. of bytes in message
*/
char buf[BUFSIZ];
if (msglen >= sizeof(buf)) {
- rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
+ rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
msglen = sizeof(buf) - 1;
}
strncpy(buf, msg, msglen);
buf[msglen] = '\0';
(void) expandU(mb, buf, sizeof(buf));
if (waserror)
- rpmError(RPMERR_BADSPEC, "%s\n", buf);
+ rpmlog(RPMERR_BADSPEC, "%s\n", buf);
else
fprintf(stderr, "%s", buf);
}
buf[0] = '\0';
if (g != NULL) {
if (gn >= sizeof(buf)) {
- rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
+ rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
gn = sizeof(buf) - 1;
}
strncpy(buf, g, gn);
int chkexist;
if (++mb->depth > max_macro_depth) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Recursion depth(%d) greater than max(%d)\n"),
mb->depth, max_macro_depth);
mb->depth--;
break;
case '(': /* %(...) shell escape */
if ((se = matchchar(s, c, ')')) == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Unterminated %c: %s\n"), (char)c, s);
rc = 1;
continue;
break;
case '{': /* %{...}/%{...:...} substitution */
if ((se = matchchar(s, c, '}')) == NULL) {
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Unterminated %c: %s\n"), (char)c, s);
rc = 1;
continue;
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
#if 0
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("A %% is followed by an unparseable macro\n"));
#endif
s = se;
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
#else
- rpmError(RPMERR_BADSPEC,
+ rpmlog(RPMERR_BADSPEC,
_("Macro %%%.*s not found, skipping\n"), fn, f);
s = se;
#endif
rc = expandMacro(mb);
if (mb->nb == 0)
- rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n"));
+ rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n"));
tbuf[slen] = '\0'; /* XXX just in case */
strncpy(sbuf, tbuf, (slen - mb->nb + 1));
fd = Fopen(file, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
/* XXX Fstrerror */
- rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
+ rpmlog(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
if (fd) (void) Fclose(fd);
return 1;
}
nb = Fread(magic, sizeof(magic[0]), sizeof(magic), fd);
if (nb < 0) {
- rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
+ rpmlog(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
rc = 1;
} else if (nb < sizeof(magic)) {
- rpmError(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"),
+ rpmlog(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"),
file, (unsigned)sizeof(magic));
rc = 0;
}
wait = waitpid(pid, &rc, 0);
if (!WIFEXITED(rc) || WEXITSTATUS(rc)) {
- rpmError(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"),
+ rpmlog(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"),
cmd, WEXITSTATUS(rc));
} else {
fd = fdOpen(dest, flags, mode);
if (name == NULL)
name = "<lua>";
if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {
- rpmError(RPMERR_SCRIPT,
+ rpmlog(RPMERR_SCRIPT,
_("invalid syntax in lua scriptlet: %s\n"),
lua_tostring(L, -1));
ret = -1;
if (name == NULL)
name = "<lua>";
if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {
- rpmError(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"),
+ rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
} else if (lua_pcall(L, 0, 0, 0) != 0) {
- rpmError(RPMERR_SCRIPT, _("lua script failed: %s\n"),
+ rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
lua_State *L = lua->L;
int ret = 0;
if (luaL_loadfile(L, filename) != 0) {
- rpmError(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"),
+ rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
} else if (lua_pcall(L, 0, 0, 0) != 0) {
- rpmError(RPMERR_SCRIPT, _("lua script failed: %s\n"),
+ rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
ret = -1;
}
}
if (lua_pcall(L, 1, 1, 0) != 0) {
- rpmError(RPMERR_SCRIPT, _("lua hook failed: %s\n"),
+ rpmlog(RPMERR_SCRIPT, _("lua hook failed: %s\n"),
lua_tostring(L, -1));
lua_pop(L, 1);
} else {
/* Try to read the header from a package file. */
fd = Fopen(*fnp, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
Fstrerror(fd));
if (fd) {
Fclose(fd);
/* Try to read a package manifest. */
fd = Fopen(*fnp, "r.fpio");
if (fd == NULL || Ferror(fd)) {
- rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
+ rpmlog(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp,
Fstrerror(fd));
if (fd) {
Fclose(fd);
/* Read list of packages from manifest. */
rc = rpmReadPackageManifest(fd, &argc, &argv);
if (rc)
- rpmError(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"),
+ rpmlog(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"),
fileURL, Fstrerror(fd));
Fclose(fd);
fd = NULL;