diff options
author | jbj <devnull@localhost> | 2001-01-15 23:09:42 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-01-15 23:09:42 +0000 |
commit | c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2 (patch) | |
tree | 68ccc4b1ad6388c283f56cf9c932b2712efc29ed /build | |
parent | 082ccecf35f3fb73c2a58b9052f102e5d9386fc4 (diff) | |
download | rpm-c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2.tar.gz rpm-c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2.tar.bz2 rpm-c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2.zip |
- fix: extra newline in many error messages (#23947).
- fix: rpm -Va with db1 needs per-iterator, not per-index, offset.
- add install/remove transaction id tags.
CVS patchset: 4441
CVS date: 2001/01/15 23:09:42
Diffstat (limited to 'build')
-rw-r--r-- | build/build.c | 7 | ||||
-rw-r--r-- | build/expression.c | 32 | ||||
-rw-r--r-- | build/files.c | 76 | ||||
-rw-r--r-- | build/pack.c | 41 | ||||
-rw-r--r-- | build/parseBuildInstallClean.c | 3 | ||||
-rw-r--r-- | build/parseChangelog.c | 15 | ||||
-rw-r--r-- | build/parseDescription.c | 11 | ||||
-rw-r--r-- | build/parseFiles.c | 10 | ||||
-rw-r--r-- | build/parsePreamble.c | 60 | ||||
-rw-r--r-- | build/parsePrep.c | 43 | ||||
-rw-r--r-- | build/parseReqs.c | 8 | ||||
-rw-r--r-- | build/parseScript.c | 16 | ||||
-rw-r--r-- | build/parseSpec.c | 32 | ||||
-rw-r--r-- | build/spec.c | 4 |
14 files changed, 191 insertions, 167 deletions
diff --git a/build/build.c b/build/build.c index 3f8ce87b7..a6fcae0c0 100644 --- a/build/build.c +++ b/build/build.c @@ -111,7 +111,7 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) } if (makeTempFile(rootURL, &scriptName, &fd) || fd == NULL || Ferror(fd)) { - rpmError(RPMERR_SCRIPT, _("Unable to open temp file.")); + rpmError(RPMERR_SCRIPT, _("Unable to open temp file.\n")); rc = RPMERR_SCRIPT; goto exit; } @@ -196,7 +196,8 @@ fprintf(stderr, "*** addMacros\n"); errno = 0; execvp(argv[0], (char *const *)argv); - rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s"), scriptName, name, strerror(errno)); + rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"), + scriptName, name, strerror(errno)); _exit(-1); } @@ -204,7 +205,7 @@ fprintf(stderr, "*** addMacros\n"); rc = waitpid(child, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { - rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)"), + rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)\n"), scriptName, name); rc = RPMERR_SCRIPT; } else diff --git a/build/expression.c b/build/expression.c index 1884905ad..b8e34072f 100644 --- a/build/expression.c +++ b/build/expression.c @@ -212,7 +212,7 @@ static int rdToken(ParseState state) token = TOK_EQ; p++; } else { - rpmError(RPMERR_BADSPEC, _("syntax error while parsing ==")); + rpmError(RPMERR_BADSPEC, _("syntax error while parsing ==\n")); return -1; } break; @@ -242,7 +242,7 @@ static int rdToken(ParseState state) token = TOK_LOGICAL_AND; p++; } else { - rpmError(RPMERR_BADSPEC, _("syntax error while parsing &&")); + rpmError(RPMERR_BADSPEC, _("syntax error while parsing &&\n")); return -1; } break; @@ -251,7 +251,7 @@ static int rdToken(ParseState state) token = TOK_LOGICAL_OR; p++; } else { - rpmError(RPMERR_BADSPEC, _("syntax error while parsing ||")); + rpmError(RPMERR_BADSPEC, _("syntax error while parsing ||\n")); return -1; } break; @@ -291,7 +291,7 @@ static int rdToken(ParseState state) v = valueMakeString( rpmExpand(temp, NULL) ); } else { - rpmError(RPMERR_BADSPEC, _("parse error in expression")); + rpmError(RPMERR_BADSPEC, _("parse error in expression\n")); return -1; } } @@ -323,7 +323,7 @@ static Value doPrimary(ParseState state) return NULL; v = doLogical(state); if (state->nextToken != TOK_CLOSE_P) { - rpmError(RPMERR_BADSPEC, _("unmatched (")); + rpmError(RPMERR_BADSPEC, _("unmatched (\n")); return NULL; } break; @@ -353,7 +353,7 @@ static Value doPrimary(ParseState state) return NULL; if (! valueIsInteger(v)) { - rpmError(RPMERR_BADSPEC, _("- only on numbers")); + rpmError(RPMERR_BADSPEC, _("- only on numbers\n")); return NULL; } @@ -369,7 +369,7 @@ static Value doPrimary(ParseState state) return NULL; if (! valueIsInteger(v)) { - rpmError(RPMERR_BADSPEC, _("! only on numbers")); + rpmError(RPMERR_BADSPEC, _("! only on numbers\n")); return NULL; } @@ -411,7 +411,7 @@ static Value doMultiplyDivide(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmError(RPMERR_BADSPEC, _("types must match")); + rpmError(RPMERR_BADSPEC, _("types must match\n")); return NULL; } @@ -424,7 +424,7 @@ static Value doMultiplyDivide(ParseState state) else v1 = valueMakeInteger(i1 / i2); } else { - rpmError(RPMERR_BADSPEC, _("* / not suported for strings")); + rpmError(RPMERR_BADSPEC, _("* / not suported for strings\n")); return NULL; } } @@ -459,7 +459,7 @@ static Value doAddSubtract(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmError(RPMERR_BADSPEC, _("types must match")); + rpmError(RPMERR_BADSPEC, _("types must match\n")); return NULL; } @@ -475,7 +475,7 @@ static Value doAddSubtract(ParseState state) char *copy; if (op == TOK_MINUS) { - rpmError(RPMERR_BADSPEC, _("- not suported for strings")); + rpmError(RPMERR_BADSPEC, _("- not suported for strings\n")); return NULL; } @@ -517,7 +517,7 @@ static Value doRelational(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmError(RPMERR_BADSPEC, _("types must match")); + rpmError(RPMERR_BADSPEC, _("types must match\n")); return NULL; } @@ -609,7 +609,7 @@ static Value doLogical(ParseState state) return NULL; if (! valueSameType(v1, v2)) { - rpmError(RPMERR_BADSPEC, _("types must match")); + rpmError(RPMERR_BADSPEC, _("types must match\n")); return NULL; } @@ -622,7 +622,7 @@ static Value doLogical(ParseState state) else v1 = valueMakeInteger(i1 || i2); } else { - rpmError(RPMERR_BADSPEC, _("&& and || not suported for strings")); + rpmError(RPMERR_BADSPEC, _("&& and || not suported for strings\n")); return NULL; } } @@ -655,7 +655,7 @@ int parseExpressionBoolean(Spec spec, const char *expr) /* If the next token is not TOK_EOF, we have a syntax error. */ if (state.nextToken != TOK_EOF) { - rpmError(RPMERR_BADSPEC, _("syntax error in expression")); + rpmError(RPMERR_BADSPEC, _("syntax error in expression\n")); free(state.str); return -1; } @@ -702,7 +702,7 @@ char * parseExpressionString(Spec spec, const char *expr) /* If the next token is not TOK_EOF, we have a syntax error. */ if (state.nextToken != TOK_EOF) { - rpmError(RPMERR_BADSPEC, _("syntax error in expression")); + rpmError(RPMERR_BADSPEC, _("syntax error in expression\n")); free(state.str); return NULL; } diff --git a/build/files.c b/build/files.c index 140dd8d3f..91a8d1e3b 100644 --- a/build/files.c +++ b/build/files.c @@ -273,7 +273,7 @@ static int parseForVerify(char *buf, struct FileList *fl) SKIPSPACE(pe); if (*pe != '(') { - rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s"), name, pe); + rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -284,7 +284,7 @@ static int parseForVerify(char *buf, struct FileList *fl) ; if (*pe == '\0') { - rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s"), name, p); + rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -322,7 +322,7 @@ static int parseForVerify(char *buf, struct FileList *fl) if (!strcmp(p, "not")) { not ^= 1; } else { - rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s"), name, p); + rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -357,7 +357,7 @@ static int parseForAttr(char *buf, struct FileList *fl) SKIPSPACE(pe); if (*pe != '(') { - rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s"), name, pe); + rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -373,7 +373,7 @@ static int parseForAttr(char *buf, struct FileList *fl) SKIPSPACE(q); if (*q) { rpmError(RPMERR_BADSPEC, - _("Non-white space follows %s(): %s"), name, q); + _("Non-white space follows %s(): %s\n"), name, q); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -411,7 +411,7 @@ static int parseForAttr(char *buf, struct FileList *fl) } if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') { - rpmError(RPMERR_BADSPEC, _("Bad syntax: %s(%s)"), name, q); + rpmError(RPMERR_BADSPEC, _("Bad syntax: %s(%s)\n"), name, q); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -421,7 +421,7 @@ static int parseForAttr(char *buf, struct FileList *fl) unsigned int ui; x = sscanf(ar->ar_fmodestr, "%o", &ui); if ((x == 0) || (ar->ar_fmode & ~MYALLPERMS)) { - rpmError(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)"), name, q); + rpmError(RPMERR_BADSPEC, _("Bad mode spec: %s(%s)\n"), name, q); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -433,7 +433,7 @@ static int parseForAttr(char *buf, struct FileList *fl) unsigned int ui; x = sscanf(ar->ar_dmodestr, "%o", &ui); if ((x == 0) || (ar->ar_dmode & ~MYALLPERMS)) { - rpmError(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)"), name, q); + rpmError(RPMERR_BADSPEC, _("Bad dirmode spec: %s(%s)\n"), name, q); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -476,7 +476,7 @@ static int parseForConfig(char *buf, struct FileList *fl) ; if (*pe == '\0') { - rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s"), name, p); + rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -501,7 +501,7 @@ static int parseForConfig(char *buf, struct FileList *fl) } else if (!strcmp(p, "noreplace")) { fl->currentFlags |= RPMFILE_NOREPLACE; } else { - rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s"), name, p); + rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s\n"), name, p); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -524,7 +524,7 @@ static int parseForLang(char *buf, struct FileList *fl) SKIPSPACE(pe); if (*pe != '(') { - rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s"), name, pe); + rpmError(RPMERR_BADSPEC, _("Missing '(' in %s %s\n"), name, pe); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -535,7 +535,7 @@ static int parseForLang(char *buf, struct FileList *fl) ; if (*pe == '\0') { - rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s"), name, p); + rpmError(RPMERR_BADSPEC, _("Missing ')' in %s(%s\n"), name, p); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -561,7 +561,8 @@ static int parseForLang(char *buf, struct FileList *fl) /* Sanity check on locale lengths */ if (np < 1 || (np == 1 && *p != 'C') || np >= 32) { - rpmError(RPMERR_BADSPEC, _("Unusual locale length: \"%.*s\" in %%lang(%s)"), + rpmError(RPMERR_BADSPEC, + _("Unusual locale length: \"%.*s\" in %%lang(%s)\n"), (int)np, p, q); fl->processingFailed = 1; return RPMERR_BADSPEC; @@ -571,7 +572,7 @@ static int parseForLang(char *buf, struct FileList *fl) for (i = 0; i < fl->nLangs; i++) { if (strncmp(fl->currentLangs[i], p, np)) continue; - rpmError(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)"), + rpmError(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"), (int)np, p, q); fl->processingFailed = 1; return RPMERR_BADSPEC; @@ -703,13 +704,13 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char *buf, if (!strcmp(s, "%docdir")) { s = strtokWithQuotes(NULL, " \t\n"); if (fl->docDirCount == MAXDOCDIR) { - rpmError(RPMERR_INTERNAL, _("Hit limit for %%docdir")); + rpmError(RPMERR_INTERNAL, _("Hit limit for %%docdir\n")); fl->processingFailed = 1; res = 1; } fl->docDirs[fl->docDirCount++] = xstrdup(s); if (strtokWithQuotes(NULL, " \t\n")) { - rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir")); + rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir\n")); fl->processingFailed = 1; res = 1; } @@ -737,7 +738,8 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char *buf, if (*fileName) { /* We already got a file -- error */ - rpmError(RPMERR_BADSPEC, _("Two files on one line: %s"), *fileName); + rpmError(RPMERR_BADSPEC, _("Two files on one line: %s\n"), + *fileName); fl->processingFailed = 1; res = 1; } @@ -750,7 +752,7 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char *buf, } else { /* not in %doc, does not begin with / -- error */ rpmError(RPMERR_BADSPEC, - _("File must begin with \"/\": %s"), s); + _("File must begin with \"/\": %s\n"), s); fl->processingFailed = 1; res = 1; } @@ -762,7 +764,7 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char *buf, if (specialDoc) { if (*fileName || (fl->currentFlags & ~(RPMFILE_DOC))) { rpmError(RPMERR_BADSPEC, - _("Can't mix special %%doc with other forms: %s"), + _("Can't mix special %%doc with other forms: %s\n"), *fileName); fl->processingFailed = 1; res = 1; @@ -856,7 +858,8 @@ static void genCpioListAndHeader(struct FileList *fl, for (flp = fl->fileList, count = fl->fileListRecsUsed; count > 0; flp++, count--) { if ((count > 1) && !strcmp(flp->fileURL, flp[1].fileURL)) { - rpmError(RPMERR_BADSPEC, _("File listed twice: %s"), flp->fileURL); + rpmError(RPMERR_BADSPEC, _("File listed twice: %s\n"), + flp->fileURL); fl->processingFailed = 1; } @@ -965,7 +968,8 @@ static void genCpioListAndHeader(struct FileList *fl, if (buf[0] == '/' && strcmp(buildRoot, "/") && !strncmp(buf, buildRoot, strlen(buildRoot))) { - rpmError(RPMERR_BADSPEC, _("Symlink points to BuildRoot: %s -> %s"), + rpmError(RPMERR_BADSPEC, + _("Symlink points to BuildRoot: %s -> %s\n"), flp->fileURL, buf); fl->processingFailed = 1; } @@ -1059,7 +1063,7 @@ static int addFile(struct FileList *fl, const char * diskURL, struct stat *statp prefixTest++; } if (*prefixPtr || (*prefixTest && *prefixTest != '/')) { - rpmError(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s"), + rpmError(RPMERR_BADSPEC, _("File doesn't match prefix (%s): %s\n"), fl->prefix, fileURL); fl->processingFailed = 1; return RPMERR_BADSPEC; @@ -1069,7 +1073,7 @@ static int addFile(struct FileList *fl, const char * diskURL, struct stat *statp if (statp == NULL) { statp = &statbuf; if (Lstat(diskURL, statp)) { - rpmError(RPMERR_BADSPEC, _("File not found: %s"), diskURL); + rpmError(RPMERR_BADSPEC, _("File not found: %s\n"), diskURL); fl->processingFailed = 1; return RPMERR_BADSPEC; } @@ -1200,7 +1204,8 @@ static int processBinaryFile(/*@unused@*/Package pkg, struct FileList *fl, { const char * fileName; (void) urlPath(fileURL, &fileName); if (*fileName != '/') { - rpmError(RPMERR_BADSPEC, _("File needs leading \"/\": %s"), fileName); + rpmError(RPMERR_BADSPEC, _("File needs leading \"/\": %s\n"), + fileName); rc = 1; goto exit; } @@ -1229,7 +1234,8 @@ static int processBinaryFile(/*@unused@*/Package pkg, struct FileList *fl, } free((void *)argv); } else { - rpmError(RPMERR_BADSPEC, _("File not found by glob: %s"), diskURL); + rpmError(RPMERR_BADSPEC, _("File not found by glob: %s\n"), + diskURL); rc = 1; } } else { @@ -1283,7 +1289,7 @@ static int processPackageFiles(Spec spec, Package pkg, if (fd == NULL || Ferror(fd)) { rpmError(RPMERR_BADFILENAME, - _("Could not open %%files file %s: %s"), + _("Could not open %%files file %s: %s\n"), ffn, Fstrerror(fd)); return RPMERR_BADFILENAME; } @@ -1292,7 +1298,7 @@ static int processPackageFiles(Spec spec, Package pkg, while (fgets(buf, sizeof(buf), (FILE *)fdGetFp(fd))) { handleComments(buf); if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { - rpmError(RPMERR_BADSPEC, _("line: %s"), buf); + rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf); return RPMERR_BADSPEC; } appendStringBuf(pkg->fileList, buf); @@ -1618,7 +1624,7 @@ int processSourceFiles(Spec spec) flp->verifyFlags = RPMVERIFY_ALL; if (Stat(diskURL, &flp->fl_st)) { - rpmError(RPMERR_BADSPEC, _("Bad file: %s: %s"), + rpmError(RPMERR_BADSPEC, _("Bad file: %s: %s\n"), diskURL, strerror(errno)); fl.processingFailed = 1; } @@ -1630,7 +1636,7 @@ int processSourceFiles(Spec spec) fl.totalFileSize += flp->fl_size; if (! (flp->uname && flp->gname)) { - rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s"), diskURL); + rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskURL); fl.processingFailed = 1; } @@ -1687,12 +1693,12 @@ static StringBuf getOutputFrom(char *dir, char *argv[], execvp(argv[0], argv); /* XXX this error message is probably not seen. */ - rpmError(RPMERR_EXEC, _("Couldn't exec %s: %s"), + rpmError(RPMERR_EXEC, _("Couldn't exec %s: %s\n"), argv[0], strerror(errno)); _exit(RPMERR_EXEC); } if (progPID < 0) { - rpmError(RPMERR_FORK, _("Couldn't fork %s: %s"), + rpmError(RPMERR_FORK, _("Couldn't fork %s: %s\n"), argv[0], strerror(errno)); return NULL; } @@ -1774,11 +1780,11 @@ top: /* Collect status from prog */ (void)waitpid(progPID, &status, 0); if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) { - rpmError(RPMERR_EXEC, _("%s failed"), argv[0]); + rpmError(RPMERR_EXEC, _("%s failed\n"), argv[0]); return NULL; } if (writeBytesLeft) { - rpmError(RPMERR_EXEC, _("failed to write all data to %s"), argv[0]); + rpmError(RPMERR_EXEC, _("failed to write all data to %s\n"), argv[0]); return NULL; } return readBuff; @@ -1931,7 +1937,7 @@ static int generateDepends(Spec spec, Package pkg, if (readBuf == NULL) { rc = RPMERR_EXEC; - rpmError(rc, _("Failed to find %s:"), dm->msg); + rpmError(rc, _("Failed to find %s:\n"), dm->msg); break; } @@ -1945,7 +1951,7 @@ static int generateDepends(Spec spec, Package pkg, freeStringBuf(readBuf); if (rc) { - rpmError(rc, _("Failed to find %s:"), dm->msg); + rpmError(rc, _("Failed to find %s:\n"), dm->msg); break; } } diff --git a/build/pack.c b/build/pack.c index 9074229e1..3a0479853 100644 --- a/build/pack.c +++ b/build/pack.c @@ -49,7 +49,7 @@ static int cpio_doio(FD_t fdo, CSA_t * csa, const char * fmodeMacro) rc = cpioBuildArchive(cfd, csa->cpioList, csa->cpioCount, NULL, NULL, &csa->cpioArchiveSize, &failedFile); if (rc) { - rpmError(RPMERR_CPIO, _("create archive failed on file %s: %s"), + rpmError(RPMERR_CPIO, _("create archive failed on file %s: %s\n"), failedFile, cpioStrerror(rc)); rc = 1; } @@ -71,14 +71,14 @@ static int cpio_copy(FD_t fdo, CSA_t *csa) while((nb = Fread(buf, sizeof(buf[0]), sizeof(buf), csa->cpioFdIn)) > 0) { if (Fwrite(buf, sizeof(buf[0]), nb, fdo) != nb) { - rpmError(RPMERR_CPIO, _("cpio_copy write failed: %s"), + rpmError(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"), + rpmError(RPMERR_CPIO, _("cpio_copy read failed: %s\n"), Fstrerror(csa->cpioFdIn)); return 1; } @@ -105,7 +105,7 @@ static StringBuf addFileToTagAux(Spec spec, const char *file, StringBuf sb) while (fgets(buf, sizeof(buf), (FILE *)fdGetFp(fd))) { /* XXX display fn in error msg */ if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { - rpmError(RPMERR_BADSPEC, _("line: %s"), buf); + rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf); return NULL; } appendStringBuf(sb, buf); @@ -162,28 +162,28 @@ static int processScriptFiles(Spec spec, Package pkg) if (pkg->preInFile) { if (addFileToTag(spec, pkg->preInFile, pkg->header, RPMTAG_PREIN)) { rpmError(RPMERR_BADFILENAME, - _("Could not open PreIn file: %s"), pkg->preInFile); + _("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, - _("Could not open PreUn file: %s"), pkg->preUnFile); + _("Could not open PreUn file: %s\n"), pkg->preUnFile); return RPMERR_BADFILENAME; } } if (pkg->postInFile) { if (addFileToTag(spec, pkg->postInFile, pkg->header, RPMTAG_POSTIN)) { rpmError(RPMERR_BADFILENAME, - _("Could not open PostIn file: %s"), pkg->postInFile); + _("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, - _("Could not open PostUn file: %s"), pkg->postUnFile); + _("Could not open PostUn file: %s\n"), pkg->postUnFile); return RPMERR_BADFILENAME; } } @@ -191,7 +191,7 @@ static int processScriptFiles(Spec spec, Package pkg) if (addFileToTag(spec, pkg->verifyFile, pkg->header, RPMTAG_VERIFYSCRIPT)) { rpmError(RPMERR_BADFILENAME, - _("Could not open VerifyScript file: %s"), pkg->verifyFile); + _("Could not open VerifyScript file: %s\n"), pkg->verifyFile); return RPMERR_BADFILENAME; } } @@ -206,7 +206,7 @@ static int processScriptFiles(Spec spec, Package pkg) if (addFileToArrayTag(spec, p->fileName, pkg->header, RPMTAG_TRIGGERSCRIPTS)) { rpmError(RPMERR_BADFILENAME, - _("Could not open Trigger script file: %s"), + _("Could not open Trigger script file: %s\n"), p->fileName); return RPMERR_BADFILENAME; } @@ -264,12 +264,13 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, Header *sig switch (rc) { case 1: rpmError(RPMERR_BADMAGIC, _("readRPM: %s is not an RPM package\n"), - fileName); + fileName); return RPMERR_BADMAGIC; case 0: break; default: - rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"), fileName); + rpmError(RPMERR_BADMAGIC, _("readRPM: reading header from %s\n"), + fileName); return RPMERR_BADMAGIC; /*@notreached@*/ break; } @@ -366,7 +367,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, * archive (after compression) can be added to the header. */ if (makeTempFile(NULL, &sigtarget, &fd)) { - rpmError(RPMERR_CREATE, _("Unable to open temp file.")); + rpmError(RPMERR_CREATE, _("Unable to open temp file.\n")); return RPMERR_CREATE; } @@ -378,7 +379,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, } else if (Fileno(csa->cpioFdIn) >= 0) { rc = cpio_copy(fd, csa); } else { - rpmError(RPMERR_CREATE, _("Bad CSA data")); + rpmError(RPMERR_CREATE, _("Bad CSA data\n")); rc = RPMERR_BADARG; } } @@ -466,7 +467,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, } if (writeLead(fd, &lead)) { - rpmError(RPMERR_NOSPACE, _("Unable to write package: %s"), + rpmError(RPMERR_NOSPACE, _("Unable to write package: %s\n"), Fstrerror(fd)); rc = RPMERR_NOSPACE; goto exit; @@ -481,7 +482,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, /* Append the header and archive */ ifd = Fopen(sigtarget, "r.ufdio"); if (ifd == NULL || Ferror(ifd)) { - rpmError(RPMERR_READ, _("Unable to open sigtarget %s: %s"), + rpmError(RPMERR_READ, _("Unable to open sigtarget %s: %s\n"), sigtarget, Fstrerror(ifd)); rc = RPMERR_READ; goto exit; @@ -491,7 +492,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, { Header nh = headerRead(ifd, HEADER_MAGIC_YES); if (nh == NULL) { - rpmError(RPMERR_READ, _("Unable to read header from %s: %s"), + rpmError(RPMERR_READ, _("Unable to read header from %s: %s\n"), sigtarget, Fstrerror(ifd)); rc = RPMERR_READ; goto exit; @@ -505,7 +506,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, headerFree(nh); if (rc) { - rpmError(RPMERR_NOSPACE, _("Unable to write header to %s: %s"), + rpmError(RPMERR_NOSPACE, _("Unable to write header to %s: %s\n"), fileName, Fstrerror(fd)); rc = RPMERR_NOSPACE; goto exit; @@ -515,13 +516,13 @@ int writeRPM(Header *hdrp, const char *fileName, int type, /* Write the payload into the package. */ while ((count = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) { if (count == -1) { - rpmError(RPMERR_READ, _("Unable to read payload from %s: %s"), + rpmError(RPMERR_READ, _("Unable to read payload from %s: %s\n"), sigtarget, Fstrerror(ifd)); rc = RPMERR_READ; goto exit; } if (Fwrite(buf, sizeof(buf[0]), count, fd) < 0) { - rpmError(RPMERR_NOSPACE, _("Unable to write payload to %s: %s"), + rpmError(RPMERR_NOSPACE, _("Unable to write payload to %s: %s\n"), fileName, Fstrerror(fd)); rc = RPMERR_NOSPACE; goto exit; diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c index cb9397abf..16e0e1063 100644 --- a/build/parseBuildInstallClean.c +++ b/build/parseBuildInstallClean.c @@ -25,7 +25,8 @@ int parseBuildInstallClean(Spec spec, rpmParseState parsePart) } if (*sbp != NULL) { - rpmError(RPMERR_BADSPEC, _("line %d: second %s"), spec->lineNum, name); + rpmError(RPMERR_BADSPEC, _("line %d: second %s\n"), + spec->lineNum, name); return RPMERR_BADSPEC; } diff --git a/build/parseChangelog.c b/build/parseChangelog.c index 5e9123e3f..0c81fcd49 100644 --- a/build/parseChangelog.c +++ b/build/parseChangelog.c @@ -117,7 +117,8 @@ static int addChangelog(Header h, StringBuf sb) while (*s) { if (*s != '*') { - rpmError(RPMERR_BADSPEC, _("%%changelog entries must start with *")); + rpmError(RPMERR_BADSPEC, + _("%%changelog entries must start with *\n")); return RPMERR_BADSPEC; } @@ -125,7 +126,7 @@ static int addChangelog(Header h, StringBuf sb) date = s; while(*s && *s != '\n') s++; if (! *s) { - rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry")); + rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry\n")); return RPMERR_BADSPEC; } *s = '\0'; @@ -140,12 +141,12 @@ static int addChangelog(Header h, StringBuf sb) } SKIPSPACE(date); if (dateToTimet(date, &time)) { - rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s"), date); + rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s\n"), date); return RPMERR_BADSPEC; } if (lastTime && lastTime < time) { rpmError(RPMERR_BADSPEC, - _("%%changelog not in decending chronological order")); + _("%%changelog not in decending chronological order\n")); return RPMERR_BADSPEC; } lastTime = time; @@ -153,7 +154,7 @@ static int addChangelog(Header h, StringBuf sb) /* skip space to the name */ SKIPSPACE(s); if (! *s) { - rpmError(RPMERR_BADSPEC, _("missing name in %%changelog")); + rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n")); return RPMERR_BADSPEC; } @@ -164,14 +165,14 @@ static int addChangelog(Header h, StringBuf sb) *s-- = '\0'; } if (s == name) { - rpmError(RPMERR_BADSPEC, _("missing name in %%changelog")); + rpmError(RPMERR_BADSPEC, _("missing name in %%changelog\n")); return RPMERR_BADSPEC; } /* text */ SKIPSPACE(text); if (! *text) { - rpmError(RPMERR_BADSPEC, _("no description in %%changelog")); + rpmError(RPMERR_BADSPEC, _("no description in %%changelog\n")); return RPMERR_BADSPEC; } diff --git a/build/parseDescription.c b/build/parseDescription.c index a5652e380..8cf5ae537 100644 --- a/build/parseDescription.c +++ b/build/parseDescription.c @@ -36,7 +36,7 @@ int parseDescription(Spec spec) lang = RPMBUILD_DEFAULT_LANG; if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { - rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%description: %s\n"), spec->lineNum, poptStrerror(rc)); return RPMERR_BADSPEC; } @@ -49,7 +49,7 @@ int parseDescription(Spec spec) } if (arg < -1) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), spec->line); @@ -62,7 +62,7 @@ int parseDescription(Spec spec) if (name == NULL) name = poptGetArg(optCon); if (poptPeekArg(optCon)) { - rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"), spec->lineNum, spec->line); FREE(argv); @@ -72,7 +72,7 @@ int parseDescription(Spec spec) } if (lookupPackage(spec, name, flag, &pkg)) { - rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"), spec->lineNum, spec->line); FREE(argv); poptFreeContext(optCon); @@ -84,7 +84,8 @@ int parseDescription(Spec spec) #if 0 if (headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) { - rpmError(RPMERR_BADSPEC, _("line %d: Second description"), spec->lineNum); + rpmError(RPMERR_BADSPEC, _("line %d: Second description\n"), + spec->lineNum); FREE(argv); poptFreeContext(optCon); return RPMERR_BADSPEC; diff --git a/build/parseFiles.c b/build/parseFiles.c index 0f3139778..7d46e0664 100644 --- a/build/parseFiles.c +++ b/build/parseFiles.c @@ -30,7 +30,7 @@ int parseFiles(Spec spec) name = file = NULL; if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { - rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %%files: %s\n"), spec->lineNum, poptStrerror(rc)); rc = RPMERR_BADSPEC; goto exit; @@ -44,7 +44,7 @@ int parseFiles(Spec spec) } if (arg < -1) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), spec->line); @@ -56,7 +56,7 @@ int parseFiles(Spec spec) if (name == NULL) name = poptGetArg(optCon); if (poptPeekArg(optCon)) { - rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"), spec->lineNum, spec->line); rc = RPMERR_BADSPEC; @@ -65,14 +65,14 @@ int parseFiles(Spec spec) } if (lookupPackage(spec, name, flag, &pkg)) { - rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s"), + rpmError(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"), + rpmError(RPMERR_BADSPEC, _("line %d: Second %%files list\n"), spec->lineNum); rc = RPMERR_BADSPEC; goto exit; diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 2d7370878..3a8fd1149 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -208,22 +208,22 @@ static int checkForValidArchitectures(Spec spec) if (isMemberInEntry(spec->buildRestrictions, arch, RPMTAG_EXCLUDEARCH) == 1) { - rpmError(RPMERR_BADSPEC, _("Architecture is excluded: %s"), arch); + rpmError(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"), arch); + rpmError(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"), os); + rpmError(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"), os); + rpmError(RPMERR_BADSPEC, _("OS is not included: %s\n"), os); return RPMERR_BADSPEC; } @@ -239,8 +239,9 @@ static int checkForRequired(Header h, const char *name) for (p = requiredTags; *p != 0; p++) { if (!headerIsEntry(h, *p)) { - rpmError(RPMERR_BADSPEC, _("%s field must be present in package: %s"), - tagName(*p), name); + rpmError(RPMERR_BADSPEC, + _("%s field must be present in package: %s\n"), + tagName(*p), name); res = 1; } } @@ -266,7 +267,7 @@ static int checkForDuplicates(Header h, const char *name) { if (tag != lastTag) continue; - rpmError(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s"), + rpmError(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s\n"), tagName(tag), name); res = 1; } @@ -320,7 +321,7 @@ static int readIcon(Header h, const char *file) fd = Fopen(fn, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s"), + rpmError(RPMERR_BADSPEC, _("Unable to open icon %s: %s\n"), fn, Fstrerror(fd)); rc = RPMERR_BADSPEC; goto exit; @@ -338,7 +339,7 @@ static int readIcon(Header h, const char *file) nb = Fread(icon, sizeof(char), iconsize, fd); if (Ferror(fd) || (size >= 0 && nb != size)) { - rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s"), + rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"), fn, Fstrerror(fd)); rc = RPMERR_BADSPEC; } @@ -351,7 +352,7 @@ static int readIcon(Header h, const char *file) } else if (! strncmp(icon, "/* XPM", sizeof("/* XPM")-1)) { headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, iconsize); } else { - rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s"), file); + rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file); rc = RPMERR_BADSPEC; goto exit; } @@ -393,7 +394,7 @@ stashSt(Spec spec, Header h, int tag, const char *lang) #define SINGLE_TOKEN_ONLY \ if (multiToken) { \ - rpmError(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s"), \ + rpmError(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \ spec->lineNum, spec->line); \ return RPMERR_BADSPEC; \ } @@ -418,7 +419,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, while ((*field) && (*field != ':')) field++; if (*field != ':') { - rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -426,7 +427,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, SKIPSPACE(field); if (!*field) { /* Empty field */ - rpmError(RPMERR_BADSPEC, _("line %d: Empty tag: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Empty tag: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -448,14 +449,14 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, /* These macros are for backward compatibility */ if (tag == RPMTAG_VERSION) { if (strchr(field, '-') != NULL) { - rpmError(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s"), + rpmError(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"), + rpmError(RPMERR_BADSPEC, _("line %d: Illegal char '-' in %s: %s\n"), spec->lineNum, "release", spec->line); return RPMERR_BADSPEC; } @@ -512,7 +513,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, if (*buildRoot == '\0') buildRoot = "/"; if (!strcmp(buildRoot, "/")) { rpmError(RPMERR_BADSPEC, - _("BuildRoot can not be \"/\": %s"), spec->buildRootURL); + _("BuildRoot can not be \"/\": %s\n"), spec->buildRootURL); free((void *)buildRootURL); return RPMERR_BADSPEC; } @@ -525,7 +526,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, len = strlen(array[num]); if (array[num][len - 1] == '/' && len > 1) { rpmError(RPMERR_BADSPEC, - _("line %d: Prefixes must not end with \"/\": %s"), + _("line %d: Prefixes must not end with \"/\": %s\n"), spec->lineNum, spec->line); FREE(array); return RPMERR_BADSPEC; @@ -537,7 +538,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, SINGLE_TOKEN_ONLY; if (field[0] != '/') { rpmError(RPMERR_BADSPEC, - _("line %d: Docdir must begin with '/': %s"), + _("line %d: Docdir must begin with '/': %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -549,7 +550,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, SINGLE_TOKEN_ONLY; if (parseNum(field, &num)) { rpmError(RPMERR_BADSPEC, - _("line %d: Epoch/Serial field must be a number: %s"), + _("line %d: Epoch/Serial field must be a number: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -589,7 +590,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, case RPMTAG_BUILDREQUIRES: if ((rc = parseBits(lang, buildScriptBits, &tagflags))) { rpmError(RPMERR_BADSPEC, - _("line %d: Bad %s: qualifiers: %s"), + _("line %d: Bad %s: qualifiers: %s\n"), spec->lineNum, tagName(tag), spec->line); return rc; } @@ -600,7 +601,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, case RPMTAG_PREREQ: if ((rc = parseBits(lang, installScriptBits, &tagflags))) { rpmError(RPMERR_BADSPEC, - _("line %d: Bad %s: qualifiers: %s"), + _("line %d: Bad %s: qualifiers: %s\n"), spec->lineNum, tagName(tag), spec->line); return rc; } @@ -626,7 +627,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, &(spec->buildArchitectureCount), &(spec->buildArchitectures)))) { rpmError(RPMERR_BADSPEC, - _("line %d: Bad BuildArchitecture format: %s"), + _("line %d: Bad BuildArchitecture format: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -635,7 +636,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, break; default: - rpmError(RPMERR_INTERNAL, _("Internal error: Bogus tag %d"), tag); + rpmError(RPMERR_INTERNAL, _("Internal error: Bogus tag %d\n"), tag); return RPMERR_INTERNAL; } @@ -779,13 +780,14 @@ int parsePreamble(Spec spec, int initialPackage) if (! initialPackage) { /* There is one option to %package: <pkg> or -n <pkg> */ if (parseSimplePart(spec->line, &name, &flag)) { - rpmError(RPMERR_BADSPEC, _("Bad package specification: %s"), - spec->line); + rpmError(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"), spec->line); + rpmError(RPMERR_BADSPEC, _("Package already exists: %s\n"), + spec->line); return RPMERR_BADSPEC; } @@ -810,8 +812,8 @@ int parsePreamble(Spec spec, int initialPackage) SKIPSPACE(linep); if (*linep) { if (findPreambleTag(spec, &tag, ¯o, lang)) { - rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s"), - spec->lineNum, spec->line); + rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"), + spec->lineNum, spec->line); return RPMERR_BADSPEC; } if (handlePreambleTag(spec, pkg, tag, macro, lang)) @@ -832,7 +834,7 @@ int parsePreamble(Spec spec, int initialPackage) /* Do some final processing on the header */ if (!spec->gotBuildRootURL && spec->buildRootURL) { - rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot")); + rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot\n")); return RPMERR_BADSPEC; } diff --git a/build/parsePrep.c b/build/parsePrep.c index f1aa47039..99e170438 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -34,11 +34,12 @@ static int checkOwners(const char *urlfn) struct stat sb; if (Lstat(urlfn, &sb)) { - rpmError(RPMERR_BADSPEC, _("Bad source: %s: %s"), urlfn, strerror(errno)); + rpmError(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"), urlfn); + rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), urlfn); return RPMERR_BADSPEC; } @@ -71,7 +72,7 @@ static int checkOwners(const char *urlfn) } } if (sp == NULL) { - rpmError(RPMERR_BADSPEC, _("No patch number %d"), c); + rpmError(RPMERR_BADSPEC, _("No patch number %d\n"), c); return NULL; } @@ -161,7 +162,7 @@ static int checkOwners(const char *urlfn) } } if (sp == NULL) { - rpmError(RPMERR_BADSPEC, _("No source number %d"), c); + rpmError(RPMERR_BADSPEC, _("No source number %d\n"), c); return NULL; } @@ -180,8 +181,9 @@ static int checkOwners(const char *urlfn) if (Lstat(urlfn, &st) != 0 && errno == ENOENT && urlIsUrl(sp->fullSource) != URL_IS_UNKNOWN) { if ((rc = urlGetFile(sp->fullSource, urlfn)) != 0) { - rpmError(RPMERR_BADFILENAME, _("Couldn't download nosource %s: %s"), - sp->fullSource, ftpStrerror(rc)); + rpmError(RPMERR_BADFILENAME, + _("Couldn't download nosource %s: %s\n"), + sp->fullSource, ftpStrerror(rc)); return NULL; } } @@ -274,7 +276,7 @@ static int doSetupMacro(Spec spec, char *line) dirName = NULL; if ((rc = poptParseArgvString(line, &argc, &argv))) { - rpmError(RPMERR_BADSPEC, _("Error parsing %%setup: %s"), + rpmError(RPMERR_BADSPEC, _("Error parsing %%setup: %s\n"), poptStrerror(rc)); return RPMERR_BADSPEC; } @@ -289,7 +291,7 @@ static int doSetupMacro(Spec spec, char *line) /* We only parse -a and -b here */ if (parseNum(optArg, &num)) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup %c: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup %c: %s\n"), spec->lineNum, num, optArg); free(argv); freeStringBuf(before); @@ -307,7 +309,7 @@ static int doSetupMacro(Spec spec, char *line) } if (arg < -1) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad %%setup option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), poptStrerror(arg)); @@ -440,16 +442,18 @@ static int doPatchMacro(Spec spec, char *line) /* orig suffix */ opt_b = strtok(NULL, " \t\n"); if (! opt_b) { - rpmError(RPMERR_BADSPEC, _("line %d: Need arg to %%patch -b: %s"), - spec->lineNum, spec->line); + rpmError(RPMERR_BADSPEC, + _("line %d: Need arg to %%patch -b: %s\n"), + spec->lineNum, spec->line); return RPMERR_BADSPEC; } } else if (!strcmp(s, "-z")) { /* orig suffix */ opt_b = strtok(NULL, " \t\n"); if (! opt_b) { - rpmError(RPMERR_BADSPEC, _("line %d: Need arg to %%patch -z: %s"), - spec->lineNum, spec->line); + rpmError(RPMERR_BADSPEC, + _("line %d: Need arg to %%patch -z: %s\n"), + spec->lineNum, spec->line); return RPMERR_BADSPEC; } } else if (!strncmp(s, "-p", sizeof("-p")-1)) { @@ -460,24 +464,25 @@ static int doPatchMacro(Spec spec, char *line) s = strtok(NULL, " \t\n"); if (s == NULL) { rpmError(RPMERR_BADSPEC, - _("line %d: Need arg to %%patch -p: %s"), + _("line %d: Need arg to %%patch -p: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } } if (parseNum(s, &opt_p)) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch -p: %s"), - spec->lineNum, spec->line); + rpmError(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!")); + rpmError(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"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -513,7 +518,7 @@ int parsePrep(Spec spec) char **lines, **saveLines; if (spec->prep != NULL) { - rpmError(RPMERR_BADSPEC, _("line %d: second %%prep"), spec->lineNum); + rpmError(RPMERR_BADSPEC, _("line %d: second %%prep\n"), spec->lineNum); return RPMERR_BADSPEC; } diff --git a/build/parseReqs.c b/build/parseReqs.c index 1c760c2a9..042f570b5 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -97,7 +97,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, /* Tokens must begin with alphanumeric, _, or / */ if (!(isalnum(r[0]) || r[0] == '_' || r[0] == '/')) { rpmError(RPMERR_BADSPEC, - _("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s"), + _("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -108,7 +108,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, case RPMTAG_CONFLICTFLAGS: case RPMTAG_BUILDCONFLICTS: if (r[0] == '/') { - rpmError(RPMERR_BADSPEC,_("line %d: File name not permitted: %s"), + rpmError(RPMERR_BADSPEC,_("line %d: File name not permitted: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -140,7 +140,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, if (r[0] == '/') { rpmError(RPMERR_BADSPEC, - _("line %d: Versioned file name not permitted: %s"), + _("line %d: Versioned file name not permitted: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -170,7 +170,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, if (flags & RPMSENSE_SENSEMASK) { if (*v == '\0' || ve == v) { - rpmError(RPMERR_BADSPEC, _("line %d: Version required: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Version required: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } diff --git a/build/parseScript.c b/build/parseScript.c index d3a0bf100..9abd7fb0e 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -150,7 +150,7 @@ int parseScript(Spec spec, int parsePart) /* break line into two */ p = strstr(spec->line, "--"); if (!p) { - rpmError(RPMERR_BADSPEC, _("line %d: triggers must have --: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: triggers must have --: %s\n"), spec->lineNum, spec->line); return RPMERR_BADSPEC; } @@ -160,7 +160,7 @@ int parseScript(Spec spec, int parsePart) } if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { - rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"), spec->lineNum, partname, poptStrerror(rc)); return RPMERR_BADSPEC; } @@ -172,7 +172,7 @@ int parseScript(Spec spec, int parsePart) if (prog[0] != '/') { rpmError(RPMERR_BADSPEC, _("line %d: script program must begin " - "with \'/\': %s"), spec->lineNum, prog); + "with \'/\': %s\n"), spec->lineNum, prog); rc = RPMERR_BADSPEC; goto exit; } @@ -184,7 +184,7 @@ int parseScript(Spec spec, int parsePart) } if (arg < -1) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad option %s: %s\n"), spec->lineNum, poptBadOption(optCon, POPT_BADOPTION_NOALIAS), spec->line); @@ -196,7 +196,7 @@ int parseScript(Spec spec, int parsePart) if (name == NULL) name = poptGetArg(optCon); if (poptPeekArg(optCon)) { - rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s\n"), spec->lineNum, spec->line); rc = RPMERR_BADSPEC; @@ -205,7 +205,7 @@ int parseScript(Spec spec, int parsePart) } if (lookupPackage(spec, name, flag, &pkg)) { - rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Package does not exist: %s\n"), spec->lineNum, spec->line); rc = RPMERR_BADSPEC; goto exit; @@ -213,7 +213,7 @@ int parseScript(Spec spec, int parsePart) if (tag != RPMTAG_TRIGGERSCRIPTS) { if (headerIsEntry(pkg->header, progtag)) { - rpmError(RPMERR_BADSPEC, _("line %d: Second %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Second %s\n"), spec->lineNum, partname); rc = RPMERR_BADSPEC; goto exit; @@ -221,7 +221,7 @@ int parseScript(Spec spec, int parsePart) } if ((rc = poptParseArgvString(prog, &progArgc, &progArgv))) { - rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s"), + rpmError(RPMERR_BADSPEC, _("line %d: Error parsing %s: %s\n"), spec->lineNum, partname, poptStrerror(rc)); rc = RPMERR_BADSPEC; goto exit; diff --git a/build/parseSpec.c b/build/parseSpec.c index 7a729dab7..8362feaa0 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -133,7 +133,8 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip) /* Don't expand macros (eg. %define) in false branch of %if clause */ if (spec->readStack->reading && expandMacros(spec, spec->macros, spec->lbuf, sizeof(spec->lbuf))) { - rpmError(RPMERR_BADSPEC, _("line %d: %s"), spec->lineNum, spec->lbuf); + rpmError(RPMERR_BADSPEC, _("line %d: %s\n"), + spec->lineNum, spec->lbuf); return RPMERR_BADSPEC; } spec->nextline = spec->lbuf; @@ -193,7 +194,7 @@ retry: if (!fgets(ofi->readBuf, BUFSIZ, fdGetFp(ofi->fd))) { /* EOF */ if (spec->readStack->next) { - rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if")); + rpmError(RPMERR_UNMATCHEDIF, _("Unclosed %%if\n")); return RPMERR_UNMATCHEDIF; } @@ -264,16 +265,18 @@ retry: s += 3; match = parseExpressionBoolean(spec, s); if (match < 0) { - rpmError(RPMERR_UNMATCHEDIF, _("%s:%d: parseExpressionBoolean returns %d"), - ofi->fileName, ofi->lineNum, match); + rpmError(RPMERR_UNMATCHEDIF, + _("%s:%d: parseExpressionBoolean returns %d\n"), + ofi->fileName, ofi->lineNum, match); return RPMERR_BADSPEC; } } else if (! strncmp("%else", s, sizeof("%else")-1)) { s += 5; if (! spec->readStack->next) { /* Got an else with no %if ! */ - rpmError(RPMERR_UNMATCHEDIF, _("%s:%d: Got a %%else with no if"), - ofi->fileName, ofi->lineNum); + rpmError(RPMERR_UNMATCHEDIF, + _("%s:%d: Got a %%else with no %%if\n"), + ofi->fileName, ofi->lineNum); return RPMERR_UNMATCHEDIF; } spec->readStack->reading = @@ -283,8 +286,9 @@ retry: s += 6; if (! spec->readStack->next) { /* Got an end with no %if ! */ - rpmError(RPMERR_UNMATCHEDIF, _("%s:%d: Got a %%endif with no if"), - ofi->fileName, ofi->lineNum); + rpmError(RPMERR_UNMATCHEDIF, + _("%s:%d: Got a %%endif with no %%if\n"), + ofi->fileName, ofi->lineNum); return RPMERR_UNMATCHEDIF; } rl = spec->readStack; @@ -297,7 +301,7 @@ retry: s += 8; fileName = s; if (! isspace(*fileName)) { - rpmError(RPMERR_BADSPEC, _("malformed %%include statement")); + rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n")); return RPMERR_BADSPEC; } SKIPSPACE(fileName); @@ -306,7 +310,7 @@ retry: p = endFileName; SKIPSPACE(p); if (*p != '\0') { - rpmError(RPMERR_BADSPEC, _("malformed %%include statement")); + rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n")); return RPMERR_BADSPEC; } *endFileName = '\0'; @@ -379,7 +383,7 @@ int parseSpec(Spec *specp, const char *specFile, const char *rootURL, if (*buildRoot == '\0') buildRoot = "/"; if (!strcmp(buildRoot, "/")) { rpmError(RPMERR_BADSPEC, - _("BuildRoot can not be \"/\": %s"), buildRootURL); + _("BuildRoot can not be \"/\": %s\n"), buildRootURL); return RPMERR_BADSPEC; } spec->gotBuildRootURL = 1; @@ -443,6 +447,7 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU break; case PART_NONE: /* XXX avoid gcc whining */ + case PART_LAST: case PART_BUILDARCHITECTURES: break; } @@ -485,7 +490,7 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU spec->buildArchitectureCount = index; if (! index) { freeSpec(spec); - rpmError(RPMERR_BADSPEC, _("No buildable architectures")); + rpmError(RPMERR_BADSPEC, _("No buildable architectures\n")); return RPMERR_BADSPEC; } @@ -540,7 +545,8 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) { const char * name; headerNVR(pkg->header, &name, NULL, NULL); - rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s"), name); + rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s\n"), + name); freeSpec(spec); return RPMERR_BADSPEC; } diff --git a/build/spec.c b/build/spec.c index 31cb3a72f..b14a28a08 100644 --- a/build/spec.c +++ b/build/spec.c @@ -225,13 +225,13 @@ int parseNoSource(Spec spec, const char *field, int tag) if (*fe) fe++; if (parseNum(f, &num)) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad number: %s"), + rpmError(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"), + rpmError(RPMERR_BADSPEC, _("line %d: Bad no%s number: %d\n"), spec->lineNum, name, num); return RPMERR_BADSPEC; } |