add Slovak translation (Stanislav Meduna <stano@trillian.eunet.sk>)
gettextify rpmMessage/rpmError/fprintf messages. CVS patchset: 2368 CVS date: 1998/09/27 22:03:52
This commit is contained in:
parent
4ce5eff979
commit
fd068345e6
2
CHANGES
2
CHANGES
|
@ -1,4 +1,6 @@
|
|||
2.5.4 -> 2.9
|
||||
- add Slovak translation (Stanislav Meduna <stano@trillian.eunet.sk>)
|
||||
- gettextify rpmMessage/rpmError/fprintf messages.
|
||||
- update po files; add cz to catalogs.
|
||||
- cpio_gzip: dup the fd before doing gzdopen (Thanks Erik!)
|
||||
- add --noLang to skip non-default languages.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#ifdef DYING
|
||||
|
@ -92,7 +93,7 @@ int doScript(Spec spec, int what, char *name, StringBuf sb, int test)
|
|||
if (makeTempFile(NULL, &scriptName, &fd) ||
|
||||
fchmod(fd, 0600) < 0 ||
|
||||
(f = fdopen(fd, "w")) == NULL) {
|
||||
rpmError(RPMERR_SCRIPT, "Unable to open temp file");
|
||||
rpmError(RPMERR_SCRIPT, _("Unable to open temp file"));
|
||||
return RPMERR_SCRIPT;
|
||||
}
|
||||
|
||||
|
@ -129,11 +130,11 @@ int doScript(Spec spec, int what, char *name, StringBuf sb, int test)
|
|||
return 0;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_NORMAL, "Executing: %s\n", name);
|
||||
rpmMessage(RPMMESS_NORMAL, _("Executing: %s\n"), name);
|
||||
if (!(pid = fork())) {
|
||||
buildShell = rpmGetVar(RPMVAR_BUILDSHELL);
|
||||
execl(buildShell, buildShell, "-e", scriptName, scriptName, NULL);
|
||||
rpmError(RPMERR_SCRIPT, "Exec of %s failed (%s)",
|
||||
rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s)"),
|
||||
scriptName, name);
|
||||
unlink(scriptName);
|
||||
FREE(scriptName);
|
||||
|
@ -141,7 +142,7 @@ int doScript(Spec spec, int what, char *name, StringBuf sb, int test)
|
|||
}
|
||||
wait(&status);
|
||||
if (! WIFEXITED(status) || WEXITSTATUS(status)) {
|
||||
rpmError(RPMERR_SCRIPT, "Bad exit status from %s (%s)",
|
||||
rpmError(RPMERR_SCRIPT, _("Bad exit status from %s (%s)"),
|
||||
scriptName, name);
|
||||
#if HACK
|
||||
unlink(scriptName);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "rpmbuild.h"
|
||||
#include "buildio.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "myftw.h"
|
||||
#include "md5.h"
|
||||
#include "rpmmacro.h"
|
||||
|
@ -200,7 +201,7 @@ static void timeCheck(int tc, Header h)
|
|||
x = 0;
|
||||
while (x < count) {
|
||||
if (currentTime - mtime[x] > tc) {
|
||||
rpmMessage(RPMMESS_WARNING, "TIMECHECK failure: %s\n", file[x]);
|
||||
rpmMessage(RPMMESS_WARNING, _("TIMECHECK failure: %s\n"), file[x]);
|
||||
}
|
||||
x++;
|
||||
}
|
||||
|
@ -229,7 +230,7 @@ static int parseForVerify(char *buf, struct FileList *fl)
|
|||
SKIPSPACE(p);
|
||||
|
||||
if (*p != '(') {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %s() syntax: %s", name, buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %s() syntax: %s"), name, buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -241,7 +242,7 @@ static int parseForVerify(char *buf, struct FileList *fl)
|
|||
}
|
||||
|
||||
if (! *end) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %s() syntax: %s", name, buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %s() syntax: %s"), name, buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -275,7 +276,7 @@ static int parseForVerify(char *buf, struct FileList *fl)
|
|||
} else if (!strcmp(p, "rdev")) {
|
||||
verifyFlags |= RPMVERIFY_RDEV;
|
||||
} else {
|
||||
rpmError(RPMERR_BADSPEC, "Invalid %s token: %s", name, p);
|
||||
rpmError(RPMERR_BADSPEC, _("Invalid %s token: %s"), name, p);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -313,7 +314,7 @@ static int parseForAttr(char *buf, struct FileList *fl)
|
|||
SKIPSPACE(p);
|
||||
|
||||
if (*p != '(') {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %s() syntax: %s", name, buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %s() syntax: %s"), name, buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -325,7 +326,7 @@ static int parseForAttr(char *buf, struct FileList *fl)
|
|||
}
|
||||
|
||||
if (! *end) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %s() syntax: %s", name, buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %s() syntax: %s"), name, buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -336,7 +337,7 @@ static int parseForAttr(char *buf, struct FileList *fl)
|
|||
SKIPSPACE(s);
|
||||
if (*s) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"No files after %%defattr(): %s", buf);
|
||||
_("No files after %%defattr(): %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -352,7 +353,7 @@ static int parseForAttr(char *buf, struct FileList *fl)
|
|||
|
||||
if (! (resultAttr->PmodeString &&
|
||||
resultAttr->Uname && resultAttr->Gname)) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %s() syntax: %s", name, buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %s() syntax: %s"), name, buf);
|
||||
resultAttr->PmodeString = resultAttr->Uname = resultAttr->Gname = NULL;
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
|
@ -364,7 +365,7 @@ static int parseForAttr(char *buf, struct FileList *fl)
|
|||
} else {
|
||||
x = sscanf(resultAttr->PmodeString, "%o", &(resultAttr->Pmode));
|
||||
if ((x == 0) || (resultAttr->Pmode >> 12)) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %s() mode spec: %s", name, buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %s() mode spec: %s"), name, buf);
|
||||
resultAttr->PmodeString = resultAttr->Uname =
|
||||
resultAttr->Gname = NULL;
|
||||
fl->processingFailed = 1;
|
||||
|
@ -382,7 +383,7 @@ static int parseForAttr(char *buf, struct FileList *fl)
|
|||
&(resultAttr->Pdirmode));
|
||||
if ((x == 0) || (resultAttr->Pdirmode >> 12)) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"Bad %s() dirmode spec: %s", name, buf);
|
||||
_("Bad %s() dirmode spec: %s"), name, buf);
|
||||
resultAttr->PmodeString = resultAttr->Uname =
|
||||
resultAttr->Gname = resultAttr->PdirmodeString = NULL;
|
||||
fl->processingFailed = 1;
|
||||
|
@ -437,7 +438,7 @@ static int parseForConfig(char *buf, struct FileList *fl)
|
|||
}
|
||||
|
||||
if (! *end) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %%config() syntax: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %%config() syntax: %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -455,7 +456,7 @@ static int parseForConfig(char *buf, struct FileList *fl)
|
|||
} else if (!strcmp(p, "noreplace")) {
|
||||
fl->currentFlags |= RPMFILE_NOREPLACE;
|
||||
} else {
|
||||
rpmError(RPMERR_BADSPEC, "Invalid %%config token: %s", p);
|
||||
rpmError(RPMERR_BADSPEC, _("Invalid %%config token: %s"), p);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -478,7 +479,7 @@ static int parseForLang(char *buf, struct FileList *fl)
|
|||
SKIPSPACE(p);
|
||||
|
||||
if (*p != '(') {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %%lang() syntax: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %%lang() syntax: %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -490,7 +491,7 @@ static int parseForLang(char *buf, struct FileList *fl)
|
|||
}
|
||||
|
||||
if (! *end) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %%lang() syntax: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %%lang() syntax: %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -503,17 +504,19 @@ static int parseForLang(char *buf, struct FileList *fl)
|
|||
|
||||
p = strtok(ourbuf, ", \n\t");
|
||||
if (!p) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad %%lang() syntax: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad %%lang() syntax: %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
#if 0
|
||||
if (strlen(p) != 2) {
|
||||
rpmError(RPMERR_BADSPEC, "%%lang() entries are 2 characters: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("%%lang() entries are 2 characters: %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
#endif
|
||||
if (strtok(NULL, ", \n\t")) {
|
||||
rpmError(RPMERR_BADSPEC, "Only one entry in %%lang(): %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("Only one entry in %%lang(): %s"), buf);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -604,13 +607,13 @@ static int parseForSimple(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"));
|
||||
fl->processingFailed = 1;
|
||||
res = 1;
|
||||
}
|
||||
fl->docDirs[fl->docDirCount++] = strdup(s);
|
||||
if (strtokWithQuotes(NULL, " \t\n")) {
|
||||
rpmError(RPMERR_INTERNAL, "Only one arg for %%docdir");
|
||||
rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir"));
|
||||
fl->processingFailed = 1;
|
||||
res = 1;
|
||||
}
|
||||
|
@ -636,7 +639,7 @@ static int parseForSimple(Spec spec, Package pkg, char *buf,
|
|||
if (*fileName) {
|
||||
/* We already got a file -- error */
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"Two files on one line: %s", *fileName);
|
||||
_("Two files on one line: %s"), *fileName);
|
||||
fl->processingFailed = 1;
|
||||
res = 1;
|
||||
}
|
||||
|
@ -649,7 +652,7 @@ static int parseForSimple(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"), s);
|
||||
fl->processingFailed = 1;
|
||||
res = 1;
|
||||
}
|
||||
|
@ -661,7 +664,7 @@ static int parseForSimple(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"),
|
||||
*fileName);
|
||||
fl->processingFailed = 1;
|
||||
res = 1;
|
||||
|
@ -743,7 +746,7 @@ static void genCpioListAndHeader(struct FileList *fl,
|
|||
count = fl->fileListRecsUsed;
|
||||
while (count) {
|
||||
if ((count > 1) && !strcmp(p->fileName, p[1].fileName)) {
|
||||
rpmError(RPMERR_BADSPEC, "File listed twice: %s", p->fileName);
|
||||
rpmError(RPMERR_BADSPEC, _("File listed twice: %s"), p->fileName);
|
||||
fl->processingFailed = 1;
|
||||
}
|
||||
|
||||
|
@ -902,7 +905,7 @@ static int addFile(struct FileList *fl, char *name, 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"),
|
||||
fl->prefix, fileName);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
|
@ -912,7 +915,7 @@ static int addFile(struct FileList *fl, char *name, struct stat *statp)
|
|||
if (! statp) {
|
||||
statp = &statbuf;
|
||||
if (lstat(diskName, statp)) {
|
||||
rpmError(RPMERR_BADSPEC, "File not found: %s", diskName);
|
||||
rpmError(RPMERR_BADSPEC, _("File not found: %s"), diskName);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -957,12 +960,12 @@ static int addFile(struct FileList *fl, char *name, struct stat *statp)
|
|||
}
|
||||
|
||||
if (! (fileUname && fileGname)) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad owner/group: %s\n", diskName);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s\n"), diskName);
|
||||
fl->processingFailed = 1;
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "File %d: %s\n", fl->fileCount, fileName);
|
||||
rpmMessage(RPMMESS_DEBUG, _("File %d: %s\n"), fl->fileCount, fileName);
|
||||
|
||||
/* Add to the file list */
|
||||
if (fl->fileListRecsUsed == fl->fileListRecsAlloced) {
|
||||
|
@ -1013,7 +1016,7 @@ static int processBinaryFile(Package pkg, struct FileList *fl, char *fileName)
|
|||
|
||||
/* check that file starts with leading "/" */
|
||||
if (*fileName != '/') {
|
||||
rpmError(RPMERR_BADSPEC, "File needs leading \"/\": %s", *fileName);
|
||||
rpmError(RPMERR_BADSPEC, _("File needs leading \"/\": %s"), *fileName);
|
||||
fl->processingFailed = 1;
|
||||
return 1;
|
||||
}
|
||||
|
@ -1029,7 +1032,7 @@ static int processBinaryFile(Package pkg, struct FileList *fl, char *fileName)
|
|||
|
||||
if (glob(fullname, 0, glob_error, &glob_result) ||
|
||||
(glob_result.gl_pathc < 1)) {
|
||||
rpmError(RPMERR_BADSPEC, "File not found: %s", fullname);
|
||||
rpmError(RPMERR_BADSPEC, _("File not found: %s"), fullname);
|
||||
fl->processingFailed = 1;
|
||||
globfree(&glob_result);
|
||||
return 1;
|
||||
|
@ -1073,13 +1076,13 @@ static int processPackageFiles(Spec spec, Package pkg,
|
|||
|
||||
if ((f = fopen(buf, "r")) == NULL) {
|
||||
rpmError(RPMERR_BADFILENAME,
|
||||
"Could not open %%files file: %s", pkg->fileFile);
|
||||
_("Could not open %%files file: %s"), pkg->fileFile);
|
||||
return RPMERR_BADFILENAME;
|
||||
}
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
handleComments(buf);
|
||||
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
|
||||
rpmError(RPMERR_BADSPEC, "line: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("line: %s"), buf);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
appendStringBuf(pkg->fileList, buf);
|
||||
|
@ -1406,7 +1409,7 @@ int processSourceFiles(Spec spec)
|
|||
fl.totalFileSize += sb.st_size;
|
||||
|
||||
if (! (fl.fileList[x].uname && fl.fileList[x].gname)) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad owner/group: %s", s);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s"), s);
|
||||
fl.processingFailed = 1;
|
||||
}
|
||||
|
||||
|
@ -1461,11 +1464,11 @@ static StringBuf getOutputFrom(char *dir, char *argv[],
|
|||
}
|
||||
|
||||
execvp(argv[0], argv);
|
||||
rpmError(RPMERR_EXEC, "Couldn't exec %s", argv[0]);
|
||||
rpmError(RPMERR_EXEC, _("Couldn't exec %s"), argv[0]);
|
||||
_exit(RPMERR_EXEC);
|
||||
}
|
||||
if (progPID < 0) {
|
||||
rpmError(RPMERR_FORK, "Couldn't fork %s", argv[0]);
|
||||
rpmError(RPMERR_FORK, _("Couldn't fork %s"), argv[0]);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1512,12 +1515,12 @@ static StringBuf getOutputFrom(char *dir, char *argv[],
|
|||
signal(SIGPIPE, oldhandler);
|
||||
|
||||
if (writeBytesLeft) {
|
||||
rpmError(RPMERR_EXEC, "failed to write all data to %s", argv[0]);
|
||||
rpmError(RPMERR_EXEC, _("failed to write all data to %s"), argv[0]);
|
||||
return NULL;
|
||||
}
|
||||
waitpid(progPID, &status, 0);
|
||||
if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) {
|
||||
rpmError(RPMERR_EXEC, "%s failed", argv[0]);
|
||||
rpmError(RPMERR_EXEC, _("%s failed"), argv[0]);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1552,14 +1555,14 @@ static int generateAutoReqProv(Spec spec, Package pkg,
|
|||
/*** Do Provides ***/
|
||||
|
||||
if (spec->autoProv) {
|
||||
rpmMessage(RPMMESS_NORMAL, "Finding provides...\n");
|
||||
rpmMessage(RPMMESS_NORMAL, _("Finding provides...\n"));
|
||||
|
||||
argv[0] = FINDPROVIDES;
|
||||
argv[1] = NULL;
|
||||
readBuf = getOutputFrom(NULL, argv,
|
||||
getStringBuf(writeBuf), writeBytes, 1);
|
||||
if (!readBuf) {
|
||||
rpmError(RPMERR_EXEC, "Failed to find provides");
|
||||
rpmError(RPMERR_EXEC, _("Failed to find provides"));
|
||||
freeStringBuf(writeBuf);
|
||||
return RPMERR_EXEC;
|
||||
}
|
||||
|
@ -1579,14 +1582,14 @@ static int generateAutoReqProv(Spec spec, Package pkg,
|
|||
/*** Do Requires ***/
|
||||
|
||||
if (spec->autoReq) {
|
||||
rpmMessage(RPMMESS_NORMAL, "Finding requires...\n");
|
||||
rpmMessage(RPMMESS_NORMAL, _("Finding requires...\n"));
|
||||
|
||||
argv[0] = FINDREQUIRES;
|
||||
argv[1] = NULL;
|
||||
readBuf = getOutputFrom(NULL, argv,
|
||||
getStringBuf(writeBuf), writeBytes, 0);
|
||||
if (!readBuf) {
|
||||
rpmError(RPMERR_EXEC, "Failed to find requires");
|
||||
rpmError(RPMERR_EXEC, _("Failed to find requires"));
|
||||
freeStringBuf(writeBuf);
|
||||
return RPMERR_EXEC;
|
||||
}
|
||||
|
@ -1621,7 +1624,7 @@ static void printReqs(Spec spec, Package pkg)
|
|||
|
||||
if (headerGetEntry(pkg->header, RPMTAG_PROVIDES,
|
||||
NULL, (void **) &names, &count)) {
|
||||
rpmMessage(RPMMESS_NORMAL, "Provides:");
|
||||
rpmMessage(RPMMESS_NORMAL, _("Provides:"));
|
||||
x = 0;
|
||||
while (x < count) {
|
||||
rpmMessage(RPMMESS_NORMAL, " %s", names[x]);
|
||||
|
@ -1639,7 +1642,7 @@ static void printReqs(Spec spec, Package pkg)
|
|||
while (x < count) {
|
||||
if (flags[x] & RPMSENSE_PREREQ) {
|
||||
if (! startedPreReq) {
|
||||
rpmMessage(RPMMESS_NORMAL, "Prereqs:");
|
||||
rpmMessage(RPMMESS_NORMAL, _("Prereqs:"));
|
||||
startedPreReq = 1;
|
||||
}
|
||||
rpmMessage(RPMMESS_NORMAL, " %s", names[x]);
|
||||
|
@ -1653,7 +1656,7 @@ static void printReqs(Spec spec, Package pkg)
|
|||
while (x < count) {
|
||||
if (! (flags[x] & RPMSENSE_PREREQ)) {
|
||||
if (! startedReq) {
|
||||
rpmMessage(RPMMESS_NORMAL, "Requires:");
|
||||
rpmMessage(RPMMESS_NORMAL, _("Requires:"));
|
||||
startedReq = 1;
|
||||
}
|
||||
rpmMessage(RPMMESS_NORMAL, " %s", names[x]);
|
||||
|
@ -1678,7 +1681,7 @@ int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
|
|||
}
|
||||
|
||||
headerGetEntry(pkg->header, RPMTAG_NAME, NULL, (void **)&name, NULL);
|
||||
rpmMessage(RPMMESS_NORMAL, "Processing files: %s\n", name);
|
||||
rpmMessage(RPMMESS_NORMAL, _("Processing files: %s\n"), name);
|
||||
|
||||
if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) {
|
||||
res = rc;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#include "popt/popt.h"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
static uid_t uids[1024];
|
||||
|
@ -31,7 +32,7 @@ char *getUname(uid_t uid)
|
|||
|
||||
/* XXX - This is the other hard coded limit */
|
||||
if (x == 1024) {
|
||||
fprintf(stderr, "RPMERR_INTERNAL: Hit limit in getUname()\n");
|
||||
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getUname()\n"));
|
||||
exit(RPMERR_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -65,7 +66,7 @@ char *getUnameS(char *uname)
|
|||
|
||||
/* XXX - This is the other hard coded limit */
|
||||
if (x == 1024) {
|
||||
fprintf(stderr, "RPMERR_INTERNAL: Hit limit in getUname()\n");
|
||||
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getUname()\n"));
|
||||
exit(RPMERR_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -100,7 +101,7 @@ char *getGname(gid_t gid)
|
|||
|
||||
/* XXX - This is the other hard coded limit */
|
||||
if (x == 1024) {
|
||||
fprintf(stderr, "RPMERR_INTERNAL: Hit limit in getGname()\n");
|
||||
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getGname()\n"));
|
||||
exit(RPMERR_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -134,7 +135,7 @@ char *getGnameS(char *gname)
|
|||
|
||||
/* XXX - This is the other hard coded limit */
|
||||
if (x == 1024) {
|
||||
fprintf(stderr, "RPMERR_INTERNAL: Hit limit in getGname()\n");
|
||||
fprintf(stderr, _("RPMERR_INTERNAL: Hit limit in getGname()\n"));
|
||||
exit(RPMERR_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -172,7 +173,7 @@ char *buildHost(void)
|
|||
if ((hbn = gethostbyname(hostname))) {
|
||||
strcpy(hostname, hbn->h_name);
|
||||
} else {
|
||||
rpmMessage(RPMMESS_WARNING, "Could not canonicalize hostname: %s\n",
|
||||
rpmMessage(RPMMESS_WARNING, _("Could not canonicalize hostname: %s\n"),
|
||||
hostname);
|
||||
}
|
||||
gotit = 1;
|
||||
|
|
43
build/pack.c
43
build/pack.c
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <signal.h>
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
#include "buildio.h"
|
||||
|
||||
|
@ -137,8 +138,8 @@ int packageBinaries(Spec spec)
|
|||
if (binRpm == NULL) {
|
||||
headerGetEntry(pkg->header, RPMTAG_NAME, NULL,
|
||||
(void **)&name, NULL);
|
||||
rpmError(RPMERR_BADFILENAME, "Could not generate output "
|
||||
"filename for package %s: %s\n", name, errorString);
|
||||
rpmError(RPMERR_BADFILENAME, _("Could not generate output "
|
||||
"filename for package %s: %s\n"), name, errorString);
|
||||
return RPMERR_BADFILENAME;
|
||||
}
|
||||
strcpy(fileName, "%{_rpmdir}/");
|
||||
|
@ -187,7 +188,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
|
||||
/* Write the header */
|
||||
if (makeTempFile(NULL, &sigtarget, &fd)) {
|
||||
rpmError(RPMERR_CREATE, "Unable to open temp file");
|
||||
rpmError(RPMERR_CREATE, _("Unable to open temp file"));
|
||||
return RPMERR_CREATE;
|
||||
}
|
||||
headerWrite(fd, header, HEADER_MAGIC_YES);
|
||||
|
@ -198,7 +199,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
} else if (csa->cpioFdIn >= 0) {
|
||||
rc = cpio_copy(fd, csa);
|
||||
} else {
|
||||
rpmError(RPMERR_CREATE, "Bad CSA data");
|
||||
rpmError(RPMERR_CREATE, _("Bad CSA data"));
|
||||
rc = RPMERR_BADARG;
|
||||
}
|
||||
if (rc != 0) {
|
||||
|
@ -221,7 +222,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
/* Open the output file */
|
||||
unlink(fileName);
|
||||
if ((fd = open(fileName, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) {
|
||||
rpmError(RPMERR_CREATE, "Could not open %s\n", fileName);
|
||||
rpmError(RPMERR_CREATE, _("Could not open %s\n"), fileName);
|
||||
unlink(sigtarget);
|
||||
free(sigtarget);
|
||||
return RPMERR_CREATE;
|
||||
|
@ -253,7 +254,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
lead.signature_type = RPMSIG_HEADERSIG; /* New-style signature */
|
||||
strncpy(lead.name, buf, sizeof(lead.name));
|
||||
if (writeLead(fd, &lead)) {
|
||||
rpmError(RPMERR_NOSPACE, "Unable to write package: %s",
|
||||
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s"),
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
unlink(sigtarget);
|
||||
|
@ -269,7 +270,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase);
|
||||
rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase);
|
||||
if (sigtype > 0) {
|
||||
rpmMessage(RPMMESS_NORMAL, "Generating signature: %d\n", sigtype);
|
||||
rpmMessage(RPMMESS_NORMAL, _("Generating signature: %d\n"), sigtype);
|
||||
rpmAddSignature(sig, sigtarget, sigtype, passPhrase);
|
||||
}
|
||||
if ((rc = rpmWriteSignature(fd, sig))) {
|
||||
|
@ -286,7 +287,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
ifd = open(sigtarget, O_RDONLY);
|
||||
while ((count = read(ifd, buf, sizeof(buf))) > 0) {
|
||||
if (count == -1) {
|
||||
rpmError(RPMERR_READERROR, "Unable to read sigtarget: %s",
|
||||
rpmError(RPMERR_READERROR, _("Unable to read sigtarget: %s"),
|
||||
strerror(errno));
|
||||
close(ifd);
|
||||
close(fd);
|
||||
|
@ -296,7 +297,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
return RPMERR_READERROR;
|
||||
}
|
||||
if (write(fd, buf, count) < 0) {
|
||||
rpmError(RPMERR_NOSPACE, "Unable to write package: %s",
|
||||
rpmError(RPMERR_NOSPACE, _("Unable to write package: %s"),
|
||||
strerror(errno));
|
||||
close(ifd);
|
||||
close(fd);
|
||||
|
@ -311,7 +312,7 @@ int writeRPM(Header header, char *fileName, int type,
|
|||
unlink(sigtarget);
|
||||
free(sigtarget);
|
||||
|
||||
rpmMessage(RPMMESS_NORMAL, "Wrote: %s\n", fileName);
|
||||
rpmMessage(RPMMESS_NORMAL, _("Wrote: %s\n"), fileName);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -329,10 +330,10 @@ static int cpio_gzip(int fdo, CSA_t *csa) {
|
|||
|
||||
if (rc) {
|
||||
if (rc & CPIO_CHECK_ERRNO)
|
||||
rpmError(RPMERR_CPIO, "cpio failed on file %s: %s",
|
||||
rpmError(RPMERR_CPIO, _("cpio failed on file %s: %s"),
|
||||
failedFile, strerror(errno));
|
||||
else
|
||||
rpmError(RPMERR_CPIO, "cpio failed on file %s: %d",
|
||||
rpmError(RPMERR_CPIO, _("cpio failed on file %s: %d"),
|
||||
failedFile, rc);
|
||||
return 1;
|
||||
}
|
||||
|
@ -346,14 +347,14 @@ static int cpio_copy(int fdo, CSA_t *csa) {
|
|||
|
||||
while((nb = read(csa->cpioFdIn, buf, sizeof(buf))) > 0) {
|
||||
if (write(fdo, buf, nb) != nb) {
|
||||
rpmError(RPMERR_CPIO, "cpio_copy write failed: %s",
|
||||
rpmError(RPMERR_CPIO, _("cpio_copy write failed: %s"),
|
||||
strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
csa->cpioArchiveSize += nb;
|
||||
}
|
||||
if (nb < 0) {
|
||||
rpmError(RPMERR_CPIO, "cpio_copy read failed: %s", strerror(errno));
|
||||
rpmError(RPMERR_CPIO, _("cpio_copy read failed: %s"), strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -376,7 +377,7 @@ static StringBuf addFileToTagAux(Spec spec, char *file, StringBuf sb)
|
|||
}
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
|
||||
rpmError(RPMERR_BADSPEC, "line: %s", buf);
|
||||
rpmError(RPMERR_BADSPEC, _("line: %s"), buf);
|
||||
return NULL;
|
||||
}
|
||||
appendStringBuf(sb, buf);
|
||||
|
@ -432,28 +433,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"), 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"), 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"), 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"), pkg->postUnFile);
|
||||
return RPMERR_BADFILENAME;
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +462,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"), pkg->verifyFile);
|
||||
return RPMERR_BADFILENAME;
|
||||
}
|
||||
}
|
||||
|
@ -477,7 +478,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"),
|
||||
p->fileName);
|
||||
return RPMERR_BADFILENAME;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
int parseBuildInstallClean(Spec spec, int parsePart)
|
||||
|
@ -24,7 +25,7 @@ int parseBuildInstallClean(Spec spec, int parsePart)
|
|||
}
|
||||
|
||||
if (*sbp) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: second %s", spec->lineNum, name);
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: second %s"), spec->lineNum, name);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#ifdef DYING
|
||||
|
@ -98,7 +99,7 @@ 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 *"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
@ -106,7 +107,7 @@ static int addChangelog(Header h, StringBuf sb)
|
|||
date = s;
|
||||
SKIPTONEWLINE(s);
|
||||
if (! *s) {
|
||||
rpmError(RPMERR_BADSPEC, "incomplete %%changelog entry");
|
||||
rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
*s = '\0';
|
||||
|
@ -121,12 +122,12 @@ static int addChangelog(Header h, StringBuf sb)
|
|||
}
|
||||
SKIPSPACE(date);
|
||||
if (dateToTimet(date, (time_t *)&time)) {
|
||||
rpmError(RPMERR_BADSPEC, "bad date in %%changelog: %s", date);
|
||||
rpmError(RPMERR_BADSPEC, _("bad date in %%changelog: %s"), date);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
if (lastTime && lastTime < time) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"%%changelog not in decending chronological order");
|
||||
_("%%changelog not in decending chronological order"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
lastTime = time;
|
||||
|
@ -134,7 +135,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"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
@ -145,14 +146,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"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
/* text */
|
||||
SKIPSPACE(text);
|
||||
if (! *text) {
|
||||
rpmError(RPMERR_BADSPEC, "no description in %%changelog");
|
||||
rpmError(RPMERR_BADSPEC, _("no description in %%changelog"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#include "popt/popt.h"
|
||||
|
@ -31,7 +32,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"),
|
||||
spec->lineNum, poptStrerror(rc));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -44,7 +45,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"),
|
||||
spec->lineNum,
|
||||
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
|
||||
spec->line);
|
||||
|
@ -58,7 +59,7 @@ int parseDescription(Spec spec)
|
|||
name = poptGetArg(optCon);
|
||||
}
|
||||
if (poptPeekArg(optCon)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Too many names: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s"),
|
||||
spec->lineNum,
|
||||
spec->line);
|
||||
FREE(argv);
|
||||
|
@ -68,7 +69,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"),
|
||||
spec->lineNum, spec->line);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
|
@ -80,7 +81,7 @@ 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"), spec->lineNum);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
return RPMERR_BADSPEC;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#include "popt/popt.h"
|
||||
|
@ -26,7 +27,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"),
|
||||
spec->lineNum, poptStrerror(rc));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -39,7 +40,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"),
|
||||
spec->lineNum,
|
||||
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
|
||||
spec->line);
|
||||
|
@ -53,7 +54,7 @@ int parseFiles(Spec spec)
|
|||
name = poptGetArg(optCon);
|
||||
}
|
||||
if (poptPeekArg(optCon)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Too many names: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s"),
|
||||
spec->lineNum,
|
||||
spec->line);
|
||||
FREE(argv);
|
||||
|
@ -63,7 +64,7 @@ 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"),
|
||||
spec->lineNum, spec->line);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
|
@ -71,7 +72,7 @@ int parseFiles(Spec spec)
|
|||
}
|
||||
|
||||
if (pkg->fileList) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Second %%files list",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Second %%files list"),
|
||||
spec->lineNum);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#include "popt/popt.h"
|
||||
|
@ -146,22 +147,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"), 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"), 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"), 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"), os);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
@ -197,7 +198,7 @@ static int checkForRequired(Header h, char *name)
|
|||
|
||||
while (*p) {
|
||||
if (!headerIsEntry(h, *p)) {
|
||||
rpmError(RPMERR_BADSPEC, "%s field must be present in package: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("%s field must be present in package: %s"),
|
||||
tagName(*p), name);
|
||||
res = 1;
|
||||
}
|
||||
|
@ -239,7 +240,7 @@ static int checkForDuplicates(Header h, char *name)
|
|||
lastTag = 0;
|
||||
while (headerNextIterator(hi, &tag, NULL, NULL, NULL)) {
|
||||
if (tag == lastTag) {
|
||||
rpmError(RPMERR_BADSPEC, "Duplicate %s entries in package: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("Duplicate %s entries in package: %s"),
|
||||
tagName(tag), name);
|
||||
res = 1;
|
||||
}
|
||||
|
@ -283,14 +284,14 @@ static int readIcon(Header h, char *file)
|
|||
strcat(buf, file);
|
||||
|
||||
if (stat(buf, &statbuf)) {
|
||||
rpmError(RPMERR_BADSPEC, "Unable to read icon: %s", file);
|
||||
rpmError(RPMERR_BADSPEC, _("Unable to read icon: %s"), file);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
icon = malloc(statbuf.st_size);
|
||||
fd = open(buf, O_RDONLY);
|
||||
if (read(fd, icon, statbuf.st_size) != statbuf.st_size) {
|
||||
close(fd);
|
||||
rpmError(RPMERR_BADSPEC, "Unable to read icon: %s", file);
|
||||
rpmError(RPMERR_BADSPEC, _("Unable to read icon: %s"), file);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
close(fd);
|
||||
|
@ -300,7 +301,7 @@ static int readIcon(Header h, char *file)
|
|||
} else if (! strncmp(icon, "/* XPM", 6)) {
|
||||
headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, statbuf.st_size);
|
||||
} else {
|
||||
rpmError(RPMERR_BADSPEC, "Unknown icon type: %s", file);
|
||||
rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s"), file);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
free(icon);
|
||||
|
@ -310,7 +311,7 @@ static int readIcon(Header h, char *file)
|
|||
|
||||
#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"), \
|
||||
spec->lineNum, spec->line); \
|
||||
return RPMERR_BADSPEC; \
|
||||
}
|
||||
|
@ -331,7 +332,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
field++;
|
||||
}
|
||||
if (*field != ':') {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Malformed tag: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Malformed tag: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -339,7 +340,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
SKIPSPACE(field);
|
||||
if (! *field) {
|
||||
/* Empty field */
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Empty tag: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Empty tag: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -390,7 +391,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
}
|
||||
if (!strcmp(spec->buildRoot, "/")) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: BuildRoot can not be \"/\": %s",
|
||||
_("line %d: BuildRoot can not be \"/\": %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -403,7 +404,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
len = strlen(array[num]);
|
||||
if (array[num][len - 1] == '/') {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: Prefixes must not end with \"/\": %s",
|
||||
_("line %d: Prefixes must not end with \"/\": %s"),
|
||||
spec->lineNum, spec->line);
|
||||
FREE(array);
|
||||
return RPMERR_BADSPEC;
|
||||
|
@ -415,7 +416,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, 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"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -426,7 +427,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
SINGLE_TOKEN_ONLY;
|
||||
if (parseNum(field, &num)) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: Serial field must be a number: %s",
|
||||
_("line %d: Serial field must be a number: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -490,7 +491,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
&(spec->buildArchitectureCount),
|
||||
&(spec->buildArchitectures)))) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: Bad BuildArchitecture format: %s",
|
||||
_("line %d: Bad BuildArchitecture format: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -500,7 +501,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, char *macro,
|
|||
break;
|
||||
|
||||
default:
|
||||
rpmError(RPMERR_INTERNAL, "Internal error: Bogus tag %d", tag);
|
||||
rpmError(RPMERR_INTERNAL, _("Internal error: Bogus tag %d"), tag);
|
||||
return RPMERR_INTERNAL;
|
||||
}
|
||||
|
||||
|
@ -643,13 +644,13 @@ int parsePreamble(Spec spec, int initialPackage, int anyarch)
|
|||
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",
|
||||
rpmError(RPMERR_BADSPEC, _("Bad package specification: %s"),
|
||||
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"), spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
@ -676,7 +677,7 @@ int parsePreamble(Spec spec, int initialPackage, int anyarch)
|
|||
SKIPSPACE(linep);
|
||||
if (*linep) {
|
||||
if (findPreambleTag(spec, &tag, ¯o, lang)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Unknown tag: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -701,7 +702,7 @@ int parsePreamble(Spec spec, int initialPackage, int anyarch)
|
|||
/* Do some final processing on the header */
|
||||
|
||||
if (!spec->gotBuildRoot && spec->buildRoot) {
|
||||
rpmError(RPMERR_BADSPEC, "Spec file can't use BuildRoot");
|
||||
rpmError(RPMERR_BADSPEC, _("Spec file can't use BuildRoot"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#include "popt/popt.h"
|
||||
|
@ -33,11 +34,11 @@ static int checkOwners(char *file)
|
|||
struct stat sb;
|
||||
|
||||
if (lstat(file, &sb)) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad source: %s: %s", file, strerror(errno));
|
||||
rpmError(RPMERR_BADSPEC, _("Bad source: %s: %s"), file, strerror(errno));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
if (!getUname(sb.st_uid) || !getGname(sb.st_gid)) {
|
||||
rpmError(RPMERR_BADSPEC, "Bad owner/group: %s", file);
|
||||
rpmError(RPMERR_BADSPEC, _("Bad owner/group: %s"), file);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
@ -59,7 +60,7 @@ static char *doPatch(Spec spec, int c, int strip, char *db,
|
|||
}
|
||||
}
|
||||
if (sp == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "No patch number %d", c);
|
||||
rpmError(RPMERR_BADSPEC, _("No patch number %d"), c);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -123,7 +124,7 @@ static char *doUntar(Spec spec, int c, int quietly)
|
|||
}
|
||||
}
|
||||
if (sp == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "No source number %d", c);
|
||||
rpmError(RPMERR_BADSPEC, _("No source number %d"), c);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -176,7 +177,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"),
|
||||
poptStrerror(rc));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -191,7 +192,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"),
|
||||
spec->lineNum, num, optArg);
|
||||
free(argv);
|
||||
freeStringBuf(before);
|
||||
|
@ -212,7 +213,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"),
|
||||
spec->lineNum,
|
||||
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
|
||||
poptStrerror(arg));
|
||||
|
@ -330,7 +331,7 @@ 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",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Need arg to %%patch -b: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -338,7 +339,7 @@ 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 -z: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Need arg to %%patch -z: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -350,24 +351,24 @@ static int doPatchMacro(Spec spec, char *line)
|
|||
s = strtok(NULL, " \t\n");
|
||||
if (! s) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: Need arg to %%patch -p: %s",
|
||||
_("line %d: Need arg to %%patch -p: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
}
|
||||
if (parseNum(s, &opt_p)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Bad arg to %%patch -p: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%patch -p: %s"),
|
||||
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!"));
|
||||
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"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -405,7 +406,7 @@ int parsePrep(Spec spec)
|
|||
char **lines, **saveLines;
|
||||
|
||||
if (spec->prep) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: second %%prep", spec->lineNum);
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: second %%prep"), spec->lineNum);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
static struct ReqComp {
|
||||
|
@ -42,7 +43,7 @@ int parseRequiresConflicts(Spec spec, Package pkg, char *field,
|
|||
if (tag == RPMTAG_CONFLICTFLAGS) {
|
||||
if (req[0] == '/') {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: No file names in Conflicts: %s",
|
||||
_("line %d: No file names in Conflicts: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -73,13 +74,13 @@ int parseRequiresConflicts(Spec spec, Package pkg, char *field,
|
|||
if (rc->token) {
|
||||
if (req[0] == '/') {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: No versions on file names in %s: %s",
|
||||
_("line %d: No versions on file names in %s: %s"),
|
||||
spec->lineNum, name, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
if (tag == RPMTAG_PREREQ) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: No versions in PreReq: %s",
|
||||
_("line %d: No versions in PreReq: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -91,7 +92,7 @@ int parseRequiresConflicts(Spec spec, Package pkg, char *field,
|
|||
|
||||
if ((flags & RPMSENSE_SENSEMASK) && !version) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: Version required in %s: %s",
|
||||
_("line %d: Version required in %s: %s"),
|
||||
spec->lineNum, name, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -119,7 +120,15 @@ int parseProvidesObsoletes(Spec spec, Package pkg, char *field, int tag)
|
|||
while ((prov = strtok(line, " ,\t\n"))) {
|
||||
if (prov[0] == '/') {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: No file names in %s: %s",
|
||||
_("line %d: No file names in %s: %s"),
|
||||
spec->lineNum,
|
||||
(tag == RPMTAG_PROVIDES) ? "Provides" : "Obsoletes",
|
||||
spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
if (!(isalnum(prov[0]) || prov[0] == '_')) {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
_("line %d: %s: tokens must begin with alpha-numeric: %s"),
|
||||
spec->lineNum,
|
||||
(tag == RPMTAG_PROVIDES) ? "Provides" : "Obsoletes",
|
||||
spec->line);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
#include "popt/popt.h"
|
||||
|
@ -104,7 +105,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"),
|
||||
spec->lineNum, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -114,7 +115,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"),
|
||||
spec->lineNum, partname, poptStrerror(rc));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -124,8 +125,8 @@ int parseScript(Spec spec, int parsePart)
|
|||
if (arg == 'p') {
|
||||
if (prog[0] != '/') {
|
||||
rpmError(RPMERR_BADSPEC,
|
||||
"line %d: script program must begin "
|
||||
"with \'/\': %s", spec->lineNum, prog);
|
||||
_("line %d: script program must begin "
|
||||
"with \'/\': %s"), spec->lineNum, prog);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
return RPMERR_BADSPEC;
|
||||
|
@ -136,7 +137,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"),
|
||||
spec->lineNum,
|
||||
poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
|
||||
spec->line);
|
||||
|
@ -150,7 +151,7 @@ int parseScript(Spec spec, int parsePart)
|
|||
name = poptGetArg(optCon);
|
||||
}
|
||||
if (poptPeekArg(optCon)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Too many names: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Too many names: %s"),
|
||||
spec->lineNum,
|
||||
spec->line);
|
||||
FREE(argv);
|
||||
|
@ -160,7 +161,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"),
|
||||
spec->lineNum, spec->line);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
|
@ -169,7 +170,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"),
|
||||
spec->lineNum, partname);
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
|
@ -178,7 +179,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"),
|
||||
spec->lineNum, partname, poptStrerror(rc));
|
||||
FREE(argv);
|
||||
poptFreeContext(optCon);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
static struct PartRec {
|
||||
|
@ -244,7 +245,7 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot,
|
|||
|
||||
if (rpmGetVar(RPMVAR_TIMECHECK)) {
|
||||
if (parseNum(rpmGetVar(RPMVAR_TIMECHECK), &(spec->timeCheck))) {
|
||||
rpmError(RPMERR_BADSPEC, "Timecheck value must be an integer: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("Timecheck value must be an integer: %s"),
|
||||
rpmGetVar(RPMVAR_TIMECHECK));
|
||||
freeSpec(spec);
|
||||
return RPMERR_BADSPEC;
|
||||
|
@ -334,7 +335,7 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot,
|
|||
spec->buildArchitectureCount = index;
|
||||
if (! index) {
|
||||
freeSpec(spec);
|
||||
rpmError(RPMERR_BADSPEC, "No buildable architectures");
|
||||
rpmError(RPMERR_BADSPEC, _("No buildable architectures"));
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
closeSpec(spec);
|
||||
|
@ -348,7 +349,7 @@ int parseSpec(Spec *specp, char *specFile, char *buildRoot,
|
|||
while (pkg) {
|
||||
headerGetEntry(pkg->header, RPMTAG_NAME, NULL, (void **) &name, NULL);
|
||||
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
|
||||
rpmError(RPMERR_BADSPEC, "Package has no %%description: %s", name);
|
||||
rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s"), name);
|
||||
freeSpec(spec);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
|
||||
int addReqProv(Spec spec, Package pkg,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmbuild.h"
|
||||
#include "buildio.h"
|
||||
|
||||
|
@ -26,7 +27,7 @@ void freeCpioList(struct cpioFileMapping *cpioList, int cpioCount)
|
|||
struct cpioFileMapping *p = cpioList;
|
||||
|
||||
while (cpioCount--) {
|
||||
rpmMessage(RPMMESS_DEBUG, "archive = %s, fs = %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("archive = %s, fs = %s\n"),
|
||||
p->archivePath, p->fsPath);
|
||||
FREE(p->archivePath);
|
||||
FREE(p->fsPath);
|
||||
|
@ -214,13 +215,13 @@ int parseNoSource(Spec spec, char *field, int tag)
|
|||
field = buf;
|
||||
while ((s = strtok(field, ", \t"))) {
|
||||
if (parseNum(s, &num)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Bad number: %s",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Bad number: %s"),
|
||||
spec->lineNum, spec->line);
|
||||
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"),
|
||||
spec->lineNum, name, num);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
@ -278,7 +279,7 @@ int addSource(Spec spec, Package pkg, char *field, int tag)
|
|||
num = 0;
|
||||
} else {
|
||||
if (parseNum(buf, &num)) {
|
||||
rpmError(RPMERR_BADSPEC, "line %d: Bad %s number: %s\n",
|
||||
rpmError(RPMERR_BADSPEC, _("line %d: Bad %s number: %s\n"),
|
||||
spec->lineNum, name, spec->line);
|
||||
return RPMERR_BADSPEC;
|
||||
}
|
||||
|
|
10
checksig.c
10
checksig.c
|
@ -21,7 +21,7 @@ int doReSign(int add, char *passPhrase, char **argv)
|
|||
|
||||
while (*argv) {
|
||||
rpm = *argv++;
|
||||
printf("%s:\n", rpm);
|
||||
fprintf(stdout, "%s:\n", rpm);
|
||||
if ((fd = open(rpm, O_RDONLY, 0644)) < 0) {
|
||||
fprintf(stderr, _("%s: Open failed\n"), rpm);
|
||||
exit(1);
|
||||
|
@ -84,7 +84,7 @@ int doReSign(int add, char *passPhrase, char **argv)
|
|||
|
||||
/* Generate the signature */
|
||||
sigtype = rpmLookupSignatureType();
|
||||
rpmMessage(RPMMESS_VERBOSE, "Generating signature: %d\n", sigtype);
|
||||
rpmMessage(RPMMESS_VERBOSE, _("Generating signature: %d\n"), sigtype);
|
||||
if (add != ADD_SIGNATURE) {
|
||||
sig = rpmNewSignature();
|
||||
rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase);
|
||||
|
@ -281,14 +281,14 @@ int doCheckSig(int flags, char **argv)
|
|||
if (rpmIsVerbose()) {
|
||||
fprintf(stderr, "%s", buffer);
|
||||
} else {
|
||||
fprintf(stderr, "%sNOT OK%s\n", buffer,
|
||||
fprintf(stderr, "%s%s%s\n", buffer, _("NOT OK"),
|
||||
missingKeys ? _(" (MISSING KEYS)") : "");
|
||||
}
|
||||
} else {
|
||||
if (rpmIsVerbose()) {
|
||||
printf("%s", buffer);
|
||||
fprintf(stdout, "%s", buffer);
|
||||
} else {
|
||||
printf("%sOK%s\n", buffer,
|
||||
fprintf(stdout, "%s%s%s\n", buffer, _("OK"),
|
||||
missingKeys ? _(" (MISSING KEYS)") : "");
|
||||
}
|
||||
}
|
||||
|
|
14
convertdb.c
14
convertdb.c
|
@ -34,12 +34,12 @@ int convertDB(void) {
|
|||
int i, j;
|
||||
|
||||
if (exists("/var/lib/rpm/packages.rpm")) {
|
||||
rpmError(RPMERR_NOCREATEDB, "RPM database already exists");
|
||||
rpmError(RPMERR_NOCREATEDB, _("RPM database already exists"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (oldrpmdbOpen(&olddb)) {
|
||||
rpmError(RPMERR_OLDDBMISSING, "");
|
||||
rpmError(RPMERR_OLDDBMISSING, _("Old db is missing"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -50,13 +50,13 @@ int convertDB(void) {
|
|||
unlink("/var/lib/rpm/fileindex.rpm");
|
||||
|
||||
if (rpmdbOpen("", &db, O_RDWR | O_CREAT, 0644)) {
|
||||
rpmError(RPMERR_DBOPEN, "failed to create RPM database /var/lib/rpm");
|
||||
rpmError(RPMERR_DBOPEN, _("failed to create RPM database /var/lib/rpm"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
packageLabels = oldrpmdbGetAllLabels(&olddb);
|
||||
if (!packageLabels) {
|
||||
rpmError(RPMERR_OLDDBCORRUPT, "");
|
||||
rpmError(RPMERR_OLDDBCORRUPT, _("Old db is corrupt"));
|
||||
rpmdbClose(db);
|
||||
unlink("/var/lib/rpm/packages.rpm");
|
||||
oldrpmdbClose(&olddb);
|
||||
|
@ -65,7 +65,7 @@ int convertDB(void) {
|
|||
|
||||
for (label = packageLabels; label; label = label->next) {
|
||||
if (oldrpmdbGetPackageInfo(&olddb, *label, &package)) {
|
||||
fprintf(stderr, "oldrpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n", &olddb, olddb.packages);
|
||||
fprintf(stderr, _("oldrpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n"), &olddb, olddb.packages);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -197,13 +197,13 @@ int convertDB(void) {
|
|||
|
||||
int main(int argc, char ** argv) {
|
||||
if (argc != 1) {
|
||||
fprintf(stderr, "rpmconvert: no arguments expected");
|
||||
fprintf(stderr, _("rpmconvert: no arguments expected"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
rpmReadConfigFiles(NULL, NULL, NULL, 0);
|
||||
|
||||
printf("rpmconvert 1.0 - converting database in /var/lib/rpm\n");
|
||||
printf(_("rpmconvert 1.0 - converting database in /var/lib/rpm\n"));
|
||||
convertDB();
|
||||
|
||||
exit(0);
|
||||
|
|
40
install.c
40
install.c
|
@ -20,20 +20,20 @@ static void printHash(const unsigned long amount, const unsigned long total) {
|
|||
if (hashesPrinted != 50) {
|
||||
hashesNeeded = 50 * (total ? (((float) amount) / total) : 1);
|
||||
while (hashesNeeded > hashesPrinted) {
|
||||
printf("#");
|
||||
fprintf(stdout, "#");
|
||||
hashesPrinted++;
|
||||
}
|
||||
fflush(stdout);
|
||||
hashesPrinted = hashesNeeded;
|
||||
|
||||
if (hashesPrinted == 50)
|
||||
printf("\n");
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void printPercent(const unsigned long amount, const unsigned long total)
|
||||
{
|
||||
printf("%%%% %f\n", (total
|
||||
fprintf(stdout, "%%%% %f\n", (total
|
||||
? ((float) ((((float) amount) / total) * 100))
|
||||
: 100.0));
|
||||
fflush(stdout);
|
||||
|
@ -82,15 +82,15 @@ static int installPackages(char * rootdir, char ** packages,
|
|||
|
||||
printFormat = "%-28s";
|
||||
} else if (rpmIsVerbose())
|
||||
printf(_("Installing %s\n"), *filename);
|
||||
fprintf(stdout, _("Installing %s\n"), *filename);
|
||||
|
||||
if (db) {
|
||||
rc = rpmInstallPackage(rootdir, db, fd, relocations, installFlags,
|
||||
fn, printFormat);
|
||||
} else {
|
||||
if (installFlags &= RPMINSTALL_TEST) {
|
||||
rpmMessage(RPMMESS_DEBUG, "stopping source install as we're "
|
||||
"just testing\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("stopping source install as we're "
|
||||
"just testing\n"));
|
||||
rc = 0;
|
||||
} else {
|
||||
rc = rpmInstallSourcePackage(rootdir, fd, NULL, fn,
|
||||
|
@ -138,28 +138,28 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
|
|||
else
|
||||
mode = O_RDWR | O_CREAT;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "counting packages to install\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("counting packages to install\n"));
|
||||
for (filename = argv, numPackages = 0; *filename; filename++, numPackages++)
|
||||
;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "found %d packages\n", numPackages);
|
||||
rpmMessage(RPMMESS_DEBUG, _("found %d packages\n"), numPackages);
|
||||
packages = alloca((numPackages + 1) * sizeof(char *));
|
||||
packages[numPackages] = NULL;
|
||||
tmpPackages = alloca((numPackages + 1) * sizeof(char *));
|
||||
binaryHeaders = alloca((numPackages + 1) * sizeof(Header));
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "looking for packages to download\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("looking for packages to download\n"));
|
||||
for (filename = argv, i = 0; *filename; filename++) {
|
||||
if (urlIsURL(*filename)) {
|
||||
if (rpmIsVerbose()) {
|
||||
printf(_("Retrieving %s\n"), *filename);
|
||||
fprintf(stdout, _("Retrieving %s\n"), *filename);
|
||||
}
|
||||
packages[i] = alloca(strlen(*filename) + 30 + strlen(rootdir) +
|
||||
strlen(rpmGetVar(RPMVAR_TMPPATH)));
|
||||
sprintf(packages[i], "%s%s/rpm-ftp-%d-%d.tmp", rootdir,
|
||||
rpmGetVar(RPMVAR_TMPPATH), tmpnum++, (int) getpid());
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"getting %s as %s\n", *filename, packages[i]);
|
||||
_("getting %s as %s\n"), *filename, packages[i]);
|
||||
fd = urlGetFile(*filename, packages[i]);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr,
|
||||
|
@ -175,9 +175,9 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
|
|||
}
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "retrieved %d packages\n", numTmpPackages);
|
||||
rpmMessage(RPMMESS_DEBUG, _("retrieved %d packages\n"), numTmpPackages);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "finding source and binary packages\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("finding source and binary packages\n"));
|
||||
for (filename = packages; *filename; filename++) {
|
||||
fd = open(*filename, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
|
@ -213,11 +213,11 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
|
|||
}
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "found %d source and %d binary packages\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("found %d source and %d binary packages\n"),
|
||||
numSourcePackages, numBinaryPackages);
|
||||
|
||||
if (numBinaryPackages) {
|
||||
rpmMessage(RPMMESS_DEBUG, "opening database mode: 0%o\n", mode);
|
||||
rpmMessage(RPMMESS_DEBUG, _("opening database mode: 0%o\n"), mode);
|
||||
if (rpmdbOpen(rootdir, &db, mode, 0644)) {
|
||||
fprintf(stderr, _("error: cannot open %s%s/packages.rpm\n"),
|
||||
rootdir, rpmGetVar(RPMVAR_DBPATH));
|
||||
|
@ -261,7 +261,7 @@ int doInstall(char * rootdir, char ** argv, int installFlags,
|
|||
db = NULL;
|
||||
|
||||
if (!stopInstall) {
|
||||
rpmMessage(RPMMESS_DEBUG, "installing binary packages\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("installing binary packages\n"));
|
||||
numFailed += installPackages(rootdir, packages, numPackages,
|
||||
installFlags, interfaceFlags, db,
|
||||
relocations);
|
||||
|
@ -295,7 +295,7 @@ int doUninstall(char * rootdir, char ** argv, int uninstallFlags,
|
|||
int numConflicts;
|
||||
int stopUninstall = 0;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "counting packages to uninstall\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("counting packages to uninstall\n"));
|
||||
for (arg = argv, numPackages = 0; *arg; arg++, numPackages++)
|
||||
;
|
||||
|
||||
|
@ -351,7 +351,7 @@ int doUninstall(char * rootdir, char ** argv, int uninstallFlags,
|
|||
}
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "found %d packages to uninstall\n", numPackages);
|
||||
rpmMessage(RPMMESS_DEBUG, _("found %d packages to uninstall\n"), numPackages);
|
||||
|
||||
if (!(interfaceFlags & UNINSTALL_NODEPS)) {
|
||||
rpmdep = rpmdepDependencies(db);
|
||||
|
@ -377,7 +377,7 @@ int doUninstall(char * rootdir, char ** argv, int uninstallFlags,
|
|||
|
||||
if (!stopUninstall) {
|
||||
for (i = 0; i < numPackages; i++) {
|
||||
rpmMessage(RPMMESS_DEBUG, "uninstalling record number %d\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("uninstalling record number %d\n"),
|
||||
packageOffsets[i]);
|
||||
if (rpmRemovePackage(rootdir, db, packageOffsets[i],
|
||||
uninstallFlags))
|
||||
|
@ -404,7 +404,7 @@ int doSourceInstall(char * rootdir, char * arg, char ** specFile,
|
|||
}
|
||||
|
||||
if (rpmIsVerbose())
|
||||
printf("Installing %s\n", arg);
|
||||
fprintf(stdout, _("Installing %s\n"), arg);
|
||||
|
||||
rc = rpmInstallSourcePackage(rootdir, fd, specFile, NULL, NULL, cookie);
|
||||
if (rc == 1) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "cpio.h"
|
||||
|
||||
#define CPIO_NEWC_MAGIC "070701"
|
||||
|
@ -521,7 +522,8 @@ int cpioInstallArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
|
|||
|
||||
do {
|
||||
if ((rc = getNextHeader(cfd, &ch))) {
|
||||
printf("error %d reading header: %s\n", rc, strerror(errno));
|
||||
fprintf(stderr, _("error %d reading header: %s\n"),
|
||||
rc, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ static int unsatisfiedDepend(rpmDependencies rpmdep, char * reqName,
|
|||
char * rcProvidesString;
|
||||
char * start;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "dependencies: looking for %s\n", reqName);
|
||||
rpmMessage(RPMMESS_DEBUG, _("dependencies: looking for %s\n"), reqName);
|
||||
|
||||
if (suggestion) *suggestion = NULL;
|
||||
|
||||
|
@ -619,7 +619,7 @@ static int checkPackageDeps(rpmDependencies rpmdep, struct problemsSet * psp,
|
|||
headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release,
|
||||
&count);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "package %s require not satisfied: %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("package %s require not satisfied: %s\n"),
|
||||
name, requires[i]);
|
||||
|
||||
if (psp->num == psp->alloced) {
|
||||
|
@ -662,7 +662,7 @@ static int checkPackageDeps(rpmDependencies rpmdep, struct problemsSet * psp,
|
|||
headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release,
|
||||
&count);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "package %s conflicts: %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("package %s conflicts: %s\n"),
|
||||
name, conflicts[i]);
|
||||
|
||||
if (psp->num == psp->alloced) {
|
||||
|
@ -761,7 +761,7 @@ static int dbrecMatchesDepFlags(rpmDependencies rpmdep, int recOffset,
|
|||
|
||||
h = rpmdbGetRecord(rpmdep->db, recOffset);
|
||||
if (!h) {
|
||||
rpmMessage(RPMMESS_DEBUG, "dbrecMatchesDepFlags() failed to read header");
|
||||
rpmMessage(RPMMESS_DEBUG, _("dbrecMatchesDepFlags() failed to read header"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "falloc.h"
|
||||
#include "intl.h"
|
||||
|
||||
#define FA_MAGIC 0x02050920
|
||||
|
||||
|
@ -124,8 +125,8 @@ unsigned int faAlloc(faFile fa, unsigned int size) { /* returns 0 on failure */
|
|||
if (read(fa->fd, &header, sizeof(header)) != sizeof(header)) return 0;
|
||||
|
||||
if (!header.isFree) {
|
||||
fprintf(stderr, "free list corrupt (%d)- contact "
|
||||
"support@redhat.com\n", nextFreeBlock);
|
||||
fprintf(stderr, _("free list corrupt (%d)- contact "
|
||||
"support@redhat.com\n"), nextFreeBlock);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
6
lib/fs.c
6
lib/fs.c
|
@ -73,7 +73,7 @@ static int getFilesystemList(void) {
|
|||
filesystems[i].mntPoint = fsnames[i];
|
||||
|
||||
if (stat(filesystems[i].mntPoint, &sb)) {
|
||||
rpmError(RPMERR_STAT, "failed to stat %s: %s", fsnames[i],
|
||||
rpmError(RPMERR_STAT, _("failed to stat %s: %s"), fsnames[i],
|
||||
strerror(errno));
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -235,7 +235,7 @@ int rpmGetFilesystemUsage(char ** fileList, int_32 * fssizes, int numFiles,
|
|||
chptr = dirName + strlen(dirName) - 1;
|
||||
while (stat(dirName, &sb)) {
|
||||
if (errno != ENOENT) {
|
||||
rpmError(RPMERR_STAT, "failed to stat %s: %s", buf,
|
||||
rpmError(RPMERR_STAT, _("failed to stat %s: %s"), buf,
|
||||
strerror(errno));
|
||||
free(usages);
|
||||
return 1;
|
||||
|
@ -256,7 +256,7 @@ int rpmGetFilesystemUsage(char ** fileList, int_32 * fssizes, int numFiles,
|
|||
|
||||
if (j == numFilesystems) {
|
||||
rpmError(RPMERR_BADDEV,
|
||||
"file %s is on an unknown device", buf);
|
||||
_("file %s is on an unknown device"), buf);
|
||||
free(usages);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -663,7 +663,7 @@ void headerDump(Header h, FILE *f, int flags,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Data type %d not supprted\n",
|
||||
fprintf(stderr, _("Data type %d not supprted\n"),
|
||||
(int) p->info.type);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ static int dataLength(int_32 type, void * p, int_32 count, int onDisk) {
|
|||
break;
|
||||
}
|
||||
/* This should not be allowed */
|
||||
fprintf(stderr, "grabData() RPM_STRING_TYPE count must be 1.\n");
|
||||
fprintf(stderr, _("grabData() RPM_STRING_TYPE count must be 1.\n"));
|
||||
exit(1);
|
||||
|
||||
case RPM_STRING_ARRAY_TYPE:
|
||||
|
@ -905,7 +905,7 @@ static int dataLength(int_32 type, void * p, int_32 count, int onDisk) {
|
|||
if (typeSizes[type] != -1)
|
||||
length = typeSizes[type] * count;
|
||||
else {
|
||||
fprintf(stderr, "Data type %d not supported\n", (int) type);
|
||||
fprintf(stderr, _("Data type %d not supported\n"), (int) type);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -964,7 +964,7 @@ int headerAddEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c)
|
|||
h->sorted = 0;
|
||||
|
||||
if (c <= 0) {
|
||||
fprintf(stderr, "Bad count for headerAddEntry(): %d\n", (int) c);
|
||||
fprintf(stderr, _("Bad count for headerAddEntry(): %d\n"), (int) c);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
131
lib/install.c
131
lib/install.c
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "cpio.h"
|
||||
#include "install.h"
|
||||
#include "intl.h"
|
||||
#include "md5.h"
|
||||
#include "misc.h"
|
||||
#include "rpmdb.h"
|
||||
|
@ -92,7 +93,7 @@ int rpmInstallSourcePackage(char * rootdir, int fd, char ** specFile,
|
|||
if (rc) return rc;
|
||||
|
||||
if (!isSource) {
|
||||
rpmError(RPMERR_NOTSRPM, "source package expected, binary found");
|
||||
rpmError(RPMERR_NOTSRPM, _("source package expected, binary found"));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -164,11 +165,11 @@ static int assembleFileList(Header h, struct fileMemory * mem,
|
|||
if (!rawRelocations[i].oldPath) {
|
||||
if (!numValid) {
|
||||
rpmError(RPMERR_NORELOCATE,
|
||||
"package is not relocatable");
|
||||
_("package is not relocatable"));
|
||||
return 1;
|
||||
} else if (numValid != 1){
|
||||
rpmError(RPMERR_NORELOCATE,
|
||||
"package has multiple relocatable components");
|
||||
_("package has multiple relocatable components"));
|
||||
return 1;
|
||||
}
|
||||
relocations[i].oldPath =
|
||||
|
@ -191,7 +192,7 @@ static int assembleFileList(Header h, struct fileMemory * mem,
|
|||
if (!strcmp(validRelocations[j],
|
||||
relocations[i].oldPath)) break;
|
||||
if (j == numValid) {
|
||||
rpmError(RPMERR_BADRELOCATE, "path %s is not relocatable",
|
||||
rpmError(RPMERR_BADRELOCATE, _("path %s is not relocatable"),
|
||||
relocations[i].oldPath);
|
||||
return 1;
|
||||
}
|
||||
|
@ -273,7 +274,7 @@ static int assembleFileList(Header h, struct fileMemory * mem,
|
|||
newName = alloca(newLen + strlen(mem->names[i]));
|
||||
strcpy(newName, nextReloc->newPath);
|
||||
strcat(newName, mem->names[i] + len);
|
||||
rpmMessage(RPMMESS_DEBUG, "relocating %s to %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("relocating %s to %s\n"),
|
||||
mem->names[i], newName);
|
||||
mem->names[i] = newName;
|
||||
}
|
||||
|
@ -321,7 +322,7 @@ static int assembleFileList(Header h, struct fileMemory * mem,
|
|||
if (!strcmp(*lang, fileLangs[i])) break;
|
||||
if (!*lang) {
|
||||
file->install = 0;
|
||||
rpmMessage(RPMMESS_DEBUG, "not installing %s -- linguas\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("not installing %s -- linguas\n"),
|
||||
file->relativePath);
|
||||
}
|
||||
}
|
||||
|
@ -343,7 +344,7 @@ static void setFileOwners(Header h, struct fileInfo * files, int fileCount) {
|
|||
|
||||
for (i = 0; i < fileCount; i++) {
|
||||
if (unameToUid(fileOwners[i], &files[i].uid)) {
|
||||
rpmError(RPMERR_NOUSER, "user %s does not exist - using root",
|
||||
rpmError(RPMERR_NOUSER, _("user %s does not exist - using root"),
|
||||
fileOwners[i]);
|
||||
files[i].uid = 0;
|
||||
/* turn off the suid bit */
|
||||
|
@ -351,7 +352,7 @@ static void setFileOwners(Header h, struct fileInfo * files, int fileCount) {
|
|||
}
|
||||
|
||||
if (gnameToGid(fileGroups[i], &files[i].gid)) {
|
||||
rpmError(RPMERR_NOGROUP, "group %s does not exist - using root",
|
||||
rpmError(RPMERR_NOGROUP, _("group %s does not exist - using root"),
|
||||
fileGroups[i]);
|
||||
files[i].gid = 0;
|
||||
/* turn off the sgid bit */
|
||||
|
@ -375,8 +376,8 @@ static void trimChangelog(Header h) {
|
|||
|
||||
numToKeep = strtol(buf, &end, 10);
|
||||
if (*end) {
|
||||
rpmError(RPMERR_RPMRC, "instchangelog value in rpmrc should be a "
|
||||
"number, but isn't");
|
||||
rpmError(RPMERR_RPMRC, _("instchangelog value in rpmrc should be a "
|
||||
"number, but isn't"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -451,7 +452,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
if (isSource) {
|
||||
if (flags & RPMINSTALL_TEST) {
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"stopping install as we're running --test\n");
|
||||
_("stopping install as we're running --test\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -482,15 +483,15 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
headerRemoveEntry(h, RPMTAG_FILEGIDS);
|
||||
|
||||
if (!(flags & RPMINSTALL_NOARCH) && !archOkay(h)) {
|
||||
rpmError(RPMERR_BADARCH, "package %s-%s-%s is for a different "
|
||||
"architecture", name, version, release);
|
||||
rpmError(RPMERR_BADARCH, _("package %s-%s-%s is for a different "
|
||||
"architecture"), name, version, release);
|
||||
headerFree(h);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (!(flags & RPMINSTALL_NOOS) && !osOkay(h)) {
|
||||
rpmError(RPMERR_BADOS, "package %s-%s-%s is for a different "
|
||||
"operating system", name, version, release);
|
||||
rpmError(RPMERR_BADOS, _("package %s-%s-%s is for a different "
|
||||
"operating system"), name, version, release);
|
||||
headerFree(h);
|
||||
return 2;
|
||||
}
|
||||
|
@ -501,7 +502,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
return 2;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "package: %s-%s-%s files test = %d\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("package: %s-%s-%s files test = %d\n"),
|
||||
name, version, release, flags & RPMINSTALL_TEST);
|
||||
|
||||
/* This canonicalizes the root */
|
||||
|
@ -565,8 +566,8 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
if (rc == -1) return 2;
|
||||
if (rc == 1) continue; /* no matches */
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "package %s is now obsolete and will"
|
||||
" be removed\n", obsoletes[i]);
|
||||
rpmMessage(RPMMESS_DEBUG, _("package %s is now obsolete and will"
|
||||
" be removed\n"), obsoletes[i]);
|
||||
|
||||
toRemoveAlloced += matches.count;
|
||||
j = toRemove ? intptr - toRemove : 0;
|
||||
|
@ -676,7 +677,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
}
|
||||
|
||||
if (nsp && *nsp) {
|
||||
rpmMessage(RPMMESS_DEBUG, "file %s in netshared path\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("file %s in netshared path\n"),
|
||||
files[i].relativePath);
|
||||
files[i].action = SKIP;
|
||||
files[i].state = RPMFILE_STATE_NETSHARED;
|
||||
|
@ -693,12 +694,12 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
if (exists(files[i].relativePath)) {
|
||||
if (files[i].flags & RPMFILE_NOREPLACE) {
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"%s exists - creating with alternate name\n",
|
||||
_("%s exists - creating with alternate name\n"),
|
||||
files[i].relativePath);
|
||||
files[i].action = ALTNAME;
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"%s exists - backing up\n",
|
||||
_("%s exists - backing up\n"),
|
||||
files[i].relativePath);
|
||||
files[i].action = BACKUP;
|
||||
}
|
||||
|
@ -731,13 +732,13 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
chdir(currDir);
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "stopping install as we're running --test\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("stopping install as we're running --test\n"));
|
||||
if (replacedList) free(replacedList);
|
||||
if (freeFileMem) freeFileMemory(fileMem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "running preinstall script (if any)\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("running preinstall script (if any)\n"));
|
||||
if (runInstScript("/", h, RPMTAG_PREIN, RPMTAG_PREINPROG, scriptArg,
|
||||
flags & RPMINSTALL_NOSCRIPTS, 0)) {
|
||||
if (replacedList) free(replacedList);
|
||||
|
@ -768,7 +769,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
newpath = alloca(strlen(files[i].relativePath) + 20);
|
||||
strcpy(newpath, files[i].relativePath);
|
||||
strcat(newpath, ".rpmnew");
|
||||
rpmError(RPMMESS_ALTNAME, "warning: %s created as %s",
|
||||
rpmError(RPMMESS_ALTNAME, _("warning: %s created as %s"),
|
||||
files[i].relativePath, newpath);
|
||||
files[i].relativePath = newpath;
|
||||
|
||||
|
@ -802,11 +803,11 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
newpath = alloca(strlen(files[i].relativePath) + 20);
|
||||
strcpy(newpath, files[i].relativePath);
|
||||
strcat(newpath, ext);
|
||||
rpmError(RPMMESS_BACKUP, "warning: %s saved as %s",
|
||||
rpmError(RPMMESS_BACKUP, _("warning: %s saved as %s"),
|
||||
files[i].relativePath, newpath);
|
||||
|
||||
if (rename(files[i].relativePath, newpath)) {
|
||||
rpmError(RPMERR_RENAME, "rename of %s to %s failed: %s",
|
||||
rpmError(RPMERR_RENAME, _("rename of %s to %s failed: %s"),
|
||||
files[i].relativePath, newpath, strerror(errno));
|
||||
if (replacedList) free(replacedList);
|
||||
if (freeFileMem) freeFileMemory(fileMem);
|
||||
|
@ -838,7 +839,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
archiveSizePtr = NULL;
|
||||
|
||||
if (labelFormat) {
|
||||
printf(labelFormat, name, version, release);
|
||||
fprintf(stdout, labelFormat, name, version, release);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
@ -907,7 +908,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
return 2;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "running postinstall script (if any)\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("running postinstall script (if any)\n"));
|
||||
|
||||
if (runInstScript(rootdir, h, RPMTAG_POSTIN, RPMTAG_POSTINPROG, scriptArg,
|
||||
flags & RPMINSTALL_NOSCRIPTS, 0)) {
|
||||
|
@ -928,7 +929,7 @@ int rpmInstallPackage(char * rootdir, rpmdb db, int fd,
|
|||
}
|
||||
|
||||
if (toRemove && flags & RPMINSTALL_UPGRADE) {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing old versions of package\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing old versions of package\n"));
|
||||
intptr = toRemove;
|
||||
|
||||
if (flags & RPMINSTALL_NOSCRIPTS)
|
||||
|
@ -1019,7 +1020,7 @@ static int installArchive(int fd, struct fileInfo * files,
|
|||
if (rc) {
|
||||
/* this would probably be a good place to check if disk space
|
||||
was used up - if so, we should return a different error */
|
||||
rpmError(RPMERR_CPIO, "unpacking of archive failed on file %s: %d: %s",
|
||||
rpmError(RPMERR_CPIO, _("unpacking of archive failed on file %s: %d: %s"),
|
||||
failedFile, rc, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
@ -1057,7 +1058,7 @@ static int packageAlreadyInstalled(rpmdb db, char * name, char * version,
|
|||
*offset = matches.recs[i].recOffset;
|
||||
if (!(flags & RPMINSTALL_REPLACEPKG)) {
|
||||
rpmError(RPMERR_PKGINSTALLED,
|
||||
"package %s-%s-%s is already installed",
|
||||
_("package %s-%s-%s is already installed"),
|
||||
name, version, release);
|
||||
headerFree(sech);
|
||||
return 1;
|
||||
|
@ -1105,7 +1106,7 @@ static enum instActions decideFileFate(char * filespec, short dbMode,
|
|||
package has marked it as missingok */
|
||||
if (!(instFlags & RPMINSTALL_ALLFILES) &&
|
||||
(newFlags & RPMFILE_MISSINGOK)) {
|
||||
rpmMessage(RPMMESS_DEBUG, "%s skipped due to missingok flag\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("%s skipped due to missingok flag\n"),
|
||||
filespec);
|
||||
return SKIP;
|
||||
} else
|
||||
|
@ -1123,18 +1124,18 @@ static enum instActions decideFileFate(char * filespec, short dbMode,
|
|||
|
||||
if (diskWhat != newWhat) {
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"\tfile type on disk is different then package - saving\n");
|
||||
_("\tfile type on disk is different then package - saving\n"));
|
||||
return SAVE;
|
||||
} else if (newWhat != dbWhat && diskWhat != dbWhat) {
|
||||
rpmMessage(RPMMESS_DEBUG, "\tfile type in database is different then "
|
||||
"disk and package file - saving\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\tfile type in database is different then "
|
||||
"disk and package file - saving\n"));
|
||||
return SAVE;
|
||||
} else if (dbWhat != newWhat) {
|
||||
rpmMessage(RPMMESS_DEBUG, "\tfile type changed - replacing\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\tfile type changed - replacing\n"));
|
||||
return CREATE;
|
||||
} else if (dbWhat != LINK && dbWhat != REG) {
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"\tcan't check file for changes - replacing\n");
|
||||
_("\tcan't check file for changes - replacing\n"));
|
||||
return CREATE;
|
||||
}
|
||||
|
||||
|
@ -1146,7 +1147,7 @@ static enum instActions decideFileFate(char * filespec, short dbMode,
|
|||
|
||||
if (rc) {
|
||||
/* assume the file has been removed, don't freak */
|
||||
rpmMessage(RPMMESS_DEBUG, " file not present - creating");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\tfile not present - creating"));
|
||||
return CREATE;
|
||||
}
|
||||
dbAttr = dbMd5;
|
||||
|
@ -1156,7 +1157,7 @@ static enum instActions decideFileFate(char * filespec, short dbMode,
|
|||
i = readlink(filespec, buffer, sizeof(buffer) - 1);
|
||||
if (i == -1) {
|
||||
/* assume the file has been removed, don't freak */
|
||||
rpmMessage(RPMMESS_DEBUG, " file not present - creating");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\tfile not present - creating"));
|
||||
return CREATE;
|
||||
}
|
||||
dbAttr = dbLink;
|
||||
|
@ -1169,14 +1170,14 @@ static enum instActions decideFileFate(char * filespec, short dbMode,
|
|||
if (!strcmp(dbAttr, buffer)) {
|
||||
/* this config file has never been modified, so
|
||||
just replace it */
|
||||
rpmMessage(RPMMESS_DEBUG, " old == current, replacing "
|
||||
"with new version\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\told == current, replacing "
|
||||
"with new version\n"));
|
||||
return CREATE;
|
||||
}
|
||||
|
||||
if (!strcmp(dbAttr, newAttr)) {
|
||||
/* this file is the same in all versions of this package */
|
||||
rpmMessage(RPMMESS_DEBUG, " old == new, keeping\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\told == new, keeping\n"));
|
||||
return KEEP;
|
||||
}
|
||||
|
||||
|
@ -1184,7 +1185,7 @@ static enum instActions decideFileFate(char * filespec, short dbMode,
|
|||
the ones in the two packages are different. It would
|
||||
be nice if RPM was smart enough to at least try and
|
||||
merge the difference ala CVS, but... */
|
||||
rpmMessage(RPMMESS_DEBUG, " files changed too much - backing up\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\tfiles changed too much - backing up\n"));
|
||||
|
||||
return SAVE;
|
||||
}
|
||||
|
@ -1246,8 +1247,8 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
|
|||
secOffset = sharedList[i].secRecOffset;
|
||||
sech = rpmdbGetRecord(db, secOffset);
|
||||
if (!sech) {
|
||||
rpmError(RPMERR_DBCORRUPT, "cannot read header at %d for "
|
||||
"uninstall", secOffset);
|
||||
rpmError(RPMERR_DBCORRUPT, _("cannot read header at %d for "
|
||||
"uninstall"), secOffset);
|
||||
rc = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -1259,12 +1260,12 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
|
|||
headerGetEntry(sech, RPMTAG_RELEASE, &type, (void **) &release,
|
||||
&secFileCount);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "package %s-%s-%s contain shared files\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("package %s-%s-%s contain shared files\n"),
|
||||
name, version, release);
|
||||
|
||||
if (!headerGetEntry(sech, RPMTAG_FILENAMES, &type,
|
||||
(void **) &secFileList, &secFileCount)) {
|
||||
rpmError(RPMERR_DBCORRUPT, "package %s contains no files",
|
||||
rpmError(RPMERR_DBCORRUPT, _("package %s contains no files"),
|
||||
name);
|
||||
headerFree(sech);
|
||||
rc = 1;
|
||||
|
@ -1286,7 +1287,7 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
|
|||
secNum = sharedList[i].secFileNumber;
|
||||
mainNum = sharedList[i].mainFileNumber;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "file %s is shared\n", secFileList[secNum]);
|
||||
rpmMessage(RPMMESS_DEBUG, _("file %s is shared\n"), secFileList[secNum]);
|
||||
|
||||
if (notErrors) {
|
||||
intptr = notErrors;
|
||||
|
@ -1302,10 +1303,10 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
|
|||
replaced, just forget about it */
|
||||
state = secFileStatesList[sharedList[i].secFileNumber];
|
||||
if (state == RPMFILE_STATE_REPLACED) {
|
||||
rpmMessage(RPMMESS_DEBUG, " old version already replaced\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\told version already replaced\n"));
|
||||
continue;
|
||||
} else if (state == RPMFILE_STATE_NOTINSTALLED) {
|
||||
rpmMessage(RPMMESS_DEBUG, " other version never installed\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("\tother version never installed\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1313,8 +1314,8 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
|
|||
files[mainNum].link, secFileModesList[secNum],
|
||||
secFileMd5List[secNum], secFileLinksList[secNum])) {
|
||||
if (!(flags & RPMINSTALL_REPLACEFILES) && !intptr) {
|
||||
rpmError(RPMERR_PKGINSTALLED, "%s conflicts with file from "
|
||||
"%s-%s-%s",
|
||||
rpmError(RPMERR_PKGINSTALLED, _("%s conflicts with file from "
|
||||
"%s-%s-%s"),
|
||||
files[sharedList[i].mainFileNumber].relativePath,
|
||||
name, version, release);
|
||||
rc = 1;
|
||||
|
@ -1332,7 +1333,7 @@ static int instHandleSharedFiles(rpmdb db, int ignoreOffset,
|
|||
sharedList[i].secFileNumber;
|
||||
numReplacedFiles++;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "%s from %s-%s-%s will be replaced\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("%s from %s-%s-%s will be replaced\n"),
|
||||
files[sharedList[i].mainFileNumber].relativePath,
|
||||
name, version, release);
|
||||
}
|
||||
|
@ -1396,7 +1397,7 @@ static int installSources(Header h, char * rootdir, int fd,
|
|||
uid_t currUid = getuid();
|
||||
gid_t currGid = getgid();
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "installing a source package\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("installing a source package\n"));
|
||||
|
||||
sourceDir = rpmGetVar(RPMVAR_SOURCEDIR);
|
||||
specDir = rpmGetVar(RPMVAR_SPECDIR);
|
||||
|
@ -1412,17 +1413,17 @@ static int installSources(Header h, char * rootdir, int fd,
|
|||
strcat(realSpecDir, specDir);
|
||||
|
||||
if (access(realSourceDir, W_OK)) {
|
||||
rpmError(RPMERR_CREATE, "cannot write to %s", realSourceDir);
|
||||
rpmError(RPMERR_CREATE, _("cannot write to %s"), realSourceDir);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (access(realSpecDir, W_OK)) {
|
||||
rpmError(RPMERR_CREATE, "cannot write to %s", realSpecDir);
|
||||
rpmError(RPMERR_CREATE, _("cannot write to %s"), realSpecDir);
|
||||
return 2;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "sources in: %s\n", realSourceDir);
|
||||
rpmMessage(RPMMESS_DEBUG, "spec file in: %s\n", realSpecDir);
|
||||
rpmMessage(RPMMESS_DEBUG, _("sources in: %s\n"), realSourceDir);
|
||||
rpmMessage(RPMMESS_DEBUG, _("spec file in: %s\n"), realSpecDir);
|
||||
|
||||
if (h && headerIsEntry(h, RPMTAG_FILENAMES)) {
|
||||
/* we can't remap v1 packages */
|
||||
|
@ -1455,7 +1456,7 @@ static int installSources(Header h, char * rootdir, int fd,
|
|||
strcat(files[i].relativePath, "/");
|
||||
strcat(files[i].relativePath, files[i].cpioPath);
|
||||
} else {
|
||||
rpmError(RPMERR_NOSPEC, "source package contains no .spec file");
|
||||
rpmError(RPMERR_NOSPEC, _("source package contains no .spec file"));
|
||||
if (fileCount > 0) freeFileMemory(fileMem);
|
||||
return 2;
|
||||
}
|
||||
|
@ -1468,7 +1469,7 @@ static int installSources(Header h, char * rootdir, int fd,
|
|||
if (!headerGetEntry(h, RPMTAG_ARCHIVESIZE, &type,
|
||||
(void *) &archiveSizePtr, &count))
|
||||
archiveSizePtr = NULL;
|
||||
printf(labelFormat, name, version, release);
|
||||
fprintf(stdout, labelFormat, name, version, release);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
@ -1494,7 +1495,7 @@ static int installSources(Header h, char * rootdir, int fd,
|
|||
|
||||
if (specFileIndex == -1) {
|
||||
if (!specFile) {
|
||||
rpmError(RPMERR_NOSPEC, "source package contains no .spec file");
|
||||
rpmError(RPMERR_NOSPEC, _("source package contains no .spec file"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1514,9 +1515,9 @@ static int installSources(Header h, char * rootdir, int fd,
|
|||
free(specFile);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"renaming %s to %s\n", instSpecFile, correctSpecFile);
|
||||
_("renaming %s to %s\n"), instSpecFile, correctSpecFile);
|
||||
if (rename(instSpecFile, correctSpecFile)) {
|
||||
rpmError(RPMERR_RENAME, "rename of %s to %s failed: %s",
|
||||
rpmError(RPMERR_RENAME, _("rename of %s to %s failed: %s"),
|
||||
instSpecFile, correctSpecFile, strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
|
@ -1630,8 +1631,8 @@ static int ensureOlder(rpmdb db, Header new, int dbOffset) {
|
|||
headerGetEntry(old, RPMTAG_NAME, NULL, (void **) &name, NULL);
|
||||
headerGetEntry(old, RPMTAG_VERSION, NULL, (void **) &version, NULL);
|
||||
headerGetEntry(old, RPMTAG_RELEASE, NULL, (void **) &release, NULL);
|
||||
rpmError(RPMERR_OLDPACKAGE, "package %s-%s-%s (which is newer) is "
|
||||
"already installed", name, version, release);
|
||||
rpmError(RPMERR_OLDPACKAGE, _("package %s-%s-%s (which is newer) is "
|
||||
"already installed"), name, version, release);
|
||||
}
|
||||
|
||||
headerFree(old);
|
||||
|
|
42
lib/macro.c
42
lib/macro.c
|
@ -9,7 +9,9 @@
|
|||
#ifdef DEBUG_MACROS
|
||||
#define rpmError fprintf
|
||||
#define RPMERR_BADSPEC stderr
|
||||
#define _(x) x
|
||||
#else
|
||||
#include "intl.h"
|
||||
#include "rpmlib.h"
|
||||
#endif
|
||||
|
||||
|
@ -109,7 +111,7 @@ dumpMacroTable(MacroContext *mc)
|
|||
fprintf(stderr, "\n");
|
||||
nactive++;
|
||||
}
|
||||
fprintf(stderr, "======================== active %d empty %d\n",
|
||||
fprintf(stderr, _("======================== active %d empty %d\n"),
|
||||
nactive, nempty);
|
||||
}
|
||||
|
||||
|
@ -196,7 +198,7 @@ printMacro(MacroBuf *mb, const char *s, const char *se)
|
|||
int choplen;
|
||||
|
||||
if (s >= se) { /* XXX just in case */
|
||||
fprintf(stderr, "%3d>%*s(empty)", mb->depth,
|
||||
fprintf(stderr, _("%3d>%*s(empty)"), mb->depth,
|
||||
(2 * mb->depth + 1), "");
|
||||
return;
|
||||
}
|
||||
|
@ -231,7 +233,7 @@ printExpansion(MacroBuf *mb, const char *t, const char *te)
|
|||
int choplen;
|
||||
|
||||
if (!(te > t)) {
|
||||
fprintf(stderr, "%3d<%*s(empty)\n", mb->depth, (2 * mb->depth + 1), "");
|
||||
fprintf(stderr, _("%3d<%*s(empty)\n"), mb->depth, (2 * mb->depth + 1), "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -404,7 +406,7 @@ doDefine(MacroBuf *mb, const char *se, int level, int expandbody)
|
|||
SKIPBLANK(s, c);
|
||||
if (c == '{') { /* XXX permit silent {...} grouping */
|
||||
if ((se = matchchar(s, c, '}')) == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has unterminated body", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated body"), n);
|
||||
se = s; /* XXX W2DO? */
|
||||
return se;
|
||||
}
|
||||
|
@ -430,23 +432,23 @@ doDefine(MacroBuf *mb, const char *se, int level, int expandbody)
|
|||
|
||||
/* Names must start with alphabetic or _ and be at least 3 chars */
|
||||
if (!((c = *n) && (isalpha(c) || c == '_') && (ne - n) > 2)) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has illegal name (%%define)", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has illegal name (%%define)"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
/* Options must be terminated with ')' */
|
||||
if (o && oc != ')') {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has unterminated opts", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
if ((be - b) < 1) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has empty body", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has empty body"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
if (expandbody && expandU(mb, b, (&buf[sizeof(buf)] - b))) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s failed to expand", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s failed to expand"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
|
@ -471,7 +473,7 @@ doUndefine(MacroContext *mc, const char *se)
|
|||
|
||||
/* Names must start with alphabetic or _ and be at least 3 chars */
|
||||
if (!((c = *n) && (isalpha(c) || c == '_') && (ne - n) > 2)) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has illegal name (%%undefine)", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has illegal name (%%undefine)"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
|
@ -542,7 +544,7 @@ freeArgs(MacroBuf *mb)
|
|||
; /* XXX skip test for %# %* %0 */
|
||||
} else if (!skiptest && me->used <= 0) {
|
||||
#if NOTYET
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s (%s) was not used below level %d",
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s (%s) was not used below level %d"),
|
||||
me->name, me->body, me->level);
|
||||
#endif
|
||||
}
|
||||
|
@ -625,7 +627,7 @@ grabArgs(MacroBuf *mb, const MacroEntry *me, const char *se)
|
|||
optc++; /* XXX count argv[0] too */
|
||||
while((c = getopt(argc, (char **)argv, opts)) != -1) {
|
||||
if (!(c != '?' && (o = strchr(opts, c)))) {
|
||||
rpmError(RPMERR_BADSPEC, "Unknown option %c in %s(%s)",
|
||||
rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)"),
|
||||
c, me->name, opts);
|
||||
return se;
|
||||
}
|
||||
|
@ -787,7 +789,7 @@ expandMacro(MacroBuf *mb)
|
|||
int chkexist;
|
||||
|
||||
if (++mb->depth > max_macro_depth) {
|
||||
rpmError(RPMERR_BADSPEC, "Recursion depth(%d) greater than max(%d)",
|
||||
rpmError(RPMERR_BADSPEC, _("Recursion depth(%d) greater than max(%d)"),
|
||||
mb->depth, max_macro_depth);
|
||||
mb->depth--;
|
||||
mb->expand_trace = 1;
|
||||
|
@ -843,7 +845,7 @@ expandMacro(MacroBuf *mb)
|
|||
break;
|
||||
case '(': /* %(...) shell escape */
|
||||
if ((se = matchchar(s, c, ')')) == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "Unterminated %c: %s", c, s);
|
||||
rpmError(RPMERR_BADSPEC, _("Unterminated %c: %s"), c, s);
|
||||
rc = 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -859,7 +861,7 @@ expandMacro(MacroBuf *mb)
|
|||
break;
|
||||
case '{': /* %{...}/%{...:...} substitution */
|
||||
if ((se = matchchar(s, c, '}')) == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "Unterminated %c: %s", c, s);
|
||||
rpmError(RPMERR_BADSPEC, _("Unterminated %c: %s"), c, s);
|
||||
rc = 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -888,7 +890,7 @@ expandMacro(MacroBuf *mb)
|
|||
fn = (fe - f);
|
||||
gn = (ge - g);
|
||||
if (fn <= 0) {
|
||||
rpmError(RPMERR_BADSPEC, "Empty token");
|
||||
rpmError(RPMERR_BADSPEC, _("Empty token"));
|
||||
s = se;
|
||||
continue;
|
||||
}
|
||||
|
@ -1010,7 +1012,7 @@ expandMacro(MacroBuf *mb)
|
|||
c = '%'; /* XXX only need to save % */
|
||||
SAVECHAR(mb, c);
|
||||
#else
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%.*s not found, skipping", fn, f);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%.*s not found, skipping"), fn, f);
|
||||
s = se;
|
||||
#endif
|
||||
continue;
|
||||
|
@ -1082,7 +1084,7 @@ expandMacros(void *spec, MacroContext *mc, char *s, size_t slen)
|
|||
rc = expandMacro(mb);
|
||||
|
||||
if (mb->nb <= 0)
|
||||
rpmError(RPMERR_BADSPEC, "Target buffer overflow");
|
||||
rpmError(RPMERR_BADSPEC, _("Target buffer overflow"));
|
||||
|
||||
tbuf[slen] = '\0'; /* XXX just in case */
|
||||
strncpy(s, tbuf, (slen - mb->nb + 1));
|
||||
|
@ -1196,7 +1198,7 @@ int isCompressed(char *file, int *compressed)
|
|||
*compressed = COMPRESSED_NOT;
|
||||
|
||||
if ((fd = open(file, O_RDONLY)) < 0) {
|
||||
rpmError(RPMERR_BADSPEC, "File %s: %s", file, strerror(errno));
|
||||
rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
nb = read(fd, magic, sizeof(magic));
|
||||
|
@ -1204,10 +1206,10 @@ int isCompressed(char *file, int *compressed)
|
|||
close(fd);
|
||||
|
||||
if (nb < 0) {
|
||||
rpmError(RPMERR_BADSPEC, "File %s: %s", file, strerror(rderrno));
|
||||
rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(rderrno));
|
||||
return 1;
|
||||
} else if (nb < sizeof(magic)) {
|
||||
rpmError(RPMERR_BADSPEC, "File %s is smaller than %d bytes",
|
||||
rpmError(RPMERR_BADSPEC, _("File %s is smaller than %d bytes"),
|
||||
file, sizeof(magic));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "rpmlib.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "misc.h"
|
||||
#include "oldheader.h"
|
||||
#include "tread.h"
|
||||
|
@ -290,7 +291,7 @@ void oldrpmfileFromInfoLine(char * path, char * state, char * str,
|
|||
else if (!strcmp(state, "replaced"))
|
||||
fi->state = RPMFILE_STATE_REPLACED;
|
||||
else
|
||||
rpmError(RPMERR_INTERNAL, "bad file state: ", state);
|
||||
rpmError(RPMERR_INTERNAL, _("bad file state: "), state);
|
||||
|
||||
infoFromFields(fields, fi);
|
||||
|
||||
|
|
|
@ -48,13 +48,13 @@ static int readPackageHeaders(int fd, struct rpmlead * leadPtr,
|
|||
}
|
||||
|
||||
if (lead->major == 1) {
|
||||
rpmMessage(RPMMESS_DEBUG, "package is a version one package!\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("package is a version one package!\n"));
|
||||
|
||||
if (lead->type == RPMLEAD_SOURCE) {
|
||||
rpmMessage(RPMMESS_DEBUG, "old style source package -- "
|
||||
"I'll do my best\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("old style source package -- "
|
||||
"I'll do my best\n"));
|
||||
oldLead->archiveOffset = ntohl(oldLead->archiveOffset);
|
||||
rpmMessage(RPMMESS_DEBUG, "archive offset is %d\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("archive offset is %d\n"),
|
||||
oldLead->archiveOffset);
|
||||
lseek(fd, oldLead->archiveOffset, SEEK_SET);
|
||||
|
||||
|
@ -64,7 +64,7 @@ static int readPackageHeaders(int fd, struct rpmlead * leadPtr,
|
|||
|
||||
*hdr = NULL;
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG, "old style binary package\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("old style binary package\n"));
|
||||
readOldHeader(fd, hdr, &isSource);
|
||||
arch = lead->archnum;
|
||||
headerAddEntry(*hdr, RPMTAG_ARCH, RPM_INT8_TYPE, &arch, 1);
|
||||
|
|
|
@ -12,7 +12,7 @@ int rpmdbRebuild(char * rootdir) {
|
|||
Header h;
|
||||
int failed = 0;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "rebuilding database in rootdir %s\n", rootdir);
|
||||
rpmMessage(RPMMESS_DEBUG, _("rebuilding database in rootdir %s\n"), rootdir);
|
||||
|
||||
dbpath = rpmGetVar(RPMVAR_DBPATH);
|
||||
if (!dbpath) {
|
||||
|
@ -28,7 +28,7 @@ int rpmdbRebuild(char * rootdir) {
|
|||
newdbpath);
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "creating directory: %s\n", newdbpath);
|
||||
rpmMessage(RPMMESS_DEBUG, _("creating directory: %s\n"), newdbpath);
|
||||
if (mkdir(newdbpath, 0755)) {
|
||||
rpmError(RPMERR_MKDIR, _("error creating directory %s: %s"),
|
||||
newdbpath, strerror(errno));
|
||||
|
@ -36,12 +36,12 @@ int rpmdbRebuild(char * rootdir) {
|
|||
|
||||
sprintf(newdbpath, "%s/rebuilddb.%d", dbpath, (int) getpid());
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "opening old database\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("opening old database\n"));
|
||||
if (openDatabase(rootdir, dbpath, &olddb, O_RDONLY, 0644, 0)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "opening new database\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("opening new database\n"));
|
||||
if (openDatabase(rootdir, newdbpath, &newdb, O_RDWR | O_CREAT, 0644, 0)) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -79,21 +79,21 @@ int rpmdbRebuild(char * rootdir) {
|
|||
rpmdbClose(newdb);
|
||||
|
||||
if (failed) {
|
||||
rpmMessage(RPMMESS_NORMAL, "failed to rebuild database; original database "
|
||||
"remains in place\n");
|
||||
rpmMessage(RPMMESS_NORMAL, _("failed to rebuild database; original database "
|
||||
"remains in place\n"));
|
||||
|
||||
rpmdbRemoveDatabase(rootdir, newdbpath);
|
||||
return 1;
|
||||
} else {
|
||||
if (rpmdbMoveDatabase(rootdir, newdbpath, dbpath)) {
|
||||
rpmMessage(RPMMESS_ERROR, "failed to replace old database with new "
|
||||
"database!\n");
|
||||
rpmMessage(RPMMESS_ERROR, "replaces files in %s with files from %s "
|
||||
"to recover", dbpath, newdbpath);
|
||||
rpmMessage(RPMMESS_ERROR, _("failed to replace old database with new "
|
||||
"database!\n"));
|
||||
rpmMessage(RPMMESS_ERROR, _("replaces files in %s with files from %s "
|
||||
"to recover"), dbpath, newdbpath);
|
||||
return 1;
|
||||
}
|
||||
if (rmdir(newdbpath))
|
||||
rpmMessage(RPMERR_RMDIR, "failed to remove %s: %s\n",
|
||||
rpmMessage(RPMERR_RMDIR, _("failed to remove %s: %s\n"),
|
||||
newdbpath, strerror(errno));
|
||||
}
|
||||
|
||||
|
|
26
lib/rpmdb.c
26
lib/rpmdb.c
|
@ -42,7 +42,7 @@ int rpmdbOpen (char * prefix, rpmdb *rpmdbp, int mode, int perms) {
|
|||
|
||||
dbpath = rpmGetVar(RPMVAR_DBPATH);
|
||||
if (!dbpath) {
|
||||
rpmMessage(RPMMESS_DEBUG, "no dbpath has been set");
|
||||
rpmMessage(RPMMESS_DEBUG, _("no dbpath has been set"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ int rpmdbInit (char * prefix, int perms) {
|
|||
|
||||
dbpath = rpmGetVar(RPMVAR_DBPATH);
|
||||
if (!dbpath) {
|
||||
rpmMessage(RPMMESS_DEBUG, "no dbpath has been set");
|
||||
rpmMessage(RPMMESS_DEBUG, _("no dbpath has been set"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ int openDatabase(char * prefix, char * dbpath, rpmdb *rpmdbp, int mode,
|
|||
strcpy(filename, prefix);
|
||||
strcat(filename, dbpath);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "opening database in %s\n", filename);
|
||||
rpmMessage(RPMMESS_DEBUG, _("opening database in %s\n"), filename);
|
||||
|
||||
strcat(filename, "packages.rpm");
|
||||
|
||||
|
@ -317,21 +317,21 @@ int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant) {
|
|||
if (!headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count)) {
|
||||
rpmError(RPMERR_DBCORRUPT, _("package has no name"));
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing name index\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing name index\n"));
|
||||
removeIndexEntry(db->nameIndex, name, rec, tolerant, "name index");
|
||||
}
|
||||
|
||||
if (!headerGetEntry(h, RPMTAG_GROUP, &type, (void **) &group, &count)) {
|
||||
rpmMessage(RPMMESS_DEBUG, "package has no group\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("package has no group\n"));
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing group index\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing group index\n"));
|
||||
removeIndexEntry(db->groupIndex, group, rec, tolerant, "group index");
|
||||
}
|
||||
|
||||
if (headerGetEntry(h, RPMTAG_PROVIDES, &type, (void **) &providesList,
|
||||
&count)) {
|
||||
for (i = 0; i < count; i++) {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing provides index for %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing provides index for %s\n"),
|
||||
providesList[i]);
|
||||
removeIndexEntry(db->providesIndex, providesList[i], rec, tolerant,
|
||||
"providesfile index");
|
||||
|
@ -346,7 +346,7 @@ int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant) {
|
|||
as they should just indicate duplicated requirements. */
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing requiredby index for %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing requiredby index for %s\n"),
|
||||
requiredbyList[i]);
|
||||
removeIndexEntry(db->requiredbyIndex, requiredbyList[i], rec,
|
||||
1, "requiredby index");
|
||||
|
@ -358,7 +358,7 @@ int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant) {
|
|||
&count)) {
|
||||
/* triggerList often contains duplicates */
|
||||
for (i = 0; i < count; i++) {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing trigger index for %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing trigger index for %s\n"),
|
||||
triggerList[i]);
|
||||
removeIndexEntry(db->triggerIndex, triggerList[i], rec,
|
||||
1, "trigger index");
|
||||
|
@ -369,7 +369,7 @@ int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant) {
|
|||
if (headerGetEntry(h, RPMTAG_CONFLICTNAME, &type, (void **) &conflictList,
|
||||
&count)) {
|
||||
for (i = 0; i < count; i++) {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing conflict index for %s\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing conflict index for %s\n"),
|
||||
conflictList[i]);
|
||||
removeIndexEntry(db->conflictsIndex, conflictList[i], rec,
|
||||
tolerant, "conflict index");
|
||||
|
@ -380,14 +380,14 @@ int rpmdbRemove(rpmdb db, unsigned int offset, int tolerant) {
|
|||
if (headerGetEntry(h, RPMTAG_FILENAMES, &type, (void **) &fileList,
|
||||
&count)) {
|
||||
for (i = 0; i < count; i++) {
|
||||
rpmMessage(RPMMESS_DEBUG, "removing file index for %s\n", fileList[i]);
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing file index for %s\n"), fileList[i]);
|
||||
rec.fileNumber = i;
|
||||
removeIndexEntry(db->fileIndex, fileList[i], rec, tolerant,
|
||||
"file index");
|
||||
}
|
||||
free(fileList);
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG, "package has no files\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("package has no files\n"));
|
||||
}
|
||||
|
||||
faFree(db->pkgs, offset);
|
||||
|
@ -533,7 +533,7 @@ int rpmdbUpdateRecord(rpmdb db, int offset, Header newHeader) {
|
|||
headerFree(oldHeader);
|
||||
|
||||
if (oldSize != headerSizeof(newHeader, HEADER_MAGIC_NO)) {
|
||||
rpmMessage(RPMMESS_DEBUG, "header changed size!");
|
||||
rpmMessage(RPMMESS_DEBUG, _("header changed size!"));
|
||||
if (rpmdbRemove(db, offset, 1))
|
||||
return 1;
|
||||
|
||||
|
|
|
@ -1074,8 +1074,8 @@ static void getMachineInfo(int type, char ** name, int * num) {
|
|||
if (name) *name = current[type];
|
||||
|
||||
if (tables[currTables[type]].hasCanon) {
|
||||
rpmMessage(RPMMESS_WARNING, "Unknown system: %s\n", current[type]);
|
||||
rpmMessage(RPMMESS_WARNING, "Please contact rpm-list@redhat.com\n");
|
||||
rpmMessage(RPMMESS_WARNING, _("Unknown system: %s\n"), current[type]);
|
||||
rpmMessage(RPMMESS_WARNING, _("Please contact rpm-list@redhat.com\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,10 +69,10 @@ int rpmReadSignature(int fd, Header *header, short sig_type)
|
|||
|
||||
switch (sig_type) {
|
||||
case RPMSIG_NONE:
|
||||
rpmMessage(RPMMESS_DEBUG, "No signature\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("No signature\n"));
|
||||
break;
|
||||
case RPMSIG_PGP262_1024:
|
||||
rpmMessage(RPMMESS_DEBUG, "Old PGP signature\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("Old PGP signature\n"));
|
||||
/* These are always 256 bytes */
|
||||
if (timedRead(fd, buf, 256) != 256) {
|
||||
return 1;
|
||||
|
@ -89,7 +89,7 @@ int rpmReadSignature(int fd, Header *header, short sig_type)
|
|||
return 1;
|
||||
break;
|
||||
case RPMSIG_HEADERSIG:
|
||||
rpmMessage(RPMMESS_DEBUG, "New Header signature\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("New Header signature\n"));
|
||||
/* This is a new style signature */
|
||||
h = headerRead(fd, HEADER_MAGIC_YES);
|
||||
if (! h) {
|
||||
|
@ -97,8 +97,8 @@ int rpmReadSignature(int fd, Header *header, short sig_type)
|
|||
}
|
||||
sigSize = headerSizeof(h, HEADER_MAGIC_YES);
|
||||
pad = (8 - (sigSize % 8)) % 8; /* 8-byte pad */
|
||||
rpmMessage(RPMMESS_DEBUG, "Signature size: %d\n", sigSize);
|
||||
rpmMessage(RPMMESS_DEBUG, "Signature pad : %d\n", pad);
|
||||
rpmMessage(RPMMESS_DEBUG, _("Signature size: %d\n"), sigSize);
|
||||
rpmMessage(RPMMESS_DEBUG, _("Signature pad : %d\n"), pad);
|
||||
if (! headerGetEntry(h, RPMSIGTAG_SIZE, &type, (void **)&archSize, &count)) {
|
||||
headerFree(h);
|
||||
return 1;
|
||||
|
@ -135,8 +135,8 @@ int rpmWriteSignature(int fd, Header header)
|
|||
sigSize = headerSizeof(header, HEADER_MAGIC_YES);
|
||||
pad = (8 - (sigSize % 8)) % 8;
|
||||
if (pad) {
|
||||
rpmMessage(RPMMESS_DEBUG, "Signature size: %d\n", sigSize);
|
||||
rpmMessage(RPMMESS_DEBUG, "Signature pad : %d\n", pad);
|
||||
rpmMessage(RPMMESS_DEBUG, _("Signature size: %d\n"), sigSize);
|
||||
rpmMessage(RPMMESS_DEBUG, _("Signature pad : %d\n"), pad);
|
||||
memset(buf, 0, pad);
|
||||
write(fd, buf, pad);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ static int makePGPSignature(char *file, void **sig, int_32 *size,
|
|||
}
|
||||
|
||||
*size = statbuf.st_size;
|
||||
rpmMessage(RPMMESS_DEBUG, "PGP sig size: %d\n", *size);
|
||||
rpmMessage(RPMMESS_DEBUG, _("PGP sig size: %d\n"), *size);
|
||||
*sig = malloc(*size);
|
||||
|
||||
fd = open(sigfile, O_RDONLY);
|
||||
|
@ -245,7 +245,7 @@ static int makePGPSignature(char *file, void **sig, int_32 *size,
|
|||
close(fd);
|
||||
unlink(sigfile);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "Got %d bytes of PGP sig\n", *size);
|
||||
rpmMessage(RPMMESS_DEBUG, _("Got %d bytes of PGP sig\n"), *size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -260,13 +260,13 @@ static int checkSize(int fd, int size, int sigsize)
|
|||
if (S_ISREG(statbuf.st_mode)) {
|
||||
headerArchiveSize = statbuf.st_size - sizeof(struct rpmlead) - sigsize;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "sigsize : %d\n", sigsize);
|
||||
rpmMessage(RPMMESS_DEBUG, "Header + Archive: %d\n", headerArchiveSize);
|
||||
rpmMessage(RPMMESS_DEBUG, "expected size : %d\n", size);
|
||||
rpmMessage(RPMMESS_DEBUG, _("sigsize : %d\n"), sigsize);
|
||||
rpmMessage(RPMMESS_DEBUG, _("Header + Archive: %d\n"), headerArchiveSize);
|
||||
rpmMessage(RPMMESS_DEBUG, _("expected size : %d\n"), size);
|
||||
|
||||
return size - headerArchiveSize;
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG, "file is not regular -- skipping size check\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("file is not regular -- skipping size check\n"));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ static int verifyPGPSignature(char *datafile, void *sig,
|
|||
"+batchmode=on", "+verbose=0",
|
||||
sigfile, datafile,
|
||||
NULL);
|
||||
printf("exec failed!\n");
|
||||
fprintf(stderr, _("exec failed!\n"));
|
||||
rpmError(RPMERR_EXEC,
|
||||
_("Could not run pgp. Use --nopgp to skip PGP checks."));
|
||||
_exit(RPMERR_EXEC);
|
||||
|
|
21
lib/test.c
21
lib/test.c
|
@ -1,5 +1,6 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmlib.h"
|
||||
|
||||
void main(int argc, char **argv)
|
||||
|
@ -24,29 +25,29 @@ void main(int argc, char **argv)
|
|||
headerAddEntry(h, RPMTAG_VENDOR, RPM_CHAR_TYPE, ca, strlen(ca));
|
||||
headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE, i32a, 3);
|
||||
|
||||
printf("Original = %d\n", headerSizeof(h));
|
||||
fprintf(stdout, "Original = %d\n", headerSizeof(h));
|
||||
fd = open("test.out", O_WRONLY|O_CREAT);
|
||||
headerWrite(fd, h);
|
||||
close(fd);
|
||||
h2 = headerCopy(h);
|
||||
printf("Copy = %d\n", headerSizeof(h2));
|
||||
fprintf(stdout, "Copy = %d\n", headerSizeof(h2));
|
||||
|
||||
fd = open("test.out", O_RDONLY);
|
||||
h3 = headerRead(fd);
|
||||
close(fd);
|
||||
|
||||
printf("From disk = %d\n", headerSizeof(h3));
|
||||
fprintf(stdout, "From disk = %d\n", headerSizeof(h3));
|
||||
h4 = headerCopy(h3);
|
||||
printf("Copy of disk = %d\n", headerSizeof(h4));
|
||||
fprintf(stdout, "Copy of disk = %d\n", headerSizeof(h4));
|
||||
|
||||
printf("=====================\n");
|
||||
printf("Original\n");
|
||||
fprintf(stdout, "=====================\n");
|
||||
fprintf(stdout, "Original\n");
|
||||
headerDump(h, stdout, 1);
|
||||
printf("=====================\n");
|
||||
printf("From disk\n");
|
||||
fprintf(stdout, "=====================\n");
|
||||
fprintf(stdout, "From disk\n");
|
||||
headerDump(h3, stdout, 1);
|
||||
printf("=====================\n");
|
||||
printf("Copy of disk\n");
|
||||
fprintf(stdout, "=====================\n");
|
||||
fprintf(stdout, "Copy of disk\n");
|
||||
headerDump(h4, stdout, 1);
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -133,7 +133,7 @@ static int handleSharedFiles(rpmdb db, int offset, char ** fileList,
|
|||
|
||||
if (!headerGetEntry(sech, RPMTAG_FILENAMES, &type,
|
||||
(void **) &secFileList, &secFileCount)) {
|
||||
rpmError(RPMERR_DBCORRUPT, "package %s contains no files",
|
||||
rpmError(RPMERR_DBCORRUPT, _("package %s contains no files"),
|
||||
name);
|
||||
headerFree(sech);
|
||||
rc = 1;
|
||||
|
@ -146,7 +146,7 @@ static int handleSharedFiles(rpmdb db, int offset, char ** fileList,
|
|||
implement --justdb properly, and chose to leave this stuff
|
||||
out. */
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
"package is missing FILESTATES\n");
|
||||
_("package is missing FILESTATES\n"));
|
||||
secFileStatesList = alloca(secFileCount);
|
||||
memset(secFileStatesList, RPMFILE_STATE_NOTINSTALLED,
|
||||
secFileCount);
|
||||
|
@ -156,27 +156,27 @@ static int handleSharedFiles(rpmdb db, int offset, char ** fileList,
|
|||
(void **) &secFileMd5List, &secFileCount);
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "file %s is shared\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("file %s is shared\n"),
|
||||
fileList[sharedList[i].mainFileNumber]);
|
||||
|
||||
switch (secFileStatesList[sharedList[i].secFileNumber]) {
|
||||
case RPMFILE_STATE_REPLACED:
|
||||
rpmMessage(RPMMESS_DEBUG, " file has already been replaced\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _(" file has already been replaced\n"));
|
||||
break;
|
||||
|
||||
case RPMFILE_STATE_NOTINSTALLED:
|
||||
rpmMessage(RPMMESS_DEBUG, " file was never installed\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _(" file was never installed\n"));
|
||||
break;
|
||||
|
||||
case RPMFILE_STATE_NETSHARED:
|
||||
rpmMessage(RPMMESS_DEBUG, " file is netshared (so don't touch it)\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _(" file is netshared (so don't touch it)\n"));
|
||||
fileActions[sharedList[i].mainFileNumber] = KEEP;
|
||||
break;
|
||||
|
||||
case RPMFILE_STATE_NORMAL:
|
||||
if (!strcmp(fileMd5List[sharedList[i].mainFileNumber],
|
||||
secFileMd5List[sharedList[i].secFileNumber])) {
|
||||
rpmMessage(RPMMESS_DEBUG, " file is truely shared - saving\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _(" file is truely shared - saving\n"));
|
||||
}
|
||||
fileActions[sharedList[i].mainFileNumber] = KEEP;
|
||||
break;
|
||||
|
@ -215,7 +215,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
|
||||
h = rpmdbGetRecord(db, offset);
|
||||
if (!h) {
|
||||
rpmError(RPMERR_DBCORRUPT, "cannot read header at %d for uninstall",
|
||||
rpmError(RPMERR_DBCORRUPT, _("cannot read header at %d for uninstall"),
|
||||
offset);
|
||||
return 1;
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
/* when we run scripts, we pass an argument which is the number of
|
||||
versions of this package that will be installed when we are finished */
|
||||
if (rpmdbFindPackage(db, name, &matches)) {
|
||||
rpmError(RPMERR_DBCORRUPT, "cannot read packages named %s for uninstall",
|
||||
rpmError(RPMERR_DBCORRUPT, _("cannot read packages named %s for uninstall"),
|
||||
name);
|
||||
return 1;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
}
|
||||
}
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "will remove files test = %d\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("will remove files test = %d\n"),
|
||||
flags & RPMUNINSTALL_TEST);
|
||||
if (!(flags & RPMUNINSTALL_JUSTDB) &&
|
||||
headerGetEntry(h, RPMTAG_FILENAMES, &type, (void **) &fileList,
|
||||
|
@ -276,7 +276,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
/* This shouldn't happen, but some versions of RPM didn't
|
||||
implement --justdb properly, and chose to leave this stuff
|
||||
out. */
|
||||
rpmMessage(RPMMESS_DEBUG, "package is missing FILESTATES\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("package is missing FILESTATES\n"));
|
||||
fileStatesList = alloca(fileCount);
|
||||
memset(fileStatesList, RPMFILE_STATE_NOTINSTALLED,
|
||||
fileCount);
|
||||
|
@ -302,7 +302,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
for (i = 0; i < fileCount; i++)
|
||||
if (!strncmp(fileList[i], *nsp, j) &&
|
||||
(fileList[i][j] == '\0' || fileList[i][j] == '/')) {
|
||||
rpmMessage(RPMMESS_DEBUG, "%s has a netshared override\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("%s has a netshared override\n"),
|
||||
fileList[i]);
|
||||
fileActions[i] = KEEP;
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
}
|
||||
|
||||
if (!(flags & RPMUNINSTALL_TEST)) {
|
||||
rpmMessage(RPMMESS_DEBUG, "running postuninstall script (if any)\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("running postuninstall script (if any)\n"));
|
||||
runInstScript(prefix, h, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, scriptArg,
|
||||
flags & RPMUNINSTALL_NOSCRIPTS, 0);
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) {
|
|||
|
||||
headerFree(h);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "removing database entry\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _("removing database entry\n"));
|
||||
if (!(flags & RPMUNINSTALL_TEST))
|
||||
rpmdbRemove(db, offset, 0);
|
||||
|
||||
|
@ -548,13 +548,13 @@ static int removeFile(char * file, char state, unsigned int flags, char * md5,
|
|||
|
||||
switch (state) {
|
||||
case RPMFILE_STATE_REPLACED:
|
||||
rpmMessage(RPMMESS_DEBUG, "%s has already been replaced\n", file);
|
||||
rpmMessage(RPMMESS_DEBUG, _("%s has already been replaced\n"), file);
|
||||
break;
|
||||
|
||||
case RPMFILE_STATE_NORMAL:
|
||||
if ((action == REMOVE) && (flags & RPMFILE_CONFIG)) {
|
||||
/* if it's a config file, we may not want to remove it */
|
||||
rpmMessage(RPMMESS_DEBUG, "finding md5sum of %s\n", file);
|
||||
rpmMessage(RPMMESS_DEBUG, _("finding md5sum of %s\n"), file);
|
||||
if (brokenMd5)
|
||||
rc = mdfileBroken(file, currentMd5);
|
||||
else
|
||||
|
@ -562,14 +562,14 @@ static int removeFile(char * file, char state, unsigned int flags, char * md5,
|
|||
|
||||
if (mdfile(file, currentMd5))
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
" failed - assuming file removed\n");
|
||||
_(" failed - assuming file removed\n"));
|
||||
else {
|
||||
if (strcmp(currentMd5, md5)) {
|
||||
rpmMessage(RPMMESS_DEBUG, " file changed - will save\n");
|
||||
rpmMessage(RPMMESS_DEBUG, _(" file changed - will save\n"));
|
||||
action = BACKUP;
|
||||
} else {
|
||||
rpmMessage(RPMMESS_DEBUG,
|
||||
" file unchanged - will remove\n");
|
||||
_(" file unchanged - will remove\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -577,11 +577,11 @@ static int removeFile(char * file, char state, unsigned int flags, char * md5,
|
|||
switch (action) {
|
||||
|
||||
case KEEP:
|
||||
rpmMessage(RPMMESS_DEBUG, "keeping %s\n", file);
|
||||
rpmMessage(RPMMESS_DEBUG, _("keeping %s\n"), file);
|
||||
break;
|
||||
|
||||
case BACKUP:
|
||||
rpmMessage(RPMMESS_DEBUG, "saving %s as %s.rpmsave\n", file, file);
|
||||
rpmMessage(RPMMESS_DEBUG, _("saving %s as %s.rpmsave\n"), file, file);
|
||||
if (!test) {
|
||||
newfile = alloca(strlen(file) + 20);
|
||||
strcpy(newfile, file);
|
||||
|
@ -595,7 +595,7 @@ static int removeFile(char * file, char state, unsigned int flags, char * md5,
|
|||
break;
|
||||
|
||||
case REMOVE:
|
||||
rpmMessage(RPMMESS_DEBUG, "%s - removing\n", file);
|
||||
rpmMessage(RPMMESS_DEBUG, _("%s - removing\n"), file);
|
||||
if (S_ISDIR(mode)) {
|
||||
if (!test) {
|
||||
if (rmdir(file)) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "rpmlib.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "md5.h"
|
||||
#include "misc.h"
|
||||
#include "install.h"
|
||||
|
@ -167,8 +168,8 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result,
|
|||
if (uidList[filenum] != sb.st_uid)
|
||||
*result |= RPMVERIFY_GROUP;
|
||||
} else {
|
||||
rpmError(RPMERR_INTERNAL, "package lacks both user name and id "
|
||||
"lists (this should never happen)");
|
||||
rpmError(RPMERR_INTERNAL, _("package lacks both user name and id "
|
||||
"lists (this should never happen)"));
|
||||
*result |= RPMVERIFY_GROUP;
|
||||
}
|
||||
}
|
||||
|
@ -185,8 +186,8 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result,
|
|||
if (gidList[filenum] != sb.st_gid)
|
||||
*result |= RPMVERIFY_GROUP;
|
||||
} else {
|
||||
rpmError(RPMERR_INTERNAL, "package lacks both group name and id "
|
||||
"lists (this should never happen)");
|
||||
rpmError(RPMERR_INTERNAL, _("package lacks both group name and id "
|
||||
"lists (this should never happen)"));
|
||||
*result |= RPMVERIFY_GROUP;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -451,14 +451,14 @@ int oldrpmdbGetPackageInfo(struct oldrpmdb * oldrpmdb, struct oldrpmdbLabel labe
|
|||
|
||||
labelstr = oldrpmdbLabelToLabelstr(label, 0);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "pulling %s from database\n", labelstr);
|
||||
rpmMessage(RPMMESS_DEBUG, _("pulling %s from database\n"), labelstr);
|
||||
|
||||
key.dptr = labelstr;
|
||||
key.dsize = strlen(labelstr);
|
||||
|
||||
rec = gdbm_fetch(oldrpmdb->packages, key);
|
||||
if (!rec.dptr) {
|
||||
rpmError(RPMERR_OLDDBCORRUPT, "package not found in database");
|
||||
rpmError(RPMERR_OLDDBCORRUPT, _("package not found in database"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -519,7 +519,7 @@ int oldrpmdbGetPackageInfo(struct oldrpmdb * oldrpmdb, struct oldrpmdbLabel labe
|
|||
if (!pinfo->distribution) pinfo->distribution = strdup("");
|
||||
if (!pinfo->copyright) {
|
||||
pinfo->copyright = strdup("");
|
||||
printf("no copyright!\n");
|
||||
fprintf(stdout, _("no copyright!\n"));
|
||||
}
|
||||
|
||||
pinfo->files = malloc(sizeof(struct oldrpmFileInfo) * pinfo->fileCount);
|
||||
|
|
|
@ -14,17 +14,23 @@ NLSPACKAGE = rpm
|
|||
|
||||
CATALOGS = cz.mo de.mo fi.mo fr.mo pt_BR.mo ru.mo sr.mo sv.mo tr.mo
|
||||
|
||||
POTFILES = $(topsrcdir)/rpm.c $(topsrcdir)/query.c \
|
||||
$(topsrcdir)/install.c $(topsrcdir)/verify.c \
|
||||
$(topsrcdir)/checksig.c $(topsrcdir)/url.c \
|
||||
$(topsrcdir)/ftp.c \
|
||||
$(topsrcdir)/lib/uninstall.c $(topsrcdir)/lib/rpmdb.c \
|
||||
$(topsrcdir)/lib/signature.c $(topsrcdir)/lib/dbindex.c \
|
||||
$(topsrcdir)/lib/depends.c $(topsrcdir)/lib/formats.c \
|
||||
$(topsrcdir)/lib/fs.c $(topsrcdir)/lib/header.c \
|
||||
$(topsrcdir)/lib/lookup.c $(topsrcdir)/lib/rebuilddb.c \
|
||||
$(topsrcdir)/lib/messages.c $(topsrcdir)/lib/package.c \
|
||||
$(topsrcdir)/lib/rpmlead.c $(topsrcdir)/lib/rpmrc.c
|
||||
POTFILES = \
|
||||
../build.c ../checksig.c ../convertdb.c ../ftp.c \
|
||||
../install.c ../oldrpmdb.c ../query.c ../rpm-qo.c \
|
||||
../rpm.c ../rpm2cpio.c ../url.c ../verify.c \
|
||||
../build/build.c ../build/files.c ../build/misc.c ../build/myftw.c \
|
||||
../build/names.c ../build/pack.c ../build/parseBuildInstallClean.c \
|
||||
../build/parseChangelog.c ../build/parseDescription.c \
|
||||
../build/parseFiles.c ../build/parsePreamble.c ../build/parsePrep.c \
|
||||
../build/parseReqs.c ../build/parseScript.c ../build/parseSpec.c \
|
||||
../build/reqprov.c ../build/rpminject.c ../build/spec.c \
|
||||
../lib/cpio.c ../lib/dbindex.c ../lib/depends.c ../lib/falloc.c \
|
||||
../lib/formats.c ../lib/fs.c ../lib/header.c ../lib/install.c \
|
||||
../lib/lookup.c ../lib/macro.c ../lib/md5.c ../lib/md5sum.c \
|
||||
../lib/messages.c ../lib/misc.c ../lib/oldheader.c ../lib/package.c \
|
||||
../lib/rebuilddb.c ../lib/rpmdb.c ../lib/rpmerr.c ../lib/rpmlead.c \
|
||||
../lib/rpmrc.c ../lib/signature.c ../lib/stringbuf.c ../lib/tagtable.c \
|
||||
../lib/tread.c ../lib/uninstall.c ../lib/verify.c
|
||||
|
||||
all: $(NLSPACKAGE).pot $(CATALOGS)
|
||||
|
||||
|
@ -37,17 +43,17 @@ $(NLSPACKAGE).pot: $(POTFILES)
|
|||
mv $(NLSPACKAGE).po $(NLSPACKAGE).pot; \
|
||||
fi
|
||||
|
||||
|
||||
update-po: Makefile
|
||||
@$(MAKE) $(NLSPACKAGE).pot
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
lang=`echo $$cat | sed 's/.mo//'`; \
|
||||
if msgmerge $$lang.po $(NLSPACKAGE).pot > $$lang.pox ; then \
|
||||
echo "msgmerge of $$lang succeeded" ; \
|
||||
if $(MSGMERGE) $$lang.po $(NLSPACKAGE).pot > $$lang.pox ; then \
|
||||
echo "$(MSGMERGE) of $$lang succeeded" ; \
|
||||
mv $$lang.pox $$lang.po ; \
|
||||
else \
|
||||
echo "msgmerge of $$lang failed" ; \
|
||||
rm -f $$lang.pot ; \
|
||||
echo "$(MSGMERGE) of $$lang failed" ; \
|
||||
rm -f $$lang.pox ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
|
|
3693
po/pt_BR.po
3693
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
46
query.c
46
query.c
|
@ -54,7 +54,7 @@ static void printHeader(Header h, int queryFlags, char * queryFormat) {
|
|||
headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &count);
|
||||
|
||||
if (!queryFormat && !queryFlags) {
|
||||
printf("%s-%s-%s\n", name, version, release);
|
||||
fprintf(stdout, "%s-%s-%s\n", name, version, release);
|
||||
} else {
|
||||
if (queryFormat)
|
||||
queryHeader(h, queryFormat);
|
||||
|
@ -62,7 +62,7 @@ static void printHeader(Header h, int queryFlags, char * queryFormat) {
|
|||
if (queryFlags & QUERY_FOR_LIST) {
|
||||
if (!headerGetEntry(h, RPMTAG_FILENAMES, &type, (void **) &fileList,
|
||||
&count)) {
|
||||
puts(_("(contains no files)"));
|
||||
fputs(_("(contains no files)"), stdout);
|
||||
} else {
|
||||
if (!headerGetEntry(h, RPMTAG_FILESTATES, &type,
|
||||
(void **) &fileStatesList, &count)) {
|
||||
|
@ -114,50 +114,50 @@ static void printHeader(Header h, int queryFlags, char * queryFormat) {
|
|||
if (fileStatesList) {
|
||||
switch (fileStatesList[i]) {
|
||||
case RPMFILE_STATE_NORMAL:
|
||||
fputs("normal ", stdout); break;
|
||||
fputs(_("normal "), stdout); break;
|
||||
case RPMFILE_STATE_REPLACED:
|
||||
fputs("replaced ", stdout); break;
|
||||
fputs(_("replaced "), stdout); break;
|
||||
case RPMFILE_STATE_NETSHARED:
|
||||
fputs("net shared ", stdout); break;
|
||||
fputs(_("net shared "), stdout); break;
|
||||
case RPMFILE_STATE_NOTINSTALLED:
|
||||
fputs("not installed ", stdout); break;
|
||||
fputs(_("not installed "), stdout); break;
|
||||
default:
|
||||
printf("(unknown %3d) ",
|
||||
fprintf(stdout, _("(unknown %3d) "),
|
||||
fileStatesList[i]);
|
||||
}
|
||||
} else {
|
||||
fputs( "(no state) ", stdout);
|
||||
fputs( _("(no state) "), stdout);
|
||||
}
|
||||
}
|
||||
|
||||
if (queryFlags & QUERY_FOR_DUMPFILES) {
|
||||
printf("%s %d %d %s 0%o ", fileList[i],
|
||||
fprintf(stdout, "%s %d %d %s 0%o ", fileList[i],
|
||||
fileSizeList[i], fileMTimeList[i],
|
||||
fileMD5List[i], fileModeList[i]);
|
||||
|
||||
if (fileOwnerList)
|
||||
printf("%s %s", fileOwnerList[i],
|
||||
fprintf(stdout, "%s %s", fileOwnerList[i],
|
||||
fileGroupList[i]);
|
||||
else if (fileUIDList)
|
||||
printf("%d %d", fileUIDList[i],
|
||||
fprintf(stdout, "%d %d", fileUIDList[i],
|
||||
fileGIDList[i]);
|
||||
else {
|
||||
rpmError(RPMERR_INTERNAL, "package has "
|
||||
"neither file owner or id lists");
|
||||
rpmError(RPMERR_INTERNAL, _("package has "
|
||||
"neither file owner or id lists"));
|
||||
}
|
||||
|
||||
printf(" %s %s %d ",
|
||||
fprintf(stdout, " %s %s %d ",
|
||||
fileFlagsList[i] & RPMFILE_CONFIG ? "1" : "0",
|
||||
fileFlagsList[i] & RPMFILE_DOC ? "1" : "0",
|
||||
fileRdevList[i]);
|
||||
|
||||
if (strlen(fileLinktoList[i]))
|
||||
printf("%s\n", fileLinktoList[i]);
|
||||
fprintf(stdout, "%s\n", fileLinktoList[i]);
|
||||
else
|
||||
printf("X\n");
|
||||
fprintf(stdout, "X\n");
|
||||
|
||||
} else if (!rpmIsVerbose()) {
|
||||
puts(fileList[i]);
|
||||
fputs(fileList[i], stdout);
|
||||
} else if (fileOwnerList)
|
||||
printFileInfo(fileList[i], fileSizeList[i],
|
||||
fileModeList[i], fileMTimeList[i],
|
||||
|
@ -171,8 +171,8 @@ static void printHeader(Header h, int queryFlags, char * queryFormat) {
|
|||
NULL, fileUIDList[i],
|
||||
fileGIDList[i], fileLinktoList[i]);
|
||||
} else {
|
||||
rpmError(RPMERR_INTERNAL, "package has "
|
||||
"neither file owner or id lists");
|
||||
rpmError(RPMERR_INTERNAL, _("package has "
|
||||
"neither file owner or id lists"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ static void printFileInfo(char * name, unsigned int size, unsigned short mode,
|
|||
else
|
||||
strftime(timefield, sizeof(timefield) - 1, "%b %d %Y", tstruct);
|
||||
|
||||
printf("%s %8s %8s %10s %s %s\n", perms, ownerfield, groupfield,
|
||||
fprintf(stdout, "%s %8s %8s %10s %s %s\n", perms, ownerfield, groupfield,
|
||||
sizefield, timefield, namefield);
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ static void showMatches(rpmdb db, dbiIndexSet matches, int queryFlags,
|
|||
|
||||
for (i = 0; i < matches.count; i++) {
|
||||
if (matches.recs[i].recOffset) {
|
||||
rpmMessage(RPMMESS_DEBUG, "querying record number %d\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("querying record number %d\n"),
|
||||
matches.recs[i].recOffset);
|
||||
|
||||
h = rpmdbGetRecord(db, matches.recs[i].recOffset);
|
||||
|
@ -537,12 +537,12 @@ void queryPrintTags(void) {
|
|||
struct headerSprintfExtension * ext = rpmHeaderFormats;
|
||||
|
||||
for (i = 0, t = rpmTagTable; i < rpmTagTableSize; i++, t++) {
|
||||
printf("%s\n", t->name + 7);
|
||||
fprintf(stdout, "%s\n", t->name + 7);
|
||||
}
|
||||
|
||||
while (ext->name) {
|
||||
if (ext->type == HEADER_EXT_TAG)
|
||||
printf("%s\n", ext->name + 7), ext++;
|
||||
fprintf(stdout, "%s\n", ext->name + 7), ext++;
|
||||
else if (ext->type == HEADER_EXT_MORE)
|
||||
ext = ext->u.more;
|
||||
else
|
||||
|
|
90
rpm-qo.c
90
rpm-qo.c
|
@ -39,7 +39,7 @@ enum modes { MODE_QUERY, MODE_INSTALL, MODE_UNINSTALL, MODE_VERIFY,
|
|||
static void argerror(char * desc);
|
||||
|
||||
static void argerror(char * desc) {
|
||||
fprintf(stderr, "rpm: %s\n", desc);
|
||||
fprintf(stderr, _("rpm: %s\n"), desc);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -51,65 +51,65 @@ int build(char *arg, int buildAmount, char *passPhrase,
|
|||
char *buildRootOverride);
|
||||
|
||||
void printVersion(void) {
|
||||
printf(_("RPM version %s\n"), version);
|
||||
fprintf(stdout, _("RPM version %s\n"), version);
|
||||
}
|
||||
|
||||
void printBanner(void) {
|
||||
puts(_("Copyright (C) 1995 - Red Hat Software"));
|
||||
puts(_("This may be freely redistributed under the terms of the GNU "
|
||||
"Public License"));
|
||||
fputs(_("Copyright (C) 1995 - Red Hat Software"), stdout);
|
||||
fputs(_("This may be freely redistributed under the terms of the GNU "
|
||||
"Public License"), stdout);
|
||||
}
|
||||
|
||||
void printUsage(void) {
|
||||
printVersion();
|
||||
printBanner();
|
||||
puts("");
|
||||
fputs("", stdout);
|
||||
|
||||
puts(_("usage: rpm {--help}"));
|
||||
puts(_(" rpm {--version}"));
|
||||
puts(_(" rpm {--query -q} [-afFpP] [-i] [-l] [-s] [-d] [-c] [-v] [-R]"));
|
||||
puts(_(" [--scripts] [--root <dir>] [--rcfile <file>]"));
|
||||
puts(_(" [--whatprovides] [--whatrequires] [--requires]"));
|
||||
puts(_(" [--ftpuseport] [--ftpproxy <host>] [--ftpport <port>]"));
|
||||
puts(_(" [--provides] [--dump] [--dbpath <dir>] [targets]"));
|
||||
puts(_(" rpm {--querytags}"));
|
||||
fputs(_("usage: rpm {--help}"), stdout);
|
||||
fputs(_(" rpm {--version}"), stdout);
|
||||
fputs(_(" rpm {--query -q} [-afFpP] [-i] [-l] [-s] [-d] [-c] [-v] [-R]"), stdout);
|
||||
fputs(_(" [--scripts] [--root <dir>] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" [--whatprovides] [--whatrequires] [--requires]"), stdout);
|
||||
fputs(_(" [--ftpuseport] [--ftpproxy <host>] [--ftpport <port>]"), stdout);
|
||||
fputs(_(" [--provides] [--dump] [--dbpath <dir>] [targets]"), stdout);
|
||||
fputs(_(" rpm {--querytags}"), stdout);
|
||||
}
|
||||
|
||||
void printHelp(void) {
|
||||
printVersion();
|
||||
printBanner();
|
||||
puts(_(""));
|
||||
fputs(_(""), stdout);
|
||||
|
||||
puts(_("usage:"));
|
||||
puts(_(" --help - print this message"));
|
||||
puts(_(" --version - print the version of rpm being used"));
|
||||
puts(_(" all modes support the following arguments:"));
|
||||
puts(_(" -v - be a little more verbose"));
|
||||
puts(_(" -vv - be incredibly verbose (for debugging)"));
|
||||
puts(_(" -q - query mode"));
|
||||
puts(_(" --queryformat <s> - use s as the header format (implies -i)"));
|
||||
puts(_(" Package specification options:"));
|
||||
puts(_(" -a - query all packages"));
|
||||
puts(_(" -f <file>+ - query package owning <file>"));
|
||||
puts(_(" -F - like -f, but read file names from stdin"));
|
||||
puts(_(" -p <packagefile>+ - query (uninstalled) package <packagefile>"));
|
||||
puts(_(" -P - like -p, but read package names from stdin"));
|
||||
puts(_(" --whatprovides <i> - query packages which provide <i> capability"));
|
||||
puts(_(" --whatrequires <i> - query packages which require <i> capability"));
|
||||
puts(_(" Information selection options:"));
|
||||
puts(_(" -i - display package information"));
|
||||
puts(_(" -l - display package file list"));
|
||||
puts(_(" -s - show file states (implies -l)"));
|
||||
puts(_(" -d - list only documentation files (implies -l)"));
|
||||
puts(_(" -c - list only configuration files (implies -l)"));
|
||||
puts(_(" --dump - show all verifiable information for each file"));
|
||||
puts(_(" (must be used with -l, -c, or -d)"));
|
||||
puts(_(" --provides - list capabilbities package provides"));
|
||||
puts(_(" --requires"));
|
||||
puts(_(" -R - list package dependencies"));
|
||||
puts(_(" --scripts - print the various [un]install scripts"));
|
||||
puts(_(""));
|
||||
puts(_(" --querytags - list the tags that can be used in a query format"));
|
||||
fputs(_("usage:"), stdout);
|
||||
fputs(_(" --help - print this message"), stdout);
|
||||
fputs(_(" --version - print the version of rpm being used"), stdout);
|
||||
fputs(_(" all modes support the following arguments:"), stdout);
|
||||
fputs(_(" -v - be a little more verbose"), stdout);
|
||||
fputs(_(" -vv - be incredibly verbose (for debugging)"), stdout);
|
||||
fputs(_(" -q - query mode"), stdout);
|
||||
fputs(_(" --queryformat <s> - use s as the header format (implies -i)"), stdout);
|
||||
fputs(_(" Package specification options:"), stdout);
|
||||
fputs(_(" -a - query all packages"), stdout);
|
||||
fputs(_(" -f <file>+ - query package owning <file>"), stdout);
|
||||
fputs(_(" -F - like -f, but read file names from stdin"), stdout);
|
||||
fputs(_(" -p <packagefile>+ - query (uninstalled) package <packagefile>"), stdout);
|
||||
fputs(_(" -P - like -p, but read package names from stdin"), stdout);
|
||||
fputs(_(" --whatprovides <i> - query packages which provide <i> capability"), stdout);
|
||||
fputs(_(" --whatrequires <i> - query packages which require <i> capability"), stdout);
|
||||
fputs(_(" Information selection options:"), stdout);
|
||||
fputs(_(" -i - display package information"), stdout);
|
||||
fputs(_(" -l - display package file list"), stdout);
|
||||
fputs(_(" -s - show file states (implies -l)"), stdout);
|
||||
fputs(_(" -d - list only documentation files (implies -l)"), stdout);
|
||||
fputs(_(" -c - list only configuration files (implies -l)"), stdout);
|
||||
fputs(_(" --dump - show all verifiable information for each file"), stdout);
|
||||
fputs(_(" (must be used with -l, -c, or -d)"), stdout);
|
||||
fputs(_(" --provides - list capabilbities package provides"), stdout);
|
||||
fputs(_(" --requires"), stdout);
|
||||
fputs(_(" -R - list package dependencies"), stdout);
|
||||
fputs(_(" --scripts - print the various [un]install scripts"), stdout);
|
||||
fputs(_(""), stdout);
|
||||
fputs(_(" --querytags - list the tags that can be used in a query format"), stdout);
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv) {
|
||||
|
|
236
rpm.c
236
rpm.c
|
@ -174,7 +174,7 @@ static struct poptOption optionsTable[] = {
|
|||
static void argerror(char * desc);
|
||||
|
||||
static void argerror(char * desc) {
|
||||
fprintf(stderr, "rpm: %s\n", desc);
|
||||
fprintf(stderr, _("rpm: %s\n"), desc);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -185,66 +185,66 @@ static void printUsage(void);
|
|||
static void printHelpLine(char * prefix, char * help);
|
||||
|
||||
static void printVersion(void) {
|
||||
printf(_("RPM version %s\n"), version);
|
||||
fprintf(stdout, _("RPM version %s\n"), version);
|
||||
}
|
||||
|
||||
static void printBanner(void) {
|
||||
puts(_("Copyright (C) 1998 - Red Hat Software"));
|
||||
puts(_("This may be freely redistributed under the terms of the GNU "
|
||||
"Public License"));
|
||||
fputs(_("Copyright (C) 1998 - Red Hat Software"), stdout);
|
||||
fputs(_("This may be freely redistributed under the terms of the GNU "
|
||||
"Public License"), stdout);
|
||||
}
|
||||
|
||||
static void printUsage(void) {
|
||||
printVersion();
|
||||
printBanner();
|
||||
puts("");
|
||||
fputs(_(""), stdout);
|
||||
|
||||
puts(_("usage: rpm {--help}"));
|
||||
puts(_(" rpm {--version}"));
|
||||
puts(_(" rpm {--initdb} [--dbpath <dir>]"));
|
||||
puts(_(" rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]"));
|
||||
puts(_(" [--replacepkgs] [--replacefiles] [--root <dir>]"));
|
||||
puts(_(" [--excludedocs] [--includedocs] [--noscripts]"));
|
||||
puts(_(" [--rcfile <file>] [--ignorearch] [--dbpath <dir>]"));
|
||||
puts(_(" [--prefix <dir>] [--ignoreos] [--nodeps] [--allfiles]"));
|
||||
puts(_(" [--ftpproxy <host>] [--ftpport <port>] [--justdb]"));
|
||||
puts(_(" [--noorder] [--relocate oldpath=newpath]"));
|
||||
puts(_(" [--badreloc] [--notriggers] file1.rpm ... fileN.rpm"));
|
||||
puts(_(" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]"));
|
||||
puts(_(" [--oldpackage] [--root <dir>] [--noscripts]"));
|
||||
puts(_(" [--excludedocs] [--includedocs] [--rcfile <file>]"));
|
||||
puts(_(" [--ignorearch] [--dbpath <dir>] [--prefix <dir>] "));
|
||||
puts(_(" [--ftpproxy <host>] [--ftpport <port>]"));
|
||||
puts(_(" [--ignoreos] [--nodeps] [--allfiles] [--justdb]"));
|
||||
puts(_(" [--noorder] [--relocate oldpath=newpath]"));
|
||||
puts(_(" [--badreloc] file1.rpm ... fileN.rpm"));
|
||||
puts(_(" rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]"));
|
||||
puts(_(" [--scripts] [--root <dir>] [--rcfile <file>]"));
|
||||
puts(_(" [--whatprovides] [--whatrequires] [--requires]"));
|
||||
puts(_(" [--triggeredby] [--ftpuseport] [--ftpproxy <host>]"));
|
||||
puts(_(" [--ftpport <port>] [--provides] [--triggers] [--dump]"));
|
||||
puts(_(" [--changelog] [--dbpath <dir>] [targets]"));
|
||||
puts(_(" rpm {--verify -V -y} [-afpg] [--root <dir>] [--rcfile <file>]"));
|
||||
puts(_(" [--dbpath <dir>] [--nodeps] [--nofiles] [--noscripts]"));
|
||||
puts(_(" [--nomd5] [targets]"));
|
||||
puts(_(" rpm {--setperms} [-afpg] [target]"));
|
||||
puts(_(" rpm {--setugids} [-afpg] [target]"));
|
||||
puts(_(" rpm {--erase -e} [--root <dir>] [--noscripts] [--rcfile <file>]"));
|
||||
puts(_(" [--dbpath <dir>] [--nodeps] [--allmatches]"));
|
||||
puts(_(" [--justdb] [--notriggers] rpackage1 ... packageN"));
|
||||
puts(_(" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile <file>]"));
|
||||
puts(_(" [--sign] [--test] [--timecheck <s>] ]"));
|
||||
puts(_(" [--buildplatform=platform1[,platform2...]]"));
|
||||
puts(_(" [--rmsource] specfile"));
|
||||
puts(_(" rpm {--rmsource} [--rcfile <file>] [-v] specfile"));
|
||||
puts(_(" rpm {--rebuild} [--rcfile <file>] [-v] source1.rpm ... sourceN.rpm"));
|
||||
puts(_(" rpm {--recompile} [--rcfile <file>] [-v] source1.rpm ... sourceN.rpm"));
|
||||
puts(_(" rpm {--resign} [--rcfile <file>] package1 package2 ... packageN"));
|
||||
puts(_(" rpm {--addsign} [--rcfile <file>] package1 package2 ... packageN"));
|
||||
puts(_(" rpm {--checksig -K} [--nopgp] [--nomd5] [--rcfile <file>]"));
|
||||
puts(_(" package1 ... packageN"));
|
||||
puts(_(" rpm {--rebuilddb} [--rcfile <file>] [--dbpath <dir>]"));
|
||||
puts(_(" rpm {--querytags}"));
|
||||
fputs(_("usage: rpm {--help}"), stdout);
|
||||
fputs(_(" rpm {--version}"), stdout);
|
||||
fputs(_(" rpm {--initdb} [--dbpath <dir>]"), stdout);
|
||||
fputs(_(" rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]"), stdout);
|
||||
fputs(_(" [--replacepkgs] [--replacefiles] [--root <dir>]"), stdout);
|
||||
fputs(_(" [--excludedocs] [--includedocs] [--noscripts]"), stdout);
|
||||
fputs(_(" [--rcfile <file>] [--ignorearch] [--dbpath <dir>]"), stdout);
|
||||
fputs(_(" [--prefix <dir>] [--ignoreos] [--nodeps] [--allfiles]"), stdout);
|
||||
fputs(_(" [--ftpproxy <host>] [--ftpport <port>] [--justdb]"), stdout);
|
||||
fputs(_(" [--noorder] [--relocate oldpath=newpath]"), stdout);
|
||||
fputs(_(" [--badreloc] [--notriggers] file1.rpm ... fileN.rpm"), stdout);
|
||||
fputs(_(" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]"), stdout);
|
||||
fputs(_(" [--oldpackage] [--root <dir>] [--noscripts]"), stdout);
|
||||
fputs(_(" [--excludedocs] [--includedocs] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" [--ignorearch] [--dbpath <dir>] [--prefix <dir>] "), stdout);
|
||||
fputs(_(" [--ftpproxy <host>] [--ftpport <port>]"), stdout);
|
||||
fputs(_(" [--ignoreos] [--nodeps] [--allfiles] [--justdb]"), stdout);
|
||||
fputs(_(" [--noorder] [--relocate oldpath=newpath]"), stdout);
|
||||
fputs(_(" [--badreloc] file1.rpm ... fileN.rpm"), stdout);
|
||||
fputs(_(" rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]"), stdout);
|
||||
fputs(_(" [--scripts] [--root <dir>] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" [--whatprovides] [--whatrequires] [--requires]"), stdout);
|
||||
fputs(_(" [--triggeredby] [--ftpuseport] [--ftpproxy <host>]"), stdout);
|
||||
fputs(_(" [--ftpport <port>] [--provides] [--triggers] [--dump]"), stdout);
|
||||
fputs(_(" [--changelog] [--dbpath <dir>] [targets]"), stdout);
|
||||
fputs(_(" rpm {--verify -V -y} [-afpg] [--root <dir>] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" [--dbpath <dir>] [--nodeps] [--nofiles] [--noscripts]"), stdout);
|
||||
fputs(_(" [--nomd5] [targets]"), stdout);
|
||||
fputs(_(" rpm {--setperms} [-afpg] [target]"), stdout);
|
||||
fputs(_(" rpm {--setugids} [-afpg] [target]"), stdout);
|
||||
fputs(_(" rpm {--erase -e} [--root <dir>] [--noscripts] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" [--dbpath <dir>] [--nodeps] [--allmatches]"), stdout);
|
||||
fputs(_(" [--justdb] [--notriggers] rpackage1 ... packageN"), stdout);
|
||||
fputs(_(" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" [--sign] [--test] [--timecheck <s>] ]"), stdout);
|
||||
fputs(_(" [--buildplatform=platform1[,platform2...]]"), stdout);
|
||||
fputs(_(" [--rmsource] specfile"), stdout);
|
||||
fputs(_(" rpm {--rmsource} [--rcfile <file>] [-v] specfile"), stdout);
|
||||
fputs(_(" rpm {--rebuild} [--rcfile <file>] [-v] source1.rpm ... sourceN.rpm"), stdout);
|
||||
fputs(_(" rpm {--recompile} [--rcfile <file>] [-v] source1.rpm ... sourceN.rpm"), stdout);
|
||||
fputs(_(" rpm {--resign} [--rcfile <file>] package1 package2 ... packageN"), stdout);
|
||||
fputs(_(" rpm {--addsign} [--rcfile <file>] package1 package2 ... packageN"), stdout);
|
||||
fputs(_(" rpm {--checksig -K} [--nopgp] [--nomd5] [--rcfile <file>]"), stdout);
|
||||
fputs(_(" package1 ... packageN"), stdout);
|
||||
fputs(_(" rpm {--rebuilddb} [--rcfile <file>] [--dbpath <dir>]"), stdout);
|
||||
fputs(_(" rpm {--querytags}"), stdout);
|
||||
}
|
||||
|
||||
static void printHelpLine(char * prefix, char * help) {
|
||||
|
@ -254,7 +254,7 @@ static void printHelpLine(char * prefix, char * help) {
|
|||
char * ch;
|
||||
char format[10];
|
||||
|
||||
printf("%s - ", prefix);
|
||||
fprintf(stdout, "%s - ", prefix);
|
||||
|
||||
while (helpLength > lineLength) {
|
||||
ch = help + lineLength - 1;
|
||||
|
@ -264,27 +264,27 @@ static void printHelpLine(char * prefix, char * help) {
|
|||
ch++;
|
||||
|
||||
sprintf(format, "%%.%ds\n%%%ds", (int) (ch - help), indentLength);
|
||||
printf(format, help, " ");
|
||||
fprintf(stdout, format, help, " ");
|
||||
help = ch;
|
||||
while (isspace(*help) && *help) help++;
|
||||
helpLength = strlen(help);
|
||||
}
|
||||
|
||||
if (helpLength) puts(help);
|
||||
if (helpLength) fputs(help, stdout);
|
||||
}
|
||||
|
||||
static void printHelp(void) {
|
||||
printVersion();
|
||||
printBanner();
|
||||
puts("");
|
||||
fputs(_(""), stdout);
|
||||
|
||||
puts(_("usage:"));
|
||||
fputs(_("usage:"), stdout);
|
||||
printHelpLine(" --help ",
|
||||
_("print this message"));
|
||||
printHelpLine(" --version ",
|
||||
_("print the version of rpm being used"));
|
||||
puts(_(" all modes support the following arguments:"));
|
||||
printHelpLine(" --rcfile <file> ",
|
||||
fputs(_(" all modes support the following arguments:"), stdout);
|
||||
printHelpLine(_(" --rcfile <file> "),
|
||||
_("use <file> instead of /etc/rpmrc and $HOME/.rpmrc"));
|
||||
printHelpLine(" -v ",
|
||||
_("be a little more verbose"));
|
||||
|
@ -292,32 +292,32 @@ static void printHelp(void) {
|
|||
_("be incredibly verbose (for debugging)"));
|
||||
printHelpLine(" -q ",
|
||||
_("query mode"));
|
||||
printHelpLine(" --root <dir> ",
|
||||
printHelpLine(_(" --root <dir> "),
|
||||
_("use <dir> as the top level directory"));
|
||||
printHelpLine(" --dbpath <dir> ",
|
||||
printHelpLine(_(" --dbpath <dir> "),
|
||||
_("use <dir> as the directory for the database"));
|
||||
printHelpLine(" --queryformat <s> ",
|
||||
_("use s as the header format (implies -i)"));
|
||||
puts(_(" install, upgrade and query (with -p) allow ftp URL's to be used in place"));
|
||||
puts(_(" of file names as well as the following options:\n"));
|
||||
printHelpLine(" --ftpproxy <host> ",
|
||||
printHelpLine(_(" --queryformat <qfmt> "),
|
||||
_("use qfmt as the header format (implies -i)"));
|
||||
fputs(_(" install, upgrade and query (with -p) allow ftp URL's to be used in place"), stdout);
|
||||
fputs(_(" of file names as well as the following options:\n"), stdout);
|
||||
printHelpLine(_(" --ftpproxy <host> "),
|
||||
_("hostname or IP of ftp proxy"));
|
||||
printHelpLine(" --ftpport <port> ",
|
||||
printHelpLine(_(" --ftpport <port> "),
|
||||
_("port number of ftp server (or proxy)"));
|
||||
puts( _(" Package specification options:"));
|
||||
printHelpLine(" -a ",
|
||||
fputs( _(" Package specification options:"), stdout);
|
||||
printHelpLine( " -a ",
|
||||
_("query all packages"));
|
||||
printHelpLine(" -f <file>+ ",
|
||||
printHelpLine(_(" -f <file>+ "),
|
||||
_("query package owning <file>"));
|
||||
printHelpLine(" -p <packagefile>+ ",
|
||||
printHelpLine(_(" -p <packagefile>+ "),
|
||||
_("query (uninstalled) package <packagefile>"));
|
||||
printHelpLine(" --triggeredby <package>",
|
||||
printHelpLine(_(" --triggeredby <package>"),
|
||||
_("query packages triggered by <package>"));
|
||||
printHelpLine(" --whatprovides <i>",
|
||||
_("query packages which provide <i> capability"));
|
||||
printHelpLine(" --whatrequires <i>",
|
||||
_("query packages which require <i> capability"));
|
||||
puts(_(" Information selection options:"));
|
||||
printHelpLine(_(" --whatprovides <icap>"),
|
||||
_("query packages which provide <icap> capability"));
|
||||
printHelpLine(_(" --whatrequires <icap>"),
|
||||
_("query packages which require <icap> capability"));
|
||||
fputs(_(" Information selection options:"), stdout);
|
||||
printHelpLine(" -i ",
|
||||
_("display package information"));
|
||||
printHelpLine(" --changelog ",
|
||||
|
@ -334,23 +334,23 @@ static void printHelp(void) {
|
|||
_("show all verifiable information for each file (must be used with -l, -c, or -d)"));
|
||||
printHelpLine(" --provides ",
|
||||
_("list capabilities package provides"));
|
||||
puts( _(" --requires"));
|
||||
fputs( _(" --requires"), stdout);
|
||||
printHelpLine(" -R ",
|
||||
_("list package dependencies"));
|
||||
printHelpLine(" --scripts ",
|
||||
_("print the various [un]install scripts"));
|
||||
printHelpLine(" --triggers ",
|
||||
_("show the trigger scripts contained in the package"));
|
||||
puts( "");
|
||||
puts( " -V");
|
||||
puts( " -y");
|
||||
printHelpLine(" --pipe <cmd> ",
|
||||
fputs( "", stdout);
|
||||
fputs( " -V", stdout);
|
||||
fputs( " -y", stdout);
|
||||
printHelpLine(_(" --pipe <cmd> "),
|
||||
_("send stdout to <cmd>"));
|
||||
printHelpLine(" --verify ",
|
||||
_("verify a package installation using the same same package specification options as -q"));
|
||||
printHelpLine(" --dbpath <dir> ",
|
||||
printHelpLine(_(" --dbpath <dir> "),
|
||||
_("use <dir> as the directory for the database"));
|
||||
printHelpLine(" --root <dir> ",
|
||||
printHelpLine(_(" --root <dir> "),
|
||||
_("use <dir> as the top level directory"));
|
||||
printHelpLine(" --nodeps ",
|
||||
_("do not verify package dependencies"));
|
||||
|
@ -358,7 +358,7 @@ static void printHelp(void) {
|
|||
_("do not verify file md5 checksums"));
|
||||
printHelpLine(" --nofiles ",
|
||||
_("do not verify file attributes"));
|
||||
puts("");
|
||||
fputs("", stdout);
|
||||
printHelpLine(" --setperms ",
|
||||
_("set the file permissions to those in the package database"
|
||||
" using the same package specification options as -q"));
|
||||
|
@ -366,23 +366,23 @@ static void printHelp(void) {
|
|||
_("set the file owner and group to those in the package "
|
||||
"database using the same package specification options as "
|
||||
"-q"));
|
||||
puts("");
|
||||
puts( " --install <packagefile>");
|
||||
printHelpLine(" -i <packagefile> ",
|
||||
fputs("", stdout);
|
||||
fputs( _(" --install <packagefile>"), stdout);
|
||||
printHelpLine(_(" -i <packagefile> "),
|
||||
_("install package"));
|
||||
printHelpLine(" --relocate <oldpath>=<newpath>",
|
||||
printHelpLine(_(" --relocate <oldpath>=<newpath>"),
|
||||
_("relocate files from <oldpath> to <newpath>"));
|
||||
printHelpLine(" --badreloc",
|
||||
_("relocate files even though the package doesn't allow it"));
|
||||
printHelpLine(" --prefix <dir> ",
|
||||
printHelpLine(_(" --prefix <dir> "),
|
||||
_("relocate the package to <dir>, if relocatable"));
|
||||
printHelpLine(" --dbpath <dir> ",
|
||||
printHelpLine(_(" --dbpath <dir> "),
|
||||
_("use <dir> as the directory for the database"));
|
||||
printHelpLine(" --excludedocs ",
|
||||
_("do not install documentation"));
|
||||
printHelpLine(" --force ",
|
||||
_("short hand for --replacepkgs --replacefiles"));
|
||||
puts( " -h");
|
||||
fputs( " -h", stdout);
|
||||
printHelpLine(" --hash ",
|
||||
_("print hash marks as package installs (good with -v)"));
|
||||
printHelpLine(" --allfiles ",
|
||||
|
@ -410,23 +410,23 @@ static void printHelp(void) {
|
|||
_("install even if the package replaces installed files"));
|
||||
printHelpLine(" --replacepkgs ",
|
||||
_("reinstall if the package is already present"));
|
||||
printHelpLine(" --root <dir> ",
|
||||
printHelpLine(_(" --root <dir> "),
|
||||
_("use <dir> as the top level directory"));
|
||||
printHelpLine(" --test ",
|
||||
_("don't install, but tell if it would work or not"));
|
||||
puts("");
|
||||
puts( " --upgrade <packagefile>");
|
||||
printHelpLine(" -U <packagefile> ",
|
||||
fputs("", stdout);
|
||||
fputs( _(" --upgrade <packagefile>"), stdout);
|
||||
printHelpLine(_(" -U <packagefile> "),
|
||||
_("upgrade package (same options as --install, plus)"));
|
||||
printHelpLine(" --oldpackage ",
|
||||
_("upgrade to an old version of the package (--force on upgrades does this automatically)"));
|
||||
puts("");
|
||||
puts( " --erase <package>");
|
||||
fputs("", stdout);
|
||||
fputs( _(" --erase <package>"), stdout);
|
||||
printHelpLine(" -e <package> ",
|
||||
_("erase (uninstall) package"));
|
||||
printHelpLine(" --allmatches ",
|
||||
_("remove all packages which match <package> (normally an error is generated if <package> specified multiple packages)"));
|
||||
printHelpLine(" --dbpath <dir> ",
|
||||
printHelpLine(_(" --dbpath <dir> "),
|
||||
_("use <dir> as the directory for the database"));
|
||||
printHelpLine(" --justdb ",
|
||||
_("update the database, but do not modify the filesystem"));
|
||||
|
@ -438,11 +438,11 @@ static void printHelp(void) {
|
|||
_("do not execute any package specific scripts"));
|
||||
printHelpLine(" --notriggers ",
|
||||
_("don't execute any scripts triggered by this package"));
|
||||
printHelpLine(" --root <dir> ",
|
||||
printHelpLine(_(" --root <dir> "),
|
||||
_("use <dir> as the top level directory"));
|
||||
puts("");
|
||||
puts(_(" -b<stage> <spec> "));
|
||||
printHelpLine(" -t<stage> <tarball> ",
|
||||
fputs("", stdout);
|
||||
fputs( _(" -b<stage> <spec> "), stdout);
|
||||
printHelpLine(_(" -t<stage> <tarball> "),
|
||||
_("build package, where <stage> is one of:"));
|
||||
printHelpLine(" p ",
|
||||
_("prep (unpack sources and apply patches)"));
|
||||
|
@ -464,27 +464,27 @@ static void printHelp(void) {
|
|||
_("remove sources and spec file when done"));
|
||||
printHelpLine(" --sign ",
|
||||
_("generate PGP signature"));
|
||||
printHelpLine(" --buildroot <dir> ",
|
||||
printHelpLine(_(" --buildroot <dir> "),
|
||||
_("use <dir> as the build root"));
|
||||
printHelpLine(" --platform=platform1[,platform2,... platformN]",
|
||||
printHelpLine(_(" --platform=<platform>+"),
|
||||
_("build the packages for the platform1...platformN build targets."));
|
||||
printHelpLine(" --test ",
|
||||
_("do not execute any stages"));
|
||||
printHelpLine(" --timecheck <s> ",
|
||||
_("set the time check to S seconds (0 disables it)"));
|
||||
puts("");
|
||||
printHelpLine(" --rebuild <src_pkg> ",
|
||||
printHelpLine(_(" --timecheck <secs> "),
|
||||
_("set the time check to <secs> seconds (0 disables it)"));
|
||||
fputs("", stdout);
|
||||
printHelpLine(_(" --rebuild <src_pkg> "),
|
||||
_("install source package, build binary package and remove spec file, sources, patches, and icons."));
|
||||
printHelpLine(" --rmsource <spec> ",
|
||||
printHelpLine(_(" --rmsource <spec> "),
|
||||
_("remove sources and spec file"));
|
||||
printHelpLine(" --recompile <src_pkg> ",
|
||||
printHelpLine(_(" --recompile <src_pkg> "),
|
||||
_("like --rebuild, but don't build any package"));
|
||||
printHelpLine(" --resign <pkg>+ ",
|
||||
printHelpLine(_(" --resign <pkg>+ "),
|
||||
_("sign a package (discard current signature)"));
|
||||
printHelpLine(" --addsign <pkg>+ ",
|
||||
printHelpLine(_(" --addsign <pkg>+ "),
|
||||
_("add a signature to a package"));
|
||||
puts( " -K");
|
||||
printHelpLine(" --checksig <pkg>+ ",
|
||||
fputs( " -K", stdout);
|
||||
printHelpLine(_(" --checksig <pkg>+ "),
|
||||
_("verify package signature"));
|
||||
printHelpLine(" --nopgp ",
|
||||
_("skip any PGP signatures"));
|
||||
|
@ -496,7 +496,7 @@ static void printHelp(void) {
|
|||
_("make sure a valid database exists"));
|
||||
printHelpLine(" --rebuilddb ",
|
||||
_("rebuild database from existing database"));
|
||||
printHelpLine(" --dbpath <dir> ",
|
||||
printHelpLine(_(" --dbpath <dir> "),
|
||||
_("use <dir> as the directory for the database"));
|
||||
printHelpLine(" --root <dir> ",
|
||||
_("use <dir> as the top level directory"));
|
||||
|
@ -901,7 +901,7 @@ int main(int argc, char ** argv) {
|
|||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Internal error in argument processing :-(\n");
|
||||
fprintf(stderr, _("Internal error in argument processing :-(\n"));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -1137,7 +1137,7 @@ int main(int argc, char ** argv) {
|
|||
dup2(p[0], 0);
|
||||
close(p[0]);
|
||||
execl("/bin/sh", "/bin/sh", "-c", pipeOutput, NULL);
|
||||
fprintf(stderr, "exec failed\n");
|
||||
fprintf(stderr, _("exec failed\n"));
|
||||
}
|
||||
|
||||
close(p[0]);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "system.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmlib.h"
|
||||
|
||||
char *zlib_err [] = {
|
||||
|
@ -35,10 +36,10 @@ int main(int argc, char **argv)
|
|||
|
||||
rc = rpmReadPackageHeader(fd, &hd, &isSource, NULL, NULL);
|
||||
if (rc == 1) {
|
||||
fprintf(stderr, "argument is not an RPM package\n");
|
||||
fprintf(stderr, _("argument is not an RPM package\n"));
|
||||
exit(1);
|
||||
} else if (rc) {
|
||||
fprintf(stderr, "error reading header from package\n");
|
||||
fprintf(stderr, _("error reading header from package\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
#ifdef DEBUG_MACROS
|
||||
#define rpmError fprintf
|
||||
#define RPMERR_BADSPEC stderr
|
||||
#define _(x) x
|
||||
#else
|
||||
#include "intl.h"
|
||||
#include "rpmlib.h"
|
||||
#endif
|
||||
|
||||
|
@ -109,7 +111,7 @@ dumpMacroTable(MacroContext *mc)
|
|||
fprintf(stderr, "\n");
|
||||
nactive++;
|
||||
}
|
||||
fprintf(stderr, "======================== active %d empty %d\n",
|
||||
fprintf(stderr, _("======================== active %d empty %d\n"),
|
||||
nactive, nempty);
|
||||
}
|
||||
|
||||
|
@ -196,7 +198,7 @@ printMacro(MacroBuf *mb, const char *s, const char *se)
|
|||
int choplen;
|
||||
|
||||
if (s >= se) { /* XXX just in case */
|
||||
fprintf(stderr, "%3d>%*s(empty)", mb->depth,
|
||||
fprintf(stderr, _("%3d>%*s(empty)"), mb->depth,
|
||||
(2 * mb->depth + 1), "");
|
||||
return;
|
||||
}
|
||||
|
@ -231,7 +233,7 @@ printExpansion(MacroBuf *mb, const char *t, const char *te)
|
|||
int choplen;
|
||||
|
||||
if (!(te > t)) {
|
||||
fprintf(stderr, "%3d<%*s(empty)\n", mb->depth, (2 * mb->depth + 1), "");
|
||||
fprintf(stderr, _("%3d<%*s(empty)\n"), mb->depth, (2 * mb->depth + 1), "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -404,7 +406,7 @@ doDefine(MacroBuf *mb, const char *se, int level, int expandbody)
|
|||
SKIPBLANK(s, c);
|
||||
if (c == '{') { /* XXX permit silent {...} grouping */
|
||||
if ((se = matchchar(s, c, '}')) == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has unterminated body", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated body"), n);
|
||||
se = s; /* XXX W2DO? */
|
||||
return se;
|
||||
}
|
||||
|
@ -430,23 +432,23 @@ doDefine(MacroBuf *mb, const char *se, int level, int expandbody)
|
|||
|
||||
/* Names must start with alphabetic or _ and be at least 3 chars */
|
||||
if (!((c = *n) && (isalpha(c) || c == '_') && (ne - n) > 2)) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has illegal name (%%define)", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has illegal name (%%define)"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
/* Options must be terminated with ')' */
|
||||
if (o && oc != ')') {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has unterminated opts", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
if ((be - b) < 1) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has empty body", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has empty body"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
if (expandbody && expandU(mb, b, (&buf[sizeof(buf)] - b))) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s failed to expand", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s failed to expand"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
|
@ -471,7 +473,7 @@ doUndefine(MacroContext *mc, const char *se)
|
|||
|
||||
/* Names must start with alphabetic or _ and be at least 3 chars */
|
||||
if (!((c = *n) && (isalpha(c) || c == '_') && (ne - n) > 2)) {
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s has illegal name (%%undefine)", n);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s has illegal name (%%undefine)"), n);
|
||||
return se;
|
||||
}
|
||||
|
||||
|
@ -542,7 +544,7 @@ freeArgs(MacroBuf *mb)
|
|||
; /* XXX skip test for %# %* %0 */
|
||||
} else if (!skiptest && me->used <= 0) {
|
||||
#if NOTYET
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%s (%s) was not used below level %d",
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%s (%s) was not used below level %d"),
|
||||
me->name, me->body, me->level);
|
||||
#endif
|
||||
}
|
||||
|
@ -625,7 +627,7 @@ grabArgs(MacroBuf *mb, const MacroEntry *me, const char *se)
|
|||
optc++; /* XXX count argv[0] too */
|
||||
while((c = getopt(argc, (char **)argv, opts)) != -1) {
|
||||
if (!(c != '?' && (o = strchr(opts, c)))) {
|
||||
rpmError(RPMERR_BADSPEC, "Unknown option %c in %s(%s)",
|
||||
rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)"),
|
||||
c, me->name, opts);
|
||||
return se;
|
||||
}
|
||||
|
@ -787,7 +789,7 @@ expandMacro(MacroBuf *mb)
|
|||
int chkexist;
|
||||
|
||||
if (++mb->depth > max_macro_depth) {
|
||||
rpmError(RPMERR_BADSPEC, "Recursion depth(%d) greater than max(%d)",
|
||||
rpmError(RPMERR_BADSPEC, _("Recursion depth(%d) greater than max(%d)"),
|
||||
mb->depth, max_macro_depth);
|
||||
mb->depth--;
|
||||
mb->expand_trace = 1;
|
||||
|
@ -843,7 +845,7 @@ expandMacro(MacroBuf *mb)
|
|||
break;
|
||||
case '(': /* %(...) shell escape */
|
||||
if ((se = matchchar(s, c, ')')) == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "Unterminated %c: %s", c, s);
|
||||
rpmError(RPMERR_BADSPEC, _("Unterminated %c: %s"), c, s);
|
||||
rc = 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -859,7 +861,7 @@ expandMacro(MacroBuf *mb)
|
|||
break;
|
||||
case '{': /* %{...}/%{...:...} substitution */
|
||||
if ((se = matchchar(s, c, '}')) == NULL) {
|
||||
rpmError(RPMERR_BADSPEC, "Unterminated %c: %s", c, s);
|
||||
rpmError(RPMERR_BADSPEC, _("Unterminated %c: %s"), c, s);
|
||||
rc = 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -888,7 +890,7 @@ expandMacro(MacroBuf *mb)
|
|||
fn = (fe - f);
|
||||
gn = (ge - g);
|
||||
if (fn <= 0) {
|
||||
rpmError(RPMERR_BADSPEC, "Empty token");
|
||||
rpmError(RPMERR_BADSPEC, _("Empty token"));
|
||||
s = se;
|
||||
continue;
|
||||
}
|
||||
|
@ -1010,7 +1012,7 @@ expandMacro(MacroBuf *mb)
|
|||
c = '%'; /* XXX only need to save % */
|
||||
SAVECHAR(mb, c);
|
||||
#else
|
||||
rpmError(RPMERR_BADSPEC, "Macro %%%.*s not found, skipping", fn, f);
|
||||
rpmError(RPMERR_BADSPEC, _("Macro %%%.*s not found, skipping"), fn, f);
|
||||
s = se;
|
||||
#endif
|
||||
continue;
|
||||
|
@ -1082,7 +1084,7 @@ expandMacros(void *spec, MacroContext *mc, char *s, size_t slen)
|
|||
rc = expandMacro(mb);
|
||||
|
||||
if (mb->nb <= 0)
|
||||
rpmError(RPMERR_BADSPEC, "Target buffer overflow");
|
||||
rpmError(RPMERR_BADSPEC, _("Target buffer overflow"));
|
||||
|
||||
tbuf[slen] = '\0'; /* XXX just in case */
|
||||
strncpy(s, tbuf, (slen - mb->nb + 1));
|
||||
|
@ -1196,7 +1198,7 @@ int isCompressed(char *file, int *compressed)
|
|||
*compressed = COMPRESSED_NOT;
|
||||
|
||||
if ((fd = open(file, O_RDONLY)) < 0) {
|
||||
rpmError(RPMERR_BADSPEC, "File %s: %s", file, strerror(errno));
|
||||
rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
nb = read(fd, magic, sizeof(magic));
|
||||
|
@ -1204,10 +1206,10 @@ int isCompressed(char *file, int *compressed)
|
|||
close(fd);
|
||||
|
||||
if (nb < 0) {
|
||||
rpmError(RPMERR_BADSPEC, "File %s: %s", file, strerror(rderrno));
|
||||
rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, strerror(rderrno));
|
||||
return 1;
|
||||
} else if (nb < sizeof(magic)) {
|
||||
rpmError(RPMERR_BADSPEC, "File %s is smaller than %d bytes",
|
||||
rpmError(RPMERR_BADSPEC, _("File %s is smaller than %d bytes"),
|
||||
file, sizeof(magic));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "rpmlib.h"
|
||||
|
||||
#include "intl.h"
|
||||
#include "rpmlib.h"
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
|
@ -16,13 +15,13 @@ int main(int argc, char ** argv)
|
|||
}
|
||||
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno));
|
||||
fprintf(stderr, _("cannot open %s: %s\n"), argv[1], strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
h = headerRead(fd, HEADER_MAGIC_YES);
|
||||
if (!h) {
|
||||
fprintf(stderr, "headerRead error: %s\n", strerror(errno));
|
||||
fprintf(stderr, _("headerRead error: %s\n"), strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
close(fd);
|
||||
|
@ -32,5 +31,3 @@ int main(int argc, char ** argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "system.h"
|
||||
|
||||
#include "rpmlib.h"
|
||||
#include "intl.h"
|
||||
#include "rpmlib.h"
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
|
@ -16,12 +16,12 @@ int main(int argc, char ** argv)
|
|||
if (argc == 2) {
|
||||
dspBlockNum = atoi(argv[1]);
|
||||
} else if (argc != 1) {
|
||||
fprintf(stderr, "dumpdb <block num>\n");
|
||||
fprintf(stderr, _("dumpdb <block num>\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (rpmdbOpen("", &db, O_RDONLY, 0644)) {
|
||||
fprintf(stderr, "cannot open /var/lib/rpm/packages.rpm\n");
|
||||
fprintf(stderr, _("cannot open /var/lib/rpm/packages.rpm\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,12 @@ int main(int argc, char ** argv)
|
|||
if (!dspBlockNum || dspBlockNum == blockNum) {
|
||||
h = rpmdbGetRecord(db, offset);
|
||||
if (!h) {
|
||||
fprintf(stderr, "headerRead failed\n");
|
||||
fprintf(stderr, _("headerRead failed\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
headerDump(h, stdout, 1, rpmTagTable);
|
||||
printf("Offset: %d\n", offset);
|
||||
fprintf(stdout, "Offset: %d\n", offset);
|
||||
headerFree(h);
|
||||
}
|
||||
|
||||
|
@ -50,5 +50,3 @@ int main(int argc, char ** argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,12 +29,12 @@ int main(int argc, char **argv)
|
|||
readLead(fd, &lead);
|
||||
rpmReadSignature(fd, lead.signature_type, (void **) &sig);
|
||||
res = verifySignature(fd, lead.signature_type, sig, result, 1);
|
||||
printf("%s", result);
|
||||
fprintf(stdout, "%s", result);
|
||||
if (res) {
|
||||
printf("Signature OK.\n");
|
||||
fprintf(stdout, "Signature OK.\n");
|
||||
return 0;
|
||||
} else {
|
||||
printf("Signature NOT OK!\n");
|
||||
fprintf(stdout, "Signature NOT OK!\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -393,22 +393,22 @@ slurp(const char *file, char **ibufp, size_t *nbp)
|
|||
*nbp = 0;
|
||||
|
||||
if (stat(file, &sb) < 0) {
|
||||
fprintf(stderr, "stat(%s): %s\n", file, strerror(errno));
|
||||
fprintf(stderr, _("stat(%s): %s\n"), file, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
nb = sb.st_size + 1;
|
||||
if ((ibuf = (char *)malloc(nb)) == NULL) {
|
||||
fprintf(stderr, "malloc(%d)\n", nb);
|
||||
fprintf(stderr, _("malloc(%d)\n"), nb);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if ((fd = open(file, O_RDONLY)) < 0) {
|
||||
fprintf(stderr, "open(%s): %s\n", file, strerror(errno));
|
||||
fprintf(stderr, _("open(%s): %s\n"), file, strerror(errno));
|
||||
return 3;
|
||||
}
|
||||
if ((nb = read(fd, ibuf, nb)) != sb.st_size) {
|
||||
fprintf(stderr, "read(%s): %s\n", file, strerror(errno));
|
||||
fprintf(stderr, _("read(%s): %s\n"), file, strerror(errno));
|
||||
return 4;
|
||||
}
|
||||
close(fd);
|
||||
|
@ -496,7 +496,7 @@ DPRINTF(100, ("================ %s\n", file));
|
|||
SKIPWHITE;
|
||||
s = se;
|
||||
if (!(isalpha(c) || c == '#')) {
|
||||
fprintf(stderr, "non-alpha char at \"%.20s\"\n", se);
|
||||
fprintf(stderr, _("non-alpha char at \"%.20s\"\n"), se);
|
||||
NEXTLINE;
|
||||
break;
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ DPRINTF(100, ("%.*s\n", (int)(se-s), s));
|
|||
fe = f;
|
||||
while (*fe && !strchr(": \t", *fe)) fe++;
|
||||
if (*fe != ':') {
|
||||
fprintf(stderr, "malformed #: xref at \"%.60s\"\n", s);
|
||||
fprintf(stderr, _("malformed #: xref at \"%.60s\"\n"), s);
|
||||
break;
|
||||
}
|
||||
*fe++ = '\0';
|
||||
|
@ -566,7 +566,7 @@ DPRINTF(100, ("%.*s\n", (int)(se-s), s));
|
|||
}
|
||||
}
|
||||
if (kw == NULL || kw->name == NULL) {
|
||||
fprintf(stderr, "unknown keyword at \"%.20s\"\n", se);
|
||||
fprintf(stderr, _("unknown keyword at \"%.20s\"\n"), se);
|
||||
NEXTLINE;
|
||||
break;
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ DPRINTF(100, ("%.*s", (int)(se-s), s));
|
|||
if (kw->haslang && *se == '(') {
|
||||
while ((c = *se) && c != ')') se++;
|
||||
if (c != ')') {
|
||||
fprintf(stderr, "unclosed paren at \"%.20s\"\n", s);
|
||||
fprintf(stderr, _("unclosed paren at \"%.20s\"\n"), s);
|
||||
se = s;
|
||||
NEXTLINE;
|
||||
break;
|
||||
|
@ -596,7 +596,7 @@ DPRINTF(100, ("\n"));
|
|||
|
||||
SKIPWHITE;
|
||||
if (*se != '"') {
|
||||
fprintf(stderr, "missing string at \"%.20s\"\n", s);
|
||||
fprintf(stderr, _("missing string at \"%.20s\"\n"), s);
|
||||
se = s;
|
||||
NEXTLINE;
|
||||
break;
|
||||
|
@ -606,7 +606,7 @@ DPRINTF(100, ("\n"));
|
|||
case 2: /* "...." */
|
||||
SKIPWHITE;
|
||||
if (c != '"') {
|
||||
fprintf(stderr, "not a string at \"%.20s\"\n", s);
|
||||
fprintf(stderr, _("not a string at \"%.20s\"\n"), s);
|
||||
NEXTLINE;
|
||||
break;
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ DPRINTF(100, ("\n"));
|
|||
s = se;
|
||||
s++; /* skip open quote */
|
||||
if ((se = matchchar(s, c, c)) == NULL) {
|
||||
fprintf(stderr, "missing close %c at \"%.20s\"\n", c, s);
|
||||
fprintf(stderr, _("missing close %c at \"%.20s\"\n"), c, s);
|
||||
se = s;
|
||||
NEXTLINE;
|
||||
break;
|
||||
|
@ -679,13 +679,13 @@ readRPM(char *fileName, Spec *specp, struct rpmlead *lead, Header *sigs, CSA_t *
|
|||
DPRINTF(99, ("readRPM(\"%s\",%p,%p,%p,%p)\n", fileName, specp, lead, sigs, csa));
|
||||
|
||||
if (fileName != NULL && (fdi = open(fileName, O_RDONLY, 0644)) < 0) {
|
||||
fprintf(stderr, "readRPM: open %s: %s\n", fileName, strerror(errno));
|
||||
fprintf(stderr, _("readRPM: open %s: %s\n"), fileName, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Get copy of lead */
|
||||
if ((rc = read(fdi, lead, sizeof(*lead))) != sizeof(*lead)) {
|
||||
fprintf(stderr, "readRPM: read %s: %s\n", fileName, strerror(errno));
|
||||
fprintf(stderr, _("readRPM: read %s: %s\n"), fileName, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
lseek(fdi, 0, SEEK_SET); /* XXX FIXME: EPIPE */
|
||||
|
@ -846,13 +846,13 @@ rpmgettext(int fd, const char *file, FILE *ofp)
|
|||
strcpy(op, ".tran");
|
||||
|
||||
if ((ofp = fopen(fno, "w")) == NULL) {
|
||||
fprintf(stderr, "Can't open %s\n", fno);
|
||||
fprintf(stderr, _("Can't open %s\n"), fno);
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
if ((fd = open(fni, O_RDONLY, 0644)) < 0) {
|
||||
fprintf(stderr, "rpmgettext: open %s: %s\n", fni, strerror(errno));
|
||||
fprintf(stderr, _("rpmgettext: open %s: %s\n"), fni, strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
@ -902,7 +902,7 @@ rpmputtext(int fd, const char *file, FILE *ofp)
|
|||
/* Find the text after the name-version-release */
|
||||
if ((fe = strrchr(f, '-')) == NULL ||
|
||||
(fe = strchr(fe, '.')) == NULL) {
|
||||
fprintf(stderr, "skipping malformed xref \"%s\"\n", fn);
|
||||
fprintf(stderr, _("skipping malformed xref \"%s\"\n"), fn);
|
||||
continue;
|
||||
}
|
||||
fe++; /* skip . */
|
||||
|
|
|
@ -22,7 +22,7 @@ int main(int argc, char **argv)
|
|||
rpmReadSignature(fd, &sig, lead.signature_type);
|
||||
switch (lead.signature_type) {
|
||||
case RPMSIG_NONE:
|
||||
fprintf(stderr, "No signature available.\n");
|
||||
fprintf(stderr, _("No signature available.\n"));
|
||||
break;
|
||||
default:
|
||||
rpmWriteSignature(1, sig);
|
||||
|
|
8
url.c
8
url.c
|
@ -110,14 +110,14 @@ static int urlFtpLogin(char * url, char ** fileNamePtr) {
|
|||
int port;
|
||||
int ftpconn;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "getting %s via anonymous ftp\n", url);
|
||||
rpmMessage(RPMMESS_DEBUG, _("getting %s via anonymous ftp\n"), url);
|
||||
|
||||
buf = alloca(strlen(url) + 1);
|
||||
strcpy(buf, url);
|
||||
|
||||
urlFtpSplit(buf, &userName, &password, &machineName, &fileName);
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "logging into %s as %s, pw %s\n", machineName,
|
||||
rpmMessage(RPMMESS_DEBUG, _("logging into %s as %s, pw %s\n"), machineName,
|
||||
userName ? userName : "ftp",
|
||||
password ? password : "(username)");
|
||||
|
||||
|
@ -153,7 +153,7 @@ int urlGetFd(char * url, struct urlContext * context) {
|
|||
char * fileName;
|
||||
int fd;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "getting %s via anonymous ftp\n", url);
|
||||
rpmMessage(RPMMESS_DEBUG, _("getting %s via anonymous ftp\n"), url);
|
||||
|
||||
if ((context->ftpControl = urlFtpLogin(url, &fileName)) < 0)
|
||||
return context->ftpControl;
|
||||
|
@ -179,7 +179,7 @@ int urlGetFile(char * url, char * dest) {
|
|||
int rc;
|
||||
int fd;
|
||||
|
||||
rpmMessage(RPMMESS_DEBUG, "getting %s via anonymous ftp\n", url);
|
||||
rpmMessage(RPMMESS_DEBUG, _("getting %s via anonymous ftp\n"), url);
|
||||
|
||||
if ((ftpconn = urlFtpLogin(url, &fileName)) < 0) return ftpconn;
|
||||
|
||||
|
|
18
verify.c
18
verify.c
|
@ -32,7 +32,7 @@ static int verifyHeader(char * prefix, Header h, int verifyFlags) {
|
|||
&count)) {
|
||||
for (i = 0; i < count; i++) {
|
||||
if ((rc = rpmVerifyFile(prefix, h, i, &verifyResult, omitMask)) != 0) {
|
||||
printf("missing %s\n", fileList[i]);
|
||||
fprintf(stdout, _("missing %s\n"), fileList[i]);
|
||||
} else {
|
||||
size = md5 = link = mtime = mode = ".";
|
||||
user = group = rdev = ".";
|
||||
|
@ -57,7 +57,7 @@ static int verifyHeader(char * prefix, Header h, int verifyFlags) {
|
|||
if (verifyResult & RPMVERIFY_MODE)
|
||||
mode = "M";
|
||||
|
||||
printf("%s%s%s%s%s%s%s%s %c %s\n",
|
||||
fprintf(stdout, "%s%s%s%s%s%s%s%s %c %s\n",
|
||||
size, mode, md5, rdev, link, user, group, mtime,
|
||||
fileFlagsList[i] & RPMFILE_CONFIG ? 'c' : ' ',
|
||||
fileList[i]);
|
||||
|
@ -88,17 +88,17 @@ static int verifyDependencies(rpmdb db, Header h) {
|
|||
headerGetEntry(h, RPMTAG_NAME, &type, (void **) &name, &count);
|
||||
headerGetEntry(h, RPMTAG_VERSION, &type, (void **) &version, &count);
|
||||
headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &count);
|
||||
printf(_("Unsatisfied dependencies for %s-%s-%s: "), name, version,
|
||||
release);
|
||||
fprintf(stdout, _("Unsatisfied dependencies for %s-%s-%s: "),
|
||||
name, version, release);
|
||||
for (i = 0; i < numConflicts; i++) {
|
||||
if (i) printf(", ");
|
||||
printf("%s", conflicts[i].needsName);
|
||||
if (i) fprintf(stdout, ", ");
|
||||
fprintf(stdout, "%s", conflicts[i].needsName);
|
||||
if (conflicts[i].needsFlags) {
|
||||
printDepFlags(stdout, conflicts[i].needsVersion,
|
||||
conflicts[i].needsFlags);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
fprintf(stdout, "\n");
|
||||
rpmdepFreeConflicts(conflicts, numConflicts);
|
||||
return 1;
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ static int verifyMatches(char * prefix, rpmdb db, dbiIndexSet matches,
|
|||
for (i = 0; i < matches.count; i++) {
|
||||
if (matches.recs[i].recOffset == 0)
|
||||
continue;
|
||||
rpmMessage(RPMMESS_DEBUG, "verifying record number %d\n",
|
||||
rpmMessage(RPMMESS_DEBUG, _("verifying record number %d\n"),
|
||||
matches.recs[i].recOffset);
|
||||
|
||||
h = rpmdbGetRecord(db, matches.recs[i].recOffset);
|
||||
|
@ -212,7 +212,7 @@ int doVerify(char * prefix, enum verifysources source, char ** argv,
|
|||
headerFree(h);
|
||||
break;
|
||||
case 1:
|
||||
fprintf(stderr, "%s is not an RPM\n", arg);
|
||||
fprintf(stderr, _("%s is not an RPM\n"), arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue