Compare commits

..

2 Commits

Author SHA1 Message Date
Tobias Powalowski
a0ab546bd7 Merge branch 'run0' into 'master'
replace sudo with run0

See merge request archlinux/devtools!266
2025-07-25 13:36:51 +02:00
Tobias Powalowski
0712c4fe2e replace sudo with run0 2024-06-09 12:39:13 +02:00
2 changed files with 9 additions and 9 deletions

View File

@@ -15,8 +15,8 @@ check_root() {
local orig_argv=("$@")
(( EUID == 0 )) && return
if type -P sudo >/dev/null; then
exec sudo --preserve-env="${keepenv}" -- "${orig_argv[@]}"
if type -P run0 && type -P pkexec >/dev/null; then
exec run0 -- "${orig_argv[@]}"
else
exec su root -c "$(printf ' %q' "${orig_argv[@]}")"
fi

View File

@@ -94,19 +94,19 @@ pkgctl_license_check() {
pushd "${path}" >/dev/null
if [[ ! -f PKGBUILD ]]; then
msg_error "${BOLD}${path}:${ALL_OFF} no PKGBUILD found"
msg_error "${BOLD}${pkgbase}:${ALL_OFF} no PKGBUILD found"
return 1
fi
if [[ ! -f .SRCINFO ]]; then
msg_error "${BOLD}${path}:${ALL_OFF} no .SRCINFO found"
return 1
fi
# reset common PKGBUILD variables
unset pkgbase
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"
# shellcheck source=contrib/makepkg/PKGBUILD.proto
if ! . ./PKGBUILD; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} failed to source PKGBUILD"
return 1
fi
pkgbase=${pkgbase:-$pkgname}
if [[ ! -e LICENSE ]]; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} is missing the LICENSE file"