annotate sources/more/record-commands.sh @ 899:726cac165450

Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
author Rob Landley <rob@landley.net>
date Mon, 23 Nov 2009 21:58:49 -0600
parents 850da666acc6
children 5ffc758bf60a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
897
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 source sources/include.sh || exit 1
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 # Build a wrapper that records each command line the build runs out of the
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
6 # host's $PATH, so we know exactly what commands the build uses.
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
7
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 # (Note: this misses things called via absolute paths, such as the #!/bin/bash
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 # at the start of shell scripts.)
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 echo "=== Setting up command recording wrapper"
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
12
899
726cac165450 Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents: 897
diff changeset
13 echo OLDPATH=$OLDPATH
726cac165450 Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents: 897
diff changeset
14 echo PATH=$PATH
726cac165450 Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents: 897
diff changeset
15
726cac165450 Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents: 897
diff changeset
16 [ -f "$WRAPDIR/wrappy" ] && PATH="$OLDPATH"
726cac165450 Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents: 897
diff changeset
17 [ -f "$HOSTTOOLS/busybox" ] && PATH="$HOSTTOOLS"
897
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 blank_tempdir "$WRAPDIR"
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
19 blank_tempdir "$BUILD/logs"
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
20
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 # Populate a directory of symlinks with every command in the $PATH.
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
22
899
726cac165450 Remove old RECORD_COMMANDS debris from host-tools.sh and simplify result (lots of white-noise from de-intenting the "else" case of an if/else), factor out wrap_path from sources/more/record-commands.sh, fix the "build host tools first, then wrap it afterwards" case.
Rob Landley <rob@landley.net>
parents: 897
diff changeset
23 wrap_path "$PATH" "$WRAPDIR" wrappy | dotprogress
897
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
24
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 # Build the wrapper
850da666acc6 Redo command recording: no longer RECORD_COMMMANDS config entry, now sources/more/record-commands.sh run to set up the wrapper (either before or after host-tools.sh). General cleanup and simplification of code this interacted with, plus clean up bit rot in the reporting.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 $CC -Os "$SOURCES/toys/wrappy.c" -o "$WRAPDIR/wrappy" || dienow