[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dist-hook and rights
From: |
Akim Demaille |
Subject: |
Re: dist-hook and rights |
Date: |
Fri, 30 Apr 2004 12:39:00 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
>>> "Alexandre" == Alexandre Duret-Lutz <address@hidden> writes:
> On Thu, Apr 29, 2004 at 03:11:35PM +0200, Akim Demaille wrote:
>>
>> Hi!
>>
>> When running make distcheck, dist-hook is run twice: once for the
>> outer tarball, then for the dist performed on the tree built by
>> distcheck.
>>
>> There is a big difference between the two though: in the second case,
>> the tree is read only, which forbids side effects from dist-hook,
>> which should be valid IMHO.
> I do not understand this. dist-hook is there to allow modifications
> of things inside $(distdir)/. I believe this directory is never
> read-only.
Actually, it may be, and especially during the inner dist! But you
know this, as shows your next paragraph. Just for the records:
distdir: $(DISTFILES)
[...]
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {}
\; \
|| chmod -R a+r $(distdir)
The perms are fixed after dist-hook, so the inner distdir builds an inner
builddir with basically `cp', hence it propagates the read-only
permissions from the source tree. It is only after that dist-hook was
running that the write permissions are restored in builddir.
Hence outer dist-hook has read/write rights, while the inner has read
only.
> Since this is the inner `make dist', every file in the source tree is
> expected to be up-to-date (or the tarball generated by the first `make
> dist' is bogus), and their should be no reason to update them. That
> also guaranties that `make dist' can work even of the source tree is
> read-only.
Well, that's a different matter.
I have a specific dist-hook tailored to build tarballs sliced in
different ways. This is triggered by
make dist STAGE=?
and dist-hook uses STAGE to cut some directories, hence I rewrite
configure.ac and some Makefile.am, and then run bootstrap to
autoreconf everybody.
Now, the inner make dist also receives this cutting request, and
reruns bootstrap (with its autoreconf -f). Hence the problem.
The question is: am I really out of the line here? In which case,
maybe the documentation should emphasize this issue for dist-hook.
And if not, let's add another chmod-restoring find invocation before
running dist-hook.
I'm fine with both (but of course the second will require that I
reconsider my tarball slicing architecture).