Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] perf: Make the install relative to DESTDIR if specified

2 views
Skip to first unread message

John Kacur

unread,
Mar 11, 2010, 8:00:01 AM3/11/10
to
Without this change, the install path is relative to
prefix/DESTDIR
where prefix is automatically set to $HOME

This can produce unexpected results. For example

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: /home/jkacur/home/jkacur/tmp/share/...
instead of the expected: /home/jkacur/tmp/share/...

Signed-off-by: John Kacur <jka...@redhat.com>
---
tools/perf/Documentation/Makefile | 4 +++-
tools/perf/Makefile | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index bdd3b7e..bd498d4 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))
DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))

+# Make the path relative to DESTDIR, not prefix
+ifndef DESTDIR
prefix?=$(HOME)
+endif
bindir?=$(prefix)/bin
htmldir?=$(prefix)/share/doc/perf-doc
pdfdir?=$(prefix)/share/doc/perf-doc
@@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man
man1dir=$(mandir)/man1
man5dir=$(mandir)/man5
man7dir=$(mandir)/man7
-# DESTDIR=

ASCIIDOC=asciidoc
ASCIIDOC_EXTRA = --unsafe
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 2d53738..5da0cd0 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -216,7 +216,10 @@ STRIP ?= strip
# runtime figures out where they are based on the path to the executable.
# This can help installing the suite in a relocatable way.

+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR
prefix = $(HOME)
+endif
bindir_relative = bin
bindir = $(prefix)/$(bindir_relative)
mandir = share/man
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc
ETC_PERFCONFIG = etc/perfconfig
endif
lib = lib
-# DESTDIR=

export prefix bindir sharedir sysconfdir

--
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

John Kacur

unread,
Mar 11, 2010, 9:00:02 AM3/11/10
to

Sorry, I'd like to withdraw this patch.

I see I can achieve my desired ends without changing the behaviour for
others who expect the old behaviour,
simply by setting "prefix" on the command line, eg:
make -C tools/perf prefix="" DESTDIR=/home/jkacur/tmp install-man

Thanks.

Ingo Molnar

unread,
Mar 11, 2010, 9:20:02 AM3/11/10
to

* John Kacur <jka...@redhat.com> wrote:

> On Thu, Mar 11, 2010 at 1:57 PM, John Kacur <jka...@redhat.com> wrote:
> > Without this change, the install path is relative to
> > prefix/DESTDIR
> > where prefix is automatically set to $HOME
> >
> > This can produce unexpected results. For example
> >
> > make -C tools/perf DESTDIR=/home/jkacur/tmp install-man
> >

> > creates the directory: ? ? ? ? ?/home/jkacur/home/jkacur/tmp/share/...
> > instead of ?the expected: ? ? ? /home/jkacur/tmp/share/...


> >
> > Signed-off-by: John Kacur <jka...@redhat.com>
> > ---

> > ?tools/perf/Documentation/Makefile | ? ?4 +++-
> > ?tools/perf/Makefile ? ? ? ? ? ? ? | ? ?4 +++-
> > ?2 files changed, 6 insertions(+), 2 deletions(-)


> >
> > diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
> > index bdd3b7e..bd498d4 100644
> > --- a/tools/perf/Documentation/Makefile
> > +++ b/tools/perf/Documentation/Makefile
> > @@ -24,7 +24,10 @@ DOC_MAN1=$(patsubst %.txt,%.1,$(MAN1_TXT))

> > ?DOC_MAN5=$(patsubst %.txt,%.5,$(MAN5_TXT))
> > ?DOC_MAN7=$(patsubst %.txt,%.7,$(MAN7_TXT))


> >
> > +# Make the path relative to DESTDIR, not prefix
> > +ifndef DESTDIR

> > ?prefix?=$(HOME)
> > +endif
> > ?bindir?=$(prefix)/bin
> > ?htmldir?=$(prefix)/share/doc/perf-doc
> > ?pdfdir?=$(prefix)/share/doc/perf-doc


> > @@ -32,7 +35,6 @@ mandir?=$(prefix)/share/man

> > ?man1dir=$(mandir)/man1
> > ?man5dir=$(mandir)/man5
> > ?man7dir=$(mandir)/man7
> > -# DESTDIR=
> >
> > ?ASCIIDOC=asciidoc
> > ?ASCIIDOC_EXTRA = --unsafe


> > diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> > index 2d53738..5da0cd0 100644
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> > @@ -216,7 +216,10 @@ STRIP ?= strip

> > ?# runtime figures out where they are based on the path to the executable.
> > ?# This can help installing the suite in a relocatable way.


> >
> > +# Make the path relative to DESTDIR, not to prefix
> > +ifndef DESTDIR

> > ?prefix = $(HOME)
> > +endif
> > ?bindir_relative = bin
> > ?bindir = $(prefix)/$(bindir_relative)
> > ?mandir = share/man


> > @@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc

> > ?ETC_PERFCONFIG = etc/perfconfig
> > ?endif
> > ?lib = lib
> > -# DESTDIR=
> >
> > ?export prefix bindir sharedir sysconfdir


> >
> > --
> > 1.6.6.1
>
> Sorry, I'd like to withdraw this patch.
>
> I see I can achieve my desired ends without changing the behaviour for
> others who expect the old behaviour,

The old behavior doesnt look very logical though, right?

Ingo

tip-bot for John Kacur

unread,
Mar 11, 2010, 9:50:02 AM3/11/10
to
Commit-ID: 7ae5f21361fea11f58c398701da635f778635d13
Gitweb: http://git.kernel.org/tip/7ae5f21361fea11f58c398701da635f778635d13
Author: John Kacur <jka...@redhat.com>
AuthorDate: Thu, 11 Mar 2010 13:57:00 +0100
Committer: Ingo Molnar <mi...@elte.hu>
CommitDate: Thu, 11 Mar 2010 14:08:11 +0100

perf: Make the install relative to DESTDIR if specified

Without this change, the install path is relative to

prefix/DESTDIR where prefix is automatically set to $HOME.

This can produce unexpected results. For example:

make -C tools/perf DESTDIR=/home/jkacur/tmp install-man

creates the directory: /home/jkacur/home/jkacur/tmp/share/...
instead of the expected: /home/jkacur/tmp/share/...

Signed-off-by: John Kacur <jka...@redhat.com>
Cc: Peter Zijlstra <a.p.zi...@chello.nl>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Arnaldo Carvalho de Melo <ac...@redhat.com>
Cc: Frederic Weisbecker <fwei...@gmail.com>
Cc: Tom Zanussi <tzan...@gmail.com>
Cc: Kyle McMartin <ky...@redhat.com>
Cc: <sta...@kernel.org>
LKML-Reference: <1268312220-12880-1-g...@redhat.com>
Signed-off-by: Ingo Molnar <mi...@elte.hu>

index 5840499..8a8f52d 100644


--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -216,7 +216,10 @@ STRIP ?= strip
# runtime figures out where they are based on the path to the executable.
# This can help installing the suite in a relocatable way.

+# Make the path relative to DESTDIR, not to prefix
+ifndef DESTDIR
prefix = $(HOME)
+endif
bindir_relative = bin
bindir = $(prefix)/$(bindir_relative)
mandir = share/man
@@ -233,7 +236,6 @@ sysconfdir = $(prefix)/etc
ETC_PERFCONFIG = etc/perfconfig
endif
lib = lib
-# DESTDIR=

export prefix bindir sharedir sysconfdir

--

John Kacur

unread,
Mar 11, 2010, 9:50:03 AM3/11/10
to

No, not really. Well, logical for people quickly prototyping code
on their own machines, but perf has grown beyond that.

However, I don't like my quick fix either, maybe I can come-up
with something cleaner.

John

Ingo Molnar

unread,
Mar 11, 2010, 10:30:03 AM3/11/10
to

I've applied it meanwhile though, as /home/jkacur/home/jkacur/ is clearly a
misbehavior :-)

Ingo

0 new messages