mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH for 2.4] fix find to not stumble over BK
@ 2002-07-17  0:08 Larry McVoy
  2002-07-17  1:40 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Larry McVoy @ 2002-07-17  0:08 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel

Marcelo,

here's a backport of the patch I did for 2.5 which fixes up all the targets
in the top level Makefile which do things like 

	find dir dir2 -name '*.h' | xargs etags -

Note that common usage

	find . -name '*.[chS]' | whatever

becomes

	find . -name SCCS -prune -o -name BitKeeper -prune -o \
		-name '*.[chS]' -print | whatever
		                ^^^^^^

The -print is needed or find will produce nothing, it's now multiple clauses.

Please pull

	bk pull bk://linux.bkbits.net/lm-2.4

Here are the diffs:

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.620   -> 1.621  
#	            Makefile	1.174   -> 1.175  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/16	lm@disks.bitmover.com	1.621
# Do not descend into BitKeeper/SCCS directories when running find
# to generate lists of files.
# --------------------------------------------
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Tue Jul 16 16:57:21 2002
+++ b/Makefile	Tue Jul 16 16:57:21 2002
@@ -367,16 +367,25 @@
 	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
 
 TAGS: dummy
-	{ find include/asm-${ARCH} -name '*.h' -print ; \
-	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print ; \
-	find $(SUBDIRS) init arch/${ARCH} -name '*.[chS]' ; } | grep -v SCCS | etags -
+	{ find include/asm-${ARCH} \
+		-name SCCS -prune -o -name BitKeeper -prune -o \
+		-name '*.h' -print ; \
+	find include -name SCCS -prune -o -name BitKeeper -prune -o \
+		-type d \( -name "asm-*" -o -name config \) -prune -o \
+		-name '*.h' -print ; \
+	find $(SUBDIRS) init arch/${ARCH} \
+		-name SCCS -prune -o -name BitKeeper -prune -o \
+		-name '*.[chS]' -print ; } | etags -
 
 # Exuberant ctags works better with -I
 tags: dummy
 	CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
-	ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
-	find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
-	find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
+	ctags $$CTAGSF `find include/asm-$(ARCH) -name SCCS -prune -o -name BitKeeper -prune -o -name '*.h' -print` && \
+	find include -name SCCS -prune -o -name BitKeeper -prune -o \
+		-type d \( -name "asm-*" -o -name config \) -prune -o \
+		-name '*.h' -print | xargs ctags $$CTAGSF -a && \
+	find $(SUBDIRS) init -name SCCS -prune -o -name BitKeeper -prune -o \
+		-name '*.[ch]' -print | xargs ctags $$CTAGSF -a
 
 ifdef CONFIG_MODULES
 ifdef CONFIG_MODVERSIONS
@@ -440,23 +449,29 @@
 endif
 
 clean:	archclean
-	find . \( -name '*.[oas]' -o -name core -o -name '.*.flags' \) -type f -print \
+	find . -name SCCS -prune -o -name BitKeeper -prune -o \
+		\( -name '*.[oas]' -o -name core -o -name '.*.flags' \) \
+		-type f -print \
 		| grep -v lxdialog/ | xargs rm -f
 	rm -f $(CLEAN_FILES)
 	rm -rf $(CLEAN_DIRS)
 	$(MAKE) -C Documentation/DocBook clean
 
 mrproper: clean archmrproper
-	find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
+	find . -name SCCS -prune -o -name BitKeeper -prune -o \
+		\( -size 0 -o -name .depend \) \
+		-type f -print | xargs rm -f
 	rm -f $(MRPROPER_FILES)
 	rm -rf $(MRPROPER_DIRS)
 	$(MAKE) -C Documentation/DocBook mrproper
 
 distclean: mrproper
-	rm -f core `find . \( -not -type d \) -and \
+	@find . -name SCCS -prune -o -name BitKeeper -prune -o \
+		\( -not -type d \) -and \
 		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
+		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f \
+		-print | xargs rm -f
 
 backup: mrproper
 	cd .. && tar cf - linux/ | gzip -9 > backup.gz
@@ -483,11 +498,12 @@
 	$(MAKE) -C Documentation/DocBook man
 
 sums:
-	find . -type f -print | sort | xargs sum > .SUMS
+	find . -name SCCS -prune -o -name BitKeeper -prune -o \
+		-type f -print | sort | xargs sum > .SUMS
 
 dep-files: scripts/mkdep archdep include/linux/version.h
 	scripts/mkdep -- init/*.c > .depend
-	scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
+	scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -name BitKeeper -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
 	$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
 ifdef CONFIG_MODVERSIONS
 	$(MAKE) update-modverfile
@@ -503,13 +519,19 @@
 depend dep: dep-files
 
 checkconfig:
-	find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkconfig.pl
+	find * -name SCCS -prune -o -name BitKeeper -prune -o \
+		-name '*.[hcS]' -type f -print \
+		| sort | xargs $(PERL) -w scripts/checkconfig.pl
 
 checkhelp:
-	find * -name [cC]onfig.in -print | sort | xargs $(PERL) -w scripts/checkhelp.pl
+	find * -name SCCS -prune -o -name BitKeeper -prune -o \
+		-name [cC]onfig.in -print \
+		| sort | xargs $(PERL) -w scripts/checkhelp.pl
 
 checkincludes:
-	find * -name '*.[hcS]' -type f -print | sort | xargs $(PERL) -w scripts/checkincludes.pl
+	find * -name SCCS -prune -o -name BitKeeper -prune -o \
+		-name '*.[hcS]' -type f -print \
+		| sort | xargs $(PERL) -w scripts/checkincludes.pl
 
 ifdef CONFIGURATION
 ..$(CONFIGURATION):
@@ -559,7 +581,9 @@
 #	   will become invalid
 #
 rpm:	clean spec
-	find . \( -size 0 -o -name .depend -o -name .hdepend \) -type f -print | xargs rm -f
+	find . -name SCCS -prune -o -name BitKeeper -prune -o \
+		\( -size 0 -o -name .depend -o -name .hdepend \) \
+		-type f -print | xargs rm -f
 	set -e; \
 	cd $(TOPDIR)/.. ; \
 	ln -sf $(TOPDIR) $(KERNELPATH) ; \

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

* Re: [PATCH for 2.4] fix find to not stumble over BK
  2002-07-17  0:08 [PATCH for 2.4] fix find to not stumble over BK Larry McVoy
@ 2002-07-17  1:40 ` Alan Cox
  2002-07-17  2:05   ` [OT] -print argument to find (was [PATCH for 2.4] fix find to not stumble over BK) Chris Wedgwood
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2002-07-17  1:40 UTC (permalink / raw)
  To: Larry McVoy; +Cc: Marcelo Tosatti, linux-kernel

On Wed, 2002-07-17 at 01:08, Larry McVoy wrote:

> Note that common usage
> 
> 	find . -name '*.[chS]' | whatever
> 
> becomes
> 
> 	find . -name SCCS -prune -o -name BitKeeper -prune -o \
> 		-name '*.[chS]' -print | whatever
> 		                ^^^^^^
> 
> The -print is needed or find will produce nothing, it's now multiple clauses.

The -print is not needed. See IEEE Std 1003.1-2001

If no expression is present, -print shall be used as the expression.
Otherwise, if the given expression does not contain any of the primaries
-exec, -ok, or -print, the given expression shall be effectively
replaced by:

( given_expression ) -print

Alan the pedantic


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

* [OT] -print argument to find (was [PATCH for 2.4] fix find to not stumble over BK)
  2002-07-17  1:40 ` Alan Cox
@ 2002-07-17  2:05   ` Chris Wedgwood
  2002-07-17 15:41     ` jlnance
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wedgwood @ 2002-07-17  2:05 UTC (permalink / raw)
  To: Alan Cox; +Cc: Larry McVoy, Marcelo Tosatti, linux-kernel

On Wed, Jul 17, 2002 at 02:40:33AM +0100, Alan Cox wrote:

    The -print is not needed. See IEEE Std 1003.1-2001

    If no expression is present, -print shall be used as the
    expression.

[...]

Interesting...


That said, I do out of habit as Solaris did/does require print and so
does some other commercial OS (I forget which now).



  --cw

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

* Re: [OT] -print argument to find (was [PATCH for 2.4] fix find to not stumble over BK)
  2002-07-17  2:05   ` [OT] -print argument to find (was [PATCH for 2.4] fix find to not stumble over BK) Chris Wedgwood
@ 2002-07-17 15:41     ` jlnance
  0 siblings, 0 replies; 4+ messages in thread
From: jlnance @ 2002-07-17 15:41 UTC (permalink / raw)
  To: linux-kernel

On Tue, Jul 16, 2002 at 07:05:35PM -0700, Chris Wedgwood wrote:
> On Wed, Jul 17, 2002 at 02:40:33AM +0100, Alan Cox wrote:
> 
>     The -print is not needed. See IEEE Std 1003.1-2001
> 
>     If no expression is present, -print shall be used as the
>     expression.
> 
> [...]
> 
> Interesting...
> 
> 
> That said, I do out of habit as Solaris did/does require print and so
> does some other commercial OS (I forget which now).

Oh, its even more interesting.  If the -print is not present find prints
out the name of the pruned directories.  If it is present it does not:

    vmware> find . -name tmpdir -prune -o -type d
    .
    ./tmpdir
    ./output
    vmware> find . -name tmpdir -prune -o -type d -print
    .
    ./output

Jim

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

end of thread, other threads:[~2002-07-17 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-17  0:08 [PATCH for 2.4] fix find to not stumble over BK Larry McVoy
2002-07-17  1:40 ` Alan Cox
2002-07-17  2:05   ` [OT] -print argument to find (was [PATCH for 2.4] fix find to not stumble over BK) Chris Wedgwood
2002-07-17 15:41     ` jlnance

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

all inboxes | Powered by JetHome®