Files
mercury/tools/stdlines_for_sh
Zoltan Somogyi 0638d7769b Include Mmake.params and Mmake.workspace next to each other.
Mmake.common.in:
    Before this diff, there were a whole bunch of definitions between
    the inclusion of Mmake.workspace and the inclusion of Mmake.params.
    Move all those definitions elsewhere. Specifically, move the definitions
    whose right hand sides are autoconfigured values, and which are NOT
    also set by Mmake.workspace, to before both inclusions, moving related
    non-autoconfigure variable definitions with them, while moving
    other definitions to after both inclusions.

    Document the cause of the "phasing problem" that kept the inclusion
    of Mmake.params after the inclusion of Mmake.workspace (the definition
    of MC), and a possible solution.

tools/stdlines_for_sh:
    Add a version of stdlines for sh scripts.
2025-08-12 06:58:44 +02:00

16 lines
781 B
Bash
Executable File

#!/bin/sh
# vim: ts=4 sw=4 wm=0
# Ensure that all divider lines (lines that match the regular expression #--*#)
# in shell scripts are of two standard lengths, one short, one long.
# The long lines are intended to separate major sections of a file, while
# the short ones separate just the different parts of a section.
for f in "$@"
do
echo "${f}"
tmpf="${f}.tmp"
sed -e '/^#------------------------*#$/s//#===========================================================================#/' -e '/^#--*#$/s//#---------------------#/' < "${f}" > "${tmpf}"
sed -e 's/#===========================================================================#/#---------------------------------------------------------------------------#/' < "${tmpf}" > "${f}"
/bin/rm ${tmpf}
done