]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- cleanup upgrade path from rpm5
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 31 Dec 2019 13:20:50 +0000 (22:20 +0900)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 31 Dec 2019 13:20:50 +0000 (22:20 +0900)
dbupgrade.sh
rpm.spec
rpm5-db-compat.patch [new file with mode: 0644]

index 2d403b563ebdf05bddab1dbf5bc531a5c1bd83df..30c2d5c902beeb76165b12f55164c14fe855e4c1 100755 (executable)
@@ -12,25 +12,25 @@ if [ "$1" = "-r" ]; then
        fi
 fi
 
-if ! /usr/lib/rpm/bin/rpmdb_reset -r lsn "$ROOTDIR"/var/lib/rpm/Packages ; then
+if ! /usr/lib/rpm/rpmdb_reset -r lsn "$ROOTDIR"/var/lib/rpm/Packages ; then
        echo
        echo "rpm database conversion failed!"
        echo
        echo "You have to run:"
        echo
-       echo "  /usr/lib/rpm/bin/rpmdb_reset -r lsn /var/lib/rpm/Packages"
+       echo "  /usr/lib/rpm/rpmdb_reset -r lsn /var/lib/rpm/Packages"
        echo "  /bin/rm -f /var/lib/rpm/__db.00*"
        echo "  /bin/rm -f /var/lib/rpm/log/*"
-       echo "  /usr/lib/rpm/bin/dbconvert --rebuilddb"
+       echo "  /usr/bin/rpmdb --rebuilddb"
        echo
 else
        /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/__db.00* >/dev/null 2>/dev/null || :
        /bin/rm --interactive=never -f "$ROOTDIR"/var/lib/rpm/log/* >/dev/null 2>/dev/null || :
 
-       if ! /usr/lib/rpm/bin/dbconvert --rebuilddb ${ROOTDIR:+--root="$ROOTDIR"}; then
+       if ! /usr/bin/rpmdb --rebuilddb ${ROOTDIR:+--root="$ROOTDIR"}; then
                echo
                echo "rpm database conversion failed!"
-               echo "You have to run /usr/lib/rpm/bin/dbconvert manually"
+               echo "You have to run /usr/bin/rpmdb manually"
                echo
        fi
 fi
index b003ce8591fed3d1d1c5a7e6be266a5a0e3067e1..2afcb8610dc133b16b55c119448ddff6bd0e2638 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -1,5 +1,7 @@
 #
 # TODO:
+# - build python stuff with libs from build tree
+# - rebuild database after upgrading from rpm5
 # - when adopting, use 4.5 ticket for checklist: https://bugs.launchpad.net/pld-linux/+bug/262985
 #
 # Conditional build:
@@ -91,6 +93,7 @@ Patch16:      %{name}-ignore-missing-macro-files.patch
 Patch17:       x32.patch
 Patch18:       %{name}-fix-compress-doc.patch
 Patch19:       vendor-pld.patch
+Patch20:       rpm5-db-compat.patch
 URL:           https://rpm.org/
 BuildRequires: %{reqdb_pkg}-devel >= %{reqdb_pkgver}
 BuildRequires: %{reqdb_pkg}-sql-devel >= %{reqdb_pkgver}
@@ -659,6 +662,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch17 -p1
 #%patch18 -p1
 #%patch19 -p1
+%patch20 -p1
 
 install %{SOURCE2} pld.in
 install %{SOURCE8} scripts/php.prov.in
@@ -946,6 +950,7 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f
 %{_rpmlibdir}/macros
 %dir %{_rpmlibdir}/macros.d
 #%{_rpmlibdir}/macros.d/pld
+%dir %{_rpmlibdir}/platform
 %{_rpmlibdir}/platform/noarch-*
 %ifarch %{ix86} %{x8664} x32
 %{_rpmlibdir}/platform/athlon*
diff --git a/rpm5-db-compat.patch b/rpm5-db-compat.patch
new file mode 100644 (file)
index 0000000..6d8ec64
--- /dev/null
@@ -0,0 +1,15 @@
+--- rpm-4.15.1/lib/header.c~   2019-11-04 21:13:13.000000000 +0900
++++ rpm-4.15.1/lib/header.c    2019-12-31 19:48:06.709777565 +0900
+@@ -277,6 +277,12 @@
+     for (i = 0; i < il; i++) {
+       ei2h(&pe[i], &info);
++      /* XXX rpm5 compat: convert RPMTAG_FILESTATE to RPM_CHAR_TYPE. */
++      if (info.tag == RPMTAG_FILESTATES && info.type == RPM_INT8_TYPE) {
++          info.type = RPM_CHAR_TYPE;
++          pe[i].type = htonl(info.type);
++      }
++
+       /* Previous data must not overlap */
+       if (end > info.offset)
+           goto err;
This page took 0.082303 seconds and 4 git commands to generate.