diff options
-rw-r--r-- | scripts/libmakepkg/tidy/strip.sh.in | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 82ab1ce1..b04426c9 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -56,11 +56,14 @@ strip_file() { fi # copy source files to debug directory - local f t + local file dest t while IFS= read -r t; do - f=${t/${dbgsrcdir}/"$srcdir"} - mkdir -p "${dbgsrc/"$dbgsrcdir"/}${t%/*}" - cp -- "$f" "${dbgsrc/"$dbgsrcdir"/}$t" + file=${t/${dbgsrcdir}/"$srcdir"} + dest="${dbgsrc/"$dbgsrcdir"/}$t" + if ! [[ -f $dest ]]; then + mkdir -p "${dest%/*}" + cp -- "$file" "$dest" + fi done < <(source_files "$binary") # copy debug symbols to debug directory |