From 6715b2ec7babda753cb98800887b9853352ff7e8 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Wed, 25 Oct 2023 16:28:44 +0800 Subject: [PATCH] %ghc_gen_filelists: tweak pkgdir for ghc-9.8 library short hashes --- ghc-rpm-macros.spec | 5 ++++- macros.ghc | 13 +++++++++---- tests/test-rebuild.sh | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 23f8b8d..b0a7f9a 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -7,7 +7,7 @@ %endif Name: ghc-rpm-macros -Version: 2.6.0 +Version: 2.6.1 Release: 1%{?dist} Summary: RPM macros for building Haskell packages for GHC @@ -185,6 +185,9 @@ mkdir -p %{buildroot}%{_docdir}/ghc/html/libraries %changelog +* Tue Oct 24 2023 Jens Petersen - 2.6.1-1 +- ghc_gen_filelists: tweak pkgdir for ghc-9.8 short hash suffices + * Mon Sep 18 2023 Jens Petersen - 2.6.0-1 - add ghc-info.sh to read fields from ghc --info diff --git a/macros.ghc b/macros.ghc index c68ac4b..3e5b7e9 100644 --- a/macros.ghc +++ b/macros.ghc @@ -158,7 +158,7 @@ if [ -d "%{ghclibdir}/lib" ]; then\ subsubdir=/lib\ fi\ %endif\ -if [ -z "$(ls %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf)" ]; then\ +if [ ! -f %{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf ]; then\ echo "%{buildroot}%{ghcliblib}${subsubdir}/package.conf.d/%{pkgnamever}*.conf not found"\ exit 1\ fi\ @@ -182,9 +182,14 @@ exit 1\ %endif\ fi\ done\ -pkgdir="%{ghcliblib}${subsubdir}%{?with_hadrian:/%{ghcplatform}}/%{pkgnamever}"\ -if [ -d "%{buildroot}${pkgdir}" ]; then\ -find %{buildroot}${pkgdir} -type d -fprintf %{basepkg}-devel.files '%%%%dir %p\\n' -o \\( -name '*.p_hi' -o -name 'libHS*_p.a' \\) -fprint %{basepkg}-prof.files -o -fprint %{basepkg}-devel.files\ +pkgdir="%{buildroot}%{ghcliblib}${subsubdir}%{?with_hadrian:/%{ghcplatform}}/%{pkgnamever}"\ +%if %[v"%{ghc_version}" > v"9.8"]\ +if [ ! -d ${pkgdir} ]; then\ +pkgdir="${pkgdir}-*"\ +fi\ +%endif\ +if [ -d ${pkgdir} ]; then\ +find ${pkgdir} -type d -fprintf %{basepkg}-devel.files '%%%%dir %p\\n' -o \\( -name '*.p_hi' -o -name 'libHS*_p.a' \\) -fprint %{basepkg}-prof.files -o -fprint %{basepkg}-devel.files\ else\ rm -f %{basepkg}-devel.files %{basepkg}-prof.files\ touch %{basepkg}-devel.files %{basepkg}-prof.files\ diff --git a/tests/test-rebuild.sh b/tests/test-rebuild.sh index 06aed0d..bc0f17e 100755 --- a/tests/test-rebuild.sh +++ b/tests/test-rebuild.sh @@ -64,7 +64,7 @@ TMP=test-tmp mkdir -p $TMP/ -PKGS=$(cd $ARCH; rpm -qp $(ls *-$VERREL*.rpm)) +PKGS=$(cd $ARCH; rpm -qp *-$VERREL.*.rpm) for i in $PKGS; do # FIXME: should check NVR is same before building