diff --git a/share/shpkg/shpkg.subr b/share/shpkg/shpkg.subr
index 94b7143..e5c69f7 100644
--- a/share/shpkg/shpkg.subr
+++ b/share/shpkg/shpkg.subr
@@ -287,96 +287,106 @@ shpkg_checkout () {
TREE="$1"
shift
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_checkout: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- if ! [ -d "${SHPKG_REPO_SRC_DIR}" ]; then
- ( verbose 2 shpkg_clone "${SHPKG_REPO}"; )
- fi
- SHPKG_REPO_VERSION_A="$(shpkg_version "${SHPKG_REPO}")"
- ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
- verbose 1 git fetch origin "$TREE" &&
- verbose 1 git checkout "$TREE" &&
- verbose 1 git submodule update; )
- SHPKG_REPO_VERSION_B="$(shpkg_version "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_VERSION_A}" != "x${SHPKG_REPO_VERSION_B}" ]; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.checkout.log"; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_checkout: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ if ! [ -d "${SHPKG_REPO_SRC_DIR}" ]; then
+ ( verbose 2 shpkg_clone "${SHPKG_REPO}"; )
+ fi
+ SHPKG_REPO_VERSION_A="$(shpkg_version "${SHPKG_REPO}")"
+ ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
+ verbose 1 git fetch origin "$TREE" &&
+ verbose 1 git checkout "$TREE" &&
+ verbose 1 git submodule update; )
+ SHPKG_REPO_VERSION_B="$(shpkg_version "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_VERSION_A}" != "x${SHPKG_REPO_VERSION_B}" ]; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.checkout.log"; )
+ fi
+ } || break
done
}
shpkg_clone () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_clone: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_PARENT_DIR="$(shpkg_src_parent_dir "${SHPKG_REPO}")"
- SHPKG_REPO_GIT_BRANCH="$(shpkg_git_branch "${SHPKG_REPO}")"
- SHPKG_REPO_GIT_URL="$(shpkg_git_url "${SHPKG_REPO}")"
- SHPKG_REPO_BASENAME="$(basename "${SHPKG_REPO_DIR}")"
- if ! [ -d "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" ]; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.clone.log"; )
- verbose 1 mkdir -p "${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}"
- ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}" &&
- verbose 1 git clone "${SHPKG_REPO_GIT_URL}" -b "${SHPKG_REPO_GIT_BRANCH}" "${SHPKG_REPO_BASENAME}" &&
- verbose 1 cd "${SHPKG_REPO_BASENAME}" &&
- verbose 1 git submodule init &&
- verbose 1 git submodule update
- )
- SHPKG_REPO_HASH="$(shpkg_hash "${SHPKG_REPO}")"
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.tree_${SHPKG_REPO_GIT_BRANCH}.log"; )
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.commit_${SHPKG_REPO_HASH}.log"; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_clone: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_PARENT_DIR="$(shpkg_src_parent_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_GIT_BRANCH="$(shpkg_git_branch "${SHPKG_REPO}")"
+ SHPKG_REPO_GIT_URL="$(shpkg_git_url "${SHPKG_REPO}")"
+ SHPKG_REPO_BASENAME="$(basename "${SHPKG_REPO_DIR}")"
+ if ! [ -d "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" ]; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.clone.log"; )
+ verbose 1 mkdir -p "${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}"
+ ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}" &&
+ verbose 1 git clone "${SHPKG_REPO_GIT_URL}" -b "${SHPKG_REPO_GIT_BRANCH}" "${SHPKG_REPO_BASENAME}" &&
+ verbose 1 cd "${SHPKG_REPO_BASENAME}" &&
+ verbose 1 git submodule init &&
+ verbose 1 git submodule update
+ )
+ SHPKG_REPO_HASH="$(shpkg_hash "${SHPKG_REPO}")"
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.tree_${SHPKG_REPO_GIT_BRANCH}.log"; )
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.commit_${SHPKG_REPO_HASH}.log"; )
+ fi
+ } || break
done
}
shpkg_fetch () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- SHPKG_REPO_LOG_FETCH="${SHPKG_LOG_TMP_DIR}/${SHPKG_REPO}.fetch.log"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_fetch: unknown repo: $SHPKG_REPO"
- fi
- ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
- verbose -n 1 git fetch --recurse-submodules --tags &&
- git fetch --recurse-submodules --tags | tee "${SHPKG_REPO_LOG_FETCH}"; )
- if [ -s "${SHPKG_REPO_LOG_FETCH}" ]; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.fetch.log"; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_LOG_FETCH="${SHPKG_LOG_TMP_DIR}/${SHPKG_REPO}.fetch.log"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_fetch: unknown repo: $SHPKG_REPO"
+ fi
+ ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
+ verbose -n 1 git fetch --recurse-submodules --tags &&
+ git fetch --recurse-submodules --tags | tee "${SHPKG_REPO_LOG_FETCH}"; )
+ if [ -s "${SHPKG_REPO_LOG_FETCH}" ]; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.fetch.log"; )
+ fi
+ } || break
done
}
shpkg_pull () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_pull: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_VERSION_A="$(shpkg_version "${SHPKG_REPO}")"
- ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
- verbose 1 git pull &&
- verbose 1 git submodule update; )
- SHPKG_REPO_VERSION_B="$(shpkg_version "${SHPKG_REPO}")"
- SHPKG_REPO_VERSION_B_TREE="$(echo "${SHPKG_REPO_VERSION_B}" | cut -d - -f 1)"
- if [ "x${SHPKG_REPO_VERSION_A}" != "x${SHPKG_REPO_VERSION_B}" ]; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.pull.log"; )
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.tree_${SHPKG_REPO_VERSION_B_TREE}.log"; )
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.version_${SHPKG_REPO_VERSION_B}.log"; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_pull: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_VERSION_A="$(shpkg_version "${SHPKG_REPO}")"
+ ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
+ verbose 1 git pull &&
+ verbose 1 git submodule update; )
+ SHPKG_REPO_VERSION_B="$(shpkg_version "${SHPKG_REPO}")"
+ SHPKG_REPO_VERSION_B_TREE="$(echo "${SHPKG_REPO_VERSION_B}" | cut -d - -f 1)"
+ if [ "x${SHPKG_REPO_VERSION_A}" != "x${SHPKG_REPO_VERSION_B}" ]; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.pull.log"; )
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.tree_${SHPKG_REPO_VERSION_B_TREE}.log"; )
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.version_${SHPKG_REPO_VERSION_B}.log"; )
+ fi
+ } || break
done
}
shpkg_clean_sources () {
for SHPKG_REPO; do
- ( verbose 2 shpkg_clean_configure "${SHPKG_REPO}"; )
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- SHPKG_REPO_PARENT_DIR="$(shpkg_src_parent_dir "${SHPKG_REPO}")"
- verbose 1 rm -rf "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- verbose -n 1 "rmdir ${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}"
- rmdir "${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}" 2>/dev/null || true
+ { set -e
+ ( verbose 2 shpkg_clean_configure "${SHPKG_REPO}"; )
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_PARENT_DIR="$(shpkg_src_parent_dir "${SHPKG_REPO}")"
+ verbose 1 rm -rf "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ verbose -n 1 "rmdir ${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}"
+ rmdir "${SHPKG_SRC_DIR}/${SHPKG_REPO_PARENT_DIR}" 2>/dev/null || true
+ } || break
done
}
@@ -410,53 +420,57 @@ shpkg_version () {
shpkg_autogen () {
verbose 2 shpkg_clone "$@"
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- if [ -x "${SHPKG_REPO_SRC_DIR}/autogen" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
- verbose 1 ./autogen; )
- elif [ -f "${SHPKG_REPO_SRC_DIR}/autogen.sh" ]; then
- ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
- verbose 1 sh autogen.sh; )
- elif [ -x "${SHPKG_REPO_SRC_DIR}/bootstrap" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
- verbose 1 ./bootstrap; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ if [ -x "${SHPKG_REPO_SRC_DIR}/autogen" ]; then
+ ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
+ verbose 1 ./autogen; )
+ elif [ -f "${SHPKG_REPO_SRC_DIR}/autogen.sh" ]; then
+ ( verbose 1 cd "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}" &&
+ verbose 1 sh autogen.sh; )
+ elif [ -x "${SHPKG_REPO_SRC_DIR}/bootstrap" ]; then
+ ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
+ verbose 1 ./bootstrap; )
+ fi
+ } || break
done
}
shpkg_build () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_build: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- if shpkg__tag_is_absent build-done; then
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.build.status" running
- ( if ! verbose 2 shpkg_configure "${SHPKG_REPO}"; then
- exit 1
- fi; )
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.build.log"; )
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
- if verbose 1 make -j "${SHPKG_NCPU}"; then
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_build: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ if shpkg__tag_is_absent build-done; then
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.build.status" running
+ ( if ! verbose 2 shpkg_configure "${SHPKG_REPO}"; then
+ exit 1
+ fi; )
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.build.log"; )
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
+ ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
+ if verbose 1 make -j "${SHPKG_NCPU}"; then
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.build.status" ok
+ else
+ exit 1
+ fi ; ) || exit 1
+ elif [ -f "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}/CMakeLists.txt" ]; then
+ if verbose 1 cmake -j "${SHPKG_NCPU}" --build "${SHPKG_REPO_OBJ_DIR}"; then
verbose 2 shpkg_ci_status "${SHPKG_REPO}.build.status" ok
else
exit 1
- fi ; ) || exit 1
- elif [ -f "${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}/CMakeLists.txt" ]; then
- if verbose 1 cmake -j "${SHPKG_NCPU}" --build "${SHPKG_REPO_OBJ_DIR}"; then
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.build.status" ok
- else
- exit 1
- fi
- fi
- shpkg__tag_write build-done
- fi
+ fi
+ fi
+ shpkg__tag_write build-done
+ fi
+ } || break
done
}
@@ -468,86 +482,96 @@ shpkg_checksum () {
shpkg_clean_build () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_clean_build: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
- verbose 1 make clean; )
- fi
- if [ -d "${SHPKG_REPO_OBJ_DIR}" ]; then
- verbose 1 rm -rf "${SHPKG_REPO_OBJ_DIR}"
- fi
- shpkg__tag_remove build-done
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_clean_build: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
+ ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
+ verbose 1 make clean; )
+ fi
+ if [ -d "${SHPKG_REPO_OBJ_DIR}" ]; then
+ verbose 1 rm -rf "${SHPKG_REPO_OBJ_DIR}"
+ fi
+ shpkg__tag_remove build-done
+ } || break
done
}
shpkg_clean_configure () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_clean_configure: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- shpkg__tag_remove configure-done
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_clean_configure: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ shpkg__tag_remove configure-done
+ } || break
done
}
shpkg_configure () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_configure: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- if shpkg__tag_is_absent configure-done; then
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.configure.status" running
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.configure.log"; )
- ( verbose 2 shpkg_autogen "${SHPKG_REPO}"; )
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- if ! [ -d "${SHPKG_REPO_FAKE_DIR}" ]; then
- verbose 1 mkdir -p "${SHPKG_REPO_FAKE_DIR}"
- fi
- if [ -x "${SHPKG_REPO_SRC_DIR}/configure" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
- verbose 1 ./configure --prefix "${SHPKG_PREFIX}"
- )
- elif [ -x "${SHPKG_REPO_SRC_DIR}/configure.sh" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
- verbose 1 ./configure.sh --prefix "${SHPKG_PREFIX}"
- )
- elif [ -f "${SHPKG_REPO_SRC_DIR}/CMakeLists.txt" ]; then
- verbose 1 cmake -S "${SHPKG_REPO_SRC_DIR}" -B "${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}" -D CMAKE_INSTALL_PREFIX:PATH="${SHPKG_PREFIX}" -D BUILD_SHARED_LIBS=ON
- fi
- shpkg__tag_write configure-done
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.configure.status" ok
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_configure: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ if shpkg__tag_is_absent configure-done; then
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.configure.status" running
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.configure.log"; )
+ ( verbose 2 shpkg_autogen "${SHPKG_REPO}"; )
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ if ! [ -d "${SHPKG_REPO_FAKE_DIR}" ]; then
+ verbose 1 mkdir -p "${SHPKG_REPO_FAKE_DIR}"
+ fi
+ if [ -x "${SHPKG_REPO_SRC_DIR}/configure" ]; then
+ ( set -e
+ verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
+ verbose 1 ./configure --prefix "${SHPKG_PREFIX}"
+ )
+ elif [ -x "${SHPKG_REPO_SRC_DIR}/configure.sh" ]; then
+ ( set -e
+ verbose 1 cd "${SHPKG_REPO_SRC_DIR}"
+ verbose 1 ./configure.sh --prefix "${SHPKG_PREFIX}"
+ )
+ elif [ -f "${SHPKG_REPO_SRC_DIR}/CMakeLists.txt" ]; then
+ verbose 1 cmake -S "${SHPKG_REPO_SRC_DIR}" -B "${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}" -D CMAKE_INSTALL_PREFIX:PATH="${SHPKG_PREFIX}" -D BUILD_SHARED_LIBS=ON
+ fi
+ shpkg__tag_write configure-done
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.configure.status" ok
+ fi
+ } || break
done
}
shpkg_fake () {
verbose 2 shpkg_build "$@"
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.fake.log"; )
- if [ -d "${SHPKG_REPO_FAKE_DIR}" ]; then
- verbose 1 rm -rf "${SHPKG_REPO_FAKE_DIR}"
- fi
- verbose 1 mkdir -p "${SHPKG_REPO_FAKE_DIR}"
- if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
- ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
- verbose 1 make prefix="${SHPKG_REPO_FAKE_DIR}" install; )
- elif [ -f "${SHPKG_REPO_SRC_DIR}/CMakeLists.txt" ]; then
- verbose 1 cmake --install "${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}" --prefix "${SHPKG_REPO_FAKE_DIR}"
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.fake.log"; )
+ if [ -d "${SHPKG_REPO_FAKE_DIR}" ]; then
+ verbose 1 rm -rf "${SHPKG_REPO_FAKE_DIR}"
+ fi
+ verbose 1 mkdir -p "${SHPKG_REPO_FAKE_DIR}"
+ if [ -f "${SHPKG_REPO_SRC_DIR}/Makefile" ]; then
+ ( verbose 1 cd "${SHPKG_REPO_SRC_DIR}" &&
+ verbose 1 make prefix="${SHPKG_REPO_FAKE_DIR}" install; )
+ elif [ -f "${SHPKG_REPO_SRC_DIR}/CMakeLists.txt" ]; then
+ verbose 1 cmake --install "${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}" --prefix "${SHPKG_REPO_FAKE_DIR}"
+ fi
+ } || break
done
}
@@ -557,29 +581,31 @@ shpkg_fake_dir () {
shpkg_package () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_package: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
- if ! [ -f "${SHPKG_REPO_PACKAGE}" ]; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.package.log"; )
- SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
- verbose 2 shpkg_fake "${SHPKG_REPO}"
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
- SHPKG_REPO_PACKAGE_CHECKSUM="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.SHA256"
- SHPKG_REPO_PACKAGE_DIR="$(dirname "${SHPKG_REPO_PACKAGE}")"
- if ! [ -d "${SHPKG_REPO_PACKAGE_DIR}" ]; then
- verbose 1 mkdir -p "${SHPKG_REPO_PACKAGE_DIR}"
- fi
- ( verbose 1 cd "${SHPKG_REPO_FAKE_DIR}" &&
- verbose -n 1 "shpkg_checksum > ${SHPKG_REPO_PACKAGE_CHECKSUM}" &&
- shpkg_checksum > "${SHPKG_REPO_PACKAGE_CHECKSUM}" &&
- verbose -n 1 "pax -wz . > ${SHPKG_REPO_PACKAGE}" &&
- pax -wz . > "${SHPKG_REPO_PACKAGE}" )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_package: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
+ if ! [ -f "${SHPKG_REPO_PACKAGE}" ]; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.package.log"; )
+ SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
+ verbose 2 shpkg_fake "${SHPKG_REPO}"
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
+ SHPKG_REPO_PACKAGE_CHECKSUM="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.SHA256"
+ SHPKG_REPO_PACKAGE_DIR="$(dirname "${SHPKG_REPO_PACKAGE}")"
+ if ! [ -d "${SHPKG_REPO_PACKAGE_DIR}" ]; then
+ verbose 1 mkdir -p "${SHPKG_REPO_PACKAGE_DIR}"
+ fi
+ ( verbose 1 cd "${SHPKG_REPO_FAKE_DIR}" &&
+ verbose -n 1 "shpkg_checksum > ${SHPKG_REPO_PACKAGE_CHECKSUM}" &&
+ shpkg_checksum > "${SHPKG_REPO_PACKAGE_CHECKSUM}" &&
+ verbose -n 1 "pax -wz . > ${SHPKG_REPO_PACKAGE}" &&
+ pax -wz . > "${SHPKG_REPO_PACKAGE}" )
+ fi
+ } || break
done
}
@@ -646,49 +672,53 @@ shpkg_is_system_package () {
shpkg_install () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_install: unknown repo: $SHPKG_REPO"
- fi
- if ! shpkg_is_system_package "${SHPKG_REPO_DIR}"; then
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
- SHPKG_REPO_INSTALLED="${SHPKG_VAR_DB_DIR}/installed/${SHPKG_REPO_DIR}"
- SHPKG_REPO_INSTALLED_DIR="$(dirname "${SHPKG_REPO_INSTALLED}")"
- if ! shpkg_is_installed "${SHPKG_REPO}"; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.install.log"; )
- ( verbose 2 shpkg_install_dependencies "${SHPKG_REPO}"; )
- ( verbose 2 shpkg_build "${SHPKG_REPO}"; )
- ( verbose 2 shpkg_package "${SHPKG_REPO}"; )
- SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
- SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
- SHPKG_REPO_PACKAGE_CHECKSUM="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.SHA256"
- ( verbose 1 cd "${SHPKG_DIR}" &&
- verbose -n 1 "pax -rdz < ${SHPKG_REPO_PACKAGE}" &&
- pax -rdz < "${SHPKG_REPO_PACKAGE}"; )
- if ! [ -d "${SHPKG_REPO_INSTALLED_DIR}" ]; then
- verbose 1 mkdir -p "${SHPKG_REPO_INSTALLED_DIR}"
- fi
- verbose -n 1 "echo Version: ${SHPKG_REPO_VERSION} > ${SHPKG_REPO_INSTALLED}"
- echo "Version: ${SHPKG_REPO_VERSION}" > "${SHPKG_REPO_INSTALLED}"
- verbose -n 1 "cat ${SHPKG_REPO_PACKAGE_CHECKSUM} >> ${SHPKG_REPO_INSTALLED}"
- cat "${SHPKG_REPO_PACKAGE_CHECKSUM}" >> "${SHPKG_REPO_INSTALLED}"
- verbose 1 libtool --mode=finish "${SHPKG_LIB_DIR}"
- fi
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_install: unknown repo: $SHPKG_REPO"
+ fi
+ if ! shpkg_is_system_package "${SHPKG_REPO_DIR}"; then
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
+ SHPKG_REPO_INSTALLED="${SHPKG_VAR_DB_DIR}/installed/${SHPKG_REPO_DIR}"
+ SHPKG_REPO_INSTALLED_DIR="$(dirname "${SHPKG_REPO_INSTALLED}")"
+ if ! shpkg_is_installed "${SHPKG_REPO}"; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.install.log"; )
+ ( verbose 2 shpkg_install_dependencies "${SHPKG_REPO}"; )
+ ( verbose 2 shpkg_build "${SHPKG_REPO}"; )
+ ( verbose 2 shpkg_package "${SHPKG_REPO}"; )
+ SHPKG_REPO_VERSION="$(shpkg_version "${SHPKG_REPO}")"
+ SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.tgz"
+ SHPKG_REPO_PACKAGE_CHECKSUM="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}-${SHPKG_REPO_VERSION}.SHA256"
+ ( verbose 1 cd "${SHPKG_DIR}" &&
+ verbose -n 1 "pax -rdz < ${SHPKG_REPO_PACKAGE}" &&
+ pax -rdz < "${SHPKG_REPO_PACKAGE}"; )
+ if ! [ -d "${SHPKG_REPO_INSTALLED_DIR}" ]; then
+ verbose 1 mkdir -p "${SHPKG_REPO_INSTALLED_DIR}"
+ fi
+ verbose -n 1 "echo Version: ${SHPKG_REPO_VERSION} > ${SHPKG_REPO_INSTALLED}"
+ echo "Version: ${SHPKG_REPO_VERSION}" > "${SHPKG_REPO_INSTALLED}"
+ verbose -n 1 "cat ${SHPKG_REPO_PACKAGE_CHECKSUM} >> ${SHPKG_REPO_INSTALLED}"
+ cat "${SHPKG_REPO_PACKAGE_CHECKSUM}" >> "${SHPKG_REPO_INSTALLED}"
+ verbose 1 libtool --mode=finish "${SHPKG_LIB_DIR}"
+ fi
+ fi
+ } || break
done
}
shpkg_install_dependencies () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_install_dependencies: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_DEPENDS_ON="$(shpkg_depends_on "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DEPENDS_ON}" != "x" ]; then
- ( verbose 2 shpkg_install ${SHPKG_REPO_DEPENDS_ON}; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_install_dependencies: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_DEPENDS_ON="$(shpkg_depends_on "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DEPENDS_ON}" != "x" ]; then
+ ( verbose 2 shpkg_install ${SHPKG_REPO_DEPENDS_ON}; )
+ fi
+ } || break
done
}
@@ -718,26 +748,28 @@ shpkg_latest_is_installed () {
shpkg_uninstall () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_uninstall: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_INSTALLED="${SHPKG_VAR_DB_DIR}/installed/${SHPKG_REPO_DIR}"
- if [ -f "${SHPKG_REPO_INSTALLED}" ]; then
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.uninstall.status" running
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.uninstall.log"; )
- verbose 1 cd "${SHPKG_DIR}"
- grep -v : "${SHPKG_REPO_INSTALLED}" |
- cut -d '(' -f 2 |
- cut -d ')' -f 1 |
- while read F; do
- if grep -E "^SHA256 \\($F\\) = " "${SHPKG_REPO_INSTALLED}" |
- "${SHPKG_SHA256}" -c; then
- verbose 1 rm "$F"
- fi
- done
- verbose 1 rm "${SHPKG_REPO_INSTALLED}"
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_uninstall: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_INSTALLED="${SHPKG_VAR_DB_DIR}/installed/${SHPKG_REPO_DIR}"
+ if [ -f "${SHPKG_REPO_INSTALLED}" ]; then
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.uninstall.status" running
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.uninstall.log"; )
+ verbose 1 cd "${SHPKG_DIR}"
+ grep -v : "${SHPKG_REPO_INSTALLED}" |
+ cut -d '(' -f 2 |
+ cut -d ')' -f 1 |
+ while read F; do
+ if grep -E "^SHA256 \\($F\\) = " "${SHPKG_REPO_INSTALLED}" |
+ "${SHPKG_SHA256}" -c; then
+ verbose 1 rm "$F"
+ fi
+ done
+ verbose 1 rm "${SHPKG_REPO_INSTALLED}"
+ fi
+ } || break
done
}
@@ -751,35 +783,39 @@ shpkg_upgrade () {
shpkg_upgrade_rec () {
( verbose 2 shpkg_upgrade_dependencies "$@"; )
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_upgrade_rec: unknown repo: ${SHPKG_REPO}"
- fi
- if ! shpkg_is_system_package "${SHPKG_REPO_DIR}"; then
- verbose 2 shpkg_pull "${SHPKG_REPO}"
- if ! shpkg_latest_is_installed "${SHPKG_REPO}"; then
- ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.upgrade.log"; )
- verbose 2 shpkg_build "${SHPKG_REPO}"
- verbose 2 shpkg_package "${SHPKG_REPO}"
- verbose 2 shpkg_uninstall "${SHPKG_REPO}"
- verbose 2 shpkg_install "${SHPKG_REPO}"
- fi
- else
- true
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_upgrade_rec: unknown repo: ${SHPKG_REPO}"
+ fi
+ if ! shpkg_is_system_package "${SHPKG_REPO_DIR}"; then
+ verbose 2 shpkg_pull "${SHPKG_REPO}"
+ if ! shpkg_latest_is_installed "${SHPKG_REPO}"; then
+ ( verbose 2 shpkg_tag_log "${SHPKG_REPO}.upgrade.log"; )
+ verbose 2 shpkg_build "${SHPKG_REPO}"
+ verbose 2 shpkg_package "${SHPKG_REPO}"
+ verbose 2 shpkg_uninstall "${SHPKG_REPO}"
+ verbose 2 shpkg_install "${SHPKG_REPO}"
+ fi
+ else
+ true
+ fi
+ } || break
done
}
shpkg_upgrade_dependencies () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_upgrade_dependencies: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_DEPENDS_ON="$(shpkg_depends_on "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DEPENDS_ON}" != "x" ]; then
- ( verbose 2 shpkg_upgrade_rec ${SHPKG_REPO_DEPENDS_ON}; )
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_upgrade_dependencies: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_DEPENDS_ON="$(shpkg_depends_on "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DEPENDS_ON}" != "x" ]; then
+ ( verbose 2 shpkg_upgrade_rec ${SHPKG_REPO_DEPENDS_ON}; )
+ fi
+ } || break
done
}
@@ -787,17 +823,19 @@ shpkg_upgrade_dependencies () {
shpkg_clean_all () {
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
- verbose 1 rm -rf "${SHPKG_REPO_FAKE_DIR}"
- SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
- verbose 1 rm -rf "${SHPKG_REPO_OBJ_DIR}"
- SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}"
- verbose 1 rm -rf "${SHPKG_REPO_PACKAGE}"-*
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- verbose 1 rm -rf "${SHPKG_REPO_SRC_DIR}"
- SHPKG_REPO_TAG_DIR="${SHPKG_TAG_DIR}/${SHPKG_REPO_DIR}"
- verbose 1 rm -rf "${SHPKG_REPO_TAG_DIR}"
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ SHPKG_REPO_FAKE_DIR="$(shpkg_fake_dir "${SHPKG_REPO}")"
+ verbose 1 rm -rf "${SHPKG_REPO_FAKE_DIR}"
+ SHPKG_REPO_OBJ_DIR="${SHPKG_OBJ_DIR}/${SHPKG_REPO_DIR}"
+ verbose 1 rm -rf "${SHPKG_REPO_OBJ_DIR}"
+ SHPKG_REPO_PACKAGE="${SHPKG_PACKAGE_DIR}/${SHPKG_REPO_DIR}"
+ verbose 1 rm -rf "${SHPKG_REPO_PACKAGE}"-*
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ verbose 1 rm -rf "${SHPKG_REPO_SRC_DIR}"
+ SHPKG_REPO_TAG_DIR="${SHPKG_TAG_DIR}/${SHPKG_REPO_DIR}"
+ verbose 1 rm -rf "${SHPKG_REPO_TAG_DIR}"
+ } || break
done
}
@@ -928,55 +966,57 @@ shpkg_ci_main () {
echo -n > "${SHPKG_CI_CHANGED_FILES}"
verbose 2 shpkg_ci_status "shpkg_ci.status" running
for SHPKG_REPO; do
- SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
- if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
- err 1 "shpkg_ci: unknown repo: $SHPKG_REPO"
- fi
- SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
- if ! [ -d "${SHPKG_REPO_SRC_DIR}" ]; then
- verbose 2 shpkg_clone "${SHPKG_REPO}"
- else
- verbose 2 shpkg_pull "${SHPKG_REPO}"
- fi
- SHPKG_REPO_GIT_BRANCH="$(shpkg_git_branch "${SHPKG_REPO}")"
- SHPKG_REPO_HASH="$(shpkg_hash "${SHPKG_REPO}")"
- verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.log"
- verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.log"
- verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.log"
- SHPKG_REPO_BUILD_DIR="${SHPKG_CI_BUILD_DIR}/${SHPKG_REPO}"
- if ! [ -d "${SHPKG_REPO_BUILD_DIR}" ]; then
- # first bootstrap
- ( verbose 2 shpkg_bootstrap "${SHPKG_REPO_BUILD_DIR}"; )
- else
- # run shpkg upgrade
- ( . "${SHPKG_REPO_BUILD_DIR}/etc/shpkg/profile"
- if ! verbose 2 shpkg upgrade "${SHPKG_REPO}"; then
- shpkg_ci_status_ko_grep "^${SHPKG_REPO}[.]"
- fi; )
- if verbose 1 cp -p "${SHPKG_REPO_BUILD_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".*.log "${SHPKG_CI_LOG_DIR}"; then
- verbose 2 logs2html
- verbose 2 shpkg_ci_status2png
- fi
- fi
- ( verbose 2 shpkg_bootstrap -f "${SHPKG_REPO_BUILD_DIR}"; )
- ( . "${SHPKG_REPO_BUILD_DIR}/etc/shpkg/profile"
- if ! verbose 2 shpkg install "${SHPKG_REPO}"; then
- shpkg_ci_status_ko_grep "^${SHPKG_REPO}[.]"
- fi ; )
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.status" ok
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.status" ok
- verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.status" ok
- SHPKG_CI_COPY=No
- if verbose 1 cp -p "${SHPKG_REPO_BUILD_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".*.log "${SHPKG_CI_LOG_DIR}"; then
- SHPKG_CI_COPY=Yes
- fi
- if verbose 1 cp -p "${SHPKG_DIR}/var/log/shpkg/tags/${SHPKG_REPO}.ci.log" "${SHPKG_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".ci.*.log "${SHPKG_CI_LOG_DIR}"; then
- SHPKG_CI_COPY=Yes
- fi
- if [ "x${SHPKG_CI_COPY}" = "xYes" ]; then
- verbose 2 logs2html
- verbose 2 shpkg_ci_status2png
- fi
+ { set -e
+ SHPKG_REPO_DIR="$(shpkg_dir "${SHPKG_REPO}")"
+ if [ "x${SHPKG_REPO_DIR}" = "x" ]; then
+ err 1 "shpkg_ci: unknown repo: $SHPKG_REPO"
+ fi
+ SHPKG_REPO_SRC_DIR="${SHPKG_SRC_DIR}/${SHPKG_REPO_DIR}"
+ if ! [ -d "${SHPKG_REPO_SRC_DIR}" ]; then
+ verbose 2 shpkg_clone "${SHPKG_REPO}"
+ else
+ verbose 2 shpkg_pull "${SHPKG_REPO}"
+ fi
+ SHPKG_REPO_GIT_BRANCH="$(shpkg_git_branch "${SHPKG_REPO}")"
+ SHPKG_REPO_HASH="$(shpkg_hash "${SHPKG_REPO}")"
+ verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.log"
+ verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.log"
+ verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.log"
+ SHPKG_REPO_BUILD_DIR="${SHPKG_CI_BUILD_DIR}/${SHPKG_REPO}"
+ if ! [ -d "${SHPKG_REPO_BUILD_DIR}" ]; then
+ # first bootstrap
+ ( verbose 2 shpkg_bootstrap "${SHPKG_REPO_BUILD_DIR}"; )
+ else
+ # run shpkg upgrade
+ ( . "${SHPKG_REPO_BUILD_DIR}/etc/shpkg/profile"
+ if ! verbose 2 shpkg upgrade "${SHPKG_REPO}"; then
+ shpkg_ci_status_ko_grep "^${SHPKG_REPO}[.]"
+ fi; )
+ if verbose 1 cp -p "${SHPKG_REPO_BUILD_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".*.log "${SHPKG_CI_LOG_DIR}"; then
+ verbose 2 logs2html
+ verbose 2 shpkg_ci_status2png
+ fi
+ fi
+ ( verbose 2 shpkg_bootstrap -f "${SHPKG_REPO_BUILD_DIR}"; )
+ ( . "${SHPKG_REPO_BUILD_DIR}/etc/shpkg/profile"
+ if ! verbose 2 shpkg install "${SHPKG_REPO}"; then
+ shpkg_ci_status_ko_grep "^${SHPKG_REPO}[.]"
+ fi ; )
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.status" ok
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.status" ok
+ verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.status" ok
+ SHPKG_CI_COPY=No
+ if verbose 1 cp -p "${SHPKG_REPO_BUILD_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".*.log "${SHPKG_CI_LOG_DIR}"; then
+ SHPKG_CI_COPY=Yes
+ fi
+ if verbose 1 cp -p "${SHPKG_DIR}/var/log/shpkg/tags/${SHPKG_REPO}.ci.log" "${SHPKG_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".ci.*.log "${SHPKG_CI_LOG_DIR}"; then
+ SHPKG_CI_COPY=Yes
+ fi
+ if [ "x${SHPKG_CI_COPY}" = "xYes" ]; then
+ verbose 2 logs2html
+ verbose 2 shpkg_ci_status2png
+ fi
+ } || break
done
verbose 2 shpkg_ci_status "shpkg_ci.status" ok
verbose 2 logs2html