public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] makesystem: revive cscope target
@ 2008-12-10 12:10 Jiri Slaby
  2008-12-10 12:41 ` Sam Ravnborg
  2008-12-13 23:13 ` Sam Ravnborg
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby @ 2008-12-10 12:10 UTC (permalink / raw)
  To: sam; +Cc: linux-kbuild, linux-kernel, Jiri Slaby

- export src and obj, so that we can check them in tags.sh
- don't allow * expansion during sh function calls

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 Makefile        |    2 +-
 scripts/tags.sh |   22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 8f4f626..a094d74 100644
--- a/Makefile
+++ b/Makefile
@@ -156,7 +156,7 @@ obj		:= $(objtree)
 
 VPATH		:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
-export srctree objtree VPATH TOPDIR
+export src obj srctree objtree VPATH TOPDIR
 
 
 # SUBARCH tells the usermode build what the underlying arch is.  That is set
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 47274dc..3b7225c 100644
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -21,25 +21,25 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
 if [ ${src} == ${obj} ]; then
 	tree=
 else
-	tree=${srctree}
+	tree=${srctree}/
 fi
 
 # find sources in arch/$ARCH
 find_arch_sources()
 {
-	find ${tree}arch/$1 $ignore -name $2 -print;
+	find ${tree}arch/$1 $ignore -name "$2" -print;
 }
 
 # find sources in arch/$1/include
 find_arch_include_sources()
 {
-	find ${tree}arch/$1/include $ignore -name $2 -print;
+	find ${tree}arch/$1/include $ignore -name "$2" -print;
 }
 
 # find sources in include/
 find_include_sources()
 {
-	find ${tree}include $ignore -name config -prune -o -name $1 -print;
+	find ${tree}include $ignore -name config -prune -o -name "$1" -print;
 }
 
 # find sources in rest of tree
@@ -48,27 +48,27 @@ find_other_sources()
 {
 	find ${tree}* $ignore \
 	     \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-	       -name $1 -print;
+	       -name "$1" -print;
 }
 
 find_sources()
 {
-	find_arch_sources $1 $2
-	find_include_sources $2
-	find_other_sources $2
+	find_arch_sources $1 "$2"
+	find_include_sources "$2"
+	find_other_sources "$2"
 }
 
 all_sources()
 {
-	find_sources $SRCARCH *.[chS]
+	find_sources $SRCARCH '*.[chS]'
 	if [ ! -z "$archinclude" ]; then
-		find_arch_include_sources $archinclude *.[chS]
+		find_arch_include_sources $archinclude '*.[chS]'
 	fi
 }
 
 all_kconfigs()
 {
-	find_sources $SRCARCH "Kconfig*"
+	find_sources $SRCARCH 'Kconfig*'
 }
 
 all_defconfigs()
-- 
1.6.0.5


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

* Re: [PATCH 1/1] makesystem: revive cscope target
  2008-12-10 12:10 [PATCH 1/1] makesystem: revive cscope target Jiri Slaby
@ 2008-12-10 12:41 ` Sam Ravnborg
  2008-12-10 12:46   ` Jiri Slaby
  2008-12-13 23:13 ` Sam Ravnborg
  1 sibling, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2008-12-10 12:41 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linux-kbuild, linux-kernel

On Wed, Dec 10, 2008 at 01:10:13PM +0100, Jiri Slaby wrote:
> - export src and obj, so that we can check them in tags.sh
> - don't allow * expansion during sh function calls

What benefit does this patch give us?
We do not use $obj neither $src in tags.sh.

Likewise we do not pass it non-expanded parameters.

	Sam

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

* Re: [PATCH 1/1] makesystem: revive cscope target
  2008-12-10 12:41 ` Sam Ravnborg
@ 2008-12-10 12:46   ` Jiri Slaby
  2008-12-10 13:00     ` Sam Ravnborg
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2008-12-10 12:46 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild, linux-kernel

On 12/10/2008 01:41 PM, Sam Ravnborg wrote:
> On Wed, Dec 10, 2008 at 01:10:13PM +0100, Jiri Slaby wrote:
>> - export src and obj, so that we can check them in tags.sh
>> - don't allow * expansion during sh function calls
> 
> What benefit does this patch give us?
> We do not use $obj neither $src in tags.sh.

I'm confused...

git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild-next.git
says:
# Do not use full path is we do not use O=.. builds
if [ ${src} == ${obj} ]; then
        tree=
else
        tree=${srctree}
fi
in scripts/tags.sh.

> Likewise we do not pass it non-expanded parameters.

We do inside the script. Try to touch XYZ.S in your build tree, the tags.sh
won't work then.

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

* Re: [PATCH 1/1] makesystem: revive cscope target
  2008-12-10 13:00     ` Sam Ravnborg
@ 2008-12-10 12:59       ` Jiri Slaby
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2008-12-10 12:59 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild, linux-kernel

Sam Ravnborg wrote:
> OK - forgot about that one.
> Will apply your patches when I get at my Linux box.

Ok, thanks.

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

* Re: [PATCH 1/1] makesystem: revive cscope target
  2008-12-10 12:46   ` Jiri Slaby
@ 2008-12-10 13:00     ` Sam Ravnborg
  2008-12-10 12:59       ` Jiri Slaby
  0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2008-12-10 13:00 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linux-kbuild, linux-kernel

On Wed, Dec 10, 2008 at 01:46:51PM +0100, Jiri Slaby wrote:
> On 12/10/2008 01:41 PM, Sam Ravnborg wrote:
> > On Wed, Dec 10, 2008 at 01:10:13PM +0100, Jiri Slaby wrote:
> >> - export src and obj, so that we can check them in tags.sh
> >> - don't allow * expansion during sh function calls
> > 
> > What benefit does this patch give us?
> > We do not use $obj neither $src in tags.sh.
> 
> I'm confused...
> 
> git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild-next.git
> says:
> # Do not use full path is we do not use O=.. builds
> if [ ${src} == ${obj} ]; then
>         tree=
> else
>         tree=${srctree}
> fi
> in scripts/tags.sh.

OK - forgot about that one.
Will apply your patches when I get at my Linux box.

	Sam

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

* Re: [PATCH 1/1] makesystem: revive cscope target
  2008-12-10 12:10 [PATCH 1/1] makesystem: revive cscope target Jiri Slaby
  2008-12-10 12:41 ` Sam Ravnborg
@ 2008-12-13 23:13 ` Sam Ravnborg
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-12-13 23:13 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: linux-kbuild, linux-kernel

On Wed, Dec 10, 2008 at 01:10:13PM +0100, Jiri Slaby wrote:
> - export src and obj, so that we can check them in tags.sh
> - don't allow * expansion during sh function calls
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>

I have applied a slightly modifed version.
See below.

	Sam

>From 6d97189e6862970911ec74cfeaadc3d9ed3e295a Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jirislaby@gmail.com>
Date: Wed, 10 Dec 2008 13:10:13 +0100
Subject: [PATCH] kbuild fix make tags/cscope

- fix combining O=... and tags
- don't allow * expansion during sh function calls

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
[sam: use KBUILD_SRC to check if we use O=...]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/tags.sh |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 47274dc..3c814ba 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -18,28 +18,28 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
           -prune -o"
 
 # Do not use full path is we do not use O=.. builds
-if [ ${src} == ${obj} ]; then
+if [ "${KBUILD_SRC}" == "" ]; then
 	tree=
 else
-	tree=${srctree}
+	tree=${srctree}/
 fi
 
 # find sources in arch/$ARCH
 find_arch_sources()
 {
-	find ${tree}arch/$1 $ignore -name $2 -print;
+	find ${tree}arch/$1 $ignore -name "$2" -print;
 }
 
 # find sources in arch/$1/include
 find_arch_include_sources()
 {
-	find ${tree}arch/$1/include $ignore -name $2 -print;
+	find ${tree}arch/$1/include $ignore -name "$2" -print;
 }
 
 # find sources in include/
 find_include_sources()
 {
-	find ${tree}include $ignore -name config -prune -o -name $1 -print;
+	find ${tree}include $ignore -name config -prune -o -name "$1" -print;
 }
 
 # find sources in rest of tree
@@ -48,27 +48,27 @@ find_other_sources()
 {
 	find ${tree}* $ignore \
 	     \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-	       -name $1 -print;
+	       -name "$1" -print;
 }
 
 find_sources()
 {
-	find_arch_sources $1 $2
-	find_include_sources $2
-	find_other_sources $2
+	find_arch_sources $1 "$2"
+	find_include_sources "$2"
+	find_other_sources "$2"
 }
 
 all_sources()
 {
-	find_sources $SRCARCH *.[chS]
+	find_sources $SRCARCH '*.[chS]'
 	if [ ! -z "$archinclude" ]; then
-		find_arch_include_sources $archinclude *.[chS]
+		find_arch_include_sources $archinclude '*.[chS]'
 	fi
 }
 
 all_kconfigs()
 {
-	find_sources $SRCARCH "Kconfig*"
+	find_sources $SRCARCH 'Kconfig*'
 }
 
 all_defconfigs()
-- 
1.5.6.GIT


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

end of thread, other threads:[~2008-12-13 23:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 12:10 [PATCH 1/1] makesystem: revive cscope target Jiri Slaby
2008-12-10 12:41 ` Sam Ravnborg
2008-12-10 12:46   ` Jiri Slaby
2008-12-10 13:00     ` Sam Ravnborg
2008-12-10 12:59       ` Jiri Slaby
2008-12-13 23:13 ` Sam Ravnborg

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