mirror of
https://gitlab.postmarketos.org/postmarketOS/pmaports.git
synced 2025-07-12 16:19:48 +03:00
githooks: ignore unstaged hunks of APKBUILD (MR 5807)
It's possible that additional sources have been made to an APKBUILD which are unstaged, but if the hunks adding those sources haven't been staged either then it doesn't make sense to fail on this. Use git show to get only the staged hunks for the APKBUILD. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
b76e61f7b4
commit
1c3296a63a
1 changed files with 12 additions and 2 deletions
|
@ -65,7 +65,7 @@ is_symlink() {
|
|||
# available in git tree and checksums are correct.
|
||||
check_local_sources() {
|
||||
local apkbuild="$1"
|
||||
local startdir="${apkbuild%/*}"
|
||||
local startdir="$2"
|
||||
local status=0
|
||||
local checksum_act checksum_exp content filename line sources
|
||||
|
||||
|
@ -109,11 +109,21 @@ check_file_size() {
|
|||
fi
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
[ -f "$_staged" ] && rm "$_staged"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
for apkbuild in $(changed_files '**/APKBUILD'); do
|
||||
check_local_sources "$apkbuild"
|
||||
_staged="$(mktemp)"
|
||||
git show ":$apkbuild" >"$_staged"
|
||||
check_local_sources "$_staged" "${apkbuild%/*}"
|
||||
cleanup
|
||||
done
|
||||
|
||||
for path in $(changed_files); do
|
||||
check_file_size "$path"
|
||||
done
|
||||
|
||||
trap - EXIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue