summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-10-09 14:06:06 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-10-09 14:06:06 +0300
commitd709195c3a51522629443cddea042513f47c5ad3 (patch)
tree2d0f91f22a13179bb56331ae9f7d13ed38159cee /rpmdb
parent46921b2334ddde2cad8f3546c6f9b6124adbb3a2 (diff)
downloadrpm-d709195c3a51522629443cddea042513f47c5ad3.tar.gz
rpm-d709195c3a51522629443cddea042513f47c5ad3.tar.bz2
rpm-d709195c3a51522629443cddea042513f47c5ad3.zip
Replace all rpmError() uses with rpmlog()
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/db3.c6
-rw-r--r--rpmdb/dbconfig.c8
-rw-r--r--rpmdb/rpmdb.c48
3 files changed, 31 insertions, 31 deletions
diff --git a/rpmdb/db3.c b/rpmdb/db3.c
index 92d23af02..3f8299463 100644
--- a/rpmdb/db3.c
+++ b/rpmdb/db3.c
@@ -146,10 +146,10 @@ static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit)
if (printit && rc) {
if (msg)
- rpmError(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
+ rpmlog(RPMERR_DBERR, _("db%d error(%d) from %s: %s\n"),
dbi->dbi_api, rc, msg, db_strerror(error));
else
- rpmError(RPMERR_DBERR, _("db%d error(%d): %s\n"),
+ rpmlog(RPMERR_DBERR, _("db%d error(%d): %s\n"),
dbi->dbi_api, rc, db_strerror(error));
}
@@ -1156,7 +1156,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
(dbi->dbi_eflags & DB_INIT_CDB) &&
!(dbi->dbi_eflags & DB_PRIVATE))
? 0 : 1);
- rpmError( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
+ rpmlog( (rc ? RPMERR_FLOCK : RPMWARN_FLOCK),
_("cannot get %s lock on %s/%s\n"),
((dbi->dbi_mode & (O_RDWR|O_WRONLY))
? _("exclusive") : _("shared")),
diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c
index 93ad1e817..51fd38946 100644
--- a/rpmdb/dbconfig.c
+++ b/rpmdb/dbconfig.c
@@ -321,7 +321,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
break;
}
if (opt->longName == NULL) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("unrecognized db option: \"%s\" ignored.\n"), o);
continue;
}
@@ -358,7 +358,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
else if (!xstrncasecmp(pe, "Kb", 2))
aLong *= 1024;
else if (*pe != '\0') {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("%s has invalid numeric value, skipped\n"),
opt->longName);
continue;
@@ -367,7 +367,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
if ((argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) {
if (aLong == LONG_MIN || aLong == LONG_MAX) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("%s has too large or too small long value, skipped\n"),
opt->longName);
continue;
@@ -376,7 +376,7 @@ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
break;
} else {
if (aLong > INT_MAX || aLong < INT_MIN) {
- rpmError(RPMERR_DBCONFIG,
+ rpmlog(RPMERR_DBCONFIG,
_("%s has too large or too small integer value, skipped\n"),
opt->longName);
continue;
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index 7f2ded765..670ec5356 100644
--- a/rpmdb/rpmdb.c
+++ b/rpmdb/rpmdb.c
@@ -243,7 +243,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags)
if (rc) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
- rpmError(RPMERR_DBOPEN,
+ rpmlog(RPMERR_DBOPEN,
_("cannot open %s index using db%d - %s (%d)\n"),
rpmTagGetName(rpmtag), _dbapi,
(rc > 0 ? strerror(rc) : ""), rc);
@@ -264,7 +264,7 @@ dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, unsigned int flags)
if (_dbapi <= 0) {
static int _printed[32];
if (!_printed[dbix & 0x1f]++)
- rpmError(RPMERR_DBOPEN, _("cannot open %s index\n"),
+ rpmlog(RPMERR_DBOPEN, _("cannot open %s index\n"),
rpmTagGetName(rpmtag));
rc = 1;
goto exit;
@@ -900,7 +900,7 @@ rpmdb newRpmdb(const char * root,
db->db_root = rpmGetPath(_DB_ROOT, NULL);
db->db_home = rpmGetPath( (home && *home ? home : _DB_HOME), NULL);
if (!(db->db_home && db->db_home[0] != '%')) {
- rpmError(RPMERR_DBOPEN, _("no dbpath has been set\n"));
+ rpmlog(RPMERR_DBOPEN, _("no dbpath has been set\n"));
db->db_root = _free(db->db_root);
db->db_home = _free(db->db_home);
db = _free(db);
@@ -1136,7 +1136,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
}
@@ -1261,7 +1261,7 @@ key->size = strlen(name);
if (rc == DB_NOTFOUND) { /* not found */
rc = 0;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
rc = -1;
@@ -1311,7 +1311,7 @@ key->size = strlen(name);
if (rc == DB_NOTFOUND) { /* not found */
return RPMRC_NOTFOUND;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
return RPMRC_FAIL;
@@ -1496,7 +1496,7 @@ static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi)
(void) blockSignals(dbi->dbi_rpmdb, &signalMask);
rc = dbiPut(dbi, mi->mi_dbc, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record #%d into %s\n"),
rc, mi->mi_prevoffset, rpmTagGetName(dbi->dbi_rpmtag));
}
@@ -1597,7 +1597,7 @@ static int miregexec(miRE mire, const char * val)
char msg[256];
(void) regerror(rc, mire->preg, msg, sizeof(msg)-1);
msg[sizeof(msg)-1] = '\0';
- rpmError(RPMERR_REGEXEC, "%s: regexec failed: %s\n",
+ rpmlog(RPMERR_REGEXEC, "%s: regexec failed: %s\n",
mire->pattern, msg);
rc = -1;
}
@@ -1778,7 +1778,7 @@ int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag,
char msg[256];
(void) regerror(rc, preg, msg, sizeof(msg)-1);
msg[sizeof(msg)-1] = '\0';
- rpmError(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg);
+ rpmlog(RPMERR_REGCOMP, "%s: regcomp failed: %s\n", allpat, msg);
}
break;
case RPMMIRE_GLOB:
@@ -2141,7 +2141,7 @@ if (dbiByteSwapped(dbi) == 1)
mi->mi_h = headerCopyLoad(uh);
#endif
if (mi->mi_h == NULL || !headerIsEntry(mi->mi_h, RPMTAG_NAME)) {
- rpmError(RPMERR_BADHEADER,
+ rpmlog(RPMERR_BADHEADER,
_("rpmdb: damaged header #%u retrieved -- skipping.\n"),
mi->mi_offset);
goto top;
@@ -2215,7 +2215,7 @@ static int rpmdbGrowIterator(rpmdbMatchIterator mi, int fpNum)
if (rc) { /* error/not found */
if (rc != DB_NOTFOUND)
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
#ifdef SQLITE_HACK
@@ -2334,7 +2334,7 @@ if (key->data && key->size == 0) key->size++; /* XXX "/" fixup. */
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc > 0) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, (key->data ? key->data : "???"), rpmTagGetName(dbi->dbi_rpmtag));
}
@@ -2436,7 +2436,7 @@ memset(data, 0, sizeof(*data));
}
if (h == NULL) {
- rpmError(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
+ rpmlog(RPMERR_DBCORRUPT, _("%s: cannot read header at 0x%x\n"),
"rpmdbRemove", hdrNum);
return 1;
}
@@ -2493,7 +2493,7 @@ if (dbiByteSwapped(dbi) == 1)
rc = dbiCopen(dbi, dbi->dbi_txnid, &dbcursor, DB_WRITECURSOR);
rc = dbiGet(dbi, dbcursor, key, data, DB_SET);
if (rc) {
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) setting header #%d record for %s removal\n"),
rc, hdrNum, rpmTagGetName(dbi->dbi_rpmtag));
} else
@@ -2631,7 +2631,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
} else if (rc == DB_NOTFOUND) { /* not found */
continue;
} else { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) setting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@@ -2650,7 +2650,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
(void) set2dbt(dbi, data, set);
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record \"%s\" into %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@@ -2660,7 +2660,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
} else {
rc = dbiDel(dbi, dbcursor, key, data, 0);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) removing record \"%s\" from %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@@ -2810,7 +2810,7 @@ memset(data, 0, sizeof(*data));
}
if (ret) {
- rpmError(RPMERR_DBCORRUPT,
+ rpmlog(RPMERR_DBCORRUPT,
_("error(%d) allocating new package instance\n"), ret);
goto exit;
}
@@ -3046,7 +3046,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
if (!dbi->dbi_permit_dups)
(void) dbt2set(dbi, data, &set);
} else if (rc != DB_NOTFOUND) { /* error */
- rpmError(RPMERR_DBGETINDEX,
+ rpmlog(RPMERR_DBGETINDEX,
_("error(%d) getting \"%s\" records from %s index\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@@ -3062,7 +3062,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */
rc = dbiPut(dbi, dbcursor, key, data, DB_KEYLAST);
if (rc) {
- rpmError(RPMERR_DBPUTINDEX,
+ rpmlog(RPMERR_DBPUTINDEX,
_("error(%d) storing record %s into %s\n"),
rc, key->data, rpmTagGetName(dbi->dbi_rpmtag));
ret += 1;
@@ -3480,7 +3480,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
rootdbpath, newrootdbpath);
if (!access(newrootdbpath, F_OK)) {
- rpmError(RPMERR_MKDIR, _("temporary database %s already exists\n"),
+ rpmlog(RPMERR_MKDIR, _("temporary database %s already exists\n"),
newrootdbpath);
rc = 1;
goto exit;
@@ -3488,7 +3488,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
rpmMessage(RPMMESS_DEBUG, _("creating directory %s\n"), newrootdbpath);
if (Mkdir(newrootdbpath, 0755)) {
- rpmError(RPMERR_MKDIR, _("creating directory %s: %s\n"),
+ rpmlog(RPMERR_MKDIR, _("creating directory %s: %s\n"),
newrootdbpath, strerror(errno));
rc = 1;
goto exit;
@@ -3534,7 +3534,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
headerIsEntry(h, RPMTAG_RELEASE) &&
headerIsEntry(h, RPMTAG_BUILDTIME)))
{
- rpmError(RPMERR_INTERNAL,
+ rpmlog(RPMERR_INTERNAL,
_("header #%u in the database is bad -- skipping.\n"),
_RECNUM);
continue;
@@ -3572,7 +3572,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts,
}
if (rc) {
- rpmError(RPMERR_INTERNAL,
+ rpmlog(RPMERR_INTERNAL,
_("cannot add record originally at %u\n"), _RECNUM);
failed = 1;
break;