From 44046a5a791e742ef22b052b1fe2ca5e32748fe2 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Nov 18 2016 00:15:20 +0000 Subject: subr/check_updates.subr: preliminary support for infounzip, infozip, libgpg_error, libpthread_stubs, lua, mksh, rxvt_unicode, the_silver_searcher, util_linux, and xcb_proto, --- diff --git a/build.sh b/build.sh index 108d1c7..38a66c1 100755 --- a/build.sh +++ b/build.sh @@ -51,7 +51,9 @@ 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}."; -log_env_vars "build (global)" ${LOG_ENV_VARS}; +if [ ${ARG_CHECK_UPDATES:-0} -eq 0 ]; then + log_env_vars "build (global)" ${LOG_ENV_VARS}; +fi; for BUILD_TARGET_LC in $(subst_tgts ${BUILD_TARGETS_META}); do BUILD_TARGET=$(echo ${BUILD_TARGET_LC} | tr a-z A-Z); for BUILD_PACKAGE_LC in $(get_var_unsafe ${BUILD_TARGET}_PACKAGES); do diff --git a/subr/check_updates.subr b/subr/check_updates.subr index 26a2c4a..65acb83 100644 --- a/subr/check_updates.subr +++ b/subr/check_updates.subr @@ -4,50 +4,94 @@ # cpu_get_fnames() { - case "${cu_url}" in - *://github.com/*) - _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 '//s/^.*\([a-zA-Z]\+-\|v\|\)\(.\+\)<\/span>.*$/\2/p')"; - cu_fname_base="${cu_name}"; - cu_fname_ext="${cu_fname#v${cu_version}.}"; + case "${cu_name}" in + infounzip|infozip) + cu_fname="${cu_url##*/}"; + cu_fname_base="${cu_fname%%[0-9]*}"; + cu_fname_ext="${cu_fname#${cu_fname_base}${cu_version}.}"; ;; - */libgpg-error/*) + libgpg_error) cu_url_index="${cu_url%/*}/"; cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ sed -n '/href="[^"]\+"/s/^.*href="\([^"]\+\)".*$/\1/p')"; cu_fname_base="libgpg-error"; ;; - */util-linux/*) - cu_fname_base="util_linux"; + libpthread_stubs) + cu_fname_base="libpthread-stubs"; + ;; + rxvt_unicode) + cu_fname_base="rxvt-unicode"; + ;; + the_silver_searcher) + cu_url_index="http://geoff.greer.fm/ag/"; + cu_fnames="$(wget ${WGET_ARGS} -qO- ${cu_url_index} |\ + sed -n '/href="[^"]\+"/{s/^.*href="\([^"]\+\)".*$/\1/;s/\/$//;p}')"; + ;; + util_linux) + cu_fname_base="util-linux"; cu_url_index="https://www.kernel.org/pub/linux/utils/util-linux/"; cu_fnames="$(wget ${WGET_ARGS} -qO- ${cu_url_index} |\ sed -n '/href="[^"]\+"/{s/^.*href="\([^"]\+\)".*$/\1/;s/\/$//;p}')"; ;; + xcb_proto) + cu_fname_base="xcb-proto"; + ;; *) - cu_url_index="${cu_url%/*}/"; - cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ - sed -n '/href="[^"]\+"/s/^.*href="\([^"]\+\)".*$/\1/p')"; + 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 '//s/^.*\([a-zA-Z]\+-\|v\|\)\(.\+\)<\/span>.*$/\2/p')"; + cu_fname_base="${cu_name}"; + cu_fname_ext="${cu_fname#v${cu_version}.}"; + fi; ;; esac; + 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')"; + fi; : ${cu_fname:="${cu_url##*/}"}; : ${cu_fname_base:="${cu_fname%%-*}"}; : ${cu_fname_ext:="${cu_fname#${cu_fname_base}-${cu_version}.}"}; }; cpu_get_version() { - case "${cu_url}" in - *://github.com/*) - cu_fname_version="${cu_fname}"; ;; - */util-linux/*) - cu_fname_version="${cu_fname#v}"; ;; - *) if ! [ "${cu_fname#${cu_fname_base}-}" = "${cu_fname}" ]\ - && ! [ "${cu_fname%.${cu_fname_ext}}" = "${cu_fname}" ]; then + case "${cu_name}" in + infounzip|infozip) + if [ "${cu_fname#${cu_fname_base}}" != "${cu_fname}" ]\ + && [ "${cu_fname%.${cu_fname_ext}}" != "${cu_fname}" ]; then + cu_fname_version="${cu_fname%.${cu_fname_ext}}"; + cu_fname_version="${cu_fname_version#*zip*}"; + fi; + ;; + mksh) + if [ "${cu_fname#${cu_fname_base}-}" != "${cu_fname}" ]\ + && [ "${cu_fname%.${cu_fname_ext}}" != "${cu_fname}" ]; then + cu_fname_version="${cu_fname%.${cu_fname_ext}}"; + cu_fname_version="${cu_fname_version#*-R}"; + fi; + ;; + util_linux) + if [ "${cu_fname#${cu_fname_base}-}" = "${cu_fname}" ]\ + && [ "${cu_fname%.${cu_fname_ext}}" = "${cu_fname}" ]; then + cu_fname_version="${cu_fname%.${cu_fname_ext}}"; + cu_fname_version="${cu_fname_version#v}"; + fi; + ;; + *) + if [ "${cu_url#*://github.com/*}" != "${cu_url}" ]; then + if [ "${cu_fname#${cu_fname_base}-}" = "${cu_fname}" ]\ + && [ "${cu_fname%.${cu_fname_ext}}" = "${cu_fname}" ]; then + cu_fname_version="${cu_fname}"; + fi; + elif [ "${cu_fname#${cu_fname_base}-}" != "${cu_fname}" ]\ + && [ "${cu_fname%.${cu_fname_ext}}" != "${cu_fname}" ]; then cu_fname_version="${cu_fname#${cu_fname_base}-}"; cu_fname_version="${cu_fname_version%.${cu_fname_ext}}"; fi; @@ -87,6 +131,10 @@ check_pkg_updates() { sed 's/ /\n/g' | sort -rV | uniq |\ head -n${CHECK_UPDATES_SHOW_NEW:-6} |\ paste -d" " -s)"; + case "${cu_name}" in + mksh) + cu_version="${cu_version#R}"; + esac; if [ "${_cpu_versions%% *}" != "${cu_version}" ]; then log_msg info "New release(s) available for ${cu_name} v${cu_version}: ${_cpu_versions}."; else