From 0764abbecb77ebd37a5004df856a6b4a67559c1e Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 15 Aug 2020 13:13:49 -0700 Subject: [PATCH] fetching: enforce $Girocco::Config::max_file_size512 When fetching updates, enforce the new $Girocco::Config::max_file_size512 file size limit. Signed-off-by: Kyle J. McKay --- jobd/update.sh | 16 ++++++++++------ shlib.sh | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/jobd/update.sh b/jobd/update.sh index daf2e09..993d81c 100755 --- a/jobd/update.sh +++ b/jobd/update.sh @@ -13,6 +13,10 @@ fi datefmt='+%a, %d %b %Y %T %z' git_fetch_q_progress() { + if [ "${cfg_max_file_size512:-0}" != "0" ]; then + GIT_BIN="'$cfg_basedir/bin/ulimit512' -i -f '$cfg_max_file_size512' -- '$cfg_git_bin'" && + export GIT_BIN + fi PATH="$var_git_exec_path:$cfg_basedir/bin:$PATH" @basedir@/jobd/git-fetch-q-progress.sh "$@" } @@ -51,7 +55,7 @@ git_darcs_fetch() ( } | { _e2=0 - git fast-import \ + git_ulimit fast-import \ --export-marks="$(pwd)/gfi-marks" \ --export-pack-edges="$(pwd)/gfi-packs" \ --import-marks="$(pwd)/gfi-marks" \ @@ -85,7 +89,7 @@ git_bzr_fetch() ( } | { _e2=0 - git fast-import \ + git_ulimit fast-import \ --export-marks="$(pwd)/gfi-marks" \ --export-pack-edges="$(pwd)/gfi-packs" \ --import-marks="$(pwd)/gfi-marks" \ @@ -322,7 +326,7 @@ case "$url" in saveconfig="$GIT_CONFIG_PARAMETERS" git_add_config 'gc.auto=1' git_add_config 'gc.autoPackLimit=1' - GIT_DIR=. bang git svn fetch --log-window-size=$var_log_window_size --username="$svnuser" --quiet <"$mtlinesfile" + GIT_DIR=. bang git_ulimit svn fetch --log-window-size=$var_log_window_size --username="$svnuser" --quiet <"$mtlinesfile" GIROCCO_SUPPRESS_AUTO_GC_UPDATE=1 export GIROCCO_SUPPRESS_AUTO_GC_UPDATE unset GIROCCO_DIVERT_GIT_SVN_AUTO_GC @@ -394,14 +398,14 @@ case "$url" in fi fetcharg="default" git config remotes.default >/dev/null 2>&1 || fetcharg="--all" - fetchcmd="git fetch" - [ "$show_progress" != "0" ] || fetchcmd="git fetch -q" + fetchcmd="git_ulimit fetch" + [ "$show_progress" != "0" ] || fetchcmd="git_ulimit fetch -q" if [ -n "$var_have_git_171" ] && [ "${show_progress:-0}" != "0" ]; then # git fetch learned --progress in v1.7.1 case "$show_progress" in [2-9]*|1[0-9]*) # full volume progress with all the spammy noise - fetchcmd="git fetch --progress" + fetchcmd="git_ulimit fetch --progress" ;; *) # a kinder, gentler progress that doesn't leave one diff --git a/shlib.sh b/shlib.sh index 171dadc..0d07397 100644 --- a/shlib.sh +++ b/shlib.sh @@ -1059,7 +1059,7 @@ git_hg_fetch() ( } | { _e2=0 - git fast-import \ + git_ulimit fast-import \ --import-marks="$(pwd)/hg2git-marks.old" \ --export-marks="$(pwd)/hg2git-marks.new" \ --export-pack-edges="$(pwd)/gfi-packs" \ -- 2.11.4.GIT