Commit 982e7b6e by Kaarle Ritvanen Committed by Serge Hallyn

lxc-alpine: option for specifying the release to be installed

parent 85b41c7d
...@@ -10,6 +10,7 @@ get_static_apk () { ...@@ -10,6 +10,7 @@ get_static_apk () {
if [ -z "$repository" ]; then if [ -z "$repository" ]; then
url=http://wiki.alpinelinux.org/cgi-bin/dl.cgi url=http://wiki.alpinelinux.org/cgi-bin/dl.cgi
if [ -z "$release" ]; then
echo -n "Determining the latest release... " echo -n "Determining the latest release... "
release=$($wget $url/.latest.$apk_arch.txt | \ release=$($wget $url/.latest.$apk_arch.txt | \
cut -d " " -f 3 | cut -d / -f 1 | uniq) cut -d " " -f 3 | cut -d / -f 1 | uniq)
...@@ -18,6 +19,7 @@ get_static_apk () { ...@@ -18,6 +19,7 @@ get_static_apk () {
return 1 return 1
fi fi
echo $release echo $release
fi
auto_repo_dir=$release/main auto_repo_dir=$release/main
repository=$url/$auto_repo_dir repository=$url/$auto_repo_dir
pkglist=$pkglist:alpine-mirrors pkglist=$pkglist:alpine-mirrors
...@@ -222,7 +224,8 @@ die() { ...@@ -222,7 +224,8 @@ die() {
usage() { usage() {
cat >&2 <<EOF cat >&2 <<EOF
Usage: $(basename $0) [-h|--help] [-r|--repository <url>] [-a|--arch <arch>] Usage: $(basename $0) [-h|--help] [-r|--repository <url>]
[-R|--release <release>] [-a|--arch <arch>]
[--rootfs <rootfs>] -p|--path <path> -n|--name <name> [--rootfs <rootfs>] -p|--path <path> -n|--name <name>
[PKG...] [PKG...]
EOF EOF
...@@ -240,6 +243,7 @@ optarg_check() { ...@@ -240,6 +243,7 @@ optarg_check() {
} }
default_path=@LXCPATH@ default_path=@LXCPATH@
release=
arch=$(uname -m) arch=$(uname -m)
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
...@@ -270,6 +274,11 @@ while [ $# -gt 0 ]; do ...@@ -270,6 +274,11 @@ while [ $# -gt 0 ]; do
repository=$1 repository=$1
shift shift
;; ;;
-R|--release)
optarg_check $opt "$1"
release=$1
shift
;;
-a|--arch) -a|--arch)
optarg_check $opt "$1" optarg_check $opt "$1"
arch=$1 arch=$1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment