mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
59 lines
1.9 KiB
Diff
59 lines
1.9 KiB
Diff
From 270fc7be6bfab43cb0e7451d7b60acfa14e5915d Mon Sep 17 00:00:00 2001
|
|
From: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
Date: Sun, 28 Dec 2014 22:25:58 -0700
|
|
Subject: [PATCH 1/7] makechrootpkg: cache dir
|
|
|
|
---
|
|
makechrootpkg.in | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/makechrootpkg.in b/makechrootpkg.in
|
|
index 3c8a20f..64bdbcb 100644
|
|
--- a/makechrootpkg.in
|
|
+++ b/makechrootpkg.in
|
|
@@ -51,6 +51,7 @@ usage() {
|
|
echo 'Flags:'
|
|
echo '-h This help'
|
|
echo '-c Clean the chroot before building'
|
|
+ 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'
|
|
@@ -313,12 +314,13 @@ move_products() {
|
|
|
|
orig_argv=("$@")
|
|
|
|
-while getopts 'hcur:I:l:nTD:d:' arg; do
|
|
+while getopts 'hcuC:r:I:l:nTD:d:' arg; do
|
|
case "$arg" in
|
|
c) clean_first=true ;;
|
|
D) bindmounts_ro+=(--bind-ro="$OPTARG") ;;
|
|
d) bindmounts_rw+=(--bind="$OPTARG") ;;
|
|
u) update_first=true ;;
|
|
+ C) cache_dir="$OPTARG" ;;
|
|
r) passeddir="$OPTARG" ;;
|
|
I) install_pkgs+=("$OPTARG") ;;
|
|
l) copy="$OPTARG" ;;
|
|
@@ -337,6 +339,10 @@ chrootdir=$(readlink -e "$passeddir")
|
|
[[ ! -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"
|
|
|
|
+if [ -n "$cache_dir" ]; then
|
|
+ cache_dir="-c $cache_dir"
|
|
+fi
|
|
+
|
|
# Detect chrootdir filesystem type
|
|
chroottype=$(stat -f -c %T "$chrootdir")
|
|
|
|
@@ -388,7 +394,7 @@ download_sources
|
|
|
|
prepare_chroot
|
|
|
|
-if arch-nspawn "$copydir" \
|
|
+if arch-nspawn $cache_dir "$copydir" \
|
|
--bind-ro="$PWD:/startdir_host" \
|
|
--bind-ro="$SRCDEST:/srcdest_host" \
|
|
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
|
--
|
|
2.5.2
|
|
|