Project

General

Profile

  • svn:executable: *

# Date Author Comment
13313 04/24/2014 03:49 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: a non-runscript should have all args passed to main(). this fixes a bug in backups/*_snapshot where "main" would need to be prepended to any args for the script to run correctly.

13312 04/24/2014 03:43 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: $wrap_fn: invoked script must always run as runscript so that wrapped command is run

13311 04/24/2014 03:40 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added $is_runscript, for use by $wrap_fn

13310 04/24/2014 03:36 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: $wrap_fn: $top_script doesn't need to be world-executable for most uses of sudo (only if sudoing to non-root)

13268 04/21/2014 08:01 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: sudo(): avoid slow $wrap_fn when using `command` (ie. always executable)

13216 04/20/2014 05:54 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: $subdirs: adjusted log_level now that echo_vars is one log_level lower

13208 04/20/2014 05:06 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: $wrap_fn: log at higher log_level because it's startup code

13203 04/20/2014 04:44 PM Aaron Marcuse-Kubitza

lib/sh/util.sh, runscripts/util.run: set_paths(): run with higher log_level to hide all the paths that are set at the beginning of the script

13182 04/19/2014 07:14 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added sudo() override that uses $wrap_fn to support shell functions

13181 04/19/2014 07:13 PM Aaron Marcuse-Kubitza

fix: lib/runscripts/util.run: $wrap_fn: make it usable even if $top_script isn't world-executable

12982 03/30/2014 05:06 PM Aaron Marcuse-Kubitza

fix: lib/runscripts/util.run: to_top_file(): handle $_remake properly, without requiring deferred_check_target_exists to set to_file()'s flags

12968 03/29/2014 04:06 AM Aaron Marcuse-Kubitza

*{.sh,run}: runscript targets: use begin_target instead of echo_func so the target name is properly echoed. note that this requires using with_rm so that $rm is properly progagated to applicable invoked targets. (previously, $rm was progagated to all invoked targets. note that with_rm only works inside a runscript target that starts with begin_target.)

12967 03/29/2014 03:58 AM Aaron Marcuse-Kubitza

lib/sh/make.sh: self_make(): renamed to with_rm() for clarity, since this is used only to progagate $rm, and does not also invoke a command with the same name as the current function, as the name might suggest

12964 03/28/2014 07:03 AM Aaron Marcuse-Kubitza

lib/runscripts/util.run: support conventional main() method as well as `all` target

12866 03/22/2014 04:55 AM Aaron Marcuse-Kubitza

lib/runscripts/util.run: on_exit(): documented that users can also override gateway()/fallback() to perform other commands (or no commands) after the script is read

12863 03/22/2014 04:43 AM Aaron Marcuse-Kubitza

fix: lib/runscripts/util.run: run_args_cmd(): need to indent the output of the target that it's running

12829 03/21/2014 11:48 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: clog*: renamed to log* for clarity (possible now that log* is no longer used for function-local log_level setting)

12778 03/20/2014 07:51 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: runscript template: added sample make target, using new make target template

12715 03/14/2014 07:53 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: $auto_ignore: need to unexport it so don't pass this to invoked scripts except through fwd()

12713 03/14/2014 07:34 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: auto_fwd's fallback() must be set after auto_ignore's fallback() to overwrite it (auto_ignore should only apply if an error would otherwise have been generated by the fallback)

12712 03/14/2014 07:30 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: fwd(): support subdirs that don't contain a runscript, so that the default value of @subdirs will work in most cases

12711 03/14/2014 07:29 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: fwd(): set default @subdirs (`{.,}*/`)

12700 03/14/2014 04:53 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: fwd(): enable $auto_ignore so that each subdir doesn't have to have a definition for the forwarded target

12699 03/14/2014 04:52 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added $auto_ignore switch, which causes fallback() not to generate an error that a non-existant target doesn't exist

12697 03/14/2014 03:55 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added fwd_self alias

12695 03/14/2014 03:47 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added $auto_fwd switch

12694 03/14/2014 03:36 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: gateway(): need to use is_callable() rather than func_exists() to check whether the target exists, because external commands (eg. echo) are supported as targets, too

12692 03/14/2014 03:23 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: support custom handlers for all targets (gateway()) as well as targets w/o function (fallback())

11970 01/20/2014 11:33 AM Aaron Marcuse-Kubitza

moved everything into /trunk/ to create the standard svn layout, for use with tools that require this (eg. git-svn). IMPORTANT: do NOT do an `svn up`. instead, re-use your working copy's existing files with `svn switch` (http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.switch.html).

11428 10/24/2013 03:26 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: `trap on_exit EXIT`: only set this if the script is not a dot script, because if it is a dot script, on_exit() will not be invoked until the calling shell exits, which may be much later than when the script is run. previously, this was handled by canceling the EXIT trap if on_exit() is run manually, but this would not work correctly if a load-time error prevented on_exit() from running and canceling the trap.

11427 10/24/2013 03:21 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: if is_dot_script, fix $ when no args causes this to incorrectly contain the script name. use is_dot_script rather than the presence of $ args to decide whether to use @BASH_ARGV, because @BASH_ARGV is actually wrong when run as a .-script (it contains the script name).

11418 10/23/2013 11:02 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: run script template: changed sample command name to all() because each runscript requires this in order to be run without args

11417 10/23/2013 11:00 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: support scripts that are run as shell-includes (with leading "."), by allowing the calling script to manually invoke on_exit() without it then being invoked twice (the end of a shell-include does not trigger the EXIT trap)

11414 10/23/2013 10:17 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: support scripts that are run as shell-includes (with leading "."), by also accepting $@ args that are passed along in the util.run include, in addition to @BASH_ARGV

11359 10/18/2013 09:52 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: to_top_file(): need to pass "$@" to to_file

11358 10/18/2013 08:17 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: to_top_file: added function for this (in addition to alias), so that this can be run from sudo in a wrap_fn command

11348 10/18/2013 05:28 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added $wrap_fn to run any function via sudo, etc.

10835 08/30/2013 06:06 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: usage: documented that this usage also applies to all files that include this file

10834 08/30/2013 06:06 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: usage: clarified that the cmd to run is a function

10766 08/27/2013 07:30 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added to_top_file alias for use with $top_file

10272 07/14/2013 01:52 AM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added , function, which treats each of the command-line args as commands the way make does (instead of as args to the same command, the way runscripts do)

10271 07/14/2013 01:39 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: moved runscript-related commands to lib/runscripts/util.run because these only apply to runscripts

9854 06/12/2013 03:25 AM Aaron Marcuse-Kubitza

*{.sh,run}: use simpler .rel() instead of `. "$(dirname "${BASH_SOURCE0}")"/...` for relative includes

9507 05/23/2013 12:15 PM Aaron Marcuse-Kubitza

bugfix: lib/runscripts/util.run: need to include sh/make.sh for all runscripts that use make-style commands

9298 05/12/2013 02:08 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: run_args_cmd(): moved test of $? to lib/runscripts/util.run on_exit() since it needs to be performed for all run_args_cmd() functions, not just the default implementation. (this test ensures that no commands are executed if the EXIT trap was encountered due to a parsing/loading error).

9268 05/12/2013 10:34 AM Aaron Marcuse-Kubitza

lib/runscripts/util.run: added setting of $top_file, $top_filename to set_paths()

9267 05/12/2013 10:25 AM Aaron Marcuse-Kubitza

lib/runscripts/util.run: set $top_file, $top_filename in a function (set_paths__util_run())

9248 05/12/2013 08:13 AM Aaron Marcuse-Kubitza

lib/runscripts/util.run: $top_file: also match dir-level runscripts by removing /run suffix

9239 05/12/2013 06:10 AM Aaron Marcuse-Kubitza

*{.sh,run}: echo all global vars (except those defined before echo_vars is available)

9074 05/10/2013 12:08 PM Aaron Marcuse-Kubitza

*{.sh,run}: removed extra space between function name and (), which is apparently not needed even though `help function` includes it. this greatly improves readability, including when function names are pasted into commit messages!

9013 05/10/2013 04:05 AM Aaron Marcuse-Kubitza

moved lib/*.sh to sh/ subdir so it's easier to find the .sh files among all the other lib/ files

8999 05/10/2013 02:20 AM Aaron Marcuse-Kubitza

lib/util.sh: run all commands verbosely by default, not just runscripts. this ensures verbose output for invoked commands like inputs/GBIF/MySQL_export.

8988 05/10/2013 12:42 AM Aaron Marcuse-Kubitza

lib/util.sh: moved $top_file* to runscripts/util.run because they only apply to runscripts

8972 05/09/2013 11:11 PM Aaron Marcuse-Kubitza

lib/runscripts/util.run: tell users to override run_args_cmd rather than this function to perform other commands, so that on_exit () can contain other exit-related processing that should not be overriden by the user

8922 05/09/2013 06:51 AM Aaron Marcuse-Kubitza

lib/util.sh: echo_vars (): output vars with log_level 3 so they can be excluded separately from function calls to reduce clutter in the logging output. increase the default util.run verbosity so that vars are still printed by default.

8881 05/08/2013 08:02 PM Aaron Marcuse-Kubitza

*{.sh,run}: changed echo_func to an alias that includes the "$", so that callers don't need to specify the "$" manually. although the original echo_func function is still there, callers need to switch over to the alias at the same time as it's defined because otherwise the "$@" would be doubled, since echo_func refers to the alias instead.

8774 05/02/2013 04:47 AM Aaron Marcuse-Kubitza

moved lib/*.run into runscripts/ subdir so runscripts are grouped together and easier to find rather than being scattered throughout lib/

8715 04/25/2013 06:05 PM Aaron Marcuse-Kubitza

lib/util.run: doc comment: changed "run scripts" to "runscripts"

8714 04/25/2013 06:04 PM Aaron Marcuse-Kubitza

lib/util.run: factored general utils (non-runscript-specific) out into new util.sh

8713 04/25/2013 05:55 PM Aaron Marcuse-Kubitza

lib/util.run: renamed $verbose to $verbosity because it's an integer level, not a boolean. continue to support specifying the verbosity in $verbose.

8712 04/25/2013 05:52 PM Aaron Marcuse-Kubitza

lib/util.run: support $verbose="", which is treated as 0

8711 04/25/2013 05:50 PM Aaron Marcuse-Kubitza

lib/util.run: only automatically echo env vars when they are set if verbosity is >= 2

8710 04/25/2013 05:49 PM Aaron Marcuse-Kubitza

lib/util.run: added $verbose var to control logging. this is normally set to 0, but defaults to 2 for a runscript.

8709 04/25/2013 05:41 PM Aaron Marcuse-Kubitza

lib/util.run: moved `shopt -s expand_aliases` inside the include guard so callers can override the setting without it being reset if util.run is included again

8704 04/25/2013 04:30 PM Aaron Marcuse-Kubitza

bugfix: lib/util.run: added include guard to prevent issues in "diamond includes", where a runscript includes two runscripts and each includes util.run, causing the second include of util.run to reset any methods overridden in the first included runscript. this prevents util.run from being included twice in the first place.

8703 04/25/2013 04:25 PM Aaron Marcuse-Kubitza

lib/util.run: added include_guard_var (), self_not_included () for use by path-based include guards

8702 04/25/2013 03:40 PM Aaron Marcuse-Kubitza

lib/util.run: echo_stdin (): print a separator before and after the echoed output to help distinguish it from other verbose output

8700 04/25/2013 03:36 PM Aaron Marcuse-Kubitza

lib/util.run: echo_export (): run the export builtin using `builtin` to avoid recursively calling any export alias or function defined by the user (e.g. `alias export=echo_export`. this causes util.run to be idempotent, such that it can be included multiple times without causing problems due to the redefinition of functions, vars, etc.

8694 04/24/2013 11:16 PM Aaron Marcuse-Kubitza

lib/util.run: added set_var ()

8693 04/24/2013 10:58 PM Aaron Marcuse-Kubitza

bugfix: lib/util.run: run_args_cmd (): `set --`: need to use eval so that the output of reverse is interpreted as escaped args rather than split using $IFS

8692 04/24/2013 10:40 PM Aaron Marcuse-Kubitza

bugfix: lib/util.run: run_args_cmd (): BASH_ARGV is stored in reverse order, so it needs to be reversed to be usable as $@

8691 04/24/2013 10:38 PM Aaron Marcuse-Kubitza

lib/util.run: added reverse ()

8659 04/23/2013 11:06 PM Aaron Marcuse-Kubitza

lib/util.run: added zip/unzip_newer aliases

8658 04/23/2013 11:05 PM Aaron Marcuse-Kubitza

lib/util.run: added zip/unzip echo_run aliases

8653 04/23/2013 09:58 PM Aaron Marcuse-Kubitza

bugfix: lib/util.run: inline_make (): put echo_func at the top of the function

8652 04/23/2013 09:58 PM Aaron Marcuse-Kubitza

lib/util.run: inline_make (): pass Makefile commands using /dev/fd/3 (i.e. 3<<'EOF' ...) instead of stdin, to allow stdin to be used by commands that prompt the user

8651 04/23/2013 09:44 PM Aaron Marcuse-Kubitza

lib/util.run: inline_make (): use <() to pass Makefile commands as a named descriptor rather than using stdin, to allow stdin to be used by commands that prompt the user

8650 04/23/2013 09:27 PM Aaron Marcuse-Kubitza

bugfix: lib/util.run: echo_vars (): remove any value to set (=*) from the vars, since this is often used with export

8649 04/23/2013 09:14 PM Aaron Marcuse-Kubitza

bugfix: lib/util.run: echo_export (): set the vars before echoing them

8648 04/23/2013 08:55 PM Aaron Marcuse-Kubitza

lib/util.run: run_args_cmd (): use new canon_rel_path() to resolve .. in the script path, so it's easier to see where the script is actually located

8647 04/23/2013 08:52 PM Aaron Marcuse-Kubitza

lib/util.run: echo_func (): use new canon_rel_path() to resolve .. in the script path, so it's easier to see where the script is actually located

8646 04/23/2013 08:51 PM Aaron Marcuse-Kubitza

lib/util.run: added canon_rel_path ()

8645 04/23/2013 08:40 PM Aaron Marcuse-Kubitza

lib/util.run: inline_make (): provide $self as make var

8644 04/23/2013 08:35 PM Aaron Marcuse-Kubitza

lib/util.run: inline_make (): provide self_dir to make as env var instead of as make var, to avoid specifying every make var both as a local var and as a make var in the make command

8643 04/23/2013 08:31 PM Aaron Marcuse-Kubitza

lib/util.run: export alias: added comment explaining what it does

8642 04/23/2013 08:30 PM Aaron Marcuse-Kubitza

lib/util.run: aliased export to echo_export so all env vars are automatically echoed when they are set

8641 04/23/2013 08:29 PM Aaron Marcuse-Kubitza

lib/util.run: added echo_vars (), echo_export ()

8640 04/23/2013 08:17 PM Aaron Marcuse-Kubitza

lib/util.run: inline_make (): added local $self and use it to create $self_dir

8639 04/23/2013 08:15 PM Aaron Marcuse-Kubitza

lib/util.run: inline_make (): set $self_dir as a local var before passing it to make, to avoid clutter in the command that invokes make

8465 04/13/2013 02:46 AM Aaron Marcuse-Kubitza

lib/util.run: run_cmd (): renamed to run_args_cmd to clarify that this runs only the command line args command, not any command. added doc comment to clarify this.

8464 04/13/2013 02:41 AM Aaron Marcuse-Kubitza

lib/util.run: EXIT trap: use on_exit() function which calls run_cmd instead of having run_cmd be the handler, so that users can override this function to perform other commands (or no commands) after the script is read

8463 04/13/2013 02:28 AM Aaron Marcuse-Kubitza

lib/util.run: echo_func (): use the caller's FUNCNAME via the $FUNCNAME[] array instead of requiring them to pass it in the function args as `echo_func "$FUNCNAME" "$@"`

8298 04/02/2013 02:57 PM Aaron Marcuse-Kubitza

lib/util.run: echo_func: Fixed bug where need to use BASH_LINENO0 for the line #s to match up with the files. For some reason the required array indexes for BASH_SOURCE (1) and BASH_LINENO (0) differ by one.

8294 04/02/2013 02:48 PM Aaron Marcuse-Kubitza

lib/util.run: echo_func: Include the line # of the function to make it easier to find where the code being run is

8292 04/02/2013 02:26 PM Aaron Marcuse-Kubitza

lib/util.run: run_cmd: If bash exited with an error, don't run the "$@" command. This test is necessary because `trap run_cmd EXIT` will run run_cmd as the result of any exit from the shell, including an error.

8291 04/02/2013 02:21 PM Aaron Marcuse-Kubitza

*run: Use -e option to bash on the #! line instead of separate `set -o errexit` line so that there is no issue with the `set -o errexit` line getting separated from the #! line (errexit is required for the scripts to work properly)

8290 04/02/2013 02:09 PM Aaron Marcuse-Kubitza

lib/util.run: run_cmd: When no command specified, default to running the `all` command, just like make

8289 04/02/2013 02:07 PM Aaron Marcuse-Kubitza

lib/util.run: Run run_cmd at shell exit (using trap) instead of requiring every runscript to have `run_cmd ` at the end of it

8284 04/02/2013 01:42 PM Aaron Marcuse-Kubitza

lib/util.run: fwd: Check that $subdirs is defined. Added $subdirs to usage.

8283 04/02/2013 01:39 PM Aaron Marcuse-Kubitza

lib/util.run: fwd: Added usage