mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-14 02:16:18 +02:00
Compare commits
5 Commits
272-check-
...
a1b66a95b6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a1b66a95b6 | ||
![]() |
fc56ebedf3 | ||
![]() |
01757e6904 | ||
![]() |
c5fe8ff3e6 | ||
![]() |
52b8cf1928 |
@@ -150,6 +150,7 @@ _pkgctl_cmds=(
|
|||||||
db
|
db
|
||||||
diff
|
diff
|
||||||
issue
|
issue
|
||||||
|
license
|
||||||
release
|
release
|
||||||
repo
|
repo
|
||||||
search
|
search
|
||||||
|
@@ -80,7 +80,7 @@ check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAG
|
|||||||
makechrootpkg_args+=("${@:$OPTIND}")
|
makechrootpkg_args+=("${@:$OPTIND}")
|
||||||
|
|
||||||
# Automatically recreate the root chroot if a version mismatch is detected
|
# Automatically recreate the root chroot if a version mismatch is detected
|
||||||
CURRENT_CHROOT_VERSION=$(cat "${chroots}/${repo}-${arch}/root/.arch-chroot" 2>/dev/null)
|
CURRENT_CHROOT_VERSION=$(cat "${chroots}/${repo}-${arch}/root/.arch-chroot")
|
||||||
if [[ -f "${chroots}/${repo}-${arch}/root/.arch-chroot" ]] && [[ "$CURRENT_CHROOT_VERSION" != "$CHROOT_VERSION" ]]; then
|
if [[ -f "${chroots}/${repo}-${arch}/root/.arch-chroot" ]] && [[ "$CURRENT_CHROOT_VERSION" != "$CHROOT_VERSION" ]]; then
|
||||||
warning "Recreating chroot '%s' (%s) as it is not at version %s" "${chroots}/${repo}-${arch}/root" "$CURRENT_CHROOT_VERSION" "$CHROOT_VERSION"
|
warning "Recreating chroot '%s' (%s) as it is not at version %s" "${chroots}/${repo}-${arch}/root" "$CURRENT_CHROOT_VERSION" "$CHROOT_VERSION"
|
||||||
clean_first=true
|
clean_first=true
|
||||||
|
@@ -155,7 +155,7 @@ if (( ${#needsversioning[*]} )); then
|
|||||||
if [[ ! -f "${file}" ]]; then
|
if [[ ! -f "${file}" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if ! git ls-files --error-unmatch "$file"; then
|
if ! git ls-files --error-unmatch "$file" >/dev/null; then
|
||||||
die "%s is not under version control" "$file"
|
die "%s is not under version control" "$file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@@ -191,7 +191,9 @@ path = [
|
|||||||
".nvchecker.toml",
|
".nvchecker.toml",
|
||||||
"*.install",
|
"*.install",
|
||||||
"*.sysusers",
|
"*.sysusers",
|
||||||
|
"*sysusers.conf",
|
||||||
"*.tmpfiles",
|
"*.tmpfiles",
|
||||||
|
"*tmpfiles.conf",
|
||||||
"*.logrotate",
|
"*.logrotate",
|
||||||
"*.pam",
|
"*.pam",
|
||||||
"*.service",
|
"*.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
|
rmdir --ignore-fail-on-non-empty src 2>/dev/null || true
|
||||||
|
|
||||||
# Create a temporary directory on the server
|
# Create a temporary directory on the server
|
||||||
remote_temp=$(
|
cmd='
|
||||||
ssh "${SSH_OPTS[@]}" -- "$server" '
|
|
||||||
temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" &&
|
temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" &&
|
||||||
mkdir -p "$temp" &&
|
mkdir -p "$temp" &&
|
||||||
mktemp --directory --tmpdir="$temp"
|
mktemp --directory --tmpdir="$temp"
|
||||||
')
|
'
|
||||||
|
remote_temp=$(ssh "${SSH_OPTS[@]}" -- "$server" "bash -l -c '$cmd'")
|
||||||
|
|
||||||
# Transfer the srcpkg to the server
|
# Transfer the srcpkg to the server
|
||||||
msg "Transferring source package to the server..."
|
msg "Transferring source package to the server..."
|
||||||
@@ -109,18 +109,17 @@ rsync "${RSYNC_OPTS[@]}" -- "$srcpkg" "$server":"$remote_temp" || die
|
|||||||
|
|
||||||
# Prepare the srcpkg on the server
|
# Prepare the srcpkg on the server
|
||||||
msg "Extracting srcpkg"
|
msg "Extracting srcpkg"
|
||||||
ssh "${SSH_OPTS[@]}" -- "$server" "cd ${remote_temp@Q} && bsdtar --strip-components 1 -xvf $(basename "$srcpkg")" || die
|
ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l 'cd ${remote_temp@Q} && bsdtar --strip-components 1 -xvf $(basename "$srcpkg")'" || die
|
||||||
|
|
||||||
# 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
|
||||||
if ssh "${SSH_OPTS[@]}" -t -- "$server" "cd ${remote_temp@Q} && export LOGDEST="" && ${archbuild_cmd[@]@Q}"; then
|
if ssh "${SSH_OPTS[@]}" -t -- "$server" "bash -c -l '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 < <(
|
cmd='
|
||||||
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" &&
|
||||||
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" &&
|
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" &&
|
||||||
if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then
|
if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then
|
||||||
@@ -132,13 +131,12 @@ if ssh "${SSH_OPTS[@]}" -t -- "$server" "cd ${remote_temp@Q} && export LOGDEST="
|
|||||||
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"
|
||||||
')
|
'
|
||||||
|
mapfile -t files < <(ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l '$cmd'")
|
||||||
else
|
else
|
||||||
# Build failed, only the logs should be downloaded from the server
|
# Build failed, only the logs should be downloaded from the server
|
||||||
mapfile -t files < <(
|
cmd='find '"${remote_temp@Q}"' -name "*.log"'
|
||||||
ssh "${SSH_OPTS[@]}" -- "$server" '
|
mapfile -t files < <(ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l '$cmd'")
|
||||||
find '"${remote_temp@Q}"' -name "*.log"
|
|
||||||
')
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user