Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4414124

sanityck testing of makefile flags could be simplified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.3.1
    • 1.4.0
    • infrastructure
    • None
    • rc1
    • generic
    • generic



        Name: dm26566 Date: 02/09/2001


        There are a series of checks for validting the contents of MAKEFLAGS. They
        could be simplified:

         To check if $MAKEFLAGS contains a space-delimited 'e' or 'i' or 'I' (you
        can generalize from there):

                echo "$MAKEFLAGS" | egrep -c '(^| )[eiI]( |$)'
                                               ^^^ matches start of line or a space
                                                         ^^^ space or end of line

        The "-c" flag causes egrep to return a count of the number of matching
        lines on stdout. It'll be 0 if nothing matches, so:

                if [ `echo ...` -ne 0 ]; then echo Bad boy; fi

        egrep has an option to supress the output, which is useful for
        conditional tests in shell scripts. /bin/egrep uses "-s" while
        GNU egrep uses "-q". So you could use this, but you'd need to
        be careful in a multi-platform script to see who uses what.


        ======================================================================

              dmcduffisunw Dale Mcduffie (Inactive)
              dmcduffisunw Dale Mcduffie (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: