diff options
-rwxr-xr-x | .githooks/pre-commit | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 3901bc09de..be06c22512 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -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() { status=1 continue fi + + if is_symlink ":$startdir/$filename"; then + continue + fi + checksum_act=$(git show ":$startdir/$filename" | sha512sum) if [ "$checksum_act" != "$checksum_exp -" ]; then error "$startdir: bad checksum for file \"$filename\" (hint: run abuild checksum)" |