On Wed, Dec 31, 2014 at 08:31:45AM +0100, Natanael Copa wrote:
> Alpine Linux provides yaml files with latest release instead of the old
> approach with .latest.txt.
> 
> Signed-off-by: Natanael Copa <[email protected]>

Acked-by: Stéphane Graber <[email protected]>

> ---
> Should also go to 1.0.x stable
> 
>  templates/lxc-alpine.in | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in
> index ba27aea..187a032 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
> -- 
> 2.2.1
> 
> _______________________________________________
> lxc-devel mailing list
> [email protected]
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to