mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
1 Commits
a1b66a95b6
...
mr-origin-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ef6da62956 |
@@ -150,7 +150,6 @@ _pkgctl_cmds=(
|
||||
db
|
||||
diff
|
||||
issue
|
||||
license
|
||||
release
|
||||
repo
|
||||
search
|
||||
|
@@ -155,7 +155,7 @@ if (( ${#needsversioning[*]} )); then
|
||||
if [[ ! -f "${file}" ]]; then
|
||||
continue
|
||||
fi
|
||||
if ! git ls-files --error-unmatch "$file" >/dev/null; then
|
||||
if ! git ls-files --error-unmatch "$file"; then
|
||||
die "%s is not under version control" "$file"
|
||||
fi
|
||||
done
|
||||
|
@@ -94,19 +94,19 @@ pkgctl_license_check() {
|
||||
pushd "${path}" >/dev/null
|
||||
|
||||
if [[ ! -f PKGBUILD ]]; then
|
||||
msg_error "${BOLD}${pkgbase}:${ALL_OFF} no PKGBUILD found"
|
||||
msg_error "${BOLD}${path}:${ALL_OFF} no PKGBUILD found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# reset common PKGBUILD variables
|
||||
unset pkgbase
|
||||
|
||||
# shellcheck source=contrib/makepkg/PKGBUILD.proto
|
||||
if ! . ./PKGBUILD; then
|
||||
msg_error "${BOLD}${pkgbase}:${ALL_OFF} failed to source PKGBUILD"
|
||||
if [[ ! -f .SRCINFO ]]; then
|
||||
msg_error "${BOLD}${path}:${ALL_OFF} no .SRCINFO found"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! pkgbase=$(grep --max-count=1 --extended-regexp "pkgbase = (.+)" .SRCINFO | awk '{print $3}'); then
|
||||
msg_error "${BOLD}${path}:${ALL_OFF} pkgbase not found in .SRCINFO"
|
||||
return 1
|
||||
fi
|
||||
pkgbase=${pkgbase:-$pkgname}
|
||||
|
||||
if [[ ! -e LICENSE ]]; then
|
||||
msg_error "${BOLD}${pkgbase}:${ALL_OFF} is missing the LICENSE file"
|
||||
|
@@ -191,9 +191,7 @@ path = [
|
||||
".nvchecker.toml",
|
||||
"*.install",
|
||||
"*.sysusers",
|
||||
"*sysusers.conf",
|
||||
"*.tmpfiles",
|
||||
"*tmpfiles.conf",
|
||||
"*.logrotate",
|
||||
"*.pam",
|
||||
"*.service",
|
||||
|
@@ -94,12 +94,12 @@ makepkg_source_package || die "unable to make source package"
|
||||
rmdir --ignore-fail-on-non-empty src 2>/dev/null || true
|
||||
|
||||
# Create a temporary directory on the server
|
||||
cmd='
|
||||
temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" &&
|
||||
mkdir -p "$temp" &&
|
||||
mktemp --directory --tmpdir="$temp"
|
||||
'
|
||||
remote_temp=$(ssh "${SSH_OPTS[@]}" -- "$server" "bash -l -c '$cmd'")
|
||||
remote_temp=$(
|
||||
ssh "${SSH_OPTS[@]}" -- "$server" '
|
||||
temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" &&
|
||||
mkdir -p "$temp" &&
|
||||
mktemp --directory --tmpdir="$temp"
|
||||
')
|
||||
|
||||
# Transfer the srcpkg to the server
|
||||
msg "Transferring source package to the server..."
|
||||
@@ -109,34 +109,36 @@ rsync "${RSYNC_OPTS[@]}" -- "$srcpkg" "$server":"$remote_temp" || die
|
||||
|
||||
# Prepare the srcpkg on the server
|
||||
msg "Extracting srcpkg"
|
||||
ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l 'cd ${remote_temp@Q} && bsdtar --strip-components 1 -xvf $(basename "$srcpkg")'" || die
|
||||
ssh "${SSH_OPTS[@]}" -- "$server" "cd ${remote_temp@Q} && bsdtar --strip-components 1 -xvf $(basename "$srcpkg")" || die
|
||||
|
||||
# Run the build command on the server
|
||||
msg "Running archbuild"
|
||||
# shellcheck disable=SC2145
|
||||
if ssh "${SSH_OPTS[@]}" -t -- "$server" "bash -c -l 'cd ${remote_temp@Q} && export LOGDEST="" && ${archbuild_cmd[@]@Q}'"; then
|
||||
if ssh "${SSH_OPTS[@]}" -t -- "$server" "cd ${remote_temp@Q} && export LOGDEST="" && ${archbuild_cmd[@]@Q}"; then
|
||||
msg "Build complete"
|
||||
|
||||
# Get an array of files that should be downloaded from the server
|
||||
cmd='
|
||||
cd '"${remote_temp@Q}"' &&
|
||||
makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" &&
|
||||
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" &&
|
||||
if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then
|
||||
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf"
|
||||
fi &&
|
||||
while read -r file; do
|
||||
[[ -f "${file}" ]] && printf "%s\n" "${file}" ||:
|
||||
done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) &&
|
||||
printf "%s\n" '"${remote_temp@Q}/PKGBUILD"'
|
||||
mapfile -t files < <(
|
||||
ssh "${SSH_OPTS[@]}" -- "$server" "
|
||||
cd ${remote_temp@Q}"' &&
|
||||
makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" &&
|
||||
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" &&
|
||||
if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then
|
||||
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf"
|
||||
fi &&
|
||||
while read -r file; do
|
||||
[[ -f "${file}" ]] && printf "%s\n" "${file}" ||:
|
||||
done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) &&
|
||||
printf "%s\n" '"${remote_temp@Q}/PKGBUILD"'
|
||||
|
||||
find '"${remote_temp@Q}"' -name "*.log"
|
||||
'
|
||||
mapfile -t files < <(ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l '$cmd'")
|
||||
find '"${remote_temp@Q}"' -name "*.log"
|
||||
')
|
||||
else
|
||||
# Build failed, only the logs should be downloaded from the server
|
||||
cmd='find '"${remote_temp@Q}"' -name "*.log"'
|
||||
mapfile -t files < <(ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l '$cmd'")
|
||||
mapfile -t files < <(
|
||||
ssh "${SSH_OPTS[@]}" -- "$server" '
|
||||
find '"${remote_temp@Q}"' -name "*.log"
|
||||
')
|
||||
fi
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user