PKGBUILDs/alarm/devtools-alarm/0001-makechrootpkg-cache-dir.patch
2013-05-31 18:39:05 +00:00

44 lines
1.2 KiB
Diff

diff -urN a/makechrootpkg.in b/makechrootpkg.in
--- a/makechrootpkg.in 2013-04-08 10:09:19.000000000 -0600
+++ b/makechrootpkg.in 2013-05-31 12:12:06.555461241 -0600
@@ -49,6 +49,7 @@
echo 'Flags:'
echo '-h This help'
echo '-c Clean the chroot before building'
+ echo '-C <dir> Set pacman cache to pass to mkarchroot'
echo '-u Update the working copy of the chroot before building'
echo ' This is useful for rebuilds without dirtying the pristine'
echo ' chroot'
@@ -63,10 +64,11 @@
exit 1
}
-while getopts 'hcudr:I:l:nT' arg; do
+while getopts 'hcudC:r:I:l:nT' arg; do
case "$arg" in
h) usage ;;
c) clean_first=true ;;
+ C) cache_dir="$OPTARG" ;;
u) update_first=true ;;
d) add_to_db=true ;;
r) passeddir="$OPTARG" ;;
@@ -116,6 +118,10 @@
umask 0022
+if [ -n "$cache_dir" ]; then
+ cache_dir="-c $cache_dir"
+fi
+
# Detect chrootdir filesystem type
chroottype=$(stat -f -c %T "$chrootdir")
@@ -288,7 +294,7 @@
EOF
chmod +x "$copydir/chrootbuild"
-if mkarchroot -r "/chrootbuild" "$copydir"; then
+if mkarchroot $cache_dir -r "/chrootbuild" "$copydir"; then
for pkgfile in "$copydir"/pkgdest/*.pkg.tar.?z; do
if $add_to_db; then
mkdir -p "$copydir/repo"