classification
Title: make install failed
Type: Stage:
Components: Installation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: akineko, georg.brandl, loewis
Priority: normal Keywords:

Created on 2007-09-03 17:09 by akineko, last changed 2007-09-07 20:13 by georg.brandl. This issue is now closed.

Messages (8)
msg55624 - (view) Author: Aki (akineko) Date: 2007-09-03 17:09
I thought this was already reported but I didn't see it in the list.
If this issue is already addressed, please discard.

The 'make install' failed if I re-run the installation again because
python-config under /usr/local/bin was already there.

Removing /usr/local/lib/python2.5/lib-dynload/Python-2.5.1-py2.5.egg-info
Writing /usr/local/lib/python2.5/lib-dynload/Python-2.5.1-py2.5.egg-info
if test -f /usr/local/bin/python -o -h /usr/local/bin/python; \
then rm -f /usr/local/bin/python; \
else true; \
fi
(cd /usr/local/bin; ln python2.5 python)
(cd /usr/local/bin; ln -sf python2.5-config python-config)
ln: cannot create python-config: File exists
make: *** [bininstall] Error 2

I didn't see such problem under 2.4.

Aki-
msg55700 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-09-06 15:17
Aki schrieb:

> (cd /usr/local/bin; ln python2.5 python)
> (cd /usr/local/bin; ln -sf python2.5-config python-config)
> ln: cannot create python-config: File exists
> make: *** [bininstall] Error 2

Shouldn't ln -f ignore existing destination files?
What system is that?
msg55701 - (view) Author: Aki (akineko) Date: 2007-09-06 15:38
> Shouldn't ln -f ignore existing destination files?
> What system is that?

Well, it was on Solaris 9.

Under Solaris, ln -sf won't clobber an existing soft link.
I don't know if there is a work around of this rather than removing the
link explicitly.

Other Unix experts, any help?

Aki-
msg55704 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-09-06 16:06
Perhaps Martin knows something?
msg55707 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-09-06 16:59
The -f option to ln was not portable, traditionally. So the portable way
to create a symlink if the target might exist is to remove the old
symlink first. I've verified that 'ln -sf' indeed works as reported on
Solaris 9. On Solaris 10, it seems Sun has finally "given in" and
changed the implementation (but not the documentation).

I'm not sure why we bother checking whether the old file exists before
removing it, instead of just doing 'rm -f'; that has been there since
r6352 with no explanation given.
msg55708 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-09-06 17:30
[Martin]
> I'm not sure why we bother checking whether the old file exists before
> removing it, instead of just doing 'rm -f'; that has been there since
> r6352 with no explanation given.

So would this patch be acceptable?

Index: Makefile.pre.in
===================================================================
--- Makefile.pre.in     (Revision 57865)
+++ Makefile.pre.in     (Arbeitskopie)
@@ -655,7 +655,8 @@
        else true; \
        fi
        (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
-       (cd $(DESTDIR)$(BINDIR); $(LN) -sf python$(VERSION)-config python-config)
+       -rm -f $(DESTDIR)$(BINDIR)/python-config
+       (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)

 # Install the interpreter with $(VERSION) affixed
 # This goes into $(exec_prefix)
msg55740 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-09-07 18:50
I haven't tested it, but it looks fine to me.
msg55742 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-09-07 20:13
Committed as rev. 58043, 58044.
History
Date User Action Args
2007-09-07 20:13:15georg.brandlsetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg55742
2007-09-07 18:50:53loewissetassignee: georg.brandl
resolution: accepted
messages: + msg55740
2007-09-06 17:30:22georg.brandlsetmessages: + msg55708
2007-09-06 16:59:43loewissetassignee: loewis -> (no value)
messages: + msg55707
2007-09-06 16:06:21georg.brandlsetassignee: loewis
messages: + msg55704
nosy: + loewis
2007-09-06 15:38:19akinekosetmessages: + msg55701
2007-09-06 15:17:55georg.brandlsetnosy: + georg.brandl
messages: + msg55700
2007-09-03 17:09:15akinekocreate