From 2e599a6a25b533fe63840edc34ee265811b7b814 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 28 Jun 2013 16:56:51 +0200 Subject: [PATCH] lxc-alpine: make --release work when apk exists Use sed to set the specified alpine release in the copied /etc/apk/repositories Signed-off-by: Natanael Copa Signed-off-by: Serge Hallyn --- templates/lxc-alpine.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 410c817de..be2a5357f 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in @@ -84,6 +84,10 @@ install_alpine() { echo "$repository" > "$rootfs"/etc/apk/repositories else cp /etc/apk/repositories "$rootfs"/etc/apk/repositories || return 1 + if [ -n "$release" ]; then + sed -i -e "s:/[^/]\+/\([^/]\+\)$:/$release/\1:" \ + "$rootfs"/etc/apk/repositories + fi fi opt_arch= if [ -n "$apk_arch" ]; then -- 2.47.2