diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-10-09 14:06:06 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-10-09 14:06:06 +0300 |
commit | d709195c3a51522629443cddea042513f47c5ad3 (patch) | |
tree | 2d0f91f22a13179bb56331ae9f7d13ed38159cee /rpmio | |
parent | 46921b2334ddde2cad8f3546c6f9b6124adbb3a2 (diff) | |
download | rpm-d709195c3a51522629443cddea042513f47c5ad3.tar.gz rpm-d709195c3a51522629443cddea042513f47c5ad3.tar.bz2 rpm-d709195c3a51522629443cddea042513f47c5ad3.zip |
Replace all rpmError() uses with rpmlog()
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/macro.c | 46 | ||||
-rw-r--r-- | rpmio/rpmio.c | 2 | ||||
-rw-r--r-- | rpmio/rpmlua.c | 12 |
3 files changed, 30 insertions, 30 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c index c74da8406..972869304 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -519,7 +519,7 @@ doShellEscape(MacroBuf mb, const char * cmd, size_t clen) int c; if (clen >= sizeof(pcmd)) { - rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); return 1; } @@ -578,7 +578,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, + rpmlog(RPMERR_BADSPEC, _("Macro %%%s has unterminated body\n"), n); se = s; /* XXX W2DO? */ return se; @@ -616,7 +616,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody) *be = '\0'; if (bc || pc) { - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Macro %%%s has unterminated body\n"), n); se = s; /* XXX W2DO? */ return se; @@ -635,24 +635,24 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody) /* Names must start with alphabetic or _ and be at least 3 chars */ if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) { - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Macro %%%s has illegal name (%%define)\n"), n); return se; } /* Options must be terminated with ')' */ if (o && oc != ')') { - rpmError(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n); + rpmlog(RPMERR_BADSPEC, _("Macro %%%s has unterminated opts\n"), n); return se; } if ((be - b) < 1) { - rpmError(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n); + rpmlog(RPMERR_BADSPEC, _("Macro %%%s has empty body\n"), n); return se; } if (expandbody && expandU(mb, b, (&buf[sizeof(buf)] - b))) { - rpmError(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n); + rpmlog(RPMERR_BADSPEC, _("Macro %%%s failed to expand\n"), n); return se; } @@ -683,7 +683,7 @@ doUndefine(rpmMacroContext mc, const char * se) /* Names must start with alphabetic or _ and be at least 3 chars */ if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) { - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Macro %%%s has illegal name (%%undefine)\n"), n); return se; } @@ -784,7 +784,7 @@ freeArgs(MacroBuf mb) skiptest = 1; /* XXX skip test for %# %* %0 */ } else if (!skiptest && me->used <= 0) { #if NOTYET - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Macro %%%s (%s) was not used below level %d\n"), me->name, me->body, me->level); #endif @@ -904,7 +904,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se, while((c = getopt(argc, (char **)argv, opts)) != -1) { if (c == '?' || (o = strchr(opts, c)) == NULL) { - rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"), + rpmlog(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"), (char)c, me->name, opts); return se; } @@ -949,7 +949,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se, /** * Perform macro message output * @param mb macro expansion state - * @param waserror use rpmError()? + * @param waserror use rpmlog()? * @param msg message to ouput * @param msglen no. of bytes in message */ @@ -959,14 +959,14 @@ doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen) char buf[BUFSIZ]; if (msglen >= sizeof(buf)) { - rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); msglen = sizeof(buf) - 1; } strncpy(buf, msg, msglen); buf[msglen] = '\0'; (void) expandU(mb, buf, sizeof(buf)); if (waserror) - rpmError(RPMERR_BADSPEC, "%s\n", buf); + rpmlog(RPMERR_BADSPEC, "%s\n", buf); else fprintf(stderr, "%s", buf); } @@ -990,7 +990,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn, buf[0] = '\0'; if (g != NULL) { if (gn >= sizeof(buf)) { - rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); gn = sizeof(buf) - 1; } strncpy(buf, g, gn); @@ -1095,7 +1095,7 @@ expandMacro(MacroBuf mb) int chkexist; if (++mb->depth > max_macro_depth) { - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Recursion depth(%d) greater than max(%d)\n"), mb->depth, max_macro_depth); mb->depth--; @@ -1164,7 +1164,7 @@ expandMacro(MacroBuf mb) break; case '(': /* %(...) shell escape */ if ((se = matchchar(s, c, ')')) == NULL) { - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Unterminated %c: %s\n"), (char)c, s); rc = 1; continue; @@ -1181,7 +1181,7 @@ expandMacro(MacroBuf mb) break; case '{': /* %{...}/%{...:...} substitution */ if ((se = matchchar(s, c, '}')) == NULL) { - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Unterminated %c: %s\n"), (char)c, s); rc = 1; continue; @@ -1222,7 +1222,7 @@ expandMacro(MacroBuf mb) c = '%'; /* XXX only need to save % */ SAVECHAR(mb, c); #if 0 - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("A %% is followed by an unparseable macro\n")); #endif s = se; @@ -1378,7 +1378,7 @@ expandMacro(MacroBuf mb) c = '%'; /* XXX only need to save % */ SAVECHAR(mb, c); #else - rpmError(RPMERR_BADSPEC, + rpmlog(RPMERR_BADSPEC, _("Macro %%%.*s not found, skipping\n"), fn, f); s = se; #endif @@ -1695,7 +1695,7 @@ expandMacros(void * spec, rpmMacroContext mc, char * sbuf, size_t slen) rc = expandMacro(mb); if (mb->nb == 0) - rpmError(RPMERR_BADSPEC, _("Target buffer overflow\n")); + rpmlog(RPMERR_BADSPEC, _("Target buffer overflow\n")); tbuf[slen] = '\0'; /* XXX just in case */ strncpy(sbuf, tbuf, (slen - mb->nb + 1)); @@ -1898,16 +1898,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\n"), file, Fstrerror(fd)); + rpmlog(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); if (fd) (void) Fclose(fd); return 1; } nb = Fread(magic, sizeof(magic[0]), sizeof(magic), fd); if (nb < 0) { - rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); + rpmlog(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); rc = 1; } else if (nb < sizeof(magic)) { - rpmError(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"), + rpmlog(RPMERR_BADSPEC, _("File %s is smaller than %u bytes\n"), file, (unsigned)sizeof(magic)); rc = 0; } diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 262a62522..82f3066e9 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -810,7 +810,7 @@ static FD_t urlOpen(const char * url, int flags, mode_t mode) wait = waitpid(pid, &rc, 0); if (!WIFEXITED(rc) || WEXITSTATUS(rc)) { - rpmError(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"), + rpmlog(RPMERR_EXEC, _("URL helper failed: %s (%d)\n"), cmd, WEXITSTATUS(rc)); } else { fd = fdOpen(dest, flags, mode); diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c index 342c2cda3..bda4be324 100644 --- a/rpmio/rpmlua.c +++ b/rpmio/rpmlua.c @@ -446,7 +446,7 @@ int rpmluaCheckScript(rpmlua _lua, const char *script, const char *name) if (name == NULL) name = "<lua>"; if (luaL_loadbuffer(L, script, strlen(script), name) != 0) { - rpmError(RPMERR_SCRIPT, + rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua scriptlet: %s\n"), lua_tostring(L, -1)); ret = -1; @@ -463,12 +463,12 @@ int rpmluaRunScript(rpmlua _lua, const char *script, const char *name) if (name == NULL) name = "<lua>"; if (luaL_loadbuffer(L, script, strlen(script), name) != 0) { - rpmError(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"), + rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua script: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); ret = -1; } else if (lua_pcall(L, 0, 0, 0) != 0) { - rpmError(RPMERR_SCRIPT, _("lua script failed: %s\n"), + rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); ret = -1; @@ -482,12 +482,12 @@ int rpmluaRunScriptFile(rpmlua _lua, const char *filename) lua_State *L = lua->L; int ret = 0; if (luaL_loadfile(L, filename) != 0) { - rpmError(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"), + rpmlog(RPMERR_SCRIPT, _("invalid syntax in lua file: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); ret = -1; } else if (lua_pcall(L, 0, 0, 0) != 0) { - rpmError(RPMERR_SCRIPT, _("lua script failed: %s\n"), + rpmlog(RPMERR_SCRIPT, _("lua script failed: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); ret = -1; @@ -617,7 +617,7 @@ static int rpmluaHookWrapper(rpmhookArgs args, void *data) } } if (lua_pcall(L, 1, 1, 0) != 0) { - rpmError(RPMERR_SCRIPT, _("lua hook failed: %s\n"), + rpmlog(RPMERR_SCRIPT, _("lua hook failed: %s\n"), lua_tostring(L, -1)); lua_pop(L, 1); } else { |