summaryrefslogtreecommitdiff
path: root/rpmio/macro.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-01-15 23:09:42 +0000
committerjbj <devnull@localhost>2001-01-15 23:09:42 +0000
commitc74cc1df1c51f0c2a99de94cb0a0b1e9448499f2 (patch)
tree68ccc4b1ad6388c283f56cf9c932b2712efc29ed /rpmio/macro.c
parent082ccecf35f3fb73c2a58b9052f102e5d9386fc4 (diff)
downloadlibrpm-tizen-c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2.tar.gz
librpm-tizen-c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2.tar.bz2
librpm-tizen-c74cc1df1c51f0c2a99de94cb0a0b1e9448499f2.zip
- fix: extra newline in many error messages (#23947).
- fix: rpm -Va with db1 needs per-iterator, not per-index, offset. - add install/remove transaction id tags. CVS patchset: 4441 CVS date: 2001/01/15 23:09:42
Diffstat (limited to 'rpmio/macro.c')
-rw-r--r--rpmio/macro.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index f7301a4a1..193789caa 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -552,7 +552,8 @@ 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"), n);
se = s; /* XXX W2DO? */
return se;
}
@@ -578,23 +579,25 @@ 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"), 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"), 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"), 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"), n);
return se;
}
@@ -625,7 +628,8 @@ 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"), n);
return se;
}
@@ -718,7 +722,8 @@ 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\n"),
me->name, me->body, me->level);
#endif
}
@@ -811,7 +816,7 @@ grabArgs(MacroBuf *mb, const MacroEntry *me, const char *se, char lastc)
/* Define option macros. */
while((c = getopt(argc, (char **)argv, opts)) != -1) {
if (c == '?' || (o = strchr(opts, c)) == NULL) {
- rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)"),
+ rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"),
c, me->name, opts);
return se;
}
@@ -866,7 +871,7 @@ doOutput(MacroBuf *mb, int waserror, const char *msg, size_t msglen)
buf[msglen] = '\0';
expandU(mb, buf, sizeof(buf));
if (waserror)
- rpmError(RPMERR_BADSPEC, "%s", buf);
+ rpmError(RPMERR_BADSPEC, "%s\n", buf);
else
fprintf(stderr, "%s", buf);
}
@@ -990,7 +995,8 @@ 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)\n"),
mb->depth, max_macro_depth);
mb->depth--;
mb->expand_trace = 1;
@@ -1056,7 +1062,8 @@ 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\n"), c, s);
rc = 1;
continue;
}
@@ -1072,7 +1079,8 @@ expandMacro(MacroBuf *mb)
/*@notreached@*/ break;
case '{': /* %{...}/%{...:...} substitution */
if ((se = matchchar(s, c, '}')) == NULL) {
- rpmError(RPMERR_BADSPEC, _("Unterminated %c: %s"), c, s);
+ rpmError(RPMERR_BADSPEC,
+ _("Unterminated %c: %s\n"), c, s);
rc = 1;
continue;
}
@@ -1112,7 +1120,8 @@ expandMacro(MacroBuf *mb)
c = '%'; /* XXX only need to save % */
SAVECHAR(mb, c);
#if 0
- rpmError(RPMERR_BADSPEC, _("A %% is followed by an unparseable macro"));
+ rpmError(RPMERR_BADSPEC,
+ _("A %% is followed by an unparseable macro\n"));
#endif
s = se;
continue;
@@ -1238,7 +1247,8 @@ 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\n"), fn, f);
s = se;
#endif
continue;
@@ -1309,7 +1319,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\n"));
tbuf[slen] = '\0'; /* XXX just in case */
strncpy(s, tbuf, (slen - mb->nb + 1));
@@ -1489,16 +1499,16 @@ int isCompressed(const char *file, rpmCompressedMagic *compressed)
fd = Fopen(file, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
/* XXX Fstrerror */
- rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, Fstrerror(fd));
+ rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
if (fd) Fclose(fd);
return 1;
}
nb = Fread(magic, sizeof(char), sizeof(magic), fd);
if (nb < 0) {
- rpmError(RPMERR_BADSPEC, _("File %s: %s"), file, Fstrerror(fd));
+ rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd));
rc = 1;
} else if (nb < sizeof(magic)) {
- rpmError(RPMERR_BADSPEC, _("File %s is smaller than %u bytes"),
+ rpmError(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"),
file, (unsigned)sizeof(magic));
rc = 0;
}