Mail archive
alpine-devel

[alpine-devel] [PATCH] alpine-chroot fixing a few bugs

From: systmkor <systmkor_at_gmail.com>
Date: Wed, 24 Sep 2014 23:14:15 -0700

Out of date apk static file, chroot directory, fixed '.latest.txt' file
Changed the file name of the APK_TOOL to the current version. The chroot
used by the APK_TOOl no longer forces the chroot directory to be a sub
directory of the executing current working directory. The '.latest.txt'
file now uses the mirrors format of having the architecture in the file name
Changes to be committed:
 modified: alpine-chroot

---
 alpine-chroot | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/alpine-chroot b/alpine-chroot
index 49555d6..8fe9114 100644
--- a/alpine-chroot
+++ b/alpine-chroot
_at_@ -20,7 +20,7 @@
 # http://wiki.alpinelinux.org/wiki/Setting_up_the_build_environment_in_chroot
 
 MIRROR=http://dl-5.alpinelinux.org/alpine
-APK_TOOL=apk-tools-static-2.4.3-r0.apk
+APK_TOOL=apk-tools-static-2.4.4-r0.apk
 
 usage() {
         cat <<__EOF__
_at_@ -52,10 +52,6 @@ while getopts ":h:a:d:r:" opt; do
     esac
 done
 
-if [ "$RELEASE" = "" ]; then
-    LATEST=`curl --silent $MIRROR/.latest.txt`
-    RELEASE=${LATEST:31:3}
-fi
 
 if [ "$ARCH" = "" ]; then
 	ARCH=`uname -i`
_at_@ -66,6 +62,13 @@ if [ "$ARCH" != "x86" ] && [ "$ARCH" != "x86_64" ]; then
     exit 1
 fi
 
+if [ "$RELEASE" = "" ]; then
+    echo "$MIRROR/.latest.$ARCH.txt"
+    LATEST=`curl --silent "$MIRROR/.latest.$ARCH.txt"`
+    RELEASE=${LATEST:31:3}
+    echo $RELEASE
+fi
+
 if [ "$CHROOT" = "" ]; then
 	CHROOT="alpinechroot-$RELEASE"
 fi
_at_@ -85,13 +88,14 @@ else
 fi
 
 build_chroot() {
+    echo "$MIRROR/v$RELEASE/main/$ARCH/$APK_TOOL"
     curl --silent $MIRROR/v$RELEASE/main/$ARCH/$APK_TOOL -o $APK_TOOL
     tar -xzf $APK_TOOL
     ./sbin/apk.static \
         -X $MIRROR/v$RELEASE/main \
         -U \
         --allow-untrusted \
-        --root ././$CHROOT \
+        --root $CHROOT \
         --initdb add alpine-base alpine-sdk
 
     mkdir -p $CHROOT{/root,/etc/apk,/proc}
-- 
2.1.0
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Wed Sep 24 2014 - 23:14:15 UTC