Mercurial > hg > aboriginal
annotate more/record-commands.sh @ 1178:80693b1a8038
Yank toybox from simple-root-filesystem. (Still need it for patch in host-tools.sh)
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 26 Jul 2010 00:06:58 -0500 |
parents | 300e6d919d86 |
children | 878dbfe76341 |
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 [ -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
|
14 [ -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
|
15 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
|
16 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
|
17 |
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 # 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
|
19 |
903
5ffc758bf60a
Genericize search path traversal logic with pattern and command to apply to each file found.
Rob Landley <rob@landley.net>
parents:
899
diff
changeset
|
20 path_search "$PATH" "*" 'ln -s wrappy "$WRAPDIR/$FILE"' | 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
|
21 |
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 # 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
|
23 $CC -Os "$SOURCES/toys/wrappy.c" -o "$WRAPDIR/wrappy" || dienow |