[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/9] tools/build: fix pygrub linking

Ian Jackson wrote:
> Roger Pau Monne writes ("Re: [PATCH 2/9] tools/build: fix pygrub linking"):
>> diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
>> index bd22dd4..182afdd 100644
>> --- a/tools/pygrub/Makefile
>> +++ b/tools/pygrub/Makefile
>> @@ -14,7 +14,9 @@ install: all
>>              $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
>>              --install-scripts=$(PRIVATE_BINDIR) --force
>>      $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
>> +ifneq ($(shell readlink -f $(DESTDIR)/$(BINDIR)), $(shell readlink -f
>>      ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR)
>> +endif
> Why are we doing all this work in make with $(shell...) rather than
> simply in the command stanza ?
> Also I'm a bit confused.  This problem occurs only when DESTDIR="" ?

No, this occurs when $(BINDIR) == $(PRIVATE_BINDIR), but we cannot use
the "test -e", because we might have previous versions of pygrub
installed which should also be overwritten by the link, or the user will
keep using the old version.

> In which case perhaps the right answer is something like
>         set -e; if ! test -e $(DESTDIR)/$(BINDIR)/pygrub; then \
>             ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR); \
>         fi
> Ian.

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.