Ticket #2575 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

shell script gotcha in boot

Reported by: pooryorick Owned by:
Priority: normal Milestone:
Component: Build System Version: 6.8.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I use a build process which is sensitive to the exit code of "boot", assuming that everything went OK only if it returns 0. Because the last line of the script uses the && operator, the entire script can exit with a code other than zero if the last file checked does not exist. In my case, "validate" indeed did not exist, and the script failed.

Solution: Replace the && with an if statement:

if test -f $f; then
    chmod +x $f
fi

Change History

Changed 5 years ago by igloo

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution set to fixed

Thanks for the report; now done.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.