fixes for new version tagging
This commit is contained in:
parent
3679fca559
commit
9d55709851
1 changed files with 10 additions and 12 deletions
22
dist/kiwi
vendored
22
dist/kiwi
vendored
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
# base config filename
|
# base config filename
|
||||||
KIWI_CONF_NAME="kiwi.yml"
|
KIWI_CONF_NAME="kiwi.yml"
|
||||||
# version tag filename
|
|
||||||
KIWI_VERSION_TAG="kiwi_scp/data/etc/version_tag"
|
|
||||||
|
|
||||||
# dependencies to run kiwi-scp
|
# dependencies to run kiwi-scp
|
||||||
KIWI_DEPENDENCIES="python3 less docker docker-compose"
|
KIWI_DEPENDENCIES="python3 less docker docker-compose"
|
||||||
|
@ -18,12 +16,14 @@ KIWI_PROFILE="${HOME}/.kiwi_profile"
|
||||||
|
|
||||||
# repository uri
|
# repository uri
|
||||||
KIWI_REPO="https://github.com/ldericher/kiwi-scp"
|
KIWI_REPO="https://github.com/ldericher/kiwi-scp"
|
||||||
|
KIWI_REPO_RAW="https://raw.githubusercontent.com/ldericher/kiwi-scp"
|
||||||
# use latest version by default
|
# use latest version by default
|
||||||
KIWI_VERSION="master"
|
KIWI_VERSION="master"
|
||||||
|
|
||||||
# URI of "kiwi" launcher script
|
# URIs in this directory
|
||||||
KIWI_URI="https://raw.githubusercontent.com/ldericher/kiwi-scp/master/dist/kiwi"
|
PACKAGE_URI="pyproject.toml"
|
||||||
INSTALLER_URI="https://raw.githubusercontent.com/ldericher/kiwi-scp/master/dist/install.sh"
|
KIWI_URI="dist/kiwi"
|
||||||
|
INSTALLER_URI="dist/install.sh"
|
||||||
# canary file: limit curl requests
|
# canary file: limit curl requests
|
||||||
CANARY_FILENAME="/tmp/kiwi-scp-$(id -u).canary"
|
CANARY_FILENAME="/tmp/kiwi-scp-$(id -u).canary"
|
||||||
CANARY_MAX_AGE=600
|
CANARY_MAX_AGE=600
|
||||||
|
@ -115,14 +115,14 @@ fi
|
||||||
if [ "${run_kiwi_check}" = "yes" ]; then
|
if [ "${run_kiwi_check}" = "yes" ]; then
|
||||||
# hash this script and the master version
|
# hash this script and the master version
|
||||||
hash_local="$(md5sum <"$(readlink -f "${0}")")"
|
hash_local="$(md5sum <"$(readlink -f "${0}")")"
|
||||||
hash_remote="$(curl --proto '=https' --tlsv1.2 -sSfL "${KIWI_URI}" | md5sum)"
|
hash_remote="$(curl --proto '=https' --tlsv1.2 -sSfL "${KIWI_REPO_RAW}/${KIWI_VERSION}/${KIWI_URI}" | md5sum)"
|
||||||
|
|
||||||
# warn if different
|
# warn if different
|
||||||
if [ "${hash_local}" != "${hash_remote}" ]; then
|
if [ "${hash_local}" != "${hash_remote}" ]; then
|
||||||
|
|
||||||
if yes_no "Your kiwi launcher is outdated. Update now?" >/dev/stderr; then
|
if yes_no "Your kiwi launcher is outdated. Update now?" >/dev/stderr; then
|
||||||
# should reinstall, so download installer
|
# should reinstall, so download installer
|
||||||
installer="$(curl --proto '=https' --tlsv1.2 -sSfL "${INSTALLER_URI}")"
|
installer="$(curl --proto '=https' --tlsv1.2 -sSfL "${KIWI_REPO_RAW}/${KIWI_VERSION}/${INSTALLER_URI}")"
|
||||||
|
|
||||||
if yes_no "Use sudo to run as root?"; then
|
if yes_no "Use sudo to run as root?"; then
|
||||||
# enable system-wide install
|
# enable system-wide install
|
||||||
|
@ -177,11 +177,9 @@ if [ ! -x "$(kiwi_executable)" ]; then
|
||||||
|
|
||||||
# read version tag
|
# read version tag
|
||||||
KIWI_VERSION="$( \
|
KIWI_VERSION="$( \
|
||||||
curl \
|
curl --proto '=https' --tlsv1.2 -sSfL "${KIWI_REPO_RAW}/${KIWI_VERSION}/${PACKAGE_URI}" \
|
||||||
--proto '=https' \
|
| grep -r 'version\s*=' \
|
||||||
--tlsv1.2 \
|
| sed -r "s/version\s*=\s*\"([^\"]*)\"$/\1/" \
|
||||||
-sSfL \
|
|
||||||
"https://raw.githubusercontent.com/ldericher/kiwi-scp/${KIWI_VERSION}/${KIWI_VERSION_TAG}" \
|
|
||||||
)"
|
)"
|
||||||
|
|
||||||
if [ -x "$(kiwi_executable)" ]; then
|
if [ -x "$(kiwi_executable)" ]; then
|
||||||
|
|
Loading…
Reference in a new issue