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

60 lines
1.8 KiB
Diff
Raw Normal View History

2022-08-12 02:04:10 +00:00
From d7db6adbb1f9b58e86148117d5449c18232c8a43 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
Subject: [PATCH 1/9] 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
2022-08-12 02:04:10 +00:00
index 126d1da..aef2702 100644
2014-12-30 02:41:19 +00:00
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
2022-08-12 02:04:10 +00:00
@@ -56,6 +56,7 @@ usage() {
2013-05-31 18:39:05 +00:00
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
2021-10-01 23:34:58 +00:00
+ echo '-X <dir> Set pacman cache to pass to arch-nspawn'
2014-12-30 02:41:19 +00:00
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'
2022-08-12 02:04:10 +00:00
@@ -274,12 +275,13 @@ move_products() {
2019-09-21 15:13:45 +00:00
}
# }}}
2014-12-30 02:41:19 +00:00
2021-10-01 23:34:58 +00:00
-while getopts 'hcur:I:l:nCTD:d:U:' arg; do
+while getopts 'hcuX:r:I:l:nCTD:d:U:' arg; do
2019-09-21 15:13:45 +00:00
case "$arg" in
c) clean_first=1 ;;
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
d) bindmounts_rw+=("--bind=$OPTARG") ;;
u) update_first=1 ;;
2021-10-01 23:34:58 +00:00
+ X) cache_dir="$OPTARG" ;;
2019-09-21 15:13:45 +00:00
r) passeddir="$OPTARG" ;;
I) install_pkgs+=("$OPTARG") ;;
l) copy="$OPTARG" ;;
2022-08-12 02:04:10 +00:00
@@ -302,6 +304,10 @@ chrootdir=$(readlink -e "$passeddir")
2019-09-21 15:13:45 +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
2019-09-21 15:13:45 +00:00
+if [ -n "$cache_dir" ]; then
+ cache_dir="-c $cache_dir"
+fi
2013-05-31 18:39:05 +00:00
+
2019-09-21 15:13:45 +00:00
if [[ ${copy:0:1} = / ]]; then
copydir=$copy
else
2022-08-12 02:04:10 +00:00
@@ -361,7 +367,7 @@ download_sources
2019-09-21 15:13:45 +00:00
prepare_chroot
2013-05-31 18:39:05 +00:00
2019-09-21 15:13:45 +00:00
-if arch-nspawn "$copydir" \
+if arch-nspawn $cache_dir "$copydir" \
--bind="${PWD//:/\\:}:/startdir" \
--bind="${SRCDEST//:/\\:}:/srcdest" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
2014-12-30 02:41:19 +00:00
--
2022-08-12 02:04:10 +00:00
2.36.1
2014-12-30 02:41:19 +00:00