aboutsummaryrefslogtreecommitdiffstats
path: root/find-debuginfo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'find-debuginfo.sh')
-rwxr-xr-xfind-debuginfo.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/find-debuginfo.sh b/find-debuginfo.sh
index d6d539f..30bb311 100755
--- a/find-debuginfo.sh
+++ b/find-debuginfo.sh
@@ -50,11 +50,15 @@ do
fi
done
-mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
-cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0m ${RPM_BUILD_ROOT}/usr/src/debug)
-# stupid cpio creates new directories in mode 0700, fixup
-find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
-find ${RPM_BUILD_ROOT}/usr/src/debug -type f -print0 | xargs -0 -r chmod a+r
-
-find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
-find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE
+[[ -d ${debugdir} ]] && \
+find ${debugdir} -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
+
+if [ -s $SOURCEFILE ]; then
+ mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
+ cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0m ${RPM_BUILD_ROOT}/usr/src/debug)
+ # stupid cpio creates new directories in mode 0700, fixup
+ find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
+ find ${RPM_BUILD_ROOT}/usr/src/debug -type f -print0 | xargs -0 -r chmod a+r
+
+ find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE
+fi