midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone
Blob Blame History Raw
#
# 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)
		cu_fname="${cu_url##*/}";
		cu_fname_base="${cu_fname%%[0-9]*}";
		cu_fname_ext="${cu_fname#${cu_fname_base}${cu_version}.}";
		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'	|\
			grep -Ev '/(zip232|unzip552)\..+$')";
		;;
	get_version)
		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;
		;;
	esac;
};

pkg_infozip_check_updates() {
	pkg_infounzip_check_updates "${@}";
};

pkg_john_check_updates() {
	case "${1}" in
	get_fnames)
		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'	|\
			grep -Ev 'john-.+-jumbo-.+\.')";
		;;
	esac;
};

pkg_less_check_updates() {
	case "${1}" in
	get_fnames)
		cu_url_index="http://www.greenwoodsoftware.com/less/";
		cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\
			sed -n '/The current released version is less-[0-9]\+/s/^.*The current released version is less-\([0-9]\+\).*$/less-\1/p')";
		;;
	get_version)
		cu_fname_version="${cu_fname#less-}";
		;;
	esac;
};

pkg_libgpg_error_check_updates() {
	case "${1}" in
	get_fnames)
		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";
		;;
	esac;
};

pkg_lynx_check_updates() {
	case "${1}" in
	get_fnames)
		cu_fname="${cu_url##*/}";
		cu_fname_base="lynx";
		cu_fname_ext="${cu_fname#${cu_fname_base}${cu_version}.}";
		;;
	get_version)
		if [ "${cu_fname#${cu_fname_base}-cur}" = "${cu_fname}" ]\
		&& [ "${cu_fname#*rel\.}" != "${cu_fname}" ]\
		&& [ "${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#lynx}";
		fi;
		;;
	esac;
};

pkg_libpthread_stubs_check_updates() {
	case "${1}" in
	get_fnames)
		cu_fname_base="libpthread-stubs";
		;;
	esac;
};

pkg_man_db_check_updates() {
	case "${1}" in
	get_fnames)
		cu_fname="${cu_url##*/}";
		cu_fname_base="man-db";
		cu_fname_ext="${cu_fname#${cu_fname_base}-${cu_version}.}";
		;;
	esac;
};

pkg_mksh_check_updates() {
	case "${1}" in
	get_version)
		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;
		;;
	version_fixup)
		cu_version="${cu_version#R}";
		;;
	esac;
};

pkg_pacman_check_updates() {
	case "${1}" in
	get_fnames)
		cu_fname="${cu_url##*/}";
		cu_fname_base="pacman";
		cu_fname_ext="${cu_fname#${cu_fname_base}-${cu_version}.}";
		cu_url_index="https://git.archlinux.org/pacman.git/";
		cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\
			sed -n '/<a href='\''\/pacman.git\/tag\/?h=v[0-9.]\+'\''>/s/^.*<a href='\''\/pacman.git\/tag\/?h=v\([0-9.]\+\).*$/pacman-\1/p')";
		;;
	get_version)
		cu_fname_version="${cu_fname#pacman-}";
		;;
	esac;
};

pkg_procps_ng_check_updates() {
	case "${1}" in
	get_fnames)
		cu_url_index="https://gitlab.com/procps-ng/procps/tags/";
		cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\
			sed -n '/<a href="\/procps-ng\/procps\/tags\/[^"]\+"/s/^.*<a href="\/procps-ng\/procps\/tags\/v\([^"]\+\)".*$/\1/p')";
		;;
	get_version)
		cu_fname_version="${cu_fname}";
		;;
	esac;
};

pkg_rxvt_unicode_check_updates() {
	case "${1}" in
	get_fnames)
		cu_fname_base="rxvt-unicode";
		;;
	esac;
};

pkg_the_silver_searcher_check_updates() {
	case "${1}" in
	get_fnames)
		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}')";
		;;
	esac;
};

pkg_tmux_check_updates() {
	case "${1}" in
	get_fnames)
		cu_url_index="https://github.com/tmux/tmux/releases/";
		cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\
			sed -n '/<a href="\/tmux\/tmux\/releases\/tag\//s/^.*<a href="\/tmux\/tmux\/releases\/tag\/\(.\+\)".*$/\1/p')";
		;;
	esac;
};


pkg_util_linux_check_updates() {
	case "${1}" in
	get_fnames)
		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}')";
		;;
	get_version)
		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;
		;;
	esac;
};

pkg_xcb_proto_check_updates() {
	case "${1}" in
	get_fnames)
		cu_fname_base="xcb-proto";
		;;
	esac;
};

pkg_zsh_check_updates() {
	case "${1}" in
	get_fnames)
		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'	|\
			grep -v -- "-doc")";
		;;
	esac;
};

# vim:filetype=sh