Project

General

Profile

  • svn:executable: *

# Date Author Comment
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).

11914 12/16/2013 04:58 PM Aaron Marcuse-Kubitza

fix: lib/sh/util.sh: verbosity_min(): usage: clarified that '' is a special value that causes $verbosity to be overwritten to ''

11858 12/06/2013 05:37 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: stderr2stdout(): documented that this redirects fd 2->1 and log_fd (but not back to 2)

11857 12/06/2013 05:34 AM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: stderr2stdout() use `command` before tee, which re-filters log_fd so that stderr itself is also filtered. this allows log-filtering out an otherwise-confusing benign error when using e.g. stderr_matches().

11856 12/06/2013 04:31 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added not(), for use in prefixing wrapped commands

11854 12/06/2013 04:10 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added stderr_matches()

11853 12/06/2013 03:59 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: documented that fds 2x/3x should not be used because we use these, as opposed to 1x which is used by the shell internally

11852 12/06/2013 03:57 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added stdout_contains()

11851 12/06/2013 03:34 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added stderr2stdout()

11784 11/26/2013 10:58 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: import_vars: don't overwrite vars that are already defined, to allow the caller to specify their own values for the vars to create. this requires callers that rely on the overwriting functionality to reverse the order in which they run use_* commands, so that the higher-precedence use_* is applied first and the other one as the default values for the first.

11605 11/09/2013 02:02 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: already_exists_msg(): added instructions on how to force-remake when the file already exists (prepend `rm=1` to the command)

11432 10/24/2013 04:24 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added require_dot_script()

11431 10/24/2013 04:13 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: $top_script: use @BASH_SOURCE instead of $0, because this is also defined for .-scripts

11426 10/24/2013 03:17 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: is_dot_script(): need to subtract 1 from ${#BASH_LINENO[@]}, because this is the array length rather than the index of the last element as in Perl

11425 10/24/2013 02:58 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added is_dot_script()

11413 10/23/2013 09:11 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: alias_append(): need to enclose $(alias) call in "" because its result may contain separator chars (i.e. whitespace) that will be parsed incorrectly. this appears to only be a bug when runscripts are run as shell-includes, with a leading ".".

11250 10/12/2013 12:08 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added instructions for making an export only visible locally

10921 09/12/2013 12:35 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: set_fds(): don't add surrounding quotes to empty redirect dest

10920 09/12/2013 12:31 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: set_fds(): need to check if redirect is empty before escaping it with `printf %q`, which may add surrounding quotes to an empty string

10890 09/07/2013 08:14 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: set_fds(): need to escape redirect destinations which are files, because they may contain special shell characters

10889 09/07/2013 08:10 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added rm_prefix()

10822 08/30/2013 02:18 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: is_array(): handle unset vars (=false). this fixes a bug in pg_export_table_no_header, which produced the error "lib/sh/util.sh: line 290: declare: cols: not found".

10821 08/30/2013 02:06 PM Aaron Marcuse-Kubitza

fix: lib/sh/util.sh: join(): documented that delim must be a single char

10773 08/27/2013 08:59 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: set_fds(): remove empty redirects resulting from using `redirs= cmd...` to clear the redirs and then using $redirs as an array

10772 08/27/2013 08:47 PM Aaron Marcuse-Kubitza

fix: lib/sh/util.sh: set_fds(): documented that it does not currently support redirecting an fd to itself (due to bash bugs that require the dest fd to be closed before it can be reopened)

10771 08/27/2013 08:44 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: stdout2fd(): don't add >&$fd redirect if the fd is 1, because redir does not currently support redirecting an fd to itself (due to bash bugs that require the dest fd to be closed before it can be reopened)

10770 08/27/2013 08:40 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: filter_fd(): factored out >() subshell command into stdout2fd() for clarity

10769 08/27/2013 08:33 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: redir(): unset redirs so that you don't redirect again in the invoked command

10768 08/27/2013 08:29 PM Aaron Marcuse-Kubitza

fix: lib/sh/util.sh: filter_fd(): documented that ${redirs[@]} must not be set to an outer value

10648 08/08/2013 07:15 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: pf(): echo func decl to stderr instead of stdout

10647 08/08/2013 07:10 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: echo_vars(): documented that it only prints vars that are defined

10646 08/08/2013 07:10 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: local_inv: also echo_vars the new var

10506 07/30/2013 10:07 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: $sed_cmd: added usage

10440 07/26/2013 05:16 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: $sed_cmd: make output unbuffered, so that running e.g. bin/my2pg at the command line produces output as each line is read

10400 07/24/2013 05:10 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added is_array()

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

10217 07/10/2013 03:41 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: sed: must use alias instead of function because function causes segfault in redir() subshell when used with make.sh make() filter (may be bug in bash?). this involves translating `unset LANG` to `env LANG=` (`env -u` to unset a var isn't supported on Mac, but fortunately sed treats LANG="" the same as unset LANG).

10214 07/10/2013 02:42 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: sed: unset LANG to avoid "illegal byte sequence" errors on invalid UTF-8 for LANG=*.UTF-8. these occur e.g. with MySQL data that is in Latin-1.

10213 07/10/2013 02:36 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: sed: use function instead of alias so that env can be set up before calling sed

10154 07/03/2013 05:15 PM Aaron Marcuse-Kubitza

*{.sh,run}: use new log-() instead of log+() with a negative #

10153 07/03/2013 05:14 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added log-() because it's non-obvious that you would otherwise have to invoke log+() with a negative #

10143 07/02/2013 05:40 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added canon_dir_rel_path(), which canonicalizes just the parent dir if the path is a symlink, to leave the symlink itself untouched

10064 06/26/2013 02:19 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added self_name alias and use it in self/self_sys

10063 06/26/2013 02:18 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added sys_cmd_path() and use it in cmd2sys

10059 06/26/2013 12:19 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: .rel(): first use realpath() on BASH_SOURCE1 in case it's a symlink (as it is for bin/make)

10046 06/26/2013 12:23 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: self_sys alias: use new sys_cmd() instead of `command -p` so that only the command path resolution is performed with a limited PATH, and the invoked command itself inherits the full PATH

10045 06/26/2013 12:22 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added sys_cmd(), which runs a system command and allows running a system command of the same name as the script

10044 06/26/2013 12:20 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added echo_builtin()

10022 06/25/2013 12:18 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: command(): added nonrecursive=1 flag, which uses cmd2abs_path to run an external command nonrecursively

10021 06/25/2013 12:16 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added cmd2abs_path, which makes the command in $1 nonrecursive

10020 06/25/2013 11:37 AM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: PATH_rm(): also need to remove adjacent occurrences of the same path (or occurrences which become adjacent when other paths are removed), which :...: matching wasn't doing because the trailing : is consumed, preventing it from being matched at the beginning of the next path. since unlike filesystem paths with /, it is not necessary for a match to span multiple :-separated sections, we can just use new split() to split apart the PATH into an array of paths, filter each path, and join() them back together.

10019 06/25/2013 11:33 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added split()

10018 06/25/2013 10:32 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: auto-echo common external commands: added `which`

10017 06/25/2013 10:32 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: auto-echo common external commands: use simpler echo_run instead of command since logging handling is not needed

9945 06/19/2013 08:18 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added in_top_dir()

9939 06/19/2013 06:37 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added wildcard1 alias

9938 06/19/2013 06:37 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added echo1()

9900 06/17/2013 07:59 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: command-specific alternate stdin/stdout/stderr: choice of 40/41/42: added mnemonic that 4 looks like A for Alternate

9878 06/12/2013 10:28 AM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: verbosity_compat(): always use default verbosity (`unset verbosity`) when verbosity == 1, regardless of whether the caller has set $verbosity to the special value "", because $verbosity is supposed to be an integer field and "" is not supported by most functions that use $verbosity. in cases where a util.sh script is invoked, it will set $verbosity back to the default value 1, so this will function as before for util.sh scripts and fix $verbosity for scripts that use a different verbosity system.

9872 06/12/2013 08:16 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: echo_func(): check can_log at beginning of function, so that the resource-intensive func_loc (which calls `readlink -f`) does not need to be called if echo_cmd would not log anything at the current verbosity

9871 06/12/2013 08:02 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: echo_func(): removed no longer used $minor flag. use `clog++... echo_func` instead.

9870 06/12/2013 07:25 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: verbosity_compat(): don't make $verbosity a local var of this function, because then the changes will not be visible to the caller

9868 06/12/2013 07:10 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: command(): command__exec(): use verbosity_compat to support commands that don't support verbosity=""

9867 06/12/2013 07:09 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added verbosity_compat(), for use with commands that don't support verbosity=""

9865 06/12/2013 06:46 AM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: self, self_sys aliases: need to remove any func_override suffix __* from the FUNCNAME

9853 06/12/2013 03:24 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added .rel()

9850 06/12/2013 02:11 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: .(): put echo_func on its own line for clarity

9849 06/12/2013 02:10 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: .(): added echo_func (2 log_levels up because it's internal)

9846 06/11/2013 07:43 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: verbosity_min(): support value '', which sets verbosity=''

9844 06/11/2013 06:38 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: run_args_cmd(): time the command so that the runtime of the outer runscript target (i.e. the command run from the shell) is printed at the end of the output, like in bin/make

9831 06/11/2013 04:15 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added mv2dir(), mv_glob which wrap mv

9830 06/11/2013 04:14 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added mkdir alias which adds -p to prevent errors if the dir already exists

9829 06/11/2013 03:45 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added wildcard alias, similar to make's $(wildcard) function

9810 06/09/2013 08:27 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added path_parents()

9809 06/09/2013 08:01 PM Aaron Marcuse-Kubitza

*{.sh,run}: in comments, use ${array[@]} instead of @array for clarity

9808 06/09/2013 07:54 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: foreach_arg(): moved `local a` to same line as for loop that uses it

9806 06/09/2013 06:53 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: foreach_arg(): echo_run the cmd at a log_level up so it isn't printed as if it were an external command (log_level 1)

9804 06/09/2013 06:32 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: set_fds(): localize $i so it doesn't overwrite any previous value

9799 06/09/2013 06:25 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added foreach_arg()

9798 06/09/2013 06:06 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: need to use `declare -p` instead of ${var+isset} because ${var+isset} returns not set for empty arrays

9797 06/09/2013 06:05 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added echo_vars() stub

9796 06/09/2013 05:43 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: added echo_run() stub

9795 06/09/2013 05:39 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: set_fds(): don't run (or echo) exec if no redirections are being made

9794 06/09/2013 05:37 PM Aaron Marcuse-Kubitza

bugfix: lib/sh/util.sh: added missing stub for indent alias (used by echo_func alias, which is a stub). without the stub, /usr/bin/indent would be used instead on Mac.

9791 06/09/2013 03:56 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: support custom $base_dir, which will be run through realpath() to match $path ($PWD, which was used before, did not need to be realpath'd because it was already absolute)

9790 06/09/2013 03:34 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: moved echo_func alias to stub because it must be embedded in its expanded alias form to work properly

9789 06/09/2013 03:29 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: declare echo_func as a stub before it's defined, so that functions can use it even if they are defined before it (and its logging functionality will be enabled as soon as it's defined)

9788 06/09/2013 03:26 PM Aaron Marcuse-Kubitza

lib/sh/util.sh: rel_path(): don't log++ it, and instead only log++ applicable calls of it or its callers. this allows non-internal calls of rel_path() to be logged at the usual log_level.

9751 06/06/2013 06:35 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: log+ aliases: added clog++/-- aliases for cmds, which don't include log_local. these are useful when you can't just use "log++" because you need the command following it to be alias-expanded.

9747 06/06/2013 05:26 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added bg_cmd() and helpers log_bg(), log_last_bg()

9740 06/06/2013 02:23 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: command(): print the log_fd in effect in case the user changes it

9737 06/06/2013 01:57 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: no_PATH_recursion(): also remove $top_symlink_dir_abs

9736 06/06/2013 01:56 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added $top_symlink_dir_abs

9735 06/06/2013 01:53 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: $top_dir_orig: renamed to $top_symlink_dir since this reflects better what the dir actually represents, and when it differs from $top_dir

9731 06/06/2013 01:30 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added $is_outermost, which stores whether the util.sh env has not yet set up

9730 06/06/2013 01:28 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: echo_redirs_cmd(): added $cmd_name_log_inc kw param to allow echoing the command name at a different log_level than the command output

9728 06/06/2013 12:13 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: filter_fd: alias-expand filter_cmd

9726 06/06/2013 12:05 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added no_PATH_recursion(), which allows running a system command of the same name as the script

9725 06/06/2013 12:04 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added PATH_rm(), which removes components from the PATH

9724 06/06/2013 12:03 AM Aaron Marcuse-Kubitza

lib/sh/util.sh: added $top_dir_abs, $top_dir_orig