From 28eefc928e8ce7beb1f540a93fccb1e1ff7b00fb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 13 May 2013 13:58:20 -0400 Subject: makechrootpkg.sh:chroot_copy_in(): work with librefetch stuff * do the process for both PKGBUILD and SRCBUILD, if it exists * look at both ${source[@]} and ${mksource[@]} * don't require that URLs contain a path-part --- src/devtools/lib/makechrootpkg.sh.patch | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/devtools/lib/makechrootpkg.sh.patch b/src/devtools/lib/makechrootpkg.sh.patch index 13a9ff1..d20b88c 100644 --- a/src/devtools/lib/makechrootpkg.sh.patch +++ b/src/devtools/lib/makechrootpkg.sh.patch @@ -94,7 +94,7 @@ $update_first && archroot -u "$copydir" mkdir -p "$copydir/build" -@@ -230,7 +246,14 @@ +@@ -230,14 +246,24 @@ # Set target CARCH as it might be used within the PKGBUILD to select correct sources eval $(grep '^CARCH=' "$copydir/etc/makepkg.conf") export CARCH @@ -107,10 +107,31 @@ +chroot_copy_in() { +local copydir=$1 # Copy PKGBUILD and sources - cp PKGBUILD "$copydir/build/" +-cp PKGBUILD "$copydir/build/" ++for recipe in PKGBUILD SRCBUILD; do ++if [[ -f $recipe ]]; then ++cp $recipe "$copydir/build/" ( -@@ -256,13 +279,23 @@ +- source PKGBUILD +- for file in "${source[@]}"; do ++ source $recipe ++ for file in "${source[@]}" "${mksource[@]}"; do + file="${file%%::*}" + file="${file##*://*/}" ++ file="${file##*://}" + if [[ -f $file ]]; then + cp "$file" "$copydir/srcdest/" + elif [[ -f $SRCDEST/$file ]]; then +@@ -251,18 +277,30 @@ + # evaluate any bash variables used + eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\" + [[ -f $file ]] && cp "$file" "$copydir/build/" +- done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD) ++ done < <(sed -n "s/^[[:space:]]*$i=//p" $recipe) + done ) ++fi ++done chown -R nobody "$copydir"/{build,pkgdest,srcdest} +} @@ -133,7 +154,7 @@ # This is a little gross, but this way the script is recreated every time in the # working copy cat >"$copydir/chrootbuild" </dev/null || die "Unable to delete subvolume $copydir" -@@ -326,8 +384,39 @@ +@@ -326,8 +389,39 @@ # remove lock file rm --force "$copydir.lock" stat_done -- cgit v1.2.3-54-g00ecf