diff options
-rwxr-xr-x | build.sh | 4 | ||||
-rw-r--r-- | subr/check_updates.subr | 32 | ||||
-rw-r--r-- | vars/check_updates.vars | 29 |
3 files changed, 49 insertions, 16 deletions
@@ -50,9 +50,11 @@ fi; check_paths; clean_prefix; create_dirs; init_build_log; init_build_progress_file; {(init_build_vars; -log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; if [ ${ARG_CHECK_UPDATES:-0} -eq 0 ]; then + log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; log_env_vars "build (global)" ${LOG_ENV_VARS}; +else + log_msg info "Version check run started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; fi; for BUILD_TARGET_LC in $(subst_tgts ${BUILD_TARGETS_META}); do BUILD_TARGET=$(echo ${BUILD_TARGET_LC} | tr a-z A-Z); diff --git a/subr/check_updates.subr b/subr/check_updates.subr index fc331211..7af20e96 100644 --- a/subr/check_updates.subr +++ b/subr/check_updates.subr @@ -6,22 +6,24 @@ cpu_get_fnames() { if test_cmd pkg_${cu_name}_check_updates; then pkg_${cu_name}_check_updates get_fnames; - elif [ "${cu_url#*://github.com/*}" != "${cu_url}" ]; then - _cpugf_uname="${cu_url#*/github.com/}"; - _cpugf_uname="${_cpugf_uname%%/*}"; - _cpugf_pname="${cu_url#*/github.com/${_cpugf_uname}/}"; - _cpugf_pname="${_cpugf_pname%%/*}"; - cu_url_index="https://github.com/${_cpugf_uname%%/*}/${_cpugf_pname%%/*}/releases/"; - unset _cpu_uname _cpu_pname; - cu_fnames="$(wget ${WGET_ARGS} -qO- ${cu_url_index} |\ - sed -n '/<span class="tag-name">/s/^.*<span class="tag-name">\([a-zA-Z]\+-\|v\|\)\(.\+\)<\/span>.*$/\2/p')"; - cu_fname_base="${cu_name}"; - cu_fname_ext="${cu_fname#v${cu_version}.}"; fi; - if [ -z "${cu_url_index}" ]; then - cu_url_index="${cu_url%/*}/"; - cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ - sed -n '/[hH][rR][eE][fF]="[^"]\+"/s/^.*[hH][rR][eE][fF]="\([^"]\+\)".*$/\1/p')"; + if [ -z "${cu_fnames}" ]; then + if [ "${cu_url#*://github.com/*}" != "${cu_url}" ]; then + _cpugf_uname="${cu_url#*/github.com/}"; + _cpugf_uname="${_cpugf_uname%%/*}"; + _cpugf_pname="${cu_url#*/github.com/${_cpugf_uname}/}"; + _cpugf_pname="${_cpugf_pname%%/*}"; + cu_url_index="https://github.com/${_cpugf_uname%%/*}/${_cpugf_pname%%/*}/releases/"; + unset _cpu_uname _cpu_pname; + cu_fnames="$(wget ${WGET_ARGS} -qO- ${cu_url_index} |\ + sed -n '/<span class="tag-name">/s/^.*<span class="tag-name">\([a-zA-Z]\+-\|v\|\)\(.\+\)<\/span>.*$/\2/p')"; + cu_fname_base="${cu_name}"; + cu_fname_ext="${cu_fname#v${cu_version}.}"; + else + cu_url_index="${cu_url%/*}/"; + cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ + sed -n '/[hH][rR][eE][fF]="[^"]\+"/s/^.*[hH][rR][eE][fF]="\([^"]\+\)".*$/\1/p')"; + fi; fi; : ${cu_fname:="${cu_url##*/}"}; : ${cu_fname_base:="${cu_fname%%-*}"}; diff --git a/vars/check_updates.vars b/vars/check_updates.vars index 6342c5c5..d7ad5bea 100644 --- a/vars/check_updates.vars +++ b/vars/check_updates.vars @@ -2,6 +2,35 @@ # . ./build.vars and set -o errexit -o noglob are assumed. # +pkg_apk_tools_check_updates() { + case "${1}" in + get_fnames) + cu_fname="${cu_url##*/}"; + cu_fname_base="apk-tools"; + cu_fname_ext="${cu_fname#${cu_fname_base}-${cu_version}.}"; + cu_url_index="http://git.alpinelinux.org/cgit/apk-tools/"; + cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ + sed -n '/<a href='\''\/cgit\/apk-tools\/tag\/?h=v[0-9.]\+'\''>/s/^.*<a href='\''\/cgit\/apk-tools\/tag\/?h=v\([0-9.]\+\).*$/apk-tools-\1/p')"; + ;; + get_version) + cu_fname_version="${cu_fname#apk-tools-}"; + ;; + esac; +}; + +pkg_bzip2_check_updates() { + case "${1}" in + get_fnames) + cu_url_index="http://www.bzip.org/"; + cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ + sed -n '/<p>The current version is <b>1.0.6<\/b>/s/^.*<p>The current version is <b>\(.\+\)<\/b>.*$/bzip2-\1/p')"; + ;; + get_version) + cu_fname_version="${cu_fname#bzip2-}"; + ;; + esac; +}; + pkg_infounzip_check_updates() { case "${1}" in get_fnames) |