[lxc-devel] [PATCH] lxc-alpine: use yaml for detection of latest release
Stéphane Graber
stgraber at ubuntu.com
Mon Jan 5 21:26:23 UTC 2015
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 <ncopa at alpinelinux.org>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> 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
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150105/ed249645/attachment.sig>
More information about the lxc-devel
mailing list