update to rpm-4.9.0

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=93
This commit is contained in:
2011-05-16 16:07:44 +00:00
committed by Git OBS Bridge
parent 5d8f14209e
commit cebe6dd1a8
87 changed files with 1633 additions and 2481 deletions

View File

@@ -1,25 +1,21 @@
Build convertdb1, too.
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -143,6 +143,10 @@ bin_PROGRAMS += rpmqpack
--- ./Makefile.am.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:18:21.000000000 +0000
@@ -174,6 +174,10 @@ bin_PROGRAMS += rpmqpack
rpmqpack_SOURCES = rpmqpack.c
rpmqpack_LDADD = lib/librpm.la
+check_PROGRAMS += convertdb1
+bin_PROGRAMS += convertdb1
+convertdb1_SOURCES = tools/convertdb1.c
+convertdb1_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
Index: tools/convertdb1.c
===================================================================
--- /dev/null
+++ tools/convertdb1.c
@@ -0,0 +1,346 @@
--- tools/convertdb1.c.orig 2011-05-12 13:31:37.000000000 +0000
+++ tools/convertdb1.c 2011-05-12 13:31:28.000000000 +0000
@@ -0,0 +1,351 @@
+#if defined(HAVE_CONFIG_H)
+#include "system.h"
+const char *__progname;
@@ -30,6 +26,7 @@ Index: tools/convertdb1.c
+#endif
+
+#include <rpmlib.h>
+#include <rpmts.h>
+#include <rpmdb.h>
+#include <rpmio.h>
+#include <rpmmacro.h>
@@ -305,6 +302,7 @@ Index: tools/convertdb1.c
+ const char *name;
+ const char *version;
+ const char *release;
+ rpmts ts;
+
+ if (argc != 2)
+ {
@@ -321,7 +319,9 @@ Index: tools/convertdb1.c
+ /* speed things up */
+ (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1);
+
+ if (rpmdbOpen("/", &db, O_RDWR, 0644)) {
+ ts = rpmtsCreate();
+
+ if (rpmtsOpenDB(ts, O_RDWR)) {
+ fprintf(stderr, "could not open rpm database\n");
+ exit(1);
+ }
@@ -355,14 +355,15 @@ Index: tools/convertdb1.c
+ continue;
+ }
+ rpmdbFreeIterator(mi);
+ if (rpmdbAdd(db, -1, h, 0, 0))
+ if (rpmtsHeaderAddDB(ts, h))
+ {
+ fprintf(stderr, "could not add %s-%s-%s!\n", name, version, release);
+ }
+ headerFree(h);
+ }
+ Fclose(fd);
+ rpmdbClose(db);
+ rpmtsCloseDB(ts);
+ rpmtsFree(ts);
+ return 0;
+}
+