From f5724cb86ba1650e294cfdeea47d6317746612fc Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 9 Jun 2020 14:24:56 -0700 Subject: [PATCH] clone/update: feed git-svn a file of empty lines The `git svn` command has a nasty habit of prompting the user whenever anything unusual happens. The `svn` command line has a `--non-interactive` option to prevent exactly this sort of hang, but `git svn` does not. Fortunately, simply pressing "" will prevent the hang (usually the default action causes a failure result). Feed a file of empty lines to every `git svn init` and `git svn fetch` command to satisfy these unwanted prompts. This should prevent any svn mirror fetches from hanging indefinitely until they are killed by the jobd timeout. Signed-off-by: Kyle J. McKay --- jobd/update.sh | 6 +++--- taskd/clone.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jobd/update.sh b/jobd/update.sh index 309f2c0..f6c86a5 100755 --- a/jobd/update.sh +++ b/jobd/update.sh @@ -274,8 +274,8 @@ case "$url" in # the URL. However, the shortening can fail if a password is # not required for the longer version but is for the shorter, # so try again without -s if the -s version fails. - cmdstr='git svn init --username="$svnuser" --prefix "" -s "$svnurl" /dev/null 2>&1 || ' - cmdstr="$cmdstr"'git svn init --username="$svnuser" --prefix "" "$svnurl" /dev/null 2>&1' + cmdstr='git svn init --username="$svnuser" --prefix "" -s "$svnurl" <"$mtlinesfile" >/dev/null 2>&1 || ' + cmdstr="$cmdstr"'git svn init --username="$svnuser" --prefix "" "$svnurl" <"$mtlinesfile" >/dev/null 2>&1' GIT_DIR=svn-new-url bang eval "$cmdstr" gitsvnurl="$(GIT_DIR=svn-new-url git config --get svn-remote.svn.url)" || : gitsvnfetch="$(GIT_DIR=svn-new-url git config --get svn-remote.svn.fetch)" || : @@ -313,7 +313,7 @@ case "$url" in # remove any stale *.lock files greater than 1 hour old in case # git-svn was killed on the last update because it took too long find -L svn -type f -name '*.lock' -mmin +60 -exec rm -f '{}' + 2>/dev/null || : - GIT_DIR=. bang git svn fetch --log-window-size=$var_log_window_size --username="$svnuser" --quiet