PKGBUILDs/alarm/devtools-alarm/0001-makechrootpkg-cache-dir.patch

48 lines
1.4 KiB
Diff
Raw Normal View History

2013-05-31 18:39:05 +00:00
diff -urN a/makechrootpkg.in b/makechrootpkg.in
2014-01-22 01:39:39 +00:00
--- a/makechrootpkg.in 2013-11-07 06:57:03.000000000 -0700
+++ b/makechrootpkg.in 2014-01-21 18:25:01.778675214 -0700
@@ -48,6 +48,7 @@
2014-01-22 01:39:39 +00:00
echo ''
echo "Default makepkg args: $makepkg_args"
echo ''
+ echo '-C <dir> Set pacman cache to pass to arch-nspawn'
2013-05-31 18:39:05 +00:00
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
2014-01-22 01:39:39 +00:00
@@ -66,13 +67,14 @@
2013-05-31 18:39:05 +00:00
exit 1
}
2014-01-22 01:39:39 +00:00
-while getopts 'hcur:I:l:nTD:d:' arg; do
+while getopts 'hcuC:r:I:l:nTD:d:' arg; do
2013-05-31 18:39:05 +00:00
case "$arg" in
h) usage ;;
c) clean_first=true ;;
2014-01-22 01:39:39 +00:00
D) bindmounts_ro+=(--bind-ro="$OPTARG") ;;
d) bindmounts_rw+=(--bind="$OPTARG") ;;
2013-05-31 18:39:05 +00:00
u) update_first=true ;;
+ C) cache_dir="$OPTARG" ;;
2013-05-31 18:39:05 +00:00
r) passeddir="$OPTARG" ;;
I) install_pkgs+=("$OPTARG") ;;
l) copy="$OPTARG" ;;
2014-01-22 01:39:39 +00:00
@@ -91,6 +93,10 @@
[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"
[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"
2013-05-31 18:39:05 +00:00
+if [ -n "$cache_dir" ]; then
+ cache_dir="-c $cache_dir"
+fi
+
# Detect chrootdir filesystem type
chroottype=$(stat -f -c %T "$chrootdir")
2014-01-22 01:39:39 +00:00
@@ -373,7 +379,7 @@
download_sources
2013-05-31 18:39:05 +00:00
-if arch-nspawn "$copydir" \
+if arch-nspawn $cache_dir "$copydir" \
--bind-ro="$PWD:/startdir_host" \
--bind-ro="$SRCDEST:/srcdest_host" \
2014-01-22 01:39:39 +00:00
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \