Ignore:
Timestamp:
2023-03-08T18:56:56+13:00 (14 months ago)
Author:
anupama
Message:

A sed regex in gs3-setup.sh was in the wrong format and caused problems that Dr Bainbridge noticed and fixed: the sed regex was trying to get the bitness number by running a File command. It failed as the plus regex operator for one-or-more was not behaving correctly on Mac even with the unexpected escaping in place. Dr Bainbridge got the 2 digits captured with [0-9][0-9] but warned that for 3-digit bitness this would of course break. A stack overflow page reminded how one-or-more can be written as {1,}, but needs escaped braces. It worked with Dr Bainbridge's command line test and should be future proof

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/gs3-setup.sh

    r36583 r37445  
    245245      bitness=-1
    246246  else
    247       bitness=`file $JNITESTFILE | sed 's/^.* \([0-9]\+-bit\).*$/\1/'`
     247      #bitness=`file $JNITESTFILE | sed 's/^.* \([0-9]\+-bit\).*$/\1/'`
     248      # one-or-more regex to get one or more digits was not working. Dr Bainbridge fixed as below
     249      #bitness=`file $JNITESTFILE | sed 's/^.* \([0-9][0-9]-bit\).*$/\1/'`
     250      # The following also does one-or-more and works on the command line and should support 3 digit bitness
     251      # https://stackoverflow.com/questions/12101440/one-or-more-occurrences-not-working-with-sed-command
     252      bitness=`file $JNITESTFILE | sed 's/^.* \([0-9]\{1,\}-bit\).*$/\1/'`
    248253      if [ $bitness = "64-bit" ] ; then
    249254      bitness=64
Note: See TracChangeset for help on using the changeset viewer.