diff options
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | lib/fsm.c | 12 | ||||
-rw-r--r-- | lib/transaction.c | 4 | ||||
-rw-r--r-- | rpmio/rpmerr.h | 17 |
4 files changed, 30 insertions, 8 deletions
@@ -33,6 +33,11 @@ - lib/depends.c: diddle debugging messages. - fix: readlink return value clobbered by header write. - fix: ineeded count wrong for overlapped, created files. + - globalize _free(3) wrapper in rpmlib.h, consistent usage throughout. + - internalize locale insensitive ctype(3) in rpmio.h. + - boring lclint annotations and fiddles. + - transaction iterator(s) need to run in reverse order on pure erasures. + - erasures not yet strict, warn & chug on unlink(2)/rmdir(2) failure. 4.0 -> 4.0.[12] - add doxygen and lclint annotations most everywhere. @@ -19,6 +19,9 @@ int _fsm_debug = 0; +/* XXX Failure to remove is not (yet) cause for failure. */ +int strict_erasures = 0; + rpmTransactionSet fsmGetTs(const FSM_t fsm) { const FSMI_t iter = fsm->iter; return (iter ? iter->ts : NULL); @@ -1477,12 +1480,14 @@ int fsmStage(FSM_t fsm, fileStage stage) break; /* XXX common error message. */ - rpmError(RPMERR_RMDIR, + rpmError( + (strict_erasures ? RPMERR_RMDIR : RPMWARN_RMDIR), _("%s rmdir of %s failed: Directory not empty\n"), fiTypeString(fi), fsm->path); break; default: - rpmError(RPMERR_RMDIR, + rpmError( + (strict_erasures ? RPMERR_RMDIR : RPMWARN_RMDIR), _("%s rmdir of %s failed: %s\n"), fiTypeString(fi), fsm->path, strerror(errno)); break; @@ -1492,10 +1497,13 @@ int fsmStage(FSM_t fsm, fileStage stage) if (!rc) break; if (!(errno == ENOENT && (fsm->fflags & RPMFILE_MISSINGOK))) rpmError(RPMERR_UNLINK, + (strict_erasures ? RPMERR_UNLINK : RPMWARN_UNLINK), _("%s unlink of %s failed: %s\n"), fiTypeString(fi), fsm->path, strerror(errno)); } } + /* XXX Failure to remove is not (yet) cause for failure. */ + if (!strict_erasures) rc = 0; break; } diff --git a/lib/transaction.c b/lib/transaction.c index b80c64d54..b217158d5 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1411,8 +1411,8 @@ static void * tsInitIterator(/*@kept@*/ const void * this) iter = xcalloc(1, sizeof(*iter)); iter->ts = ts; - iter->oc = ((ts->transFlags & RPMTRANS_FLAG_REVERSE) - ? (ts->orderCount - 1) : 0); + iter->reverse = ((ts->transFlags & RPMTRANS_FLAG_REVERSE) ? 1 : 0); + iter->oc = (iter->reverse ? (ts->orderCount - 1) : 0); iter->ocsave = iter->oc; return iter; } diff --git a/rpmio/rpmerr.h b/rpmio/rpmerr.h index 57b47e3ae..7e22a1186 100644 --- a/rpmio/rpmerr.h +++ b/rpmio/rpmerr.h @@ -10,8 +10,14 @@ #define _em(_e) \ (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_ERR)) -#define _en(_e) \ +#define _wm(_e) \ + (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_WARNING)) +#define _nm(_e) \ (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_NOTICE)) +#define _im(_e) \ + (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_INFO)) +#define _dm(_e) \ + (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_DEBUG)) /** * Tokens used by rpmError(). @@ -87,12 +93,15 @@ typedef enum rpmerrCode_e { RPMERR_FREAD = _em(134), /*!< %s: Fread failed: %s */ RPMERR_READLEAD = _em(135), /*!< %s: readLead failed */ RPMERR_WRITELEAD = _em(136), /*!< %s: writeLead failed: %s */ - RPMERR_QUERYINFO = _en(137), /*!< */ - RPMERR_MANIFEST = _en(138), /*!< %s: read manifest failed: %s */ + RPMERR_QUERYINFO = _nm(137), /*!< */ + RPMERR_MANIFEST = _nm(138), /*!< %s: read manifest failed: %s */ RPMERR_BADSIGTYPE = _em(200), /*!< Unknown signature type */ RPMERR_SIGGEN = _em(201), /*!< Error generating signature */ - RPMERR_SIGVFY = _en(202) /*!< */ + RPMERR_SIGVFY = _nm(202), /*!< */ + + RPMWARN_UNLINK = _wm(512+16), /*!< unlink(2) failed */ + RPMWARN_RMDIR = _wm(512+17) /*!< rmdir(2) failed */ } rpmerrCode; /** |