From 47ffee16484c175cffc2b1cf445334be12ac5bd3 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Sat, 23 May 2009 12:39:39 +0000 Subject: check buildroot as other scripts --- remove_info_dir | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'remove_info_dir') diff --git a/remove_info_dir b/remove_info_dir index aa1e152..a79cd4a 100755 --- a/remove_info_dir +++ b/remove_info_dir @@ -1,8 +1,16 @@ #!/bin/sh -INFODIR=`rpm --eval %{_infodir}/dir` +if [ -z "$RPM_BUILD_ROOT" ]; then + echo "No build root defined" >&2 + exit 1 +fi -test -n "$RPM_BUILD_ROOT" || exit 0 +if [ ! -d "$RPM_BUILD_ROOT" ]; then + echo "Invalid build root" >&2 + exit 1 +fi + +INFODIR=`rpm --eval %{_infodir}/dir` dir="$RPM_BUILD_ROOT/$INFODIR" -- cgit v1.2.1