From 653d2dc86d5340c6854818bdab3dae65bf62d474 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 9 Jan 2018 12:50:37 +1000 Subject: Fix moving source files into debug packages Commit 8bec63bf92d8dd028aa88dbd5109c314cdb9ebea attempted to switch to using -fdebug-prefix-map to set file locations in debug packages. It make a few mistakes... 1) Adding debug C{,XX}FLAGS only worked if DBGSRCDIR was defined in makepkg.conf. Fix this by falling back to the default value. 2) Using -fdebug-prefix-map altered a lot of assumptions about file locations when copying source files into debug packages. This resulted in lots of messages of failed cp in packaging output. Signed-off-by: Allan McRae --- scripts/libmakepkg/tidy/strip.sh.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts/libmakepkg') diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 8a1d6096..e8f54be4 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -58,9 +58,9 @@ strip_file() { # copy source files to debug directory local f t while read -r t; do - f=${t/$dbgsrc/"$srcdir"} - mkdir -p "${t%/*}" - cp -- "$f" "$t" + f=${t/${dbgsrcdir}/"$srcdir"} + mkdir -p "${dbgsrc/"$dbgsrcdir"/}${t%/*}" + cp -- "$f" "${dbgsrc/"$dbgsrcdir"/}$t" done < <(source_files "$binary") # copy debug symbols to debug directory @@ -104,7 +104,8 @@ tidy_strip() { if check_option "debug" "y"; then dbgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@/usr/lib/debug" - dbgsrc="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@${DBGSRCDIR:-/usr/src/debug}" + dbgsrcdir="${DBGSRCDIR:-/usr/src/debug}" + dbgsrc="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@$dbgsrcdir" mkdir -p "$dbgdir" "$dbgsrc" fi -- cgit v1.2.3-70-g09d2