This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=6c6efa41e9d6754d3bd9c1b55f4e94544f436b12

commit 6c6efa41e9d6754d3bd9c1b55f4e94544f436b12
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Mon Sep 27 03:24:43 2021 +0200

    build: Add a check for symlinks in the git repository
    
    We generate dist tarballs with automake, which tells tar to dereference
    symlinks. Check whether there is any symlink in the repository that will
    degrade to a file and abort the tarball dist generation.
    
    We ignore origins/default as even as a regular file, it works fine, and
    it's less trouble to maintain for now.
---
 Makefile.am | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 2c97b830a..fe570616a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -211,10 +211,16 @@ update-po:
 include $(top_srcdir)/cpan.am
 
 # If we create the dist tarball from the git repository, make sure
-# that we're not forgetting some files...
+# that we're not forgetting some files, and we are not storing any symlink
+# in the repository (except for the origins/default one) as those degrade
+# to regular files due to automake telling tar to dereference them.
 dist-hook: dist-cpan
        echo $(VERSION) >$(distdir)/.dist-version
        if [ -e .git ]; then \
+         for file in `git ls-tree | grep ^12 | grep -v t/origins/default`; do \
+           echo "$$file is a symlink packed as a file on the dist tar" >&2 ; \
+           exit 1 ; \
+         done ; \
          for file in `git ls-files | grep -v .gitignore`; do \
            if [ ! -e "$(distdir)/$$file" ]; then \
              echo "$$file is missing in $(distdir)" >&2 ; \

-- 
Dpkg.Org's dpkg

Reply via email to