mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2025-12-22 03:30:17 +00:00
Update repo
This commit is contained in:
@@ -424,7 +424,7 @@ fi
|
||||
# Check if the package is in the compiled list
|
||||
termux_check_package_in_built_packages_list() {
|
||||
[[ ! -f "$TERMUX_BUILD_PACKAGE_CALL_BUILT_PACKAGES_LIST_FILE_PATH" ]] && \
|
||||
termux_error_exit "ERROR: file '$TERMUX_BUILD_PACKAGE_CALL_BUILT_PACKAGES_LIST_FILE_PATH' not found."
|
||||
termux_error_exit "file '$TERMUX_BUILD_PACKAGE_CALL_BUILT_PACKAGES_LIST_FILE_PATH' not found."
|
||||
# slightly faster than `grep -q $word $file`
|
||||
[[ " $(< "$TERMUX_BUILD_PACKAGE_CALL_BUILT_PACKAGES_LIST_FILE_PATH") " == *" $1 "* ]]
|
||||
return $?
|
||||
@@ -440,7 +440,7 @@ termux_add_package_to_built_packages_list() {
|
||||
# Check if the package is in the compiling list
|
||||
termux_check_package_in_building_packages_list() {
|
||||
[[ ! -f "$TERMUX_BUILD_PACKAGE_CALL_BUILDING_PACKAGES_LIST_FILE_PATH" ]] && \
|
||||
termux_error_exit "ERROR: file '$TERMUX_BUILD_PACKAGE_CALL_BUILDING_PACKAGES_LIST_FILE_PATH' not found."
|
||||
termux_error_exit "file '$TERMUX_BUILD_PACKAGE_CALL_BUILDING_PACKAGES_LIST_FILE_PATH' not found."
|
||||
# slightly faster than `grep -q $word $file`
|
||||
[[ $'\n'"$(<"$TERMUX_BUILD_PACKAGE_CALL_BUILDING_PACKAGES_LIST_FILE_PATH")"$'\n' == *$'\n'"$1"$'\n'* ]]
|
||||
return $?
|
||||
|
||||
@@ -35,6 +35,6 @@ termux_step_configure() {
|
||||
termux_step_post_massage() {
|
||||
local _GUARD_FILE="lib/libbotan-2.so"
|
||||
if [ ! -e "${_GUARD_FILE}" ]; then
|
||||
termux_error_exit "Error: file ${_GUARD_FILE} not found."
|
||||
termux_error_exit "file ${_GUARD_FILE} not found."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ termux_pkg_auto_update() {
|
||||
|
||||
local latest_commit_date_tz=$(curl -s "https://api.github.com/repos/ptitSeb/box86/commits/${latest_commit}" | jq .commit.committer.date | sed -e 's|\"||g')
|
||||
if [[ -z "${latest_commit_date_tz}" ]]; then
|
||||
termux_error_exit "ERROR: Unable to get latest commit date info"
|
||||
termux_error_exit "Unable to get latest commit date info"
|
||||
fi
|
||||
|
||||
local latest_commit_date=$(echo "${latest_commit_date_tz}" | sed -e 's|\(.*\)T\(.*\)Z|\1|' -e 's|\-||g')
|
||||
@@ -54,14 +54,14 @@ termux_pkg_auto_update() {
|
||||
fi
|
||||
|
||||
if ! dpkg --compare-versions "${latest_version}" gt "${TERMUX_PKG_VERSION}"; then
|
||||
termux_error_exit "ERROR: Resulting latest version is not counted as update to the current version (${latest_version} < ${TERMUX_PKG_VERSION})"
|
||||
termux_error_exit "Resulting latest version is not counted as update to the current version (${latest_version} < ${TERMUX_PKG_VERSION})"
|
||||
fi
|
||||
|
||||
# unlikely to happen
|
||||
if [[ "${latest_commit_date}" -lt "${_COMMIT_DATE}" ]]; then
|
||||
termux_error_exit "ERROR: Upstream is older than current package version. Please report to upstream."
|
||||
termux_error_exit "Upstream is older than current package version. Please report to upstream."
|
||||
elif [[ "${latest_commit_date}" -eq "${_COMMIT_DATE}" ]] && [[ "${latest_commit_time}" -lt "${_COMMIT_TIME}" ]]; then
|
||||
termux_error_exit "ERROR: Upstream is older than current package version. Please report to upstream."
|
||||
termux_error_exit "Upstream is older than current package version. Please report to upstream."
|
||||
fi
|
||||
|
||||
sed -i "${TERMUX_PKG_BUILDER_DIR}/build.sh" \
|
||||
|
||||
@@ -25,7 +25,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
|
||||
termux_pkg_auto_update() {
|
||||
local latest_tag="$(termux_github_api_get_tag "${TERMUX_PKG_SRCURL}")"
|
||||
[[ -z "${latest_tag}" ]] && termux_error_exit "ERROR: Unable to get tag from ${TERMUX_PKG_SRCURL}"
|
||||
[[ -z "${latest_tag}" ]] && termux_error_exit "Unable to get tag from ${TERMUX_PKG_SRCURL}"
|
||||
termux_pkg_upgrade_version "${latest_tag#FEX-}"
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ termux_pkg_auto_update() {
|
||||
|
||||
local latest_commit_date_tz=$(curl -s "https://api.github.com/repos/ptitSeb/gl4es/commits/${latest_commit}" | jq .commit.committer.date | sed -e 's|\"||g')
|
||||
if [[ -z "${latest_commit_date_tz}" ]]; then
|
||||
termux_error_exit "ERROR: Unable to get latest commit date info"
|
||||
termux_error_exit "Unable to get latest commit date info"
|
||||
fi
|
||||
|
||||
local latest_commit_date=$(echo "${latest_commit_date_tz}" | sed -e 's|\(.*\)T\(.*\)Z|\1|' -e 's|\-||g')
|
||||
@@ -50,14 +50,14 @@ termux_pkg_auto_update() {
|
||||
fi
|
||||
|
||||
if ! dpkg --compare-versions "${latest_version}" gt "${TERMUX_PKG_VERSION}"; then
|
||||
termux_error_exit "ERROR: Resulting latest version is not counted as update to the current version (${latest_version} < ${TERMUX_PKG_VERSION})"
|
||||
termux_error_exit "Resulting latest version is not counted as update to the current version (${latest_version} < ${TERMUX_PKG_VERSION})"
|
||||
fi
|
||||
|
||||
# unlikely to happen
|
||||
if [[ "${latest_commit_date}" -lt "${_COMMIT_DATE}" ]]; then
|
||||
termux_error_exit "ERROR: Upstream is older than current package version. Please report to upstream."
|
||||
termux_error_exit "Upstream is older than current package version. Please report to upstream."
|
||||
elif [[ "${latest_commit_date}" -eq "${_COMMIT_DATE}" ]] && [[ "${latest_commit_time}" -lt "${_COMMIT_TIME}" ]]; then
|
||||
termux_error_exit "ERROR: Upstream is older than current package version. Please report to upstream."
|
||||
termux_error_exit "Upstream is older than current package version. Please report to upstream."
|
||||
fi
|
||||
|
||||
sed -i "${TERMUX_PKG_BUILDER_DIR}/build.sh" \
|
||||
|
||||
@@ -22,6 +22,6 @@ termux_step_pre_configure() {
|
||||
termux_step_post_massage() {
|
||||
local _GUARD_FILE="lib/libgtksourceview-3.0.so"
|
||||
if [ ! -e "${_GUARD_FILE}" ]; then
|
||||
termux_error_exit "Error: file ${_GUARD_FILE} not found."
|
||||
termux_error_exit "file ${_GUARD_FILE} not found."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ termux_step_pre_configure() {
|
||||
termux_step_post_massage() {
|
||||
local _GUARD_FILE="lib/${TERMUX_PKG_NAME}.so"
|
||||
if [ ! -e "${_GUARD_FILE}" ]; then
|
||||
termux_error_exit "Error: file ${_GUARD_FILE} not found."
|
||||
termux_error_exit "file ${_GUARD_FILE} not found."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ termux_step_pre_configure() {
|
||||
termux_step_post_massage() {
|
||||
local _GUARD_FILE="lib/${TERMUX_PKG_NAME}.so"
|
||||
if [ ! -e "${_GUARD_FILE}" ]; then
|
||||
termux_error_exit "Error: file ${_GUARD_FILE} not found."
|
||||
termux_error_exit "file ${_GUARD_FILE} not found."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@ termux_step_post_configure() {
|
||||
termux_step_post_massage() {
|
||||
local _GUARD_FILE="lib/libunique-3.0.so"
|
||||
if [ ! -e "${_GUARD_FILE}" ]; then
|
||||
termux_error_exit "Error: file ${_GUARD_FILE} not found."
|
||||
termux_error_exit "file ${_GUARD_FILE} not found."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -45,6 +45,6 @@ termux_step_pre_configure() {
|
||||
termux_step_post_massage() {
|
||||
local _GUARD_FILE="lib/lib${TERMUX_PKG_NAME}-4.0.so"
|
||||
if [ ! -e "${_GUARD_FILE}" ]; then
|
||||
termux_error_exit "Error: file ${_GUARD_FILE} not found."
|
||||
termux_error_exit "file ${_GUARD_FILE} not found."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -111,7 +111,8 @@ _check() {
|
||||
set -euo pipefail
|
||||
# shellcheck source=/dev/null
|
||||
. "${TERMUX_SCRIPTDIR}/scripts/updates/api/termux_${from_where}_api_get_tag.sh"
|
||||
. "${TERMUX_SCRIPTDIR}/scripts/updates/utils/termux_error_exit.sh"
|
||||
# shellcheck source=scripts/build/termux_error_exit.sh
|
||||
. "${TERMUX_SCRIPTDIR}/scripts/build/termux_error_exit.sh"
|
||||
termux_"${from_where}"_api_get_tag "$@" 2>&1 >/dev/null
|
||||
)" || _check_stderr "${stderr}"
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ TERMUX_PACKAGES_DIRECTORIES=$(jq --raw-output 'del(.pkg_format) | keys | .[]' "$
|
||||
. "${TERMUX_SCRIPTDIR}/scripts/properties.sh"
|
||||
|
||||
# Utility function to write error message to stderr.
|
||||
# shellcheck source=scripts/updates/utils/termux_error_exit.sh
|
||||
. "${TERMUX_SCRIPTDIR}"/scripts/updates/utils/termux_error_exit.sh
|
||||
# shellcheck source=scripts/build/termux_error_exit.sh
|
||||
. "${TERMUX_SCRIPTDIR}/scripts/build/termux_error_exit.sh"
|
||||
|
||||
# Utility function to write updated version to build.sh.
|
||||
# shellcheck source=scripts/updates/utils/termux_pkg_upgrade_version.sh
|
||||
@@ -330,7 +330,7 @@ _should_update() {
|
||||
|
||||
if [[ ! -f "${pkg_dir}/build.sh" ]]; then
|
||||
# Fail if detected a non-package directory.
|
||||
termux_error_exit "ERROR: directory '${pkg_dir}' is not a package."
|
||||
termux_error_exit "directory '${pkg_dir}' is not a package."
|
||||
fi
|
||||
|
||||
# `[[ "$(<"$file")" =~ regex ]]` is bash builtin solution for `grep -q` without spawning extra process
|
||||
@@ -365,7 +365,7 @@ _update_dependencies() {
|
||||
if [[ -z $dep ]]; then
|
||||
continue
|
||||
elif [[ "${dep}" == "ERROR" ]]; then
|
||||
termux_error_exit "ERROR: Obtaining update order failed for $(basename "${pkg_dir}")"
|
||||
termux_error_exit "Obtaining update order failed for $(basename "${pkg_dir}")"
|
||||
fi
|
||||
_should_update "${dep_dir}" && ! _check_updated "${dep_dir}" && _run_update "${dep_dir}"
|
||||
done < <("${TERMUX_SCRIPTDIR}"/scripts/buildorder.py "${pkg_dir}" $TERMUX_PACKAGES_DIRECTORIES || echo "ERROR")
|
||||
@@ -383,7 +383,7 @@ if [[ "$1" == "@all" ]]; then
|
||||
_update_dependencies "${pkg_dir}" # Update all its dependencies first.
|
||||
# NOTE: We are not checking whether dependencies were updated successfully or not.
|
||||
# There is no way to know whether this package will build with current
|
||||
# available verions of its dependencies or needs new ones.
|
||||
# available versions of its dependencies or needs new ones.
|
||||
# So, whatever the case may be. We just need packages to be updated in order
|
||||
# and not care about anything else in between. If something fails to update,
|
||||
# it will be reported by failure handling code, so no worries.
|
||||
@@ -452,7 +452,7 @@ _gh_create_new_issue() {
|
||||
|
||||
<hr>
|
||||
<i>
|
||||
Above error occured when I last tried to update at $(date -u +"%Y-%m-%d %H:%M:%S UTC").<br>
|
||||
Above error occurred when I last tried to update at $(date -u +"%Y-%m-%d %H:%M:%S UTC").<br>
|
||||
Run ID: <a href="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}">${GITHUB_RUN_ID}</a><br><br>
|
||||
<b>Note:</b> Automatic updates will be disabled until this issue is resolved.<br>
|
||||
</i>
|
||||
|
||||
@@ -2,7 +2,7 @@ termux_download_src_archive() {
|
||||
local PKG_SRCURL=(${TERMUX_PKG_SRCURL[@]})
|
||||
local PKG_SHA256=(${TERMUX_PKG_SHA256[@]})
|
||||
if [ ! ${#PKG_SRCURL[@]} == ${#PKG_SHA256[@]} ] && [ ! ${#PKG_SHA256[@]} == 0 ]; then
|
||||
termux_error_exit "Error: length of TERMUX_PKG_SRCURL isn't equal to length of TERMUX_PKG_SHA256."
|
||||
termux_error_exit "length of TERMUX_PKG_SRCURL isn't equal to length of TERMUX_PKG_SHA256."
|
||||
fi
|
||||
|
||||
for i in $(seq 0 $(( ${#PKG_SRCURL[@]}-1 ))); do
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
# shellcheck shell=bash
|
||||
termux_error_exit() {
|
||||
echo -e "ERROR: $*" 1>&2
|
||||
if (( $# )); then
|
||||
printf 'ERROR: %s\n' "$*"
|
||||
else # Read from stdin.
|
||||
printf '%s\n' "$(cat -)"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
@@ -9,7 +9,7 @@ termux_github_api_get_tag() {
|
||||
|
||||
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
|
||||
# Needed to use graphql API.
|
||||
termux_error_exit "ERROR: GITHUB_TOKEN environment variable not set."
|
||||
termux_error_exit "GITHUB_TOKEN environment variable not set."
|
||||
fi
|
||||
|
||||
local PKG_SRCURL="$1"
|
||||
@@ -106,16 +106,16 @@ termux_github_api_get_tag() {
|
||||
tag_name="$(jq --exit-status --raw-output "${jq_filter}" <<<"${response}" \
|
||||
| sed 's/^v//' | grep -P "${FILTER_REGEX}" | head -n 1)"
|
||||
if [[ -z "${tag_name}" ]]; then
|
||||
termux_error_exit "ERROR: No tags matched regex '${FILTER_REGEX}' in '${response}'"
|
||||
termux_error_exit "No tags matched regex '${FILTER_REGEX}' in '${response}'"
|
||||
fi
|
||||
else
|
||||
termux_error_exit "ERROR: Failed to parse tag name from: '${response}'"
|
||||
termux_error_exit "Failed to parse tag name from: '${response}'"
|
||||
fi
|
||||
else
|
||||
if jq --exit-status --raw-output "${jq_filter}" <<<"${response}" >/dev/null; then
|
||||
tag_name="$(jq --exit-status --raw-output "${jq_filter}" <<<"${response}")"
|
||||
else
|
||||
termux_error_exit "ERROR: Failed to parse tag name from: '${response}'"
|
||||
termux_error_exit "Failed to parse tag name from: '${response}'"
|
||||
fi
|
||||
fi
|
||||
elif [[ "${http_code}" == "404" ]]; then
|
||||
|
||||
@@ -68,7 +68,7 @@ termux_gitlab_api_get_tag() {
|
||||
if jq --exit-status --raw-output "${jq_filter}" <<<"${response}" >/dev/null; then
|
||||
tag_name="$(jq --exit-status --raw-output "${jq_filter}" <<<"${response}")"
|
||||
else
|
||||
termux_error_exit "ERROR: Failed to parse tag name from: '${response}'"
|
||||
termux_error_exit "Failed to parse tag name from: '${response}'"
|
||||
fi
|
||||
elif [[ "${http_code}" == "404" ]]; then
|
||||
if jq --exit-status "has(\"message\") and .message == \"Not Found\"" <<<"${response}"; then
|
||||
|
||||
@@ -7,7 +7,7 @@ termux_github_auto_update() {
|
||||
)"
|
||||
|
||||
if [[ -z "${latest_tag}" ]]; then
|
||||
termux_error_exit "ERROR: Unable to get tag from ${TERMUX_PKG_SRCURL}"
|
||||
termux_error_exit "Unable to get tag from ${TERMUX_PKG_SRCURL}"
|
||||
fi
|
||||
termux_pkg_upgrade_version "${latest_tag}"
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ termux_gitlab_auto_update() {
|
||||
"${TERMUX_PKG_SRCURL}" "${TERMUX_PKG_UPDATE_TAG_TYPE}" "${TERMUX_GITLAB_API_HOST}"
|
||||
)"
|
||||
if [[ -z "${latest_tag}" ]]; then
|
||||
termux_error_exit "ERROR: Unable to get tag from ${TERMUX_PKG_SRCURL}"
|
||||
termux_error_exit "Unable to get tag from ${TERMUX_PKG_SRCURL}"
|
||||
fi
|
||||
termux_pkg_upgrade_version "${latest_tag}"
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# shellcheck shell=bash
|
||||
termux_error_exit() {
|
||||
if [ "$#" -eq 0 ]; then
|
||||
# Read from stdin.
|
||||
printf '%s\n' "$(cat)" >&2
|
||||
else
|
||||
printf '%s\n' "$*" >&2
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
@@ -26,8 +26,9 @@ termux_pkg_is_update_needed() {
|
||||
|
||||
# Make it also usable as command line tool. `scripts/bin/apt-compare-versions` is symlinked to this file.
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
# shellcheck source=scripts/build/termux_error_exit.sh
|
||||
declare -f termux_error_exit >/dev/null ||
|
||||
. "$(dirname "$(realpath "${BASH_SOURCE[0]}")")/termux_error_exit.sh" # realpath is used to resolve symlinks.
|
||||
. "$(dirname "$(realpath "${BASH_SOURCE[0]}")")/../../build/termux_error_exit.sh" # realpath is used to resolve symlinks.
|
||||
|
||||
if [[ "${1}" == "--help" ]]; then
|
||||
cat <<-EOF
|
||||
@@ -47,7 +48,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
first_version="$(grep -oP "${version_regexp}" <<<"${first_version}")"
|
||||
second_version="$(grep -oP "${version_regexp}" <<<"${second_version}")"
|
||||
if [[ -z "${first_version}" ]] || [[ -z "${second_version}" ]]; then
|
||||
termux_error_exit "ERROR: Unable to parse version numbers using regexp '${version_regexp}'"
|
||||
termux_error_exit "Unable to parse version numbers using regexp '${version_regexp}'"
|
||||
fi
|
||||
fi
|
||||
if [[ "${first_version}" == "${second_version}" ]]; then
|
||||
|
||||
@@ -100,7 +100,7 @@ termux_pkg_upgrade_version() {
|
||||
echo n | "${TERMUX_SCRIPTDIR}/scripts/bin/update-checksum" "${TERMUX_PKG_NAME}" || {
|
||||
git checkout -- "${TERMUX_PKG_BUILDER_DIR}"
|
||||
git pull --rebase --autostash
|
||||
termux_error_exit "ERROR: failed to update checksum."
|
||||
termux_error_exit "failed to update checksum."
|
||||
}
|
||||
fi
|
||||
|
||||
@@ -133,7 +133,7 @@ termux_pkg_upgrade_version() {
|
||||
if ! "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./build-package.sh -C -a "${TERMUX_ARCH}" -i "${TERMUX_PKG_NAME}"; then
|
||||
_termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh
|
||||
git checkout -- "${TERMUX_PKG_BUILDER_DIR}"
|
||||
termux_error_exit "ERROR: failed to build."
|
||||
termux_error_exit "failed to build."
|
||||
fi
|
||||
|
||||
_termux_should_cleanup "${big_package}" && "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./clean.sh
|
||||
|
||||
Reference in New Issue
Block a user