This removes errors like
cpio: glibc-2.24/csu: Cannot stat: No such file or directory
Change-Id: Ib1a710b72a44be4bc5fd2e6871ef277c66068149
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
if [ -s "$SOURCEFILE" ]; then
mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug"
+ # Get package name from directory and then filter out all files not
+ # starting with this name
+ pn=$(basename "$BUILDDIR")
LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(<internal>|<built-in>)$' |
+ grep -E -z "^${pn}" |
(cd "$RPM_BUILD_DIR"; cpio -pd0mL "${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 |