mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-14 10:26:18 +02:00
Compare commits
8 Commits
v1.3.0
...
feature/ve
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7bccfc7d99 | ||
![]() |
8af7a50c03 | ||
![]() |
bed2b5db28 | ||
![]() |
47d5ea1e89 | ||
![]() |
8df81ecd7c | ||
![]() |
1101de9fb9 | ||
![]() |
d5e1c5fae3 | ||
![]() |
e8ab01d662 |
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
|||||||
SHELL=/bin/bash -o pipefail
|
SHELL=/bin/bash -o pipefail
|
||||||
|
|
||||||
V=1.3.0
|
V=1.3.1
|
||||||
BUILDTOOLVER ?= $(V)
|
BUILDTOOLVER ?= $(V)
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
@@ -39,6 +39,14 @@ placed in the `$XDG_CONFIG_HOME`/nvchecker` directory. This keyfile is
|
|||||||
used for providing the necessary authentication tokens required for
|
used for providing the necessary authentication tokens required for
|
||||||
accessing the GitHub or GitLab API.
|
accessing the GitHub or GitLab API.
|
||||||
|
|
||||||
|
Combiner Source
|
||||||
|
---------------
|
||||||
|
|
||||||
|
To utilize the combiner source, the `pkgbase` section must be declared as the
|
||||||
|
combiner source. Additionally, individual sections should be added using a
|
||||||
|
quoted table key consisting of the `pkgbase` followed by the stage name,
|
||||||
|
separated by double colons. For example: `["sudo:stage1"]`.
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@@ -140,7 +140,7 @@ for _pkgname in "${pkgname[@]}"; do
|
|||||||
bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old"
|
bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old"
|
||||||
bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname"
|
bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname"
|
||||||
|
|
||||||
diff --side-by-side --suppress-common-lines --width="$COLUMNS" --color=auto "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
|
diff --side-by-side --suppress-common-lines --width="${COLUMNS:-130}" --color=auto "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
|
||||||
|
|
||||||
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
|
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
|
||||||
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
|
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
|
||||||
|
@@ -14,6 +14,8 @@ set -o pipefail
|
|||||||
|
|
||||||
|
|
||||||
archweb_query_all_packages() {
|
archweb_query_all_packages() {
|
||||||
|
local -a pkgbases
|
||||||
|
|
||||||
[[ -z ${WORKDIR:-} ]] && setup_workdir
|
[[ -z ${WORKDIR:-} ]] && setup_workdir
|
||||||
|
|
||||||
stat_busy "Query all released packages"
|
stat_busy "Query all released packages"
|
||||||
@@ -36,6 +38,7 @@ archweb_query_all_packages() {
|
|||||||
|
|
||||||
archweb_query_maintainer_packages() {
|
archweb_query_maintainer_packages() {
|
||||||
local maintainer=$1
|
local maintainer=$1
|
||||||
|
local -a pkgbases
|
||||||
|
|
||||||
[[ -z ${WORKDIR:-} ]] && setup_workdir
|
[[ -z ${WORKDIR:-} ]] && setup_workdir
|
||||||
|
|
||||||
|
@@ -119,11 +119,13 @@ gitlab_api_call_paged() {
|
|||||||
|
|
||||||
local next_page=1
|
local next_page=1
|
||||||
local total_pages=1
|
local total_pages=1
|
||||||
|
local known_total_pages=1
|
||||||
|
local percentage=100
|
||||||
|
|
||||||
while [[ -n "${next_page}" ]]; do
|
while [[ -n "${next_page}" ]]; do
|
||||||
percentage=$(( 100 * next_page / total_pages ))
|
percentage=$(( 100 * next_page / total_pages ))
|
||||||
printf "📡 Querying GitLab: %s/%s [%s] %%spinner%%" \
|
printf "📡 Querying GitLab: %s/%s [%s] %%spinner%%" \
|
||||||
"${BOLD}${next_page}" "${total_pages}" "${percentage}%${ALL_OFF}" \
|
"${BOLD}${next_page}" "${known_total_pages}" "${percentage}%${ALL_OFF}" \
|
||||||
> "${tmp_file}"
|
> "${tmp_file}"
|
||||||
mv "${tmp_file}" "${status_file}"
|
mv "${tmp_file}" "${status_file}"
|
||||||
|
|
||||||
@@ -148,6 +150,15 @@ gitlab_api_call_paged() {
|
|||||||
|
|
||||||
next_page=$(grep "x-next-page" "${header}" | tr -d '\r' | awk '{ print $2 }')
|
next_page=$(grep "x-next-page" "${header}" | tr -d '\r' | awk '{ print $2 }')
|
||||||
total_pages=$(grep "x-total-pages" "${header}" | tr -d '\r' | awk '{ print $2 }')
|
total_pages=$(grep "x-total-pages" "${header}" | tr -d '\r' | awk '{ print $2 }')
|
||||||
|
# The api is not guaranteed to return x-total-pages for larger query results
|
||||||
|
# https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23931
|
||||||
|
# https://gitlab.com/gitlab-org/gitlab/-/issues/436373
|
||||||
|
if (( total_pages == 0 )); then
|
||||||
|
total_pages=${next_page}
|
||||||
|
known_total_pages="?"
|
||||||
|
else
|
||||||
|
known_total_pages=${total_pages}
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
jq --slurp add "${api_workdir}"/result.* > "${outfile}"
|
jq --slurp add "${api_workdir}"/result.* > "${outfile}"
|
||||||
|
@@ -181,7 +181,7 @@ pkgctl_issue_view() {
|
|||||||
status_dir=$(mktemp --tmpdir="${WORKDIR}" --directory pkgctl-gitlab-api.XXXXXXXXXX)
|
status_dir=$(mktemp --tmpdir="${WORKDIR}" --directory pkgctl-gitlab-api.XXXXXXXXXX)
|
||||||
printf "📡 Querying GitLab issue notes API..." > "${status_dir}/status"
|
printf "📡 Querying GitLab issue notes API..." > "${status_dir}/status"
|
||||||
term_spinner_start "${status_dir}"
|
term_spinner_start "${status_dir}"
|
||||||
if ! output=$(gitlab_project_issue_notes "${project_path}" "${iid}" "${status_dir}/status"); then
|
if ! output=$(gitlab_project_issue_notes "${project_path}" "${iid}" "${status_dir}/status" "sort=asc&order_by=created_at"); then
|
||||||
term_spinner_stop "${status_dir}"
|
term_spinner_stop "${status_dir}"
|
||||||
msg_error "Failed to fetch comments"
|
msg_error "Failed to fetch comments"
|
||||||
exit 1
|
exit 1
|
||||||
|
@@ -65,6 +65,7 @@ pkgctl_repo_clone() {
|
|||||||
local CONFIGURE_OPTIONS=()
|
local CONFIGURE_OPTIONS=()
|
||||||
local jobs=
|
local jobs=
|
||||||
jobs=$(nproc)
|
jobs=$(nproc)
|
||||||
|
local -a pkgbases
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
local command=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
local command=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
@@ -33,6 +33,7 @@ update_pacman_repo_cache() {
|
|||||||
get_pacman_repo_from_pkgbuild() {
|
get_pacman_repo_from_pkgbuild() {
|
||||||
local path=${1:-PKGBUILD}
|
local path=${1:-PKGBUILD}
|
||||||
local repo=${2:-multilib}
|
local repo=${2:-multilib}
|
||||||
|
local -a pkgnames
|
||||||
|
|
||||||
# shellcheck source=contrib/makepkg/PKGBUILD.proto
|
# shellcheck source=contrib/makepkg/PKGBUILD.proto
|
||||||
mapfile -t pkgnames < <(source "${path}"; printf "%s\n" "${pkgname[@]}")
|
mapfile -t pkgnames < <(source "${path}"; printf "%s\n" "${pkgname[@]}")
|
||||||
@@ -67,6 +68,7 @@ get_pkgnames_from_repo_pkgbase() {
|
|||||||
local repo=$1
|
local repo=$1
|
||||||
shift
|
shift
|
||||||
local pkgbases=("$@")
|
local pkgbases=("$@")
|
||||||
|
local -a pkgnames
|
||||||
|
|
||||||
# update the pacman repo cache if it doesn't exist yet
|
# update the pacman repo cache if it doesn't exist yet
|
||||||
if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then
|
if [[ ! -d "${_DEVTOOLS_PACMAN_CACHE_DIR}" ]]; then
|
||||||
|
@@ -292,7 +292,8 @@ get_upstream_version() {
|
|||||||
opts+=(--keyfile "${keyfile}")
|
opts+=(--keyfile "${keyfile}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
|
if ! output=$(GIT_TERMINAL_PROMPT=0 GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null \
|
||||||
|
nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
|
||||||
jq --raw-output 'select((.level != "debug") and (.event != "ignoring invalid version"))'); then
|
jq --raw-output 'select((.level != "debug") and (.event != "ignoring invalid version"))'); then
|
||||||
printf "failed to run nvchecker: %s" "${output}"
|
printf "failed to run nvchecker: %s" "${output}"
|
||||||
return 1
|
return 1
|
||||||
@@ -303,6 +304,11 @@ get_upstream_version() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! output=$(jq --raw-output --exit-status 'select(.name == "'"${pkgbase}"'")' <<< "${output}"); then
|
||||||
|
printf "failed to select pkgbase result from output"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if ! upstream_version=$(jq --raw-output --exit-status '.version' <<< "${output}"); then
|
if ! upstream_version=$(jq --raw-output --exit-status '.version' <<< "${output}"); then
|
||||||
printf "failed to select version from result"
|
printf "failed to select version from result"
|
||||||
return 1
|
return 1
|
||||||
@@ -345,7 +351,7 @@ nvchecker_check_config() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# check if the config contains any section other than pkgbase
|
# check if the config contains any section other than pkgbase
|
||||||
if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase//+/\\+}\"?\\]).+\\]" < "${config}"); then
|
if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase//+/\\+}(:.+)?\"?\\]).+\\]" < "${config}"); then
|
||||||
printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}"
|
printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@@ -114,11 +114,11 @@ ssh "${SSH_OPTS[@]}" -- "$server" "cd ${remote_temp@Q} && bsdtar --strip-compone
|
|||||||
# Run the build command on the server
|
# Run the build command on the server
|
||||||
msg "Running archbuild"
|
msg "Running archbuild"
|
||||||
# shellcheck disable=SC2145
|
# shellcheck disable=SC2145
|
||||||
ssh "${SSH_OPTS[@]}" -t -- "$server" "cd ${remote_temp@Q} && export LOGDEST="" && ${archbuild_cmd[@]@Q}" || die
|
if ssh "${SSH_OPTS[@]}" -t -- "$server" "cd ${remote_temp@Q} && export LOGDEST="" && ${archbuild_cmd[@]@Q}"; then
|
||||||
msg "Build complete"
|
msg "Build complete"
|
||||||
|
|
||||||
# Get an array of files that should be downloaded from the server
|
# Get an array of files that should be downloaded from the server
|
||||||
mapfile -t files < <(
|
mapfile -t files < <(
|
||||||
ssh "${SSH_OPTS[@]}" -- "$server" "
|
ssh "${SSH_OPTS[@]}" -- "$server" "
|
||||||
cd ${remote_temp@Q}"' &&
|
cd ${remote_temp@Q}"' &&
|
||||||
makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" &&
|
makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" &&
|
||||||
@@ -132,7 +132,14 @@ mapfile -t files < <(
|
|||||||
printf "%s\n" '"${remote_temp@Q}/PKGBUILD"'
|
printf "%s\n" '"${remote_temp@Q}/PKGBUILD"'
|
||||||
|
|
||||||
find '"${remote_temp@Q}"' -name "*.log"
|
find '"${remote_temp@Q}"' -name "*.log"
|
||||||
')
|
')
|
||||||
|
else
|
||||||
|
# Build failed, only the logs should be downloaded from the server
|
||||||
|
mapfile -t files < <(
|
||||||
|
ssh "${SSH_OPTS[@]}" -- "$server" '
|
||||||
|
find '"${remote_temp@Q}"' -name "*.log"
|
||||||
|
')
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if (( ${#files[@]} )); then
|
if (( ${#files[@]} )); then
|
||||||
@@ -142,13 +149,14 @@ if (( ${#files[@]} )); then
|
|||||||
if is_globfile "${TEMPDIR}"/*.log; then
|
if is_globfile "${TEMPDIR}"/*.log; then
|
||||||
mv "${TEMPDIR}"/*.log "${LOGDEST:-${PWD}}/"
|
mv "${TEMPDIR}"/*.log "${LOGDEST:-${PWD}}/"
|
||||||
fi
|
fi
|
||||||
# missing PKGBUILD download means the build failed
|
if is_globfile "${TEMPDIR}"/*.pkg.tar*; then
|
||||||
if [[ ! -f "${TEMPDIR}/PKGBUILD" ]]; then
|
# Building a package may change the PKGBUILD during update_pkgver
|
||||||
|
mv "${TEMPDIR}/PKGBUILD" "${PWD}/"
|
||||||
|
mv "${TEMPDIR}"/*.pkg.tar* "${PKGDEST:-${PWD}}/"
|
||||||
|
else
|
||||||
error "Build failed, check logs in ${LOGDEST:-${PWD}}"
|
error "Build failed, check logs in ${LOGDEST:-${PWD}}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mv "${TEMPDIR}/PKGBUILD" "${PWD}/"
|
|
||||||
mv "${TEMPDIR}"/*.pkg.tar* "${PKGDEST:-${PWD}}/"
|
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user