Compare commits

..

2 Commits

Author SHA1 Message Date
Caleb Maclennan
efeac8504d Merge branch 'update-checksums-on-edit' into 'master'
feat(build): update checksums when editing source files during build

See merge request archlinux/devtools!240
2025-07-27 08:33:46 +03:00
Caleb Maclennan
f2db03786a feat(build): update checksums when editing source files during build
Using the --edit option while doing a build frequently implies making
changes to the sources...whether it is updating a URL or dropping
obsolete patches or other changes. It isn't a 100% correlation of
course, but more often than not any changes made during editing are
*expected* to also update the checksums to be in sync.

Using the --pkgver option already triggers this, but other subsequent
edits do not making for frequent failed edit/build cycles.
2024-03-02 11:22:31 +03:00
2 changed files with 8 additions and 7 deletions

View File

@@ -196,6 +196,7 @@ pkgctl_build() {
;; ;;
-e|--edit) -e|--edit)
EDIT=1 EDIT=1
UPDATE_CHECKSUMS=1
shift shift
;; ;;
-o|--offload) -o|--offload)

View File

@@ -94,19 +94,19 @@ pkgctl_license_check() {
pushd "${path}" >/dev/null pushd "${path}" >/dev/null
if [[ ! -f PKGBUILD ]]; then if [[ ! -f PKGBUILD ]]; then
msg_error "${BOLD}${path}:${ALL_OFF} no PKGBUILD found" msg_error "${BOLD}${pkgbase}:${ALL_OFF} no PKGBUILD found"
return 1 return 1
fi fi
if [[ ! -f .SRCINFO ]]; then # reset common PKGBUILD variables
msg_error "${BOLD}${path}:${ALL_OFF} no .SRCINFO found" unset pkgbase
return 1
fi
if ! pkgbase=$(grep --max-count=1 --extended-regexp "pkgbase = (.+)" .SRCINFO | awk '{print $3}'); then # shellcheck source=contrib/makepkg/PKGBUILD.proto
msg_error "${BOLD}${path}:${ALL_OFF} pkgbase not found in .SRCINFO" if ! . ./PKGBUILD; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} failed to source PKGBUILD"
return 1 return 1
fi fi
pkgbase=${pkgbase:-$pkgname}
if [[ ! -e LICENSE ]]; then if [[ ! -e LICENSE ]]; then
msg_error "${BOLD}${pkgbase}:${ALL_OFF} is missing the LICENSE file" msg_error "${BOLD}${pkgbase}:${ALL_OFF} is missing the LICENSE file"