Skip to content
  • Natanael Copa's avatar
    abump: fix set -e issue · e1d629b6
    Natanael Copa authored
    It appears that when the subshell has a ||, the 'set -e' within
    subshell gets invalidated.
    
    This will work as expected:
    
     ( set -e; false; echo "should not get here" )
    
    While this will not work as expected:
    
     ( set -e; false; echo "should not get here" ) || false
    
    We resolve it by using $? to detect the status of subshell. We also let
    the exitcode indicate how many packages that failed.
    
    While here we also refactor it so most of the loop happens within the
    subshell. This lets us set (or increase) rc variable once, and it
    reduces number of forks which gives slightly better performance.
    e1d629b6