From: Jan Rękorajski Date: Tue, 31 Dec 2019 13:20:50 +0000 (+0900) Subject: - cleanup upgrade path from rpm5 X-Git-Tag: auto/th/rpm-4.16.0-0.1~21 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=commitdiff_plain;h=e8836e1f523a7098305049bed3e5702087d8b3a8;hp=b85e185ece099a552c35e0094d014f528ed4deac - cleanup upgrade path from rpm5 --- diff --git a/dbupgrade.sh b/dbupgrade.sh index 2d403b5..30c2d5c 100755 --- a/dbupgrade.sh +++ b/dbupgrade.sh @@ -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 diff --git a/rpm.spec b/rpm.spec index b003ce8..2afcb86 100644 --- 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 index 0000000..6d8ec64 --- /dev/null +++ b/rpm5-db-compat.patch @@ -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;