Index: scripts/brp-nobuildrootpath
===================================================================
RCS file: /v/rpm/cvs/rpm/scripts/brp-nobuildrootpath,v
--- scripts/brp-nobuildrootpath 25 May 2007 18:34:16 -0000 1.2
+++ scripts/brp-nobuildrootpath 29 Jul 2008 20:49:30 -0000 1.4
+# A fixed version of this file that doesn't bomb out
+# when failing to match. Also removed the case statement
+# as it's simpler to just let 'find' do everything in one pass.
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
# Remove occurences of $RPM_BUILD_ROOT from *.la and *.pc files.
-for f in `find $RPM_BUILD_ROOT -type f` ; do
- grep "${RPM_BUILD_ROOT}\/" "$f" 2>&1 > /dev/null && \
- sed -e "s|${RPM_BUILD_ROOT}/|/|g" "$f" 2>/dev/null > "$f.out" && \
+for f in `find $RPM_BUILD_ROOT -type f -name \*.pc -o -name \*.la` ; do
+ # -c to count the occurances, only proceed if >= 1
+ if [ "`grep -c "${RPM_BUILD_ROOT}\/" "$f"`" -ge 1 ]; then
+ sed -e "s|${RPM_BUILD_ROOT}/|/|g" "$f" > "$f.out" && \