Skip to contentSkip to conversation

Fix cscope filelist by removing leading ./

PATCH Applied Ryan Harper 4 participants 5 messages Oct 1, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix cscope filelist by removing leading ./

When using cscope integrated in $EDITOR, none of the commands seemed to work even though make cscope generated the proper data. Comparing the filelist that is generated in QEMU's Makefile with what is generated from the Linux kernel's make cscope, I noticed that the kernel's cscope filelist does not contain any leading './' as is generated by the find command used in QEMU's make cscope. Stripping the leading ./ out of the filelist fixes cscope function in $EDITOR.

Makefile +1 -1
index d57f791..cde8676 100644
@@ -261,7 +261,7 @@ TAGS:
 
 cscope:
 	rm -f ./cscope.*
-	find . -name "*.[ch]" -print > ./cscope.files
+	find . -name "*.[ch]" -print | sed 's,./,,' > ./cscope.files
 	cscope -b
 
 # documentation
#1 lore raw

Makefile TAGS: · line 264

Quoted 2 lines · Ryan Harper
Makefile +1 -1
-	find . -name "*.[ch]" -print > ./cscope.files
+	find . -name "*.[ch]" -print | sed 's,./,,' > ./cscope.files

This will also match 'a/'.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#2 lore raw
Quoted 6 lines · Andreas Schwab

Makefile TAGS: · line 264

Quoted 2 lines · Ryan Harper
Makefile +1 -1
-	find . -name "*.[ch]" -print > ./cscope.files
+	find . -name "*.[ch]" -print | sed 's,./,,' > ./cscope.files

This will also match 'a/'.

Is there a case where the find command we're using would output something without './' in the first to characters in each line where that case would be an issue?

Signature · 5 lines
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
[email protected]
#3 lore raw
Quoted 11 lines · Ryan Harper
Quoted 6 lines · Andreas Schwab

Makefile TAGS: · line 264

Quoted 2 lines · Ryan Harper
Makefile +1 -1
-   find . -name "*.[ch]" -print > ./cscope.files
+   find . -name "*.[ch]" -print | sed 's,./,,' > ./cscope.files

This will also match 'a/'.

Is there a case where the find command we're using would output something without './' in the first to characters in each line where that case would be an issue?

Why not using sed 's,^\./,,'?

Laurent

#4 lore raw
Quoted 7 lines · Laurent Desnogues
Quoted 6 lines · Ryan Harper
Quoted 5 lines · Andreas Schwab
Quoted 2 lines · Ryan Harper
Makefile +1 -1
-   find . -name "*.[ch]" -print > ./cscope.files
+   find . -name "*.[ch]" -print | sed 's,./,,' > ./cscope.files
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

This will also match 'a/'.

Is there a case where the find command we're using would output something without './' in the first to characters in each line where that case would be an issue?

Why not using sed 's,^\./,,'?

I applied this version, thanks.

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net