aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--URPM.xs15
2 files changed, 18 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index b795c29..8de0a06 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
-Version 3.37.2 - 21 June 2011, by Per Øyvind Karlsen
+Version 3.37.2 - 23 June 2011, by Per Øyvind Karlsen
+- create empty DB_CONFIG for rpm first when updating to rpm >= 5.3 to prevent
+ incompatible configurations to break berkeley db during upgrade
- support getting disttag & distepoch from synthesis
- fix URPM::Package->distepoch to actually work
- add disttag & distepoch at end of @info@ line
diff --git a/URPM.xs b/URPM.xs
index e4ba8dc..c5dc22f 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3329,6 +3329,21 @@ Trans_add(trans, pkg, ...)
pretend_distepoch(pkg->h, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION);
}
remap_suggests(pkg->h);
+ /* If we're going to update to rpm 5.3, we'll create an empty DB_CONFIG
+ * first iff there's no existing DB_CONFIG in place. This will prevent
+ * switching to possibly incompatible configurations during upgrade.
+ */
+ if (!strcmp(get_name(pkg->h, RPMTAG_NAME), "rpm")) {
+ const char *version = get_name(pkg->h, RPMTAG_VERSION);
+ if (rpmvercmp(version, "5.3") >= 0) {
+ char *fn = rpmGetPath("%{_dbpath}", "/DB_CONFIG", NULL);
+ struct stat st;
+ if (stat(fn, &st)) {
+ FD_t fd = Fopen(fn, "w");
+ Fclose(fd);
+ }
+ }
+ }
RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(long)(pkg->flag & FLAG_ID)), update, relocations) == 0;