Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903699

Cleanup: remove shell redirection inside string replace

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • None
    • None
    • tools
    • None

    Description

      Several test makefiles contain the construct
        `$(@:%.ok=%/log 2>&1)`

      Quoting Johathan Gibbons from https://github.com/openjdk/jtreg/pull/181:

      > The code might work "by accident", but is for sure not how it is meant to be.
      >
      > There are two parts to this expression:
      >
      > 1. $(@:%.ok=%/log). This is an expression to generate a string from $@ by replacing the trailing .ok with /log -- in other words, based on the name of the target $@ generate a related name for the log file
      > 2. 2>&1. This is plain old shell redirection, and should be directly on the grep command line, and not hidden in. the $(@:...) expression.

      The files in which the expression is found:

      test/exclude/ExcludeTest.gmk
      test/ignoresymbolfile/IgnoreSymbolFileTest.gmk
      test/junit/JUnitLibTest.gmk
      test/libBuildArgs/LibBuildArgsTest.gmk
      test/libdirs/LibDirsTest.gmk
      test/match/MatchTest.gmk
      test/testng/TestNGLibTest.gmk
      test/testprops/TestPropsTest.gmk
      test/versionCheck/TestVersionCheck.gmk

      I propose to clean these up.

      Attachments

        Activity

          People

            lujaniuk Ludvig Janiuk
            lujaniuk Ludvig Janiuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: