[ghc-rpm-macros] ghc_fix_dynamic_rpath: abort for non-existent executable name
Jens Petersen
petersen at fedoraproject.org
Fri Jan 10 01:56:34 UTC 2014
commit 87a97e89f36afff837aed9a8c8f2ea558161077d
Author: Jens Petersen <petersen at redhat.com>
Date: Fri Jan 10 10:54:19 2014 +0900
ghc_fix_dynamic_rpath: abort for non-existent executable name
ghc-rpm-macros.ghc | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc
index 851a978..14c7e93 100644
--- a/ghc-rpm-macros.ghc
+++ b/ghc-rpm-macros.ghc
@@ -138,13 +138,18 @@ fi
PDIR=$(cd ..; pwd)\
for i in %*; do\
PROG=%{buildroot}%{_bindir}/$i\
- RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\
- case $RPATH in\
- *$PDIR*)\
- NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\
- chrpath -r $NEWRPATH $PROG\
- ;;\
- esac\
+ if [ -x "$PROG" ]; then\
+ RPATH=$(chrpath $PROG| sed -e "s@^$PROG: RPATH=@@")\
+ case $RPATH in\
+ *$PDIR*)\
+ NEWRPATH=$(echo $RPATH | sed -e "s@$PDIR@%{ghclibdir}@g" -e "s@/dist/build@@g")\
+ chrpath -r $NEWRPATH $PROG\
+ ;;\
+ esac\
+ else\
+ echo "%ghc_fix_dynamic_rpath: no such file $PROG"\
+ exit 1\
+ fi\
done\
%endif\
%{nil}
More information about the scm-commits
mailing list