Skip to contentSkip to conversation

install: Fix failed to create symbolic link hwlatdetect file exists

RFC PATCH In review John Kacur 2 participants 3 messages Mar 23, 2012 – Mar 26, 2012 Kbuild

lore
Share & tools
lore

John Kacur

author
#0 lore raw

RFC PATCH 1/1 install: Fix failed to create symbolic link hwlatdetect file exists

The following build error can occur if you have done a previous make install

if test -n "/usr/lib/python2.7/site-packages" ; then \
	install -D -m 755 src/hwlatdetect/hwlatdetect.py /usr/lib/python2.7/site-packages/hwlatdetect.py ; \
	ln -s /usr/lib/python2.7/site-packages/hwlatdetect.py "/usr/local/bin/hwlatdetect" ; \

fi
ln: failed to create symbolic link `/usr/local/bin/hwlatdetect': File exists
make: *** [install] Error 1

Fix the error by removing the symbolic link.

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index ff697ca..31e1792 100644
@@ -125,6 +125,7 @@ install: all
 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
 	if test -n "$(PYLIB)" ; then \
 		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
 		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
 	fi
 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 3 lines · John Kacur

               install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+               rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
               ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \

Why an additional command?
Just change "ln -s" to "ln -sf"...

Signature · 6 lines
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#2 lore raw
Quoted 9 lines · richard -rw- weinberger
Quoted 3 lines · John Kacur

               install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+               rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
               ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \

Why an additional command?
Just change "ln -s" to "ln -sf"...

--

Yup, that's better, but Andrew beat you to it.

Thanks!
John
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html