Skip to content

Commit 6002a8b

Browse files
committed
buildrpm.sh: don't use $HOME
This is news to me: I didn't know that some distros do not set $HOME. So use "~" instead, and only try to grep ~/.rpmmacros if it exists. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 678e314 commit 6002a8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/dist/linux/buildrpm.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ fi
267267
# Find where the top RPM-building directory is
268268
#
269269

270-
rpmtopdir=${rpmtopdir:-"`grep %_topdir $HOME/.rpmmacros | awk '{ print $2 }'`"}
270+
rpmtopdir=
271+
file=~/.rpmmacros
272+
if test -r $file; then
273+
rpmtopdir=${rpmtopdir:-"`grep %_topdir $file | awk '{ print $2 }'`"}
274+
fi
271275
if test "$rpmtopdir" != ""; then
272276
rpmbuild_options="$rpmbuild_options --define '_topdir $rpmtopdir'"
273277
if test ! -d "$rpmtopdir"; then

0 commit comments

Comments
 (0)