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

60 lines
1.9 KiB
Diff
Raw Normal View History

2016-06-06 01:37:44 +00:00
From 8c1483d23cbb96d667b97bb18eb91615bd0db34f Mon Sep 17 00:00:00 2001
2014-12-30 02:41:19 +00:00
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun, 28 Dec 2014 22:25:58 -0700
2016-07-04 03:33:59 +00:00
Subject: [PATCH 1/7] makechrootpkg: cache dir
2014-12-30 02:41:19 +00:00
---
makechrootpkg.in | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/makechrootpkg.in b/makechrootpkg.in
2016-06-06 01:37:44 +00:00
index 709e824..2c4a926 100644
2014-12-30 02:41:19 +00:00
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -51,6 +51,7 @@ usage() {
2013-05-31 18:39:05 +00:00
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
2014-12-30 02:41:19 +00:00
+ echo '-C <dir> Set pacman cache to pass to arch-nspawn'
echo '-d <dir> Bind directory into build chroot as read-write'
echo '-D <dir> Bind directory into build chroot as read-only'
echo '-u Update the working copy of the chroot before building'
2016-06-06 01:37:44 +00:00
@@ -252,12 +253,13 @@ move_products() {
2014-12-30 02:41:19 +00:00
orig_argv=("$@")
2013-05-31 18:39:05 +00:00
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
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" ;;
2016-06-06 01:37:44 +00:00
@@ -276,6 +278,10 @@ chrootdir=$(readlink -e "$passeddir")
2014-01-22 01:39:39 +00:00
[[ ! -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")
2016-06-06 01:37:44 +00:00
@@ -327,7 +333,7 @@ download_sources
2015-10-07 00:07:31 +00:00
prepare_chroot
2013-05-31 18:39:05 +00:00
-if arch-nspawn "$copydir" \
+if arch-nspawn $cache_dir "$copydir" \
2016-06-06 01:37:44 +00:00
--bind="$PWD:/startdir" \
--bind="$SRCDEST:/srcdest" \
2014-01-22 01:39:39 +00:00
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
2014-12-30 02:41:19 +00:00
--
2016-07-04 03:33:59 +00:00
2.9.0
2014-12-30 02:41:19 +00:00