summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2011-09-17 15:50:30 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2011-10-07 21:53:03 +0200
commit7a9f808a0fd80c14b32223fa73d5368294994e49 (patch)
treed4ff00f57453afc6738320feee11c19b1a3344f8
parentb9070bf0b8b6e8f154c718074058dba9c03b01e0 (diff)
downloaddevtools-7a9f808a0fd80c14b32223fa73d5368294994e49.tar.xz
makechrootpkg: Source PKGBUILD only once
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--makechrootpkg.in22
1 files changed, 11 insertions, 11 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 11fa401..04893b8 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -219,20 +219,20 @@ eval $(grep '^CARCH=' "$copydir/etc/makepkg.conf")
export CARCH
# Copy PKGBUILD and sources
-source=( $(source PKGBUILD; echo ${source[@]}) )
cp PKGBUILD "$copydir/build/"
-for file in "${source[@]}"; do
- file="${file%%::*}"
- file="${file##*://*/}"
- if [[ -f $file ]]; then
- cp "$file" "$copydir/srcdest/"
- elif [[ -f $SRCDEST/$file ]]; then
- cp "$SRCDEST/$file" "$copydir/srcdest/"
- fi
-done
-
(
source PKGBUILD
+ for file in "${source[@]}"; do
+ file="${file%%::*}"
+ file="${file##*://*/}"
+ if [[ -f $file ]]; then
+ cp "$file" "$copydir/srcdest/"
+ elif [[ -f $SRCDEST/$file ]]; then
+ cp "$SRCDEST/$file" "$copydir/srcdest/"
+ fi
+ done
+
+ # Find all changelog and install files, even inside functions
for i in changelog install; do
sed -n "s/^[[:space:]]*$i=//p" PKGBUILD | while IFS= read -r file; do
# evaluate any bash variables used