shlib.sh: provide git_ulimit function and var_xfsz_err
In order to implement the new $Girocco::Config::max_file_size512
setting, it's necessary to run git using the ulimit512 utility.
Provide a new git_ulimit function that does so if the max_file_size512
variable has been set to a non-zero value (otherwise just run git
normally).
While it would certainly be possible to always run git with the
limit in place, it's only needed during fetching/receiving of new
objects and it's better to avoid setting it during other operations
(especially gc) that could, perhaps, be adversely affected by such
a limit.
When a command fails because it receives SIGXFSZ (and it does not
have a signal handler for it installed), the shell will report that
as an exit status of 128+<signal number>.
Unfortunately, the actual signal number assigned to SIGXFSZ is not
standardized by POSIX (although it's likely 25 on many systems).
Therefore, test the actual failure at install time and set a new
"var_xfsz_err" variable to the exit code the shell will report for
a SIGXFSZ termination on the current system. This makes it possible
to reliably test for such a failure later.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>