summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2019-01-19 14:38:21 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2019-01-19 15:28:07 +0000
commitd279a98da1aae886a4b4201122ce5614a185f008 (patch)
tree0800eca320fced59a554b02507cc009c555407f3 /subr
parente402f659b8e40a27d6ce64ea1a8f08be9f28c848 (diff)
downloadmidipix_build-d279a98da1aae886a4b4201122ce5614a185f008.tar.bz2
midipix_build-d279a98da1aae886a4b4201122ce5614a185f008.tar.xz
etc/build.usage, subr/build_{args,checks}.subr: merges -c into -C as -C prefix.
etc/build.usage, subr/build_{args,init}.subr: merges -[46N] into -F as ipv4|ipv6|offline. subr/ex_rtl_fetch.subr: honour ${{ARG_FETCH_FORCE,DEFAULT_GIT_ARGS}}. subr/pkg_install_strip.subr: correctly strip non-release build binaries. subr/pkg_install_strip.subr:pkg_install_strip(): honour ${ARG_DEBUG_MINIPIX}. vars/env.vars, subr/pkg_fetch_{download,git,wget}.subr: merges fetch_{git,wget} into fetch_download. vars/midipix.vars: adds ${DEFAULT_GIT_ARGS}. vars/{musl,python[23]{,_host}}.vars: updated concerning fetch_download.
Diffstat (limited to 'subr')
-rw-r--r--subr/build_args.subr5
-rw-r--r--subr/build_checks.subr4
-rw-r--r--subr/build_init.subr6
-rw-r--r--subr/ex_rtl_fetch.subr10
-rw-r--r--subr/pkg_fetch_download.subr (renamed from subr/pkg_fetch_wget.subr)5
-rw-r--r--subr/pkg_fetch_git.subr11
-rw-r--r--subr/pkg_install_strip.subr28
7 files changed, 35 insertions, 34 deletions
diff --git a/subr/build_args.subr b/subr/build_args.subr
index 2f18a5dd..7f84414a 100644
--- a/subr/build_args.subr
+++ b/subr/build_args.subr
@@ -4,14 +4,11 @@
BUILD_ARGS_SPEC="
ARCH:arg:-a:
- ARG_IPV4_ONLY:-4:
- ARG_IPV6_ONLY:-6:
ARG_AS_NEEDED:--as-needed:
- ARG_CLEAN:-c:
ARG_CLEAN_BUILDS:arg:-C:
ARG_DEBUG_MINIPIX:--debug-minipix:
ARG_DIST:arg:-D:
- ARG_OFFLINE:-N:
+ ARG_FETCH_FORCE:-F:
ARG_PARALLEL:optarg:-P:auto
ARG_RELAXED:-R:
ARG_RESTART:arg:-r:
diff --git a/subr/build_checks.subr b/subr/build_checks.subr
index b0ba88b8..1955d585 100644
--- a/subr/build_checks.subr
+++ b/subr/build_checks.subr
@@ -33,8 +33,8 @@ build_checks() {
if [ ${_exit:-0} = 1 ]; then
exit 1;
fi;
- if [ ${ARG_CLEAN:-0} -eq 1 ]; then
- ex_rtl_log_msg info "-c specified, cleaning prefix...";
+ if ex_rtl_lmatch "${ARG_CLEAN_BUILDS}" , prefix; then
+ ex_rtl_log_msg info "-C prefix specified, cleaning prefix...";
for _pname in ${DEFAULT_CLEAR_PREFIX_PATHS}; do
ex_rtl_fileop rm ${PREFIX}/${_pname};
done;
diff --git a/subr/build_init.subr b/subr/build_init.subr
index 34fa6b68..c7ec7d4f 100644
--- a/subr/build_init.subr
+++ b/subr/build_init.subr
@@ -40,9 +40,11 @@ build_init() {
exit 0;
fi;
export PATH="${PREFIX}/bin${PATH:+:${PATH}}";
- if [ ${ARG_IPV4_ONLY:-0} -eq 1 ]; then
+ if [ "${ARG_FETCH_FORCE}" = "ipv4" ]; then
+ DEFAULT_GIT_ARGS="-4${DEFAULT_GIT_ARGS:+ ${DEFAULT_GIT_ARGS}}";
DEFAULT_WGET_ARGS="-4${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}";
- elif [ ${ARG_IPV6_ONLY:-0} -eq 1 ]; then
+ elif [ "${ARG_FETCH_FORCE}" = "ipv6" ]; then
+ DEFAULT_GIT_ARGS="-6${DEFAULT_GIT_ARGS:+ ${DEFAULT_GIT_ARGS}}";
DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}";
fi;
_env_vars="$(export | sed -e 's/^export //' -e 's/=.*$//')";
diff --git a/subr/ex_rtl_fetch.subr b/subr/ex_rtl_fetch.subr
index 5b063469..2468fb6b 100644
--- a/subr/ex_rtl_fetch.subr
+++ b/subr/ex_rtl_fetch.subr
@@ -7,9 +7,9 @@ exp_rtl_fetch_url_git() {
_oldpwd="";
if [ -e "${BUILD_DLCACHEDIR}/${_subdir}" ]; then
(ex_rtl_fileop cd "${BUILD_DLCACHEDIR}/${_subdir}" &&\
- git pull origin "${_branch:-main}");
+ git pull ${DEFAULT_GIT_ARGS} origin "${_branch:-main}");
else
- git clone "${_url}" "${BUILD_DLCACHEDIR}/${_subdir}";
+ git clone ${DEFAULT_GIT_ARGS} "${_url}" "${BUILD_DLCACHEDIR}/${_subdir}";
if [ -n "${_branch}" ]; then
(ex_rtl_fileop cd "${BUILD_DLCACHEDIR}/${_subdir}" &&\
git checkout "${_branch}");
@@ -24,6 +24,9 @@ exp_rtl_fetch_url_git() {
ex_rtl_fetch_urls_git() {
local _tgtdir="" _url_spec="" _subdir="" _url="" _git_branch="";
_tgtdir="${1}"; shift;
+ if [ "${ARG_FETCH_FORCE}" = "offline" ]; then
+ return 0;
+ fi;
for _url_spec in "${@}"; do
_subdir="${_url_spec%=*}";
_url="${_url_spec#*=}";
@@ -39,6 +42,9 @@ ex_rtl_fetch_urls_git() {
# N.B. URLs ($1) may contain `?' or '&' characters.
ex_rtl_fetch_url_wget() {
local _url="${1}" _sha256sum_src="${2}" _sha256sum_dst="";
+ if [ "${ARG_FETCH_FORCE}" = "offline" ]; then
+ return 0;
+ fi;
if [ -z "${3}" ]; then
_url_dst="${BUILD_DLCACHEDIR}/$(ex_rtl_basename "${_url}")";
else
diff --git a/subr/pkg_fetch_wget.subr b/subr/pkg_fetch_download.subr
index 56fe79d3..5774d2e4 100644
--- a/subr/pkg_fetch_wget.subr
+++ b/subr/pkg_fetch_download.subr
@@ -2,10 +2,13 @@
# set -o errexit -o noglob are assumed.
#
-pkg_fetch_wget() {
+pkg_fetch_download() {
if [ -n "${PKG_URL}" ]; then
ex_rtl_fetch_url_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}";
fi;
+ if [ -n "${PKG_URLS_GIT}" ]; then
+ ex_rtl_fetch_urls_git "${PKG_BASE_DIR}" ${PKG_URLS_GIT};
+ fi;
};
# vim:filetype=sh
diff --git a/subr/pkg_fetch_git.subr b/subr/pkg_fetch_git.subr
deleted file mode 100644
index 67c05458..00000000
--- a/subr/pkg_fetch_git.subr
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_fetch_git() {
- if [ -n "${PKG_URLS_GIT}" ]; then
- ex_rtl_fetch_urls_git "${PKG_BASE_DIR}" ${PKG_URLS_GIT};
- fi;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_install_strip.subr b/subr/pkg_install_strip.subr
index 2709e77d..5b34d70e 100644
--- a/subr/pkg_install_strip.subr
+++ b/subr/pkg_install_strip.subr
@@ -2,19 +2,23 @@
# set -o errexit -o noglob are assumed.
#
-pkg_strip() {
- local _tree_root="${PKG_DESTDIR}/bin" _bin_path="";
- if [ ! -e "${_tree_root}" ]; then
- return;
- fi;
- for _bin_path in $(find "${_tree_root}" -perm /a=x \
- \( -type f -or -type l \)); do
- if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then
- ex_rtl_log_msg info "Stripping ${_bin_path}...";
- ex_rtl_log_msg vnfo "${PKG_TARGET}-strip ${_bin_path}";
- ${PKG_TARGET}-strip ${_bin_path};
+pkg_install_strip() {
+ local _tree_root="${PKG_DESTDIR}" _bin_path="";
+ if [ -e "${_tree_root}" ]\
+ && [ "${BUILD}" != release ]; then
+ if [ "${PKG_NAME%_minipix}" != "${PKG_NAME}" ]\
+ && [ "${ARG_DEBUG_MINIPIX:-0}" -eq 1 ]; then
+ return;
fi;
- done;
+ for _bin_path in $(find "${_tree_root}" -perm /a=x \
+ \( -type f -or -type l \)); do
+ if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then
+ ex_rtl_log_msg info "Stripping ${_bin_path}...";
+ ex_rtl_log_msg vnfo "${PKG_TARGET}-strip ${_bin_path}";
+ ${PKG_TARGET}-strip ${_bin_path};
+ fi;
+ done;
+ fi;
};
# vim:filetype=sh