fix find to not stumble over BK

fix find to not stumble over BK

Post by Larry McVo » Thu, 18 Jul 2002 09:10:08



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      l...@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) ; \
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

fix find to not stumble over BK

Post by Alan Co » Thu, 18 Jul 2002 09:40:07



> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

fix find to not stumble over BK

Post by jlna.. » Fri, 19 Jul 2002 00:40:11




>     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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. completely stumbled--hard disk not detected

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

go here: http://www.redhat.com/download/howto_download.html#bootimage,
search using the text string, "Choosing a Boot Disk Image File"; it
explains how to download and create the floppies you will require

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Michael J. Tobler: motorcyclist, surfer,  #    Black holes result
 skydiver, and author: "Inside Linux",     #   when God divides the  
 "C++ HowTo", "C++ Unleashed"              #     universe by zero

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9VUKrtTveLPAHcDIRAhTsAJ0STMMwFenqJe0coxaPH0xBMRDbqQCfbo2X
e8hw1olN6dShugXJLUqLTEM=
=XMJ6
-----END PGP SIGNATURE-----

2. Can't find new (removable) disk on laptop

3. Problem with XWindows/fixed font not found

4. Monolihic Kernel

5. Cannot start X server because fixed fonts are not found

6. zgv won't display images if I'm not root

7. 2.5-BK: cpqarray IDA_LOCK compile fix

8. We've burned our boats say Compaq and HP

9. current bk ipmi build fix

10. compile fix for MPT Fusion driver for 2.5.70 bk

11. AD1848 OSS driver build fix for 2.5.63-bk (bug #398)

12. default font 'fixed' not found

13. RH73 + rp-pppoe + Gateway with no fix IP - "Device Not Found" when try connect