Only copy source files onces when creating debug packages

The Arch sharutils package was spewing messages about "Permission denied" when
copying source files into the debug package.  This is due to the source files
having 444 permissions and being used in multiple binaries.  Only copy each
source file into the debug package onces to avoid this error.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2024-06-19 11:38:24 +10:00
parent c9acfc2b50
commit 3f1943c84d

View file

@ -60,7 +60,7 @@ package_source_files() {
file="${srcdir}/${t}" file="${srcdir}/${t}"
dest="${dbgsrc}/${t}" dest="${dbgsrc}/${t}"
mkdir -p "${dest%/*}" mkdir -p "${dest%/*}"
if [[ -f "$file" ]]; then if [[ -f "$file" && ! -f "$dest" ]]; then
cp -- "$file" "$dest" cp -- "$file" "$dest"
fi fi
done < <(source_files "$binary") done < <(source_files "$binary")