From 4ce9fc1a1725b883190de2c415842a342ed3dbe3 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 9 Oct 2007 14:14:30 +0300 Subject: [PATCH] Replace all rpmMessage() uses with rpmlog() --- build.c | 2 +- build/build.c | 4 +-- build/files.c | 10 +++---- build/names.c | 2 +- build/pack.c | 4 +-- build/rpmfc.c | 14 ++++----- lib/depends.c | 30 +++++++++---------- lib/fs.c | 2 +- lib/fsm.c | 74 +++++++++++++++++++++++------------------------ lib/manifest.c | 2 +- lib/package.c | 22 +++++++------- lib/psm.c | 18 ++++++------ lib/query.c | 4 +-- lib/rpmchecksig.c | 2 +- lib/rpmds.c | 8 +++--- lib/rpmfi.c | 14 ++++----- lib/rpmgi.c | 8 +++--- lib/rpminstall.c | 54 +++++++++++++++++----------------- lib/rpmlock.c | 6 ++-- lib/rpmrc.c | 4 +-- lib/rpmts.c | 36 +++++++++++------------ lib/signature.c | 14 ++++----- lib/transaction.c | 86 +++++++++++++++++++++++++++---------------------------- lib/verify.c | 4 +-- rpmdb/db3.c | 14 ++++----- rpmdb/rpmdb.c | 44 ++++++++++++++-------------- rpmdb/sqlite.c | 50 ++++++++++++++++---------------- rpmio/rpmio.c | 2 +- rpmio/url.c | 6 ++-- tools/rpmcache.c | 4 +-- tools/rpmgraph.c | 8 +++--- tools/rpmsort.c | 8 +++--- 32 files changed, 280 insertions(+), 280 deletions(-) diff --git a/build.c b/build.c index 6507164..16b4454 100644 --- a/build.c +++ b/build.c @@ -31,7 +31,7 @@ static int checkSpec(rpmts ts, Header h) ps = rpmtsProblems(ts); if (rc == 0 && rpmpsNumProblems(ps) > 0) { - rpmMessage(RPMMESS_ERROR, _("Failed build dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed build dependencies:\n")); rpmpsPrint(NULL, ps); rc = 1; } diff --git a/build/build.c b/build/build.c index abd631d..01312a4 100644 --- a/build/build.c +++ b/build/build.c @@ -215,7 +215,7 @@ fprintf(stderr, "*** addMacros\n"); buildCmd = rpmExpand(mCmd, " ", buildScript, NULL); (void) poptParseArgvString(buildCmd, &argc, &argv); - rpmMessage(RPMMESS_NORMAL, _("Executing(%s): %s\n"), name, buildCmd); + rpmlog(RPMMESS_NORMAL, _("Executing(%s): %s\n"), name, buildCmd); if (!(child = fork())) { errno = 0; @@ -340,7 +340,7 @@ int buildSpec(rpmts ts, rpmSpec spec, int what, int test) exit: if (rc && rpmlogGetNrecs() > 0) { - rpmMessage(RPMMESS_NORMAL, _("\n\nRPM build errors:\n")); + rpmlog(RPMMESS_NORMAL, _("\n\nRPM build errors:\n")); rpmlogPrint(NULL); } diff --git a/build/files.c b/build/files.c index f8ea9f9..e2efeb9 100644 --- a/build/files.c +++ b/build/files.c @@ -248,7 +248,7 @@ static void timeCheck(int tc, Header h) for (x = 0; x < count; x++) { if ((currentTime - mtime[x]) > tc) - rpmMessage(RPMMESS_WARNING, _("TIMECHECK failure: %s\n"), files[x]); + rpmlog(RPMMESS_WARNING, _("TIMECHECK failure: %s\n"), files[x]); } files = hfd(files, fnt); } @@ -1071,7 +1071,7 @@ static void genCpioListAndHeader(FileList fl, flp[1].flags |= flp->flags; if (!(flp[1].flags & RPMFILE_EXCLUDE)) - rpmMessage(RPMMESS_WARNING, _("File listed twice: %s\n"), + rpmlog(RPMMESS_WARNING, _("File listed twice: %s\n"), flp->fileURL); /* file mode */ @@ -2253,7 +2253,7 @@ static int checkFiles(StringBuf fileList) } rc = 0; - rpmMessage(RPMMESS_NORMAL, _("Checking for unpackaged file(s): %s\n"), s); + rpmlog(RPMMESS_NORMAL, _("Checking for unpackaged file(s): %s\n"), s); rc = rpmfcExec(av_ckfile, fileList, &sb_stdout, 0); if (rc < 0) @@ -2267,7 +2267,7 @@ static int checkFiles(StringBuf fileList) t = getStringBuf(sb_stdout); if ((*t != '\0') && (*t != '\n')) { rc = (_unpackaged_files_terminate_build) ? 1 : 0; - rpmMessage((rc ? RPMMESS_ERROR : RPMMESS_WARNING), + rpmlog((rc ? RPMMESS_ERROR : RPMMESS_WARNING), _("Installed (but unpackaged) file(s) found:\n%s"), t); } } @@ -2293,7 +2293,7 @@ int processBinaryFiles(rpmSpec spec, int installSpecialDoc, int test) continue; (void) headerNVR(pkg->header, &n, &v, &r); - rpmMessage(RPMMESS_NORMAL, _("Processing files: %s-%s-%s\n"), n, v, r); + rpmlog(RPMMESS_NORMAL, _("Processing files: %s-%s-%s\n"), n, v, r); if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) res = rc; diff --git a/build/names.c b/build/names.c index 87c9465..4dd1658 100644 --- a/build/names.c +++ b/build/names.c @@ -193,7 +193,7 @@ const char * buildHost(void) if (hbn) strcpy(hostname, hbn->h_name); else - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("Could not canonicalize hostname: %s\n"), hostname); oneshot = 1; } diff --git a/build/pack.c b/build/pack.c index ffd41b4..5f4805f 100644 --- a/build/pack.c +++ b/build/pack.c @@ -540,7 +540,7 @@ int writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase); if ((sigtag = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) > 0) { - rpmMessage(RPMMESS_NORMAL, _("Generating signature: %d\n"), sigtag); + rpmlog(RPMMESS_NORMAL, _("Generating signature: %d\n"), sigtag); (void) rpmAddSignature(sig, sigtarget, sigtag, passPhrase); } @@ -695,7 +695,7 @@ exit: } if (rc == 0) - rpmMessage(RPMMESS_NORMAL, _("Wrote: %s\n"), fileName); + rpmlog(RPMMESS_NORMAL, _("Wrote: %s\n"), fileName); else (void) Unlink(fileName); diff --git a/build/rpmfc.c b/build/rpmfc.c index 625913f..996f261 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -113,7 +113,7 @@ static StringBuf getOutputFrom(const char * dir, ARGV_t argv, (void) chdir(dir); } - rpmMessage(RPMMESS_DEBUG, _("\texecv(%s) pid %d\n"), + rpmlog(RPMMESS_DEBUG, _("\texecv(%s) pid %d\n"), argv[0], (unsigned)getpid()); unsetenv("MALLOC_CHECK_"); @@ -206,7 +206,7 @@ top: /* Collect status from prog */ reaped = waitpid(child, &status, 0); - rpmMessage(RPMMESS_DEBUG, _("\twaitpid(%d) rc %d status %x\n"), + rpmlog(RPMMESS_DEBUG, _("\twaitpid(%d) rc %d status %x\n"), (unsigned)child, (unsigned)reaped, status); if (failNonZero && (!WIFEXITED(status) || WEXITSTATUS(status))) { @@ -1292,7 +1292,7 @@ assert(ftype != NULL); /* XXX figger a proper return path. */ } se = ftype; - rpmMessage(RPMMESS_DEBUG, "%s: %s\n", s, se); + rpmlog(RPMMESS_DEBUG, "%s: %s\n", s, se); /* Save the path. */ xx = argvAdd(&fc->fn, s); @@ -1429,15 +1429,15 @@ static void printDeps(Header h) if (!((Flags & dm->mask) ^ dm->xor)) continue; if (bingo == 0) { - rpmMessage(RPMMESS_NORMAL, "%s:", (dm->msg ? dm->msg : "")); + rpmlog(RPMMESS_NORMAL, "%s:", (dm->msg ? dm->msg : "")); bingo = 1; } if ((DNEVR = rpmdsDNEVR(ds)) == NULL) continue; /* XXX can't happen */ - rpmMessage(RPMMESS_NORMAL, " %s", DNEVR+2); + rpmlog(RPMMESS_NORMAL, " %s", DNEVR+2); } if (bingo) - rpmMessage(RPMMESS_NORMAL, "\n"); + rpmlog(RPMMESS_NORMAL, "\n"); } ds = rpmdsFree(ds); } @@ -1493,7 +1493,7 @@ static int rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi) continue; s = rpmExpand(dm->argv[0], NULL); - rpmMessage(RPMMESS_NORMAL, _("Finding %s: %s\n"), dm->msg, + rpmlog(RPMMESS_NORMAL, _("Finding %s: %s\n"), dm->msg, (s ? s : "")); s = _free(s); diff --git a/lib/depends.c b/lib/depends.c index 1ced6dd..4b85f97 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -188,7 +188,7 @@ int rpmtsAddInstallElement(rpmts ts, Header h, const char * pkgNEVR = rpmdsDNEVR(this); const char * addNEVR = rpmdsDNEVR(oldChk); if (rpmIsVerbose()) - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("package %s was already added, skipping %s\n"), (pkgNEVR ? pkgNEVR + 2 : "?pkgNEVR?"), (addNEVR ? addNEVR + 2 : "?addNEVR?")); @@ -205,7 +205,7 @@ int rpmtsAddInstallElement(rpmts ts, Header h, const char * pkgNEVR = rpmdsDNEVR(this); const char * addNEVR = rpmdsDNEVR(newChk); if (rpmIsVerbose()) - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("package %s was already added, replacing with %s\n"), (pkgNEVR ? pkgNEVR + 2 : "?pkgNEVR?"), (addNEVR ? addNEVR + 2 : "?addNEVR?")); @@ -340,7 +340,7 @@ addheader: if (rpmVersionCompare(h, oh)) #endif xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey); - rpmMessage(RPMMESS_DEBUG, _(" Obsoletes: %s\t\terases %s\n"), + rpmlog(RPMMESS_DEBUG, _(" Obsoletes: %s\t\terases %s\n"), rpmdsDNEVR(obsoletes)+2, ohNEVRA); ohNEVRA = _free(ohNEVRA); } @@ -778,7 +778,7 @@ static int ignoreDep(const rpmts ts, const rpmte p, const rpmte q) *qname++ = '\0'; bdp->pname = pname; bdp->qname = qname; - rpmMessage(msglvl, + rpmlog(msglvl, _("ignore package name relation(s) [%d]\t%s -> %s\n"), i, bdp->pname, (bdp->qname ? bdp->qname : "???")); } @@ -883,7 +883,7 @@ zapRelation(rpmte q, rpmte p, * Attempt to unravel a dependency loop by eliminating Requires's. */ if (zap && !(Flags & RPMSENSE_PREREQ)) { - rpmMessage(msglvl, + rpmlog(msglvl, _("removing %s \"%s\" from tsort relations.\n"), (rpmteNEVRA(p) ? rpmteNEVRA(p) : "???"), dp); rpmteTSI(p)->tsi_count--; @@ -1104,7 +1104,7 @@ int rpmtsOrder(rpmts ts) pi = rpmtsiFree(pi); /* Record all relations. */ - rpmMessage(RPMMESS_DEBUG, _("========== recording tsort relations\n")); + rpmlog(RPMMESS_DEBUG, _("========== recording tsort relations\n")); pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, oType)) != NULL) { @@ -1196,7 +1196,7 @@ int rpmtsOrder(rpmts ts) ts->ntrees = treex; /* T4. Scan for zeroes. */ - rpmMessage(RPMMESS_DEBUG, _("========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)\n")); + rpmlog(RPMMESS_DEBUG, _("========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth)\n")); rescan: if (pi != NULL) pi = rpmtsiFree(pi); @@ -1239,7 +1239,7 @@ rescan: breadth = ((depth < npeer) ? peer[depth]++ : 0); (void) rpmteSetBreadth(q, breadth); - rpmMessage(RPMMESS_DEBUG, "%5d%5d%5d%5d%5d%5d %*s%c%s\n", + rpmlog(RPMMESS_DEBUG, "%5d%5d%5d%5d%5d%5d %*s%c%s\n", orderingCount, rpmteNpreds(q), rpmteTSI(q)->tsi_qcnt, treex, depth, breadth, @@ -1286,7 +1286,7 @@ rescan: if (!_printed && loopcheck == qlen && rpmteTSI(q)->tsi_suc != NULL) { _printed++; (void) rpmtsUnorderedSuccessors(ts, orderingCount); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("========== successors only (%d bytes)\n"), (int)tsbytes); /* Relink the queue in presentation order. */ @@ -1360,7 +1360,7 @@ rescan: rpmteTSI(p)->tsi_chain = NULL; if (!printed) { - rpmMessage(msglvl, _("LOOP:\n")); + rpmlog(msglvl, _("LOOP:\n")); printed = 1; } @@ -1375,7 +1375,7 @@ rescan: buf[0] = '\0'; if (rpmteNEVRA(p) != NULL) (void) stpcpy(buf, rpmteNEVRA(p)); - rpmMessage(msglvl, " %-40s %s\n", buf, + rpmlog(msglvl, " %-40s %s\n", buf, (dp ? dp : "not found!?!")); dp = _free(dp); @@ -1395,12 +1395,12 @@ rescan: /* If a relation was eliminated, then continue sorting. */ /* XXX TODO: add control bit. */ if (nzaps && nrescans-- > 0) { - rpmMessage(RPMMESS_DEBUG, _("========== continuing tsort ...\n")); + rpmlog(RPMMESS_DEBUG, _("========== continuing tsort ...\n")); goto rescan; } /* Return no. of packages that could not be ordered. */ - rpmMessage(RPMMESS_ERROR, _("rpmtsOrder failed, %d elements remain\n"), + rpmlog(RPMMESS_ERROR, _("rpmtsOrder failed, %d elements remain\n"), loopcheck); return loopcheck; } @@ -1513,7 +1513,7 @@ int rpmtsCheck(rpmts ts) rpmds provides; /* FIX: rpmts{A,O} can return null. */ - rpmMessage(RPMMESS_DEBUG, "========== +++ %s %s/%s 0x%x\n", + rpmlog(RPMMESS_DEBUG, "========== +++ %s %s/%s 0x%x\n", rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); rc = checkPackageDeps(ts, rpmteNEVRA(p), rpmteDS(p, RPMTAG_REQUIRENAME), @@ -1553,7 +1553,7 @@ int rpmtsCheck(rpmts ts) rpmfi fi; /* FIX: rpmts{A,O} can return null. */ - rpmMessage(RPMMESS_DEBUG, "========== --- %s %s/%s 0x%x\n", + rpmlog(RPMMESS_DEBUG, "========== --- %s %s/%s 0x%x\n", rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); rc = 0; diff --git a/lib/fs.c b/lib/fs.c index 5da6ed9..b41ea8d 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -211,7 +211,7 @@ static int getFilesystemList(void) filesystems[numFilesystems].mntPoint = xstrdup(mntdir); filesystems[numFilesystems].rdonly = rdonly; #if 0 - rpmMessage(RPMMESS_DEBUG, _("%5d 0x%04x %s %s\n"), + rpmlog(RPMMESS_DEBUG, _("%5d 0x%04x %s %s\n"), numFilesystems, (unsigned) filesystems[numFilesystems].dev, (filesystems[numFilesystems].rdonly ? "ro" : "rw"), diff --git a/lib/fsm.c b/lib/fsm.c index 4aa1e6f..1705d22 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -301,13 +301,13 @@ void * dnlInitIterator(const FSM_t fsm, if (!dnli->active[i]) continue; if (j == 0) { j = 1; - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("========== Directories not explicitly included in package:\n")); } - rpmMessage(RPMMESS_DEBUG, _("%10d %s\n"), i, fi->dnl[i]); + rpmlog(RPMMESS_DEBUG, _("%10d %s\n"), i, fi->dnl[i]); } if (j) - rpmMessage(RPMMESS_DEBUG, "==========\n"); + rpmlog(RPMMESS_DEBUG, "==========\n"); } } return dnli; @@ -666,7 +666,7 @@ int fsmMapAttrs(FSM_t fsm) if (fi->fuser && unameToUid(fi->fuser[i], &uid)) { if (fsm->goal == FSM_PKGINSTALL) - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("user %s does not exist - using root\n"), fi->fuser[i]); uid = 0; finalMode &= ~S_ISUID; /* turn off suid bit */ @@ -674,7 +674,7 @@ int fsmMapAttrs(FSM_t fsm) if (fi->fgroup && gnameToGid(fi->fgroup[i], &gid)) { if (fsm->goal == FSM_PKGINSTALL) - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("group %s does not exist - using root\n"), fi->fgroup[i]); gid = 0; finalMode &= ~S_ISGID; /* turn off sgid bit */ @@ -1171,11 +1171,11 @@ static int fsmMkdirs(FSM_t fsm) } if (fsm->fcontext == NULL) - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("%s directory created with perms %04o, no context.\n"), fsm->path, (unsigned)(st->st_mode & 07777)); else - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("%s directory created with perms %04o, context %s.\n"), fsm->path, (unsigned)(st->st_mode & 07777), fsm->fcontext); @@ -1265,7 +1265,7 @@ int fsmStage(FSM_t fsm, fileStage stage) /* do nothing */ } else if (stage & FSM_INTERNAL) { if (_fsm_debug && !(stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s %06o%3d (%4d,%4d)%10d %s %s\n", + rpmlog(RPMMESS_DEBUG, " %8s %06o%3d (%4d,%4d)%10d %s %s\n", cur, (unsigned)st->st_mode, (int)st->st_nlink, (int)st->st_uid, (int)st->st_gid, (int)st->st_size, @@ -1274,7 +1274,7 @@ int fsmStage(FSM_t fsm, fileStage stage) } else { fsm->stage = stage; if (_fsm_debug || !(stage & FSM_VERBOSE)) - rpmMessage(RPMMESS_DEBUG, "%-8s %06o%3d (%4d,%4d)%10d %s %s\n", + rpmlog(RPMMESS_DEBUG, "%-8s %06o%3d (%4d,%4d)%10d %s %s\n", cur, (unsigned)st->st_mode, (int)st->st_nlink, (int)st->st_uid, (int)st->st_gid, (int)st->st_size, @@ -1464,7 +1464,7 @@ int fsmStage(FSM_t fsm, fileStage stage) if (fsm->ix < 0) { if (fsm->goal == FSM_PKGINSTALL) { #if 0 - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("archive file %s was not found in header file list\n"), fsm->path); #endif @@ -1586,7 +1586,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; fsm->path = fsmFsPath(fsm, st, NULL, fsm->osuffix); rc = fsmNext(fsm, FSM_RENAME); if (!rc) - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("%s saved as %s\n"), (fsm->opath ? fsm->opath : ""), (fsm->path ? fsm->path : "")); @@ -1713,7 +1713,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; fsm->path = fsmFsPath(fsm, st, NULL, fsm->osuffix); rc = fsmNext(fsm, FSM_RENAME); if (!rc) { - rpmMessage(RPMMESS_WARNING, _("%s saved as %s\n"), + rpmlog(RPMMESS_WARNING, _("%s saved as %s\n"), (fsm->opath ? fsm->opath : ""), (fsm->path ? fsm->path : "")); } @@ -1782,7 +1782,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; rc = fsmNext(fsm, FSM_RENAME); if (!rc && fsm->nsuffix) { const char * opath = fsmFsPath(fsm, st, NULL, NULL); - rpmMessage(RPMMESS_WARNING, _("%s created as %s\n"), + rpmlog(RPMMESS_WARNING, _("%s created as %s\n"), (opath ? opath : ""), (fsm->path ? fsm->path : "")); opath = _free(opath); @@ -1923,7 +1923,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; } rc = Unlink(fsm->path); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s) %s\n", cur, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_UNLINK_FAILED); @@ -1943,14 +1943,14 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; } #endif if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, fsm->opath, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_RENAME_FAILED; break; case FSM_MKDIR: rc = Mkdir(fsm->path, (st->st_mode & 07777)); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, 0%04o) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, 0%04o) %s\n", cur, fsm->path, (unsigned)(st->st_mode & 07777), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_MKDIR_FAILED; @@ -1958,7 +1958,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_RMDIR: rc = Rmdir(fsm->path); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s) %s\n", cur, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) switch (errno) { @@ -1973,7 +1973,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; break; rc = lsetfilecon(fsm->path, (security_context_t)fsm->fcontext); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, fsm->path, fsm->fcontext, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = (errno == EOPNOTSUPP ? 0 : CPIOERR_LSETFCON_FAILED); @@ -1981,7 +1981,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_CHOWN: rc = chown(fsm->path, st->st_uid, st->st_gid); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur, fsm->path, (int)st->st_uid, (int)st->st_gid, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_CHOWN_FAILED; @@ -1990,7 +1990,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; #if ! CHOWN_FOLLOWS_SYMLINK rc = lchown(fsm->path, st->st_uid, st->st_gid); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur, fsm->path, (int)st->st_uid, (int)st->st_gid, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_CHOWN_FAILED; @@ -1999,7 +1999,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_CHMOD: rc = chmod(fsm->path, (st->st_mode & 07777)); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, 0%04o) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, 0%04o) %s\n", cur, fsm->path, (unsigned)(st->st_mode & 07777), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_CHMOD_FAILED; @@ -2010,7 +2010,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; stamp.modtime = st->st_mtime; rc = utime(fsm->path, &stamp); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, 0x%x) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, 0x%x) %s\n", cur, fsm->path, (unsigned)st->st_mtime, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_UTIME_FAILED; @@ -2019,21 +2019,21 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_SYMLINK: rc = symlink(fsm->opath, fsm->path); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, fsm->opath, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_SYMLINK_FAILED; break; case FSM_LINK: rc = Link(fsm->opath, fsm->path); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, %s) %s\n", cur, fsm->opath, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_LINK_FAILED; break; case FSM_MKFIFO: rc = mkfifo(fsm->path, (st->st_mode & 07777)); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, 0%04o) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, 0%04o) %s\n", cur, fsm->path, (unsigned)(st->st_mode & 07777), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_MKFIFO_FAILED; @@ -2042,7 +2042,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; /* FIX: check S_IFIFO or dev != 0 */ rc = mknod(fsm->path, (st->st_mode & ~07777), st->st_rdev); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, 0%o, 0x%x) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, 0%o, 0x%x) %s\n", cur, fsm->path, (unsigned)(st->st_mode & ~07777), (unsigned)st->st_rdev, (rc < 0 ? strerror(errno) : "")); @@ -2051,7 +2051,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_LSTAT: rc = Lstat(fsm->path, ost); if (_fsm_debug && (stage & FSM_SYSCALL) && rc && errno != ENOENT) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, ost) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, ost) %s\n", cur, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) { rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_LSTAT_FAILED); @@ -2061,7 +2061,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_STAT: rc = Stat(fsm->path, ost); if (_fsm_debug && (stage & FSM_SYSCALL) && rc && errno != ENOENT) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, ost) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, ost) %s\n", cur, fsm->path, (rc < 0 ? strerror(errno) : "")); if (rc < 0) { rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_STAT_FAILED); @@ -2072,7 +2072,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; /* XXX NUL terminated result in fsm->rdbuf, len in fsm->rdnb. */ rc = Readlink(fsm->path, fsm->rdbuf, fsm->rdsize - 1); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, rdbuf, %d) %s\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, rdbuf, %d) %s\n", cur, fsm->path, (int)(fsm->rdsize -1), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = CPIOERR_READLINK_FAILED; else { @@ -2132,7 +2132,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_DREAD: fsm->rdnb = Fread(fsm->wrbuf, sizeof(*fsm->wrbuf), fsm->wrlen, fsm->cfd); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, cfd)\trdnb %d\n", + rpmlog(RPMMESS_DEBUG, " %8s (%s, %d, cfd)\trdnb %d\n", cur, (fsm->wrbuf == fsm->wrb ? "wrbuf" : "mmap"), (int)fsm->wrlen, (int)fsm->rdnb); if (fsm->rdnb != fsm->wrlen || Ferror(fsm->cfd)) @@ -2143,7 +2143,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_DWRITE: fsm->wrnb = Fwrite(fsm->rdbuf, sizeof(*fsm->rdbuf), fsm->rdnb, fsm->cfd); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, cfd)\twrnb %d\n", + rpmlog(RPMMESS_DEBUG, " %8s (%s, %d, cfd)\twrnb %d\n", cur, (fsm->rdbuf == fsm->rdb ? "rdbuf" : "mmap"), (int)fsm->rdnb, (int)fsm->wrnb); if (fsm->rdnb != fsm->wrnb || Ferror(fsm->cfd)) @@ -2161,13 +2161,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; break; } if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, \"r\") rfd %p rdbuf %p\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, \"r\") rfd %p rdbuf %p\n", cur, fsm->path, fsm->rfd, fsm->rdbuf); break; case FSM_READ: fsm->rdnb = Fread(fsm->rdbuf, sizeof(*fsm->rdbuf), fsm->rdlen, fsm->rfd); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (rdbuf, %d, rfd)\trdnb %d\n", + rpmlog(RPMMESS_DEBUG, " %8s (rdbuf, %d, rfd)\trdnb %d\n", cur, (int)fsm->rdlen, (int)fsm->rdnb); if (fsm->rdnb != fsm->rdlen || Ferror(fsm->rfd)) rc = CPIOERR_READ_FAILED; @@ -2175,7 +2175,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_RCLOSE: if (fsm->rfd != NULL) { if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%p)\n", cur, fsm->rfd); + rpmlog(RPMMESS_DEBUG, " %8s (%p)\n", cur, fsm->rfd); (void) rpmswAdd(rpmtsOp(fsmGetTs(fsm), RPMTS_OP_DIGEST), fdstat_op(fsm->rfd, FDSTAT_DIGEST)); (void) Fclose(fsm->rfd); @@ -2191,13 +2191,13 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; rc = CPIOERR_OPEN_FAILED; } if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%s, \"w\") wfd %p wrbuf %p\n", cur, + rpmlog(RPMMESS_DEBUG, " %8s (%s, \"w\") wfd %p wrbuf %p\n", cur, fsm->path, fsm->wfd, fsm->wrbuf); break; case FSM_WRITE: fsm->wrnb = Fwrite(fsm->wrbuf, sizeof(*fsm->wrbuf), fsm->rdnb, fsm->wfd); if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (wrbuf, %d, wfd)\twrnb %d\n", + rpmlog(RPMMESS_DEBUG, " %8s (wrbuf, %d, wfd)\twrnb %d\n", cur, (int)fsm->rdnb, (int)fsm->wrnb); if (fsm->rdnb != fsm->wrnb || Ferror(fsm->wfd)) rc = CPIOERR_WRITE_FAILED; @@ -2205,7 +2205,7 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; case FSM_WCLOSE: if (fsm->wfd != NULL) { if (_fsm_debug && (stage & FSM_SYSCALL)) - rpmMessage(RPMMESS_DEBUG, " %8s (%p)\n", cur, fsm->wfd); + rpmlog(RPMMESS_DEBUG, " %8s (%p)\n", cur, fsm->wfd); (void) rpmswAdd(rpmtsOp(fsmGetTs(fsm), RPMTS_OP_DIGEST), fdstat_op(fsm->wfd, FDSTAT_DIGEST)); (void) Fclose(fsm->wfd); diff --git a/lib/manifest.c b/lib/manifest.c index d48a9c6..1c05667 100644 --- a/lib/manifest.c +++ b/lib/manifest.c @@ -119,7 +119,7 @@ rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, const char *** argvPtr) rpmrc = rpmGlob(s, &ac, &av); if (rpmrc != RPMRC_OK) goto exit; - rpmMessage(RPMMESS_DEBUG, _("adding %d args from manifest.\n"), ac); + rpmlog(RPMMESS_DEBUG, _("adding %d args from manifest.\n"), ac); /* Count non-NULL args, keeping track of 1st arg after last NULL. */ npre = 0; diff --git a/lib/package.c b/lib/package.c index 241bbee..ab0d9f5 100644 --- a/lib/package.c +++ b/lib/package.c @@ -490,7 +490,7 @@ verifyinfo_exit: /* Parse the parameters from the OpenPGP packets that will be needed. */ xx = pgpPrtPkts(sig, info->count, dig, (_print_pkts & rpmIsDebug())); if (dig->signature.version != 3 && dig->signature.version != 4) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("skipping header with unverifiable V%u signature\n"), dig->signature.version); rpmtsCleanDig(ts); @@ -531,7 +531,7 @@ verifyinfo_exit: /* Parse the parameters from the OpenPGP packets that will be needed. */ xx = pgpPrtPkts(sig, info->count, dig, (_print_pkts & rpmIsDebug())); if (dig->signature.version != 3 && dig->signature.version != 4) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("skipping header with unverifiable V%u signature\n"), dig->signature.version); rpmtsCleanDig(ts); @@ -840,7 +840,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) /* Parse the parameters from the OpenPGP packets that will be needed. */ xx = pgpPrtPkts(sig, siglen, dig, (_print_pkts & rpmIsDebug())); if (dig->signature.version != 3 && dig->signature.version != 4) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("skipping package %s with unverifiable V%u signature\n"), fn, dig->signature.version); rc = RPMRC_FAIL; @@ -866,7 +866,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) /* Parse the parameters from the OpenPGP packets that will be needed. */ xx = pgpPrtPkts(sig, siglen, dig, (_print_pkts & rpmIsDebug())); if (dig->signature.version != 3 && dig->signature.version != 4) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("skipping package %s with unverifiable V%u signature\n"), fn, dig->signature.version); rc = RPMRC_FAIL; @@ -897,7 +897,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) xx = pgpPrtPkts(sig, siglen, dig, (_print_pkts & rpmIsDebug())); if (dig->signature.version != 3 && dig->signature.version != 4) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("skipping package %s with unverifiable V%u signature\n"), fn, dig->signature.version); rc = RPMRC_FAIL; @@ -949,20 +949,20 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) rc = rpmVerifySignature(ts, buf); switch (rc) { case RPMRC_OK: /* Signature is OK. */ - rpmMessage(RPMMESS_DEBUG, "%s: %s", fn, buf); + rpmlog(RPMMESS_DEBUG, "%s: %s", fn, buf); break; case RPMRC_NOTTRUSTED: /* Signature is OK, but key is not trusted. */ case RPMRC_NOKEY: /* Public key is unavailable. */ /* XXX Print NOKEY/NOTTRUSTED warning only once. */ { int lvl = (rpmtsStashKeyid(ts) ? RPMMESS_DEBUG : RPMMESS_WARNING); - rpmMessage(lvl, "%s: %s", fn, buf); + rpmlog(lvl, "%s: %s", fn, buf); } break; case RPMRC_NOTFOUND: /* Signature is unknown type. */ - rpmMessage(RPMMESS_WARNING, "%s: %s", fn, buf); + rpmlog(RPMMESS_WARNING, "%s: %s", fn, buf); break; default: case RPMRC_FAIL: /* Signature does not verify. */ - rpmMessage(RPMMESS_ERROR, "%s: %s", fn, buf); + rpmlog(RPMMESS_ERROR, "%s: %s", fn, buf); break; } @@ -1007,11 +1007,11 @@ rpmRC headerCheckPayloadFormat(Header h) { } else { const char *nevra = hGetNEVRA(h, NULL); if (payloadfmt && strncmp(payloadfmt, "drpm", strlen("drpm")) == 0) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("%s is a Delta RPM and cannot be directly installed\n"), nevra); } else { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("Unsupported payload (%s) in package %s\n"), payloadfmt ? payloadfmt : "none", nevra); } diff --git a/lib/psm.c b/lib/psm.c index b294aca..e1e10bb 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -441,7 +441,7 @@ static pid_t psmWait(rpmpsm psm) msecs = psm->sq.op.usecs/1000; (void) rpmswAdd(rpmtsOp(ts, RPMTS_OP_SCRIPTLETS), &psm->sq.op); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("%s: waitpid(%d) rc %d status %x secs %u.%03u\n"), psm->stepName, (unsigned)psm->sq.child, (unsigned)psm->sq.reaped, psm->sq.status, @@ -582,7 +582,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, if (progArgv && strcmp(progArgv[0], "") == 0) { #ifdef WITH_LUA - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("%s: %s(%s-%s-%s.%s) running scriptlet.\n"), psm->stepName, tag2sln(psm->scriptTag), n, v, r, a); return runLuaScript(psm, h, sln, progArgc, progArgv, @@ -599,7 +599,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, */ if (ldconfig_path && progArgv != NULL && psm->unorderedSuccessor) { if (ldconfig_done && !strcmp(progArgv[0], ldconfig_path)) { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("%s: %s(%s-%s-%s.%s) skipping redundant \"%s\".\n"), psm->stepName, tag2sln(psm->scriptTag), n, v, r, a, progArgv[0]); @@ -607,7 +607,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, } } - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("%s: %s(%s-%s-%s.%s) %ssynchronous scriptlet start\n"), psm->stepName, tag2sln(psm->scriptTag), n, v, r, a, (psm->unorderedSuccessor ? "a" : "")); @@ -807,7 +807,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, xx = chroot(rootDir); } xx = chdir("/"); - rpmMessage(RPMMESS_DEBUG, _("%s: %s(%s-%s-%s.%s)\texecv(%s) pid %d\n"), + rpmlog(RPMMESS_DEBUG, _("%s: %s(%s-%s-%s.%s)\texecv(%s) pid %d\n"), psm->stepName, sln, n, v, r, a, argv[0], (unsigned)getpid()); @@ -1253,7 +1253,7 @@ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) case PSM_UNKNOWN: break; case PSM_INIT: - rpmMessage(RPMMESS_DEBUG, _("%s: %s has %d files, test = %d\n"), + rpmlog(RPMMESS_DEBUG, _("%s: %s has %d files, test = %d\n"), psm->stepName, rpmteNEVR(psm->te), rpmfiFC(fi), (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)); @@ -1791,7 +1791,7 @@ assert(psm->mi == NULL); if (psm->goal == PSM_PKGSAVE) { if (!rc && ts && ts->notify == NULL) { - rpmMessage(RPMMESS_VERBOSE, _("Wrote: %s\n"), + rpmlog(RPMMESS_VERBOSE, _("Wrote: %s\n"), (psm->pkgURL ? psm->pkgURL : "???")); } } @@ -1978,7 +1978,7 @@ assert(psm->mi == NULL); /* OK, we got a real score so lets get the appropriate * score entry. */ - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Attempting to mark %s as installed in score board(%p).\n"), rpmteN(psm->te), score); se = rpmtsScoreGetEntry(score, rpmteN(psm->te)); @@ -2011,7 +2011,7 @@ assert(psm->mi == NULL); /* OK, we got a real score so lets get the appropriate * score entry. */ - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Attempting to mark %s as erased in score board(%p).\n"), rpmteN(psm->te), score); se = rpmtsScoreGetEntry(score, rpmteN(psm->te)); diff --git a/lib/query.c b/lib/query.c index b82711c..eec8e0a 100644 --- a/lib/query.c +++ b/lib/query.c @@ -128,7 +128,7 @@ static void flushBuffer(char ** tp, char ** tep, int nonewline) *te++ = '\n'; *te = '\0'; } - rpmMessage(RPMMESS_NORMAL, "%s", t); + rpmlog(RPMMESS_NORMAL, "%s", t); te = t; *t = '\0'; } @@ -647,7 +647,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) rpmlog(RPMERR_QUERYINFO, _("invalid package number: %s\n"), arg); return 1; } - rpmMessage(RPMMESS_DEBUG, _("package record number: %u\n"), recOffset); + rpmlog(RPMMESS_DEBUG, _("package record number: %u\n"), recOffset); /* RPMDBI_PACKAGES */ qva->qva_mi = rpmtsInitIterator(ts, RPMDBI_PACKAGES, &recOffset, sizeof(recOffset)); if (qva->qva_mi == NULL) { diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 37444c6..191ffbb 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -306,7 +306,7 @@ static int rpmReSign(rpmts ts, /* If same signer, skip resigning the package. */ if (!memcmp(oldsignid, newsignid, sizeof(oldsignid))) { - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("%s: was already signed by key ID %s, skipping\n"), rpm, pgpHexStr(newsignid+4, sizeof(newsignid)-4)); diff --git a/lib/rpmds.c b/lib/rpmds.c index 18a6d7f..7702849 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -504,7 +504,7 @@ void rpmdsNotify(rpmds ds, const char * where, int rc) if (!(ds->Type != NULL && ds->DNEVR != NULL)) return; - rpmMessage(RPMMESS_DEBUG, "%9s: %-45s %-s %s\n", ds->Type, + rpmlog(RPMMESS_DEBUG, "%9s: %-45s %-s %s\n", ds->Type, (!strcmp(ds->DNEVR, "cached") ? ds->DNEVR : ds->DNEVR+2), (rc ? _("NO ") : _("YES")), (where != NULL ? where : "")); @@ -800,7 +800,7 @@ int rpmdsCompare(const rpmds A, const rpmds B) else if (aE && *aE && atol(aE) > 0) { if (!B->nopromote) { int lvl = (_rpmds_unspecified_epoch_noise ? RPMMESS_WARNING : RPMMESS_DEBUG); - rpmMessage(lvl, _("The \"B\" dependency needs an epoch (assuming same epoch as \"A\")\n\tA = \"%s\"\tB = \"%s\"\n"), + rpmlog(lvl, _("The \"B\" dependency needs an epoch (assuming same epoch as \"A\")\n\tA = \"%s\"\tB = \"%s\"\n"), aDepend, bDepend); sense = 0; } else @@ -831,7 +831,7 @@ int rpmdsCompare(const rpmds A, const rpmds B) exit: if (_noisy_range_comparison_debug_message) - rpmMessage(RPMMESS_DEBUG, _(" %s A %s\tB %s\n"), + rpmlog(RPMMESS_DEBUG, _(" %s A %s\tB %s\n"), (result ? _("YES") : _("NO ")), aDepend, bDepend); aDepend = _free(aDepend); bDepend = _free(bDepend); @@ -853,7 +853,7 @@ void rpmdsProblem(rpmps ps, const char * pkgNEVR, const rpmds ds, if (EVR == NULL) EVR = "?EVR?"; if (DNEVR == NULL) DNEVR = "? ?N? ?OP? ?EVR?"; - rpmMessage(RPMMESS_DEBUG, _("package %s has unsatisfied %s: %s\n"), + rpmlog(RPMMESS_DEBUG, _("package %s has unsatisfied %s: %s\n"), pkgNEVR, ds->Type, DNEVR+2); switch ((unsigned)DNEVR[0]) { diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 1a84700..2125767 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -488,7 +488,7 @@ rpmFileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing) * package has marked it as missingok, or allfiles is requested. */ if (skipMissing && (newFlags & RPMFILE_MISSINGOK)) { - rpmMessage(RPMMESS_DEBUG, _("%s skipped due to missingok flag\n"), + rpmlog(RPMMESS_DEBUG, _("%s skipped due to missingok flag\n"), fn); return FA_SKIP; } else { @@ -757,14 +757,14 @@ assert(p != NULL); if (!_printed) { _printed = 1; - rpmMessage(RPMMESS_DEBUG, _("========== relocations\n")); + rpmlog(RPMMESS_DEBUG, _("========== relocations\n")); for (i = 0; i < numRelocations; i++) { if (relocations[i].oldPath == NULL) continue; /* XXX can't happen */ if (relocations[i].newPath == NULL) - rpmMessage(RPMMESS_DEBUG, _("%5d exclude %s\n"), + rpmlog(RPMMESS_DEBUG, _("%5d exclude %s\n"), i, relocations[i].oldPath); else - rpmMessage(RPMMESS_DEBUG, _("%5d relocate %s -> %s\n"), + rpmlog(RPMMESS_DEBUG, _("%5d relocate %s -> %s\n"), i, relocations[i].oldPath, relocations[i].newPath); } } @@ -895,7 +895,7 @@ dColors[j] |= fColors[i]; } if (actions) { actions[i] = FA_SKIPNSTATE; - rpmMessage(RPMMESS_DEBUG, _("excluding %s %s\n"), + rpmlog(RPMMESS_DEBUG, _("excluding %s %s\n"), ftstring(ft), fn); } continue; @@ -905,7 +905,7 @@ dColors[j] |= fColors[i]; if (fnlen != len) continue; if (actions) - rpmMessage(RPMMESS_DEBUG, _("relocating %s to %s\n"), + rpmlog(RPMMESS_DEBUG, _("relocating %s to %s\n"), fn, relocations[j].newPath); nrelocated++; @@ -995,7 +995,7 @@ dColors[j] |= fColors[i]; t[slen+1] = '\0'; if (actions) - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("relocating directory %s to %s\n"), dirNames[i], t); dirNames[i] = t; nrelocated++; diff --git a/lib/rpmgi.c b/lib/rpmgi.c index 67fb000..58045d0 100644 --- a/lib/rpmgi.c +++ b/lib/rpmgi.c @@ -184,7 +184,7 @@ static rpmRC rpmgiWalkPathFilter(rpmgi gi) const char * s; if (_rpmgi_debug < 0) -rpmMessage(RPMMESS_DEBUG, "FTS_%s\t%*s %s%s\n", ftsInfoStr(fts->fts_info), +rpmlog(RPMMESS_DEBUG, "FTS_%s\t%*s %s%s\n", ftsInfoStr(fts->fts_info), indent * (fts->fts_level < 0 ? 0 : fts->fts_level), "", fts->fts_name, ((fts->fts_info == FTS_D || fts->fts_info == FTS_DP) ? "/" : "")); @@ -581,19 +581,19 @@ enditer: ps = rpmtsProblems(ts); if (rpmpsNumProblems(ps) > 0) { /* XXX rpminstall will need RPMMESS_ERROR */ - rpmMessage(RPMMESS_VERBOSE, _("Failed dependencies:\n")); + rpmlog(RPMMESS_VERBOSE, _("Failed dependencies:\n")); if (rpmIsVerbose()) rpmpsPrint(NULL, ps); if (ts->suggests != NULL && ts->nsuggests > 0) { - rpmMessage(RPMMESS_VERBOSE, _(" Suggested resolutions:\n")); + rpmlog(RPMMESS_VERBOSE, _(" Suggested resolutions:\n")); for (i = 0; i < ts->nsuggests; i++) { const char * str = ts->suggests[i]; if (str == NULL) break; - rpmMessage(RPMMESS_VERBOSE, "\t%s\n", str); + rpmlog(RPMMESS_VERBOSE, "\t%s\n", str); ts->suggests[i] = NULL; str = _free(str); diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 8f5e780..1b3eb17 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -348,7 +348,7 @@ if (fileURL[0] == '=') { ts->suggests[ts->nsuggests] = _free(ts->suggests[ts->nsuggests]); } ts->suggests = _free(ts->suggests); - rpmMessage(RPMMESS_DEBUG, _("Adding goal: %s\n"), fileURL); + rpmlog(RPMMESS_DEBUG, _("Adding goal: %s\n"), fileURL); eiu->pkgURL[eiu->pkgx] = fileURL; fileURL = NULL; eiu->pkgx++; @@ -377,10 +377,10 @@ if (fileURL[0] == '=') { /* XXX undefined %{name}/%{version}/%{release} here */ /* XXX %{_tmpdir} does not exist */ - rpmMessage(RPMMESS_DEBUG, _(" ... as %s\n"), tfn); + rpmlog(RPMMESS_DEBUG, _(" ... as %s\n"), tfn); rc = urlGetFile(fileURL, tfn); if (rc < 0) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("skipping %s - transfer failed - %s\n"), fileURL, ftpStrerror(rc)); eiu->numFailed++; @@ -413,7 +413,7 @@ if (fileURL[0] == '=') { { const char * fileName; - rpmMessage(RPMMESS_DEBUG, "============== %s\n", *eiu->fnp); + rpmlog(RPMMESS_DEBUG, "============== %s\n", *eiu->fnp); (void) urlPath(*eiu->fnp, &fileName); /* Try to read the header from a package file. */ @@ -438,7 +438,7 @@ if (fileURL[0] == '=') { switch (eiu->rpmrc) { case RPMRC_FAIL: - rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *eiu->fnp); + rpmlog(RPMMESS_ERROR, _("%s cannot be installed\n"), *eiu->fnp); eiu->numFailed++; *eiu->fnp = NULL; continue; break; @@ -455,7 +455,7 @@ if (fileURL[0] == '=') { eiu->isSource = headerIsEntry(eiu->h, RPMTAG_SOURCEPACKAGE); if (eiu->isSource) { - rpmMessage(RPMMESS_DEBUG, _("\tadded source package [%d]\n"), + rpmlog(RPMMESS_DEBUG, _("\tadded source package [%d]\n"), eiu->numSRPMS); eiu->sourceURL = xrealloc(eiu->sourceURL, (eiu->numSRPMS + 2) * sizeof(*eiu->sourceURL)); @@ -479,7 +479,7 @@ if (fileURL[0] == '=') { } else { const char * name; xx = headerNVR(eiu->h, &name, NULL, NULL); - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("package %s is not relocatable\n"), name); eiu->numFailed++; goto exit; @@ -522,17 +522,17 @@ if (fileURL[0] == '=') { switch(rc) { case 0: - rpmMessage(RPMMESS_DEBUG, _("\tadded binary package [%d]\n"), + rpmlog(RPMMESS_DEBUG, _("\tadded binary package [%d]\n"), eiu->numRPMS); break; case 1: - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("error reading from file %s\n"), *eiu->fnp); eiu->numFailed++; goto exit; break; case 2: - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("file %s requires a newer version of RPM\n"), *eiu->fnp); eiu->numFailed++; @@ -580,7 +580,7 @@ maybe_manifest: break; } - rpmMessage(RPMMESS_DEBUG, _("found %d source and %d binary packages\n"), + rpmlog(RPMMESS_DEBUG, _("found %d source and %d binary packages\n"), eiu->numSRPMS, eiu->numRPMS); if (eiu->numFailed) goto exit; @@ -594,20 +594,20 @@ maybe_manifest: ps = rpmtsProblems(ts); if (!stopInstall && rpmpsNumProblems(ps) > 0) { - rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed dependencies:\n")); rpmpsPrint(NULL, ps); eiu->numFailed = eiu->numPkgs; stopInstall = 1; if (ts->suggests != NULL && ts->nsuggests > 0) { - rpmMessage(RPMMESS_NORMAL, _(" Suggested resolutions:\n")); + rpmlog(RPMMESS_NORMAL, _(" Suggested resolutions:\n")); for (i = 0; i < ts->nsuggests; i++) { const char * str = ts->suggests[i]; if (str == NULL) break; - rpmMessage(RPMMESS_NORMAL, "\t%s\n", str); + rpmlog(RPMMESS_NORMAL, "\t%s\n", str); ts->suggests[i] = NULL; str = _free(str); @@ -629,7 +629,7 @@ maybe_manifest: rpmcliPackagesTotal += eiu->numSRPMS; - rpmMessage(RPMMESS_DEBUG, _("installing binary packages\n")); + rpmlog(RPMMESS_DEBUG, _("installing binary packages\n")); /* Drop added/available package indices and dependency sets. */ rpmtsClean(ts); @@ -653,7 +653,7 @@ maybe_manifest: if (eiu->sourceURL[i] == NULL) continue; eiu->fd = Fopen(eiu->sourceURL[i], "r.ufdio"); if (eiu->fd == NULL || Ferror(eiu->fd)) { - rpmMessage(RPMMESS_ERROR, _("cannot open file %s: %s\n"), + rpmlog(RPMMESS_ERROR, _("cannot open file %s: %s\n"), eiu->sourceURL[i], Fstrerror(eiu->fd)); if (eiu->fd != NULL) { xx = Fclose(eiu->fd); @@ -732,7 +732,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, /* XXX HACK to get rpmdbFindByLabel out of the API */ mi = rpmtsInitIterator(ts, RPMDBI_LABEL, *arg, 0); if (mi == NULL) { - rpmMessage(RPMMESS_ERROR, _("package %s is not installed\n"), *arg); + rpmlog(RPMMESS_ERROR, _("package %s is not installed\n"), *arg); numFailed++; } else { Header h; /* XXX iterator owns the reference */ @@ -741,7 +741,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, unsigned int recOffset = rpmdbGetIteratorOffset(mi); if (!(count++ == 0 || (ia->eraseInterfaceFlags & UNINSTALL_ALLMATCHES))) { - rpmMessage(RPMMESS_ERROR, _("\"%s\" specifies multiple packages\n"), + rpmlog(RPMMESS_ERROR, _("\"%s\" specifies multiple packages\n"), *arg); numFailed++; break; @@ -766,7 +766,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ps = rpmtsProblems(ts); if (!stopUninstall && rpmpsNumProblems(ps) > 0) { - rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed dependencies:\n")); rpmpsPrint(NULL, ps); numFailed += numPackages; stopUninstall = 1; @@ -811,7 +811,7 @@ int rpmInstallSource(rpmts ts, const char * arg, fd = Fopen(arg, "r.ufdio"); if (fd == NULL || Ferror(fd)) { - rpmMessage(RPMMESS_ERROR, _("cannot open %s: %s\n"), arg, Fstrerror(fd)); + rpmlog(RPMMESS_ERROR, _("cannot open %s: %s\n"), arg, Fstrerror(fd)); if (fd != NULL) (void) Fclose(fd); return 1; } @@ -827,7 +827,7 @@ int rpmInstallSource(rpmts ts, const char * arg, ovsflags = rpmtsSetVSFlags(ts, ovsflags); } if (rc != 0) { - rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), arg); + rpmlog(RPMMESS_ERROR, _("%s cannot be installed\n"), arg); if (specFilePtr && *specFilePtr) *specFilePtr = _free(*specFilePtr); if (cookie && *cookie) @@ -947,7 +947,7 @@ int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, const char ** argv) /* Install the previously erased packages for this transaction. */ while (rp != NULL && rp->val.u32 == thistid) { - rpmMessage(RPMMESS_DEBUG, "\t+++ install %s\n", + rpmlog(RPMMESS_DEBUG, "\t+++ install %s\n", (rp->key ? rp->key : "???")); rc = rpmtsAddInstallElement(ts, rp->h, (fnpyKey)rp->key, @@ -973,7 +973,7 @@ int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, const char ** argv) /* Erase the previously installed packages for this transaction. */ while (ip != NULL && ip->val.u32 == thistid) { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, "\t--- erase h#%u\n", ip->instance); rc = rpmtsAddEraseElement(ts, ip->h, ip->instance); @@ -1005,14 +1005,14 @@ int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, const char ** argv) break; tid = (time_t)thistid; - rpmMessage(RPMMESS_NORMAL, + rpmlog(RPMMESS_NORMAL, _("Rollback packages (+%d/-%d) to %-24.24s (0x%08x):\n"), numAdded, numRemoved, ctime(&tid), tid); rc = rpmtsCheck(ts); ps = rpmtsProblems(ts); if (rc != 0 && rpmpsNumProblems(ps) > 0) { - rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed dependencies:\n")); rpmpsPrint(NULL, ps); ps = rpmpsFree(ps); goto exit; @@ -1037,14 +1037,14 @@ int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, const char ** argv) /* Clean up after successful rollback. */ if (rtids && !rpmIsDebug()) { int i; - rpmMessage(RPMMESS_NORMAL, _("Cleaning up repackaged packages:\n")); + rpmlog(RPMMESS_NORMAL, _("Cleaning up repackaged packages:\n")); if (rtids->idt) for (i = 0; i < rtids->nidt; i++) { IDT rrp = rtids->idt + i; if (rrp->val.u32 != thistid) continue; if (rrp->key) { /* XXX can't happen */ - rpmMessage(RPMMESS_NORMAL, _("\tRemoving %s:\n"), rrp->key); + rpmlog(RPMMESS_NORMAL, _("\tRemoving %s:\n"), rrp->key); (void) unlink(rrp->key); /* XXX: Should check rc??? */ } } diff --git a/lib/rpmlock.c b/lib/rpmlock.c index de3e95b..bb3e15c 100644 --- a/lib/rpmlock.c +++ b/lib/rpmlock.c @@ -115,13 +115,13 @@ void *rpmtsAcquireLock(rpmts ts) rootDir = "/"; lock = rpmlock_new(rootDir); if (!lock) { - rpmMessage(RPMMESS_ERROR, _("can't create transaction lock on %s\n"), rpmlock_path); + rpmlog(RPMMESS_ERROR, _("can't create transaction lock on %s\n"), rpmlock_path); } else if (!rpmlock_acquire(lock, RPMLOCK_WRITE)) { if (lock->openmode & RPMLOCK_WRITE) - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("waiting for transaction lock on %s\n"), rpmlock_path); if (!rpmlock_acquire(lock, RPMLOCK_WRITE|RPMLOCK_WAIT)) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("can't create transaction lock on %s\n"), rpmlock_path); rpmlock_free(lock); lock = NULL; diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 66d4524..554688a 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -1442,8 +1442,8 @@ static void getMachineInfo(int type, const char ** name, if (name) *name = current[type]; if (tables[currTables[type]].hasCanon) { - rpmMessage(RPMMESS_WARNING, _("Unknown system: %s\n"), current[type]); - rpmMessage(RPMMESS_WARNING, _("Please contact %s\n"), PACKAGE_BUGREPORT); + rpmlog(RPMMESS_WARNING, _("Unknown system: %s\n"), current[type]); + rpmlog(RPMMESS_WARNING, _("Please contact %s\n"), PACKAGE_BUGREPORT); } } } diff --git a/lib/rpmts.c b/lib/rpmts.c index 1add80d..660f9f9 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -154,7 +154,7 @@ int rpmtsOpenDB(rpmts ts, int dbmode) if (rc) { const char * dn; dn = rpmGetPath(ts->rootDir, "%{_dbpath}", NULL); - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("cannot open Packages database in %s\n"), dn); dn = _free(dn); } @@ -419,7 +419,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p memcpy(ts->pksignid, pubp->signid, sizeof(ts->pksignid)); if (pubkeysource) - rpmMessage(RPMMESS_DEBUG, "========== %s pubkey id %08x %08x (%s)\n", + rpmlog(RPMMESS_DEBUG, "========== %s pubkey id %08x %08x (%s)\n", (sigp->pubkey_algo == PGPPUBKEYALGO_DSA ? "DSA" : (sigp->pubkey_algo == PGPPUBKEYALGO_RSA ? "RSA" : "???")), pgpGrab(sigp->signid, 4), pgpGrab(sigp->signid+4, 4), @@ -475,7 +475,7 @@ int rpmtsOpenSDB(rpmts ts, int dbmode) if (rc) { const char * dn; dn = rpmGetPath(ts->rootDir, "%{_dbpath}", NULL); - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("cannot open Solve database in %s\n"), dn); dn = _free(dn); } @@ -614,7 +614,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) if (h != NULL && !rpmtsAddInstallElement(ts, h, (fnpyKey)str, 1, NULL)) { - rpmMessage(RPMMESS_DEBUG, _("Adding: %s\n"), str); + rpmlog(RPMMESS_DEBUG, _("Adding: %s\n"), str); rc = -1; /* XXX str memory leak */ break; @@ -626,7 +626,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) goto exit; } - rpmMessage(RPMMESS_DEBUG, _("Suggesting: %s\n"), str); + rpmlog(RPMMESS_DEBUG, _("Suggesting: %s\n"), str); /* If suggestion is already present, don't bother. */ if (ts->suggests != NULL && ts->nsuggests > 0) { if (bsearch(&str, ts->suggests, ts->nsuggests, @@ -1109,8 +1109,8 @@ int rpmtsInitDSI(const rpmts ts) if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_DISKSPACE) return 0; - rpmMessage(RPMMESS_DEBUG, _("mounted filesystems:\n")); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("mounted filesystems:\n")); + rpmlog(RPMMESS_DEBUG, _(" i dev bsize bavail iavail mount point\n")); rc = rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount); @@ -1167,7 +1167,7 @@ int rpmtsInitDSI(const rpmts ts) /* XXX Avoid FAT and other file systems that have not inodes. */ dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) ? sfb.f_ffree : -1; - rpmMessage(RPMMESS_DEBUG, _("%5d 0x%08x %8u %12ld %12ld %s\n"), + rpmlog(RPMMESS_DEBUG, _("%5d 0x%08x %8u %12ld %12ld %s\n"), i, (unsigned) dsi->dev, (unsigned) dsi->bsize, (signed long) dsi->bavail, (signed long) dsi->iavail, ts->filesystems[i]); @@ -1494,12 +1494,12 @@ rpmRC rpmtsScoreInit(rpmts runningTS, rpmts rollbackTS) rpmRC rc = RPMRC_OK; /* Assume success */ rpmtsScoreEntry se; - rpmMessage(RPMMESS_DEBUG, _("Creating transaction score board(%p, %p)\n"), + rpmlog(RPMMESS_DEBUG, _("Creating transaction score board(%p, %p)\n"), runningTS, rollbackTS); /* Allocate space for score board */ score = xcalloc(1, sizeof(*score)); - rpmMessage(RPMMESS_DEBUG, _("\tScore board address: %p\n"), score); + rpmlog(RPMMESS_DEBUG, _("\tScore board address: %p\n"), score); /* * Determine the maximum size needed for the entry list. @@ -1509,7 +1509,7 @@ rpmRC rpmtsScoreInit(rpmts runningTS, rpmts rollbackTS) * but for now it will work. */ tranElements = rpmtsNElements(runningTS); - rpmMessage(RPMMESS_DEBUG, _("\tAllocating space for %d entries\n"), tranElements); + rpmlog(RPMMESS_DEBUG, _("\tAllocating space for %d entries\n"), tranElements); score->scores = xcalloc(tranElements, sizeof(score->scores)); /* Initialize score entry count */ @@ -1536,10 +1536,10 @@ rpmRC rpmtsScoreInit(rpmts runningTS, rpmts rollbackTS) /* If we did not find the entry then allocate space for it */ if (!found) { /* XXX p->fi->te undefined. */ - rpmMessage(RPMMESS_DEBUG, _("\tAdding entry for %s to score board.\n"), + rpmlog(RPMMESS_DEBUG, _("\tAdding entry for %s to score board.\n"), rpmteN(p)); se = xcalloc(1, sizeof(*(*(score->scores)))); - rpmMessage(RPMMESS_DEBUG, _("\t\tEntry address: %p\n"), se); + rpmlog(RPMMESS_DEBUG, _("\t\tEntry address: %p\n"), se); se->N = xstrdup(rpmteN(p)); se->te_types = rpmteType(p); se->installed = 0; @@ -1550,7 +1550,7 @@ rpmRC rpmtsScoreInit(rpmts runningTS, rpmts rollbackTS) /* We found this one, so just add the element type to the one * already there. */ - rpmMessage(RPMMESS_DEBUG, _("\tUpdating entry for %s in score board.\n"), + rpmlog(RPMMESS_DEBUG, _("\tUpdating entry for %s in score board.\n"), rpmteN(p)); score->scores[i]->te_types |= rpmteType(p); } @@ -1575,7 +1575,7 @@ rpmtsScore rpmtsScoreFree(rpmtsScore score) rpmtsScoreEntry se = NULL; int i; - rpmMessage(RPMMESS_DEBUG, _("May free Score board(%p)\n"), score); + rpmlog(RPMMESS_DEBUG, _("May free Score board(%p)\n"), score); /* If score is not initialized, then just return. * This is likely the case if autorollbacks are not enabled. @@ -1590,7 +1590,7 @@ rpmtsScore rpmtsScoreFree(rpmtsScore score) */ if (score->nrefs > 0) return NULL; - rpmMessage(RPMMESS_DEBUG, _("\tRefcount is zero...will free\n")); + rpmlog(RPMMESS_DEBUG, _("\tRefcount is zero...will free\n")); /* No more references, lets clean up */ /* First deallocate the score entries */ for(i = 0; i < score->entries; i++) { @@ -1638,13 +1638,13 @@ rpmtsScoreEntry rpmtsScoreGetEntry(rpmtsScore score, const char *N) rpmtsScoreEntry se; rpmtsScoreEntry ret = NULL; /* Assume we don't find it */ - rpmMessage(RPMMESS_DEBUG, _("Looking in score board(%p) for %s\n"), score, N); + rpmlog(RPMMESS_DEBUG, _("Looking in score board(%p) for %s\n"), score, N); /* Try to find the entry in the score list */ for(i = 0; i < score->entries; i++) { se = score->scores[i]; if (strcmp(N, se->N) == 0) { - rpmMessage(RPMMESS_DEBUG, _("\tFound entry at address: %p\n"), se); + rpmlog(RPMMESS_DEBUG, _("\tFound entry at address: %p\n"), se); ret = se; break; } diff --git a/lib/signature.c b/lib/signature.c index 80b28fb..9c7fb95 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -113,11 +113,11 @@ static inline rpmRC printSize(FD_t fd, int siglen, int pad, int datalen) } else if (fstat(fdno, &st) < 0) return RPMRC_FAIL; - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Expected size: %12d = lead(%d)+sigs(%d)+pad(%d)+data(%d)\n"), (int)sizeof(struct rpmlead)+siglen+pad+datalen, (int)sizeof(struct rpmlead), siglen, pad, datalen); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _(" Actual size: %12d\n"), (int)st.st_size); return RPMRC_OK; @@ -319,7 +319,7 @@ int rpmWriteSignature(FD_t fd, Header sigh) if (Fwrite(buf, sizeof(buf[0]), pad, fd) != pad) rc = 1; } - rpmMessage(RPMMESS_DEBUG, _("Signature: size(%d)+pad(%d)\n"), sigSize, pad); + rpmlog(RPMMESS_DEBUG, _("Signature: size(%d)+pad(%d)\n"), sigSize, pad); return rc; } @@ -431,7 +431,7 @@ static int makePGPSignature(const char * file, int_32 * sigTagp, } *pktlenp = st.st_size; - rpmMessage(RPMMESS_DEBUG, _("PGP sig size: %d\n"), *pktlenp); + rpmlog(RPMMESS_DEBUG, _("PGP sig size: %d\n"), *pktlenp); *pktp = xmalloc(*pktlenp); { FD_t fd; @@ -450,7 +450,7 @@ static int makePGPSignature(const char * file, int_32 * sigTagp, } } - rpmMessage(RPMMESS_DEBUG, _("Got %d bytes of PGP sig\n"), *pktlenp); + rpmlog(RPMMESS_DEBUG, _("Got %d bytes of PGP sig\n"), *pktlenp); #ifdef NOTYET /* Parse the signature, change signature tag as appropriate. */ @@ -543,7 +543,7 @@ static int makeGPGSignature(const char * file, int_32 * sigTagp, } *pktlenp = st.st_size; - rpmMessage(RPMMESS_DEBUG, _("GPG sig size: %d\n"), *pktlenp); + rpmlog(RPMMESS_DEBUG, _("GPG sig size: %d\n"), *pktlenp); *pktp = xmalloc(*pktlenp); { FD_t fd; @@ -562,7 +562,7 @@ static int makeGPGSignature(const char * file, int_32 * sigTagp, } } - rpmMessage(RPMMESS_DEBUG, _("Got %d bytes of GPG sig\n"), *pktlenp); + rpmlog(RPMMESS_DEBUG, _("Got %d bytes of GPG sig\n"), *pktlenp); /* Parse the signature, change signature tag as appropriate. */ dig = pgpNewDig(); diff --git a/lib/transaction.c b/lib/transaction.c index 4d32fe8..36182d5 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -861,7 +861,7 @@ static void skipFiles(const rpmts ts, rpmfi fi) continue; if (strncmp(fbn, bn, bnlen)) continue; - rpmMessage(RPMMESS_DEBUG, _("excluding directory %s\n"), dn); + rpmlog(RPMMESS_DEBUG, _("excluding directory %s\n"), dn); fi->actions[i] = FA_SKIPNSTATE; break; } @@ -935,8 +935,8 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction) } tsi = rpmtsiFree(tsi); - rpmMessage(RPMMESS_NORMAL, _("Transaction failed...rolling back\n")); - rpmMessage(RPMMESS_NORMAL, + rpmlog(RPMMESS_NORMAL, _("Transaction failed...rolling back\n")); + rpmlog(RPMMESS_NORMAL, _("Rollback packages (+%d/-%d) to %-24.24s (0x%08x):\n"), numAdded, numRemoved, ctime((time_t*) &tid), tid); @@ -944,7 +944,7 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction) rc = rpmtsCheck(rollbackTransaction); ps = rpmtsProblems(rollbackTransaction); if (rc != 0 && rpmpsNumProblems(ps) > 0) { - rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed dependencies:\n")); rpmpsPrint(NULL, ps); ps = rpmpsFree(ps); return -1; @@ -954,7 +954,7 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction) /* Order the transaction */ rc = rpmtsOrder(rollbackTransaction); if (rc != 0) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("Could not order auto-rollback transaction!\n")); return -1; } @@ -988,13 +988,13 @@ static rpmRC _rpmtsRollback(rpmts rollbackTransaction) */ tsi = rpmtsiInit(rollbackTransaction); while((te = rpmtsiNext(tsi, 0)) != NULL) { - rpmMessage(RPMMESS_NORMAL, _("Cleaning up repackaged packages:\n")); + rpmlog(RPMMESS_NORMAL, _("Cleaning up repackaged packages:\n")); switch (rpmteType(te)) { /* The install elements are repackaged packages */ case TR_ADDED: /* Make sure the filename is still there. XXX: Can't happen */ if(te->key) { - rpmMessage(RPMMESS_NORMAL, _("\tRemoving %s:\n"), te->key); + rpmlog(RPMMESS_NORMAL, _("\tRemoving %s:\n"), te->key); (void) unlink(te->key); /* XXX: Should check for an error? */ } break; @@ -1041,7 +1041,7 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, int rc = RPMRC_NOTFOUND; /* Assume we do not find it*/ int xx; - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Getting repackaged header from transaction element\n")); /* Set header pointer to null if its not already */ @@ -1067,15 +1067,15 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, xx = snprintf(rp, nb, "%s/%s%s.rpm", _repackage_dir, name, globStr); /* Get the index of possible repackaged packages */ - rpmMessage(RPMMESS_DEBUG, _("\tLooking for %s...\n"), rp); + rpmlog(RPMMESS_DEBUG, _("\tLooking for %s...\n"), rp); rtids = IDTXglob(ts, rp, RPMTAG_REMOVETID); rp = _free(rp); if (rtids != NULL) { - rpmMessage(RPMMESS_DEBUG, _("\tMatches found.\n")); + rpmlog(RPMMESS_DEBUG, _("\tMatches found.\n")); rpIDT = rtids->idt; nrids = rtids->nidt; } else { - rpmMessage(RPMMESS_DEBUG, _("\tNo matches found.\n")); + rpmlog(RPMMESS_DEBUG, _("\tNo matches found.\n")); goto exit; } @@ -1087,7 +1087,7 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, * get out of here...the repackaged package was not found. */ if (rpIDT == NULL) { - rpmMessage(RPMMESS_DEBUG, _("\tRepackaged package not found!.\n")); + rpmlog(RPMMESS_DEBUG, _("\tRepackaged package not found!.\n")); break; } @@ -1108,9 +1108,9 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, * would be found. * XXX: Should Match NAC! */ - rpmMessage(RPMMESS_DEBUG, _("\tREMOVETID matched INSTALLTID.\n")); + rpmlog(RPMMESS_DEBUG, _("\tREMOVETID matched INSTALLTID.\n")); if (headerGetEntry(rpIDT->h, RPMTAG_NAME, NULL, (void **) &rpname, NULL)) { - rpmMessage(RPMMESS_DEBUG, _("\t\tName: %s.\n"), rpname); + rpmlog(RPMMESS_DEBUG, _("\t\tName: %s.\n"), rpname); if (!strcmp(name,rpname)) { /* It matched we have a canidate */ h = headerLink(rpIDT->h); @@ -1132,7 +1132,7 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, exit: if (rc != RPMRC_NOTFOUND && h != NULL && hdrp != NULL) { - rpmMessage(RPMMESS_DEBUG, _("\tRepackaged Package was %s...\n"), rp); + rpmlog(RPMMESS_DEBUG, _("\tRepackaged Package was %s...\n"), rp); if (hdrp != NULL) *hdrp = headerLink(h); if (fnp != NULL) @@ -1170,7 +1170,7 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, case TR_ADDED: { rpmdbMatchIterator mi; - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Adding install element to auto-rollback transaction.\n")); /* Get the header for this package from the database @@ -1179,7 +1179,7 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, db_instance = rpmteDBInstance(te); if (db_instance == 0) { /* Could not get the db instance: WTD! */ - rpmMessage(RPMMESS_FATALERROR, + rpmlog(RPMMESS_FATALERROR, _("Could not get install element database instance!\n")); break; } @@ -1192,7 +1192,7 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, mi = rpmdbFreeIterator(mi); if (h == NULL) { /* Header was not there??? */ - rpmMessage(RPMMESS_FATALERROR, + rpmlog(RPMMESS_FATALERROR, _("Could not get header for auto-rollback transaction!\n")); break; } @@ -1202,9 +1202,9 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, switch(rc) { case RPMRC_OK: /* Add the install element, as we had a repackaged package */ - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("\tAdded repackaged package header: %s.\n"), rpn); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("\tAdded from install element %s.\n"), rpmteNEVRA(te)); rc = rpmtsAddInstallElement(rollbackTransaction, headerLink(rph), (fnpyKey) rpn, 1, te->relocs); @@ -1214,22 +1214,22 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, /* Add the header as an erase element, we did not * have a repackaged package */ - rpmMessage(RPMMESS_DEBUG, _("\tAdded erase element.\n")); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("\tAdded erase element.\n")); + rpmlog(RPMMESS_DEBUG, _("\tAdded from install element %s.\n"), rpmteNEVRA(te)); rc = rpmtsAddEraseElement(rollbackTransaction, h, db_instance); break; default: /* Not sure what to do on failure...just give up */ - rpmMessage(RPMMESS_FATALERROR, + rpmlog(RPMMESS_FATALERROR, _("Could not get repackaged header for auto-rollback transaction!\n")); break; } } break; case TR_REMOVED: - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Add erase element to auto-rollback transaction.\n")); /* See if this element has already been added. * If so we want to do nothing. Compare N's for match. @@ -1238,8 +1238,8 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, pi = rpmtsiInit(rollbackTransaction); while ((p = rpmtsiNext(pi, 0)) != NULL) { if (!strcmp(rpmteN(p), rpmteN(te))) { - rpmMessage(RPMMESS_DEBUG, _("\tFound existing upgrade element.\n")); - rpmMessage(RPMMESS_DEBUG, _("\tNot adding erase element for %s.\n"), + rpmlog(RPMMESS_DEBUG, _("\tFound existing upgrade element.\n")); + rpmlog(RPMMESS_DEBUG, _("\tNot adding erase element for %s.\n"), rpmteN(te)); rc = RPMRC_OK; pi = rpmtsiFree(pi); @@ -1255,26 +1255,26 @@ static rpmRC _rpmtsAddRollbackElement(rpmts rollbackTransaction, switch(rc) { case RPMRC_OK: /* Add the install element */ - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("\tAdded repackaged package %s.\n"), rpn); - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("\tAdded from erase element %s.\n"), rpmteNEVRA(te)); rc = rpmtsAddInstallElement(rollbackTransaction, rph, (fnpyKey) rpn, 1, te->relocs); if (rc != RPMRC_OK) - rpmMessage(RPMMESS_FATALERROR, + rpmlog(RPMMESS_FATALERROR, _("Could not add erase element to auto-rollback transaction.\n")); break; case RPMRC_NOTFOUND: /* Just did not have a repackaged package */ - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("\tNo repackaged package...nothing to do.\n")); rc = RPMRC_OK; break; default: - rpmMessage(RPMMESS_FATALERROR, + rpmlog(RPMMESS_FATALERROR, _("Failure reading repackaged package!\n")); break; } @@ -1409,7 +1409,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) * - count files. */ -rpmMessage(RPMMESS_DEBUG, _("sanity checking %d elements\n"), rpmtsNElements(ts)); +rpmlog(RPMMESS_DEBUG, _("sanity checking %d elements\n"), rpmtsNElements(ts)); ps = rpmtsProblems(ts); /* The ordering doesn't matter here */ pi = rpmtsiInit(ts); @@ -1495,7 +1495,7 @@ rpmMessage(RPMMESS_DEBUG, _("sanity checking %d elements\n"), rpmtsNElements(ts) if (!((rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_TEST)) || (rpmpsNumProblems(ts->probs) && (okProbs == NULL || rpmpsTrim(ts->probs, okProbs))))) { - rpmMessage(RPMMESS_DEBUG, _("running pre-transaction scripts\n")); + rpmlog(RPMMESS_DEBUG, _("running pre-transaction scripts\n")); pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { if ((fi = rpmtsiFi(pi)) == NULL) @@ -1562,7 +1562,7 @@ assert(psm != NULL); * calling fpLookupList only once. I'm not sure that the speedup is * worth the trouble though. */ -rpmMessage(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount); +rpmlog(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount); numAdded = numRemoved = 0; pi = rpmtsiInit(ts); @@ -1638,7 +1638,7 @@ rpmMessage(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount) /* =============================================== * Compute file disposition for each package in transaction set. */ -rpmMessage(RPMMESS_DEBUG, _("computing file dispositions\n")); +rpmlog(RPMMESS_DEBUG, _("computing file dispositions\n")); ps = rpmtsProblems(ts); pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, 0)) != NULL) { @@ -1826,7 +1826,7 @@ rpmMessage(RPMMESS_DEBUG, _("computing file dispositions\n")); rpmVSFlags ovsflags; rpmVSFlags vsflags; - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("Creating auto-rollback transaction\n")); rollbackTransaction = rpmtsCreate(); @@ -1943,7 +1943,7 @@ assert(psm != NULL); pkgKey = rpmteAddedKey(p); - rpmMessage(RPMMESS_DEBUG, "========== +++ %s %s-%s 0x%x\n", + rpmlog(RPMMESS_DEBUG, "========== +++ %s %s-%s 0x%x\n", rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); p->h = NULL; @@ -1974,7 +1974,7 @@ assert(psm != NULL); /* If we should rollback this transaction on failure, lets do it. */ if (rollbackOnFailure) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("Add failed. Could not read package header.\n")); /* Clean up the current transaction */ p->h = headerFree(p->h); @@ -2056,7 +2056,7 @@ assert(psm != NULL); /* If we should rollback this transaction on failure, lets do it. */ if (rollbackOnFailure) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("Add failed in rpmpsmStage().\n")); /* Clean up the current transaction */ p->h = headerFree(p->h); @@ -2100,7 +2100,7 @@ assert(psm != NULL); * on failure, lets do it. */ if (rollbackOnFailure) { - rpmMessage(RPMMESS_ERROR, _("Add failed. Could not get file list.\n")); + rpmlog(RPMMESS_ERROR, _("Add failed. Could not get file list.\n")); /* Clean up the current transaction */ p->h = headerFree(p->h); xx = rpmdbSync(rpmtsGetRdb(ts)); @@ -2130,7 +2130,7 @@ assert(psm != NULL); case TR_REMOVED: (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_ERASE), 0); - rpmMessage(RPMMESS_DEBUG, "========== --- %s %s-%s 0x%x\n", + rpmlog(RPMMESS_DEBUG, "========== --- %s %s-%s 0x%x\n", rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); /* @@ -2145,7 +2145,7 @@ assert(psm != NULL); * on failure, lets do it. */ if (rollbackOnFailure) { - rpmMessage(RPMMESS_ERROR, + rpmlog(RPMMESS_ERROR, _("Erase failed failed in rpmpsmStage().\n")); /* Clean up the current transaction */ xx = rpmdbSync(rpmtsGetRdb(ts)); @@ -2204,7 +2204,7 @@ assert(psm != NULL); rollbackTransaction = rpmtsFree(rollbackTransaction); if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)) { - rpmMessage(RPMMESS_DEBUG, _("running post-transaction scripts\n")); + rpmlog(RPMMESS_DEBUG, _("running post-transaction scripts\n")); pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { int haspostscript; diff --git a/lib/verify.c b/lib/verify.c index 9f7ffcf..99ead01 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -332,7 +332,7 @@ static int verifyHeader(QVA_t qva, const rpmts ts, rpmfi fi) if (te > t) { *te++ = '\n'; *te = '\0'; - rpmMessage(RPMMESS_NORMAL, "%s", t); + rpmlog(RPMMESS_NORMAL, "%s", t); te = t = buf; *t = '\0'; } @@ -392,7 +392,7 @@ static int verifyDependencies(QVA_t qva, rpmts ts, if (te > t) { *te++ = '\n'; *te = '\0'; - rpmMessage(RPMMESS_NORMAL, "%s", t); + rpmlog(RPMMESS_NORMAL, "%s", t); te = t; *t = '\0'; } diff --git a/rpmdb/db3.c b/rpmdb/db3.c index 3f82994..af28667 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -171,7 +171,7 @@ static int db_fini(dbiIndex dbi, const char * dbhome, rc = cvtdberr(dbi, "dbenv->close", rc, _debug); if (dbfile) - rpmMessage(RPMMESS_DEBUG, _("closed db environment %s/%s\n"), + rpmlog(RPMMESS_DEBUG, _("closed db environment %s/%s\n"), dbhome, dbfile); if (rpmdb->db_remove_env) { @@ -183,7 +183,7 @@ static int db_fini(dbiIndex dbi, const char * dbhome, xx = cvtdberr(dbi, "dbenv->remove", xx, _debug); if (dbfile) - rpmMessage(RPMMESS_DEBUG, _("removed db environment %s/%s\n"), + rpmlog(RPMMESS_DEBUG, _("removed db environment %s/%s\n"), dbhome, dbfile); } @@ -238,7 +238,7 @@ static int db_init(dbiIndex dbi, const char * dbhome, if (eflags & DB_JOINENV) eflags &= DB_JOINENV; if (dbfile) - rpmMessage(RPMMESS_DEBUG, _("opening db environment %s/%s %s\n"), + rpmlog(RPMMESS_DEBUG, _("opening db environment %s/%s %s\n"), dbhome, dbfile, prDbiOpenFlags(eflags, 1)); /* XXX Can't do RPC w/o host. */ @@ -677,7 +677,7 @@ static int db3close(dbiIndex dbi, unsigned int flags) rc = cvtdberr(dbi, "db->close", rc, _printit); db = dbi->dbi_db = NULL; - rpmMessage(RPMMESS_DEBUG, _("closed db index %s/%s\n"), + rpmlog(RPMMESS_DEBUG, _("closed db index %s/%s\n"), dbhome, (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag))); } @@ -734,7 +734,7 @@ static int db3close(dbiIndex dbi, unsigned int flags) rc = db->verify(db, dbf, NULL, NULL, flags); rc = cvtdberr(dbi, "db->verify", rc, _debug); - rpmMessage(RPMMESS_DEBUG, _("verified db index %s/%s\n"), + rpmlog(RPMMESS_DEBUG, _("verified db index %s/%s\n"), (dbhome ? dbhome : ""), (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag))); @@ -945,7 +945,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) } } - rpmMessage(RPMMESS_DEBUG, _("opening db index %s/%s %s mode=0x%x\n"), + rpmlog(RPMMESS_DEBUG, _("opening db index %s/%s %s mode=0x%x\n"), dbhome, (dbfile ? dbfile : rpmTagGetName(dbi->dbi_rpmtag)), prDbiOpenFlags(oflags, 0), dbi->dbi_mode); @@ -1162,7 +1162,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip) ? _("exclusive") : _("shared")), dbhome, (dbfile ? dbfile : "")); } else if (dbfile) { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("locked db index %s/%s\n"), dbhome, dbfile); } diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 670ec53..bd69873 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -170,7 +170,7 @@ static void dbiTagsInit(void) *oe++ = '\0'; rpmtag = rpmTagGetValue(o); if (rpmtag < 0) { - rpmMessage(RPMMESS_WARNING, + rpmlog(RPMMESS_WARNING, _("dbiTagsInit: unrecognized tag name: \"%s\" ignored\n"), o); continue; } @@ -234,7 +234,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags) default: _dbapi = _dbapi_wanted; if (_dbapi < 0 || _dbapi >= 5 || mydbvecs[_dbapi] == NULL) { - rpmMessage(RPMMESS_DEBUG, "dbiOpen: _dbiapi failed\n"); + rpmlog(RPMMESS_DEBUG, "dbiOpen: _dbiapi failed\n"); return NULL; } errno = 0; @@ -653,7 +653,7 @@ int rpmdbCheckSignals(void) { if (rpmdbCheckTerminate(0)) { /* sigset_t is abstract type */ - rpmMessage(RPMMESS_DEBUG, "Exiting on signal(0x%lx) ...\n", *((unsigned long *)&rpmsqCaught)); + rpmlog(RPMMESS_DEBUG, "Exiting on signal(0x%lx) ...\n", *((unsigned long *)&rpmsqCaught)); exit(EXIT_FAILURE); } return 0; @@ -1486,7 +1486,7 @@ static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi) rpmrc = (*mi->mi_hdrchk) (mi->mi_ts, data->data, data->size, &msg); lvl = (rpmrc == RPMRC_FAIL ? RPMMESS_ERROR : RPMMESS_DEBUG); - rpmMessage(lvl, "%s h#%8u %s", + rpmlog(lvl, "%s h#%8u %s", (rpmrc == RPMRC_FAIL ? _("miFreeHeader: skipping") : "write"), mi->mi_prevoffset, (msg ? msg : "\n")); msg = _free(msg); @@ -2112,7 +2112,7 @@ if (dbiByteSwapped(dbi) == 1) rpmrc = (*mi->mi_hdrchk) (mi->mi_ts, uh, uhlen, &msg); lvl = (rpmrc == RPMRC_FAIL ? RPMMESS_ERROR : RPMMESS_DEBUG); - rpmMessage(lvl, "%s h#%8u %s", + rpmlog(lvl, "%s h#%8u %s", (rpmrc == RPMRC_FAIL ? _("rpmdbNextIterator: skipping") : " read"), mi->mi_offset, (msg ? msg : "\n")); msg = _free(msg); @@ -2451,7 +2451,7 @@ memset(data, 0, sizeof(*data)); { const char *n, *v, *r; (void) headerNVR(h, &n, &v, &r); - rpmMessage(RPMMESS_DEBUG, " --- h#%8u %s-%s-%s\n", hdrNum, n, v, r); + rpmlog(RPMMESS_DEBUG, " --- h#%8u %s-%s-%s\n", hdrNum, n, v, r); } (void) blockSignals(db, &signalMask); @@ -2600,11 +2600,11 @@ if (dbiByteSwapped(dbi) == 1) if (!printed) { if (rpmcnt == 1 && stringvalued) { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("removing \"%s\" from %s index.\n"), (char *)key->data, rpmTagGetName(dbi->dbi_rpmtag)); } else { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("removing %d entries from %s index.\n"), rpmcnt, rpmTagGetName(dbi->dbi_rpmtag)); } @@ -2866,7 +2866,7 @@ data->size = headerSizeof(h, HEADER_MAGIC_NO); rpmrc = (*hdrchk) (ts, data->data, data->size, &msg); lvl = (rpmrc == RPMRC_FAIL ? RPMMESS_ERROR : RPMMESS_DEBUG); - rpmMessage(lvl, "%s h#%8u %s", + rpmlog(lvl, "%s h#%8u %s", (rpmrc == RPMRC_FAIL ? _("rpmdbAdd: skipping") : " +++"), hdrNum, (msg ? msg : "\n")); msg = _free(msg); @@ -3022,11 +3022,11 @@ data->size = 0; if (!printed) { if (rpmcnt == 1 && stringvalued) { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("adding \"%s\" to %s index.\n"), (char *)key->data, rpmTagGetName(dbi->dbi_rpmtag)); } else { - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("adding %d entries to %s index.\n"), rpmcnt, rpmTagGetName(dbi->dbi_rpmtag)); } @@ -3418,7 +3418,7 @@ static int rpmdbMoveDatabase(const char * prefix, const char * mdb1 = "/etc/rpm/macros.db1"; struct stat st; if (!stat(mdb1, &st) && S_ISREG(st.st_mode) && !unlink(mdb1)) - rpmMessage(RPMMESS_DEBUG, + rpmlog(RPMMESS_DEBUG, _("removing %s after successful db3 rebuild.\n"), mdb1); } #endif @@ -3450,7 +3450,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, tfn = rpmGetPath("%{?_dbpath}", NULL); if (!(tfn && tfn[0] != '\0')) { - rpmMessage(RPMMESS_DEBUG, _("no dbpath has been set")); + rpmlog(RPMMESS_DEBUG, _("no dbpath has been set")); rc = 1; goto exit; } @@ -3476,7 +3476,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, newdbpath += strlen(prefix) - 1; tfn = _free(tfn); - rpmMessage(RPMMESS_DEBUG, _("rebuilding database %s into %s\n"), + rpmlog(RPMMESS_DEBUG, _("rebuilding database %s into %s\n"), rootdbpath, newrootdbpath); if (!access(newrootdbpath, F_OK)) { @@ -3486,7 +3486,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, goto exit; } - rpmMessage(RPMMESS_DEBUG, _("creating directory %s\n"), newrootdbpath); + rpmlog(RPMMESS_DEBUG, _("creating directory %s\n"), newrootdbpath); if (Mkdir(newrootdbpath, 0755)) { rpmlog(RPMERR_MKDIR, _("creating directory %s: %s\n"), newrootdbpath, strerror(errno)); @@ -3497,7 +3497,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, _rebuildinprogress = 0; - rpmMessage(RPMMESS_DEBUG, _("opening old database with dbapi %d\n"), + rpmlog(RPMMESS_DEBUG, _("opening old database with dbapi %d\n"), _dbapi); if (openDatabase(prefix, dbpath, _dbapi, &olddb, O_RDONLY, 0644, RPMDB_FLAG_MINIMAL)) { @@ -3506,7 +3506,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, } _dbapi = olddb->db_api; _rebuildinprogress = 1; - rpmMessage(RPMMESS_DEBUG, _("opening new database with dbapi %d\n"), + rpmlog(RPMMESS_DEBUG, _("opening new database with dbapi %d\n"), _dbapi_rebuild); (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1); if (openDatabase(prefix, newdbpath, _dbapi_rebuild, &newdb, O_RDWR | O_CREAT, 0644, 0)) { @@ -3587,7 +3587,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, xx = rpmdbClose(newdb); if (failed) { - rpmMessage(RPMMESS_NORMAL, _("failed to rebuild database: original database " + rpmlog(RPMMESS_NORMAL, _("failed to rebuild database: original database " "remains in place\n")); xx = rpmdbRemoveDatabase(prefix, newdbpath, _dbapi_rebuild); @@ -3595,9 +3595,9 @@ int rpmdbRebuild(const char * prefix, rpmts ts, goto exit; } else if (!nocleanup) { if (rpmdbMoveDatabase(prefix, newdbpath, _dbapi_rebuild, dbpath, _dbapi)) { - rpmMessage(RPMMESS_ERROR, _("failed to replace old database with new " + rpmlog(RPMMESS_ERROR, _("failed to replace old database with new " "database!\n")); - rpmMessage(RPMMESS_ERROR, _("replace files in %s with files from %s " + rpmlog(RPMMESS_ERROR, _("replace files in %s with files from %s " "to recover"), dbpath, newdbpath); rc = 1; goto exit; @@ -3607,9 +3607,9 @@ int rpmdbRebuild(const char * prefix, rpmts ts, exit: if (removedir && !(rc == 0 && nocleanup)) { - rpmMessage(RPMMESS_DEBUG, _("removing directory %s\n"), newrootdbpath); + rpmlog(RPMMESS_DEBUG, _("removing directory %s\n"), newrootdbpath); if (Rmdir(newrootdbpath)) - rpmMessage(RPMMESS_ERROR, _("failed to remove directory %s: %s\n"), + rpmlog(RPMMESS_ERROR, _("failed to remove directory %s: %s\n"), newrootdbpath, strerror(errno)); } newrootdbpath = _free(newrootdbpath); diff --git a/rpmdb/sqlite.c b/rpmdb/sqlite.c index b57278a..64c5107 100644 --- a/rpmdb/sqlite.c +++ b/rpmdb/sqlite.c @@ -241,9 +241,9 @@ dbg_scp(scp); } if (scp->pStmt) { xx = sqlite3_reset(scp->pStmt); - if (xx) rpmMessage(RPMMESS_WARNING, "reset %d\n", xx); + if (xx) rpmlog(RPMMESS_WARNING, "reset %d\n", xx); xx = sqlite3_finalize(scp->pStmt); - if (xx) rpmMessage(RPMMESS_WARNING, "finalize %d\n", xx); + if (xx) rpmlog(RPMMESS_WARNING, "finalize %d\n", xx); scp->pStmt = NULL; } @@ -591,7 +591,7 @@ static int sql_busy_handler(void * dbi_void, int time) { dbiIndex dbi = (dbiIndex) dbi_void; - rpmMessage(RPMMESS_WARNING, _("Unable to get lock on db %s, retrying... (%d)\n"), + rpmlog(RPMMESS_WARNING, _("Unable to get lock on db %s, retrying... (%d)\n"), dbi->dbi_file, time); (void) sleep(1); @@ -679,7 +679,7 @@ fprintf(stderr, "\t%s(%d) type(%d) keytype %s\n", rpmTagGetName(dbi->dbi_rpmtag) exit: if (rc) - rpmMessage(RPMMESS_WARNING, "Unable to initDB %s (%d)\n", + rpmlog(RPMMESS_WARNING, "Unable to initDB %s (%d)\n", scp->pzErrmsg, rc); scp = scpFree(scp); @@ -742,7 +742,7 @@ enterChroot(dbi); (void) sqlite3_close(sqldb->db); - rpmMessage(RPMMESS_DEBUG, _("closed sql db %s\n"), + rpmlog(RPMMESS_DEBUG, _("closed sql db %s\n"), dbi->dbi_subfile); dbi->dbi_stats = _free(dbi->dbi_stats); @@ -832,7 +832,7 @@ enterChroot(dbi); dbfname = rpmGenPath(dbhome, dbi->dbi_file, NULL); - rpmMessage(RPMMESS_DEBUG, _("opening sql db %s (%s) mode=0x%x\n"), + rpmlog(RPMMESS_DEBUG, _("opening sql db %s (%s) mode=0x%x\n"), dbfname, dbi->dbi_subfile, dbi->dbi_mode); /* Open the Database */ @@ -851,7 +851,7 @@ enterChroot(dbi); dbi->dbi_db = (DB *)sqldb; if (sql_errcode != NULL) { - rpmMessage(RPMMESS_DEBUG, "Unable to open database: %s\n", sql_errcode); + rpmlog(RPMMESS_DEBUG, "Unable to open database: %s\n", sql_errcode); rc = EINVAL; } @@ -948,14 +948,14 @@ enterChroot(dbi); dbi->dbi_subfile); rc = sqlite3_prepare(sqldb->db, scp->cmd, strlen(scp->cmd), &scp->pStmt, &scp->pzErrmsg); - if (rc) rpmMessage(RPMMESS_WARNING, "cdel(%s) prepare %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cdel(%s) prepare %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_bind_key(dbi, scp, 1, key); - if (rc) rpmMessage(RPMMESS_WARNING, "cdel(%s) bind key %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cdel(%s) bind key %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_bind_data(dbi, scp, 2, data); - if (rc) rpmMessage(RPMMESS_WARNING, "cdel(%s) bind data %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cdel(%s) bind data %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_step(dbi, scp); - if (rc) rpmMessage(RPMMESS_WARNING, "cdel(%s) sql_step rc %d\n", dbi->dbi_subfile, rc); + if (rc) rpmlog(RPMMESS_WARNING, "cdel(%s) sql_step rc %d\n", dbi->dbi_subfile, rc); scp = scpFree(scp); @@ -1023,10 +1023,10 @@ assert(dbi->dbi_rpmtag == RPMDBI_PACKAGES); break; } rc = sqlite3_prepare(sqldb->db, scp->cmd, strlen(scp->cmd), &scp->pStmt, &scp->pzErrmsg); - if (rc) rpmMessage(RPMMESS_WARNING, "cget(%s) sequential prepare %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cget(%s) sequential prepare %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_step(dbi, scp); - if (rc) rpmMessage(RPMMESS_WARNING, "cget(%s) sequential sql_step rc %d\n", dbi->dbi_subfile, rc); + if (rc) rpmlog(RPMMESS_WARNING, "cget(%s) sequential sql_step rc %d\n", dbi->dbi_subfile, rc); scp = scpResetKeys(scp); scp->nkeys = scp->nr; @@ -1056,7 +1056,7 @@ assert(dbi->dbi_rpmtag == RPMDBI_PACKAGES); scp->cmd = sqlite3_mprintf("SELECT value FROM '%q' WHERE key=?;", dbi->dbi_subfile); rc = sqlite3_prepare(sqldb->db, scp->cmd, strlen(scp->cmd), &scp->pStmt, &scp->pzErrmsg); - if (rc) rpmMessage(RPMMESS_WARNING, "cget(%s) prepare %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cget(%s) prepare %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); } scp = scpResetAv(scp); /* Free av and avlen, reset counters.*/ @@ -1070,13 +1070,13 @@ assert(dbi->dbi_rpmtag == RPMDBI_PACKAGES); /* Bind key to prepared statement */ rc = sql_bind_key(dbi, scp, 1, scp->keys[scp->rx]); - if (rc) rpmMessage(RPMMESS_WARNING, "cget(%s) key bind %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cget(%s) key bind %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_step(dbi, scp); - if (rc) rpmMessage(RPMMESS_WARNING, "cget(%s) sql_step rc %d\n", dbi->dbi_subfile, rc); + if (rc) rpmlog(RPMMESS_WARNING, "cget(%s) sql_step rc %d\n", dbi->dbi_subfile, rc); rc = sqlite3_reset(scp->pStmt); - if (rc) rpmMessage(RPMMESS_WARNING, "reset %d\n", rc); + if (rc) rpmlog(RPMMESS_WARNING, "reset %d\n", rc); /* 1 key should return 0 or 1 row/value */ assert(scp->nr < 2); @@ -1166,14 +1166,14 @@ enterChroot(dbi); scp->cmd = sqlite3_mprintf("INSERT OR REPLACE INTO '%q' VALUES(?, ?);", dbi->dbi_subfile); rc = sqlite3_prepare(sqldb->db, scp->cmd, strlen(scp->cmd), &scp->pStmt, &scp->pzErrmsg); - if (rc) rpmMessage(RPMMESS_WARNING, "cput(%s) prepare %s (%d)\n",dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cput(%s) prepare %s (%d)\n",dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_bind_key(dbi, scp, 1, key); - if (rc) rpmMessage(RPMMESS_WARNING, "cput(%s) key bind %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cput(%s) key bind %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_bind_data(dbi, scp, 2, data); - if (rc) rpmMessage(RPMMESS_WARNING, "cput(%s) data bind %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); + if (rc) rpmlog(RPMMESS_WARNING, "cput(%s) data bind %s (%d)\n", dbi->dbi_subfile, sqlite3_errmsg(sqldb->db), rc); rc = sql_step(dbi, scp); - if (rc) rpmMessage(RPMMESS_WARNING, "cput(%s) sql_step rc %d\n", dbi->dbi_subfile, rc); + if (rc) rpmlog(RPMMESS_WARNING, "cput(%s) sql_step rc %d\n", dbi->dbi_subfile, rc); break; } @@ -1213,10 +1213,10 @@ assert(scp->av != NULL); } else { if ( sql_rc ) { - rpmMessage(RPMMESS_DEBUG, "db_info failed %s (%d)\n", + rpmlog(RPMMESS_DEBUG, "db_info failed %s (%d)\n", scp->pzErrmsg, sql_rc); } - rpmMessage(RPMMESS_WARNING, "Unable to determine DB endian.\n"); + rpmlog(RPMMESS_WARNING, "Unable to determine DB endian.\n"); } scp = scpFree(scp); @@ -1344,11 +1344,11 @@ enterChroot(dbi); assert(scp->av != NULL); nkeys = strtol(scp->av[1], NULL, 10); - rpmMessage(RPMMESS_DEBUG, " stat on %s nkeys %ld\n", + rpmlog(RPMMESS_DEBUG, " stat on %s nkeys %ld\n", dbi->dbi_subfile, nkeys); } else { if ( rc ) { - rpmMessage(RPMMESS_DEBUG, "stat failed %s (%d)\n", + rpmlog(RPMMESS_DEBUG, "stat failed %s (%d)\n", scp->pzErrmsg, rc); } } diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 82f3066..1f7fa55 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -1730,7 +1730,7 @@ int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid) } rc = 0; if (created) - rpmMessage(RPMMESS_DEBUG, "created directory(s) %s mode 0%o\n", + rpmlog(RPMMESS_DEBUG, "created directory(s) %s mode 0%o\n", path, mode); return rc; } diff --git a/rpmio/url.c b/rpmio/url.c index 1cc8455..baa10b2 100644 --- a/rpmio/url.c +++ b/rpmio/url.c @@ -209,7 +209,7 @@ int urlSplit(const char * url, urlinfo *uret) char *end; u->port = strtol(u->portstr, &end, 0); if (!(end && *end == '\0')) { - rpmMessage(RPMMESS_ERROR, _("url port must be a number\n")); + rpmlog(RPMMESS_ERROR, _("url port must be a number\n")); myurl = _free(myurl); u = urlFree(u); return -1; @@ -254,7 +254,7 @@ int urlGetFile(const char * url, const char * dest) sfd = Fopen(url, "r.ufdio"); if (sfd == NULL || Ferror(sfd)) { - rpmMessage(RPMMESS_DEBUG, _("failed to open %s: %s\n"), url, Fstrerror(sfd)); + rpmlog(RPMMESS_DEBUG, _("failed to open %s: %s\n"), url, Fstrerror(sfd)); rc = FTPERR_UNKNOWN; goto exit; } @@ -274,7 +274,7 @@ if (_url_debug) fprintf(stderr, "*** urlGetFile sfd %p %s tfd %p %s\n", sfd, url, (tfd ? tfd : NULL), dest); if (tfd == NULL || Ferror(tfd)) { /* XXX Fstrerror */ - rpmMessage(RPMMESS_DEBUG, _("failed to create %s: %s\n"), dest, Fstrerror(tfd)); + rpmlog(RPMMESS_DEBUG, _("failed to create %s: %s\n"), dest, Fstrerror(tfd)); rc = FTPERR_UNKNOWN; goto exit; } diff --git a/tools/rpmcache.c b/tools/rpmcache.c index 86c03af..3a8d92d 100644 --- a/tools/rpmcache.c +++ b/tools/rpmcache.c @@ -187,7 +187,7 @@ static int ftsStashLatest(FTSENT * fts, rpmts ts) int ec = -1; /* assume not found */ int i = 0; - rpmMessage(RPMMESS_DEBUG, "============== %s\n", fts->fts_accpath); + rpmlog(RPMMESS_DEBUG, "============== %s\n", fts->fts_accpath); /* Read header from file. */ { FD_t fd = Fopen(fts->fts_accpath, "r"); @@ -502,7 +502,7 @@ static void initGlobs(rpmts ts, const char ** argv) bhglobs[i].patterns[0] = pattern; bhglobs[i].fnflags = (FNM_PATHNAME | FNM_PERIOD | FNM_EXTMATCH); if (bhglobs[i].patterns[0] != NULL) - rpmMessage(RPMMESS_DEBUG, "\t%d \"%s\"\n", + rpmlog(RPMMESS_DEBUG, "\t%d \"%s\"\n", i, bhglobs[i].patterns[0]); } } diff --git a/tools/rpmgraph.c b/tools/rpmgraph.c index 6c85155..c9b4ff3 100644 --- a/tools/rpmgraph.c +++ b/tools/rpmgraph.c @@ -136,7 +136,7 @@ restart: switch (rpmrc) { case RPMRC_FAIL: default: - rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *fnp); + rpmlog(RPMMESS_ERROR, _("%s cannot be installed\n"), *fnp); numFailed++; *fnp = NULL; break; case RPMRC_OK: @@ -191,19 +191,19 @@ maybe_manifest: } ps = rpmtsProblems(ts); if (rpmpsNumProblems(ps) > 0) { - rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed dependencies:\n")); rpmpsPrint(NULL, ps); numFailed += numPkgs; if (ts->suggests != NULL && ts->nsuggests > 0) { - rpmMessage(RPMMESS_NORMAL, _(" Suggested resolutions:\n")); + rpmlog(RPMMESS_NORMAL, _(" Suggested resolutions:\n")); for (i = 0; i < ts->nsuggests; i++) { const char * str = ts->suggests[i]; if (str == NULL) break; - rpmMessage(RPMMESS_NORMAL, "\t%s\n", str); + rpmlog(RPMMESS_NORMAL, "\t%s\n", str); ts->suggests[i] = NULL; str = _free(str); } diff --git a/tools/rpmsort.c b/tools/rpmsort.c index d0566ac..a58076b 100644 --- a/tools/rpmsort.c +++ b/tools/rpmsort.c @@ -70,7 +70,7 @@ do_tsort(const char *fileArgv[]) rc = rpmtsOpenDB(ts, O_RDONLY); if (rc) { - rpmMessage(RPMMESS_ERROR, _("cannot open Packages database\n")); + rpmlog(RPMMESS_ERROR, _("cannot open Packages database\n")); rc = -1; goto exit; } @@ -86,7 +86,7 @@ do_tsort(const char *fileArgv[]) rc = rpmdbOpen(rootdir, &avdb, O_RDONLY, 0644); delMacro(NULL, "_dbpath"); if (rc) { - rpmMessage(RPMMESS_ERROR, _("cannot open Available database\n")); + rpmlog(RPMMESS_ERROR, _("cannot open Available database\n")); goto endavail; } mi = rpmdbInitIterator(avdb, RPMDBI_PACKAGES, NULL, 0); @@ -172,7 +172,7 @@ restart: } if (rc != RPMRC_NOTFOUND) { - rpmMessage(RPMMESS_ERROR, _("%s cannot be installed\n"), *fnp); + rpmlog(RPMMESS_ERROR, _("%s cannot be installed\n"), *fnp); numFailed++; *fnp = NULL; break; } @@ -213,7 +213,7 @@ restart: ps = rpmtsProblems(ts); if (ps) { - rpmMessage(RPMMESS_ERROR, _("Failed dependencies:\n")); + rpmlog(RPMMESS_ERROR, _("Failed dependencies:\n")); rpmpsPrint(NULL, ps); ps = rpmpsFree(ps); rc = -1; -- 2.7.4