Compare commits

..

1 Commits

Author SHA1 Message Date
Sven-Hendrik Haase
287d2b4064 feat(commitpkg): Change warning to hard error when licensing information is absent
We originally had this as a warning to allow packagers some time for transitioning.
However, now the gloves come off and we will require all packages to have proper licensing
information.
2025-08-01 08:07:16 +02:00
4 changed files with 29 additions and 31 deletions

View File

@@ -150,7 +150,6 @@ _pkgctl_cmds=(
db db
diff diff
issue issue
license
release release
repo repo
search search

View File

@@ -123,10 +123,9 @@ fi
needsversioning=() needsversioning=()
if [[ ! -e REUSE.toml || ! -e LICENSE || ! -d LICENSES ]]; then if [[ ! -e REUSE.toml || ! -e LICENSE || ! -d LICENSES ]]; then
# TODO: Make this a hard failure in the future after packagers have had error "package doesn't have proper licensing information, set it up using:"
# some time to add licenses to all packages.
warning "package doesn't have proper licensing information, set it up using:"
msg2 'pkgctl license setup' msg2 'pkgctl license setup'
exit 1
else else
pkgctl license check pkgctl license check
needsversioning+=(REUSE.toml LICENSE LICENSES/*) needsversioning+=(REUSE.toml LICENSE LICENSES/*)
@@ -155,7 +154,7 @@ if (( ${#needsversioning[*]} )); then
if [[ ! -f "${file}" ]]; then if [[ ! -f "${file}" ]]; then
continue continue
fi 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" die "%s is not under version control" "$file"
fi fi
done done

View File

@@ -191,9 +191,7 @@ path = [
".nvchecker.toml", ".nvchecker.toml",
"*.install", "*.install",
"*.sysusers", "*.sysusers",
"*sysusers.conf",
"*.tmpfiles", "*.tmpfiles",
"*tmpfiles.conf",
"*.logrotate", "*.logrotate",
"*.pam", "*.pam",
"*.service", "*.service",

View File

@@ -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
cmd=' remote_temp=$(
temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" && ssh "${SSH_OPTS[@]}" -- "$server" '
mkdir -p "$temp" && temp="${XDG_CACHE_HOME:-$HOME/.cache}/offload-build" &&
mktemp --directory --tmpdir="$temp" mkdir -p "$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,34 +109,36 @@ 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" "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 # 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" "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" 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
cmd=' mapfile -t files < <(
cd '"${remote_temp@Q}"' && ssh "${SSH_OPTS[@]}" -- "$server" "
makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" && cd ${remote_temp@Q}"' &&
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" && makepkg_user_config="${XDG_CONFIG_HOME:-$HOME/.config}/pacman/makepkg.conf" &&
if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${arch}"'.conf" &&
makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf" if [[ -f /usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf ]]; then
fi && makepkg_config="/usr/share/devtools/makepkg.conf.d/'"${repo}"'-'"${arch}"'.conf"
while read -r file; do fi &&
[[ -f "${file}" ]] && printf "%s\n" "${file}" ||: while read -r file; do
done < <(makepkg --config <(cat "${makepkg_user_config}" "${makepkg_config}" 2>/dev/null) --packagelist) && [[ -f "${file}" ]] && printf "%s\n" "${file}" ||:
printf "%s\n" '"${remote_temp@Q}/PKGBUILD"' 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" 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
cmd='find '"${remote_temp@Q}"' -name "*.log"' mapfile -t files < <(
mapfile -t files < <(ssh "${SSH_OPTS[@]}" -- "$server" "bash -c -l '$cmd'") ssh "${SSH_OPTS[@]}" -- "$server" '
find '"${remote_temp@Q}"' -name "*.log"
')
fi fi