summaryrefslogtreecommitdiffstats
path: root/buildlab.in
diff options
context:
space:
mode:
authorMatt Smith <mcs@darkregion.net>2011-03-29 21:46:37 -0500
committerMatt Smith <mcs@darkregion.net>2011-03-29 21:46:37 -0500
commitd500aac083c735391d4b8992c6f41326a0a610f5 (patch)
tree41deb020fab4770b688c0a8bce9e60abee2f6054 /buildlab.in
parentd68c2e291224f23b28868b90f9ddedcc0531ae26 (diff)
downloadabuild-master.tar.bz2
abuild-master.tar.xz
buildlab: added apk caching option (-k)HEADmaster
Diffstat (limited to 'buildlab.in')
-rwxr-xr-xbuildlab.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/buildlab.in b/buildlab.in
index 43ffb08..2ff21d3 100755
--- a/buildlab.in
+++ b/buildlab.in
@@ -88,6 +88,7 @@ prepare_chroot() {
local version="$2"
local mirror="$3"
local arch="$4"
+ local enablecache="$5"
msg "Setting up repositories for mirror $mirror with version $version at $path..."
@@ -95,6 +96,11 @@ prepare_chroot() {
echo "http://$mirror/alpine/$version/packages/$arch/main" >> "$path"/etc/apk/repositories
echo "http://$mirror/alpine/$version/packages/$arch/testing" >> "$path"/etc/apk/repositories
+ if [ ! -z "$enablecache" ]; then
+ mkdir -p "$path"/var/cache/apk
+ ln -s /var/cache/apk "$path"/etc/apk/cache
+ fi
+
mkdir -p "$path"/var/lib/apk
echo "alpine-base" > "$path"/var/lib/apk/world
@@ -187,6 +193,7 @@ usage() {
echo " -m APK repository mirror"
echo " -v APK distribution version"
echo " -a APK repository architecture"
+ echo " -k Enable APK caching"
echo " "
echo "Updating build roots (buildlab -u):"
echo " "
@@ -205,7 +212,7 @@ usage() {
unset force
unset recursive
-while getopts "chqCp:v:m:a:b:u" opt; do
+while getopts "chqCkp:v:m:a:b:u" opt; do
case $opt in
'c') default_colors
color_opt="-c";;
@@ -215,7 +222,8 @@ while getopts "chqCp:v:m:a:b:u" opt; do
'p') buildpath="$OPTARG";;
'm') buildmirror="$OPTARG";;
'v') buildver="$OPTARG";;
- 'a') buildarch="$OPTARG";;
+ 'a') buildarch="$OPTARG";;
+ 'k') enablecache=1;;
'b') buildpkg="$OPTARG";;
'u') update="-u";;
esac
@@ -224,7 +232,7 @@ shift $(( $OPTIND - 1 ))
if [ ! -z "$create" ]; then
msg "Creating new chroot at $buildpath..."
- prepare_chroot $buildpath $buildver $buildmirror $buildarch
+ prepare_chroot $buildpath $buildver $buildmirror $buildarch $enablecache
exit 0
fi