[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Incorrect directory creation with 'make dist' and EXTRA_DIST
From: |
Sander Niemeijer |
Subject: |
Incorrect directory creation with 'make dist' and EXTRA_DIST |
Date: |
Wed, 4 Jan 2006 18:12:11 +0100 |
Hi all,
I think I have found a bug in automake.
Attached is an example that reproduces the problem.
The problem is triggered by configuring the foo-1.0 package using a
full path to configure (or to use a build directory that differs from
the source directory) and running a 'make dist'.
If I do e.g.
$ tar -zxf foo-1.0.tar.gz
$ cd foo-1.0
$ /Users/sander/foo-1.0/configure
$ make dist
I will end up with an empty directory 'Users/sander/foo-1.0/data' in
my newly created foo-1.0 package.
The problem seems to come from the creation of directories for each
of the EXTRA_DIST entries.
From Makefile.in:
---
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
---> $(mkdir_p) $(distdir)/$(top_srcdir)/data
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$
$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$
$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$
(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
......
---
Since srcdir (and thus also top_srcdir) is derived from the directory
component from the call to configure (i.e. the '/Users/sander/
foo-1.0/' part from '/Users/sander/foo-1.0/configure') this will
translate into
---
$(mkdir_p) $(distdir)/Users/sander/foo-1.0/data
---
which is clearly wrong.
Furthermore, I wonder why this directory creation for EXTRA_DIST
entries is included in the first place, since a couple of lines below
in the Makefile.in we have:
---
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
---
which seems to take care of creation of the directory if it did not
already exist.
foo-1.0.tar.gz
Description: GNU Zip compressed data
Best regards,
Sander Niemeijer
- Incorrect directory creation with 'make dist' and EXTRA_DIST,
Sander Niemeijer <=