Commit 54714202 authored by Natanael Copa's avatar Natanael Copa

githooks: skip checksum check for symlink

git will return the target of symlink instead of the content of the file
it points to, which makes the checksum check fail. To fix this we skip
checksum check if object is a symlink.
parent 8baeed5c
......@@ -55,6 +55,11 @@ abuild_local_sources() {
return $status
# check if given object is a symlink
is_symlink() {
test "$(git ls-files --stage "$1" | awk '{print $1}')" = "120000"
# Checks that all local sources specified in the APKBUILD file ($1) are
# available in git tree and checksums are correct.
check_local_sources() {
......@@ -73,6 +78,11 @@ check_local_sources() {
if is_symlink ":$startdir/$filename"; then
checksum_act=$(git show ":$startdir/$filename" | sha512sum)
if [ "$checksum_act" != "$checksum_exp -" ]; then
error "$startdir: bad checksum for file \"$filename\" (hint: run abuild checksum)"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment