[ghc-rpm-macros] ghc-dep.sh: only use buildroot package.conf.d if it exists

Jens Petersen petersen at fedoraproject.org
Sat Jun 9 13:00:38 UTC 2012


commit 8e22621418e086b4a697b0bc04268b1750775a3d
Author: Jens Petersen <petersen at redhat.com>
Date:   Sat Jun 9 22:00:32 2012 +0900

    ghc-dep.sh: only use buildroot package.conf.d if it exists

 ghc-deps.sh         |    5 ++++-
 ghc-rpm-macros.spec |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/ghc-deps.sh b/ghc-deps.sh
index a57aceb..69a2d51 100755
--- a/ghc-deps.sh
+++ b/ghc-deps.sh
@@ -69,8 +69,11 @@ for i in $files; do
     elif [ "$MODE" = "--requires" ]; then
 	if file $i | grep -q 'executable, .* dynamically linked'; then
 	    BIN_DEPS=$(ldd $i | grep libHS | grep -v libHSrts | sed -e "s%^\\tlibHS\(.*\)-ghc${GHCVERSION}.so =.*%\1%")
+	    if [ -d "$PKGCONFDIR" ]; then
+		PACKAGE_CONF_OPT="--package-conf=$PKGCONFDIR"
+	    fi
 	    for p in ${BIN_DEPS}; do
-		HASH=$(${GHC_PKG} --global --package-conf=$PKGCONFDIR field $p id | sed -e "s/^id: \+//")
+		HASH=$(${GHC_PKG} --global $PACKAGE_CONF_OPT field $p id | sed -e "s/^id: \+//")
 		echo "ghc($HASH)"
 	    done
 	fi
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index 341ad61..862b6d5 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -3,7 +3,7 @@
 %global macros_file %{_sysconfdir}/rpm/macros.ghc
 
 Name:           ghc-rpm-macros
-Version:        0.95.2
+Version:        0.95.3
 Release:        1%{?dist}
 Summary:        Macros for building packages for GHC
 
@@ -60,6 +60,9 @@ EOF
 
 
 %changelog
+* Sat Jun  9 2012 Jens Petersen <petersen at redhat.com> - 0.95.3-1
+- ghc-dep.sh: only use buildroot package.conf.d if it exists
+
 * Fri Jun  8 2012 Jens Petersen <petersen at redhat.com> - 0.95.2-1
 - ghc-deps.sh: look in buildroot package.conf.d for program deps
 


More information about the scm-commits mailing list