public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rt-tests RFC] install: Fix failed to create symbolic link hwlatdetect file exists
@ 2012-03-23  1:20 John Kacur
  2012-03-26 13:09 ` richard -rw- weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: John Kacur @ 2012-03-23  1:20 UTC (permalink / raw)
  To: rt-users, Clark Williams; +Cc: Carsten Emde, Steven Rostedt, John Kacur

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.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index ff697ca..31e1792 100644
--- a/Makefile
+++ b/Makefile
@@ -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"
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH rt-tests RFC] install: Fix failed to create symbolic link hwlatdetect file exists
  2012-03-23  1:20 [PATCH rt-tests RFC] install: Fix failed to create symbolic link hwlatdetect file exists John Kacur
@ 2012-03-26 13:09 ` richard -rw- weinberger
  2012-03-26 13:35   ` John Kacur
  0 siblings, 1 reply; 4+ messages in thread
From: richard -rw- weinberger @ 2012-03-26 13:09 UTC (permalink / raw)
  To: John Kacur; +Cc: rt-users, Clark Williams, Carsten Emde, Steven Rostedt

On Fri, Mar 23, 2012 at 3:20 AM, John Kacur <jkacur@redhat.com> wrote:
>                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"...

-- 
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH rt-tests RFC] install: Fix failed to create symbolic link hwlatdetect file exists
@ 2012-03-26 13:33 John Kacur
  0 siblings, 0 replies; 4+ messages in thread
From: John Kacur @ 2012-03-26 13:33 UTC (permalink / raw)
  To: rt-users, Clark Williams; +Cc: Carsten Emde, Steven Rostedt, John Kacur

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

I initially wanted to fix the error by removing the symbolic link, with rm -rf
but Andrew Burgess pointed out that you can just use the
ln's -f (force) flag. I like that solution better.

Suggested-by: Andrew Burgess <aab@cichlid.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index ff697ca..a143545 100644
--- a/Makefile
+++ b/Makefile
@@ -125,7 +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 ; \
-		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+		ln -sf $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
 	fi
 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
 	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH rt-tests RFC] install: Fix failed to create symbolic link hwlatdetect file exists
  2012-03-26 13:09 ` richard -rw- weinberger
@ 2012-03-26 13:35   ` John Kacur
  0 siblings, 0 replies; 4+ messages in thread
From: John Kacur @ 2012-03-26 13:35 UTC (permalink / raw)
  To: richard -rw- weinberger
  Cc: rt-users, Clark Williams, Carsten Emde, Steven Rostedt

On Mon, Mar 26, 2012 at 3:09 PM, richard -rw- weinberger
<richard.weinberger@gmail.com> wrote:
> On Fri, Mar 23, 2012 at 3:20 AM, John Kacur <jkacur@redhat.com> wrote:
>>                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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-26 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23  1:20 [PATCH rt-tests RFC] install: Fix failed to create symbolic link hwlatdetect file exists John Kacur
2012-03-26 13:09 ` richard -rw- weinberger
2012-03-26 13:35   ` John Kacur
  -- strict thread matches above, loose matches on Subject: below --
2012-03-26 13:33 John Kacur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox