From: Natanael Copa Date: Wed, 31 Dec 2014 07:31:45 +0000 (+0100) Subject: lxc-alpine: use yaml for detection of latest release X-Git-Tag: lxc-1.1.0.rc1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abf117c398c957b213feebe3fa6dea3107c3a452;p=thirdparty%2Flxc.git lxc-alpine: use yaml for detection of latest release Alpine Linux provides yaml files with latest release instead of the old approach with .latest.txt. Signed-off-by: Natanael Copa Acked-by: Stéphane Graber --- diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index ba27aeaf1..187a03253 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in @@ -28,10 +28,15 @@ get_static_apk () { if [ -z "$repository" ]; then url=http://wiki.alpinelinux.org/cgi-bin/dl.cgi + yaml_path="latest-stable/releases/$apk_arch/latest-releases.yaml" if [ -z "$release" ]; then echo -n "Determining the latest release... " - release=$($wget $url/.latest.$apk_arch.txt | \ - cut -d " " -f 3 | cut -d / -f 1 | uniq) + release=$($wget $url/$yaml_path | \ + awk '$1 == "branch:" {print $2; exit 0}') + if [ -z "$release" ]; then + release=$($wget $url/.latest.$apk_arch.txt | \ + cut -d " " -f 3 | cut -d / -f 1 | uniq) + fi if [ -z "$release" ]; then echo failed return 1