Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/repo/configure.sh
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2023-09-26 22:09:41 +0200
committerChristian Heusel <christian@heusel.eu>2023-09-26 22:44:58 +0200
commitf632659563acb7b8d481fdff9acd8305acf29b98 (patch)
treec10468b8b97ad6745d9e815a9d93f65dcb123d6a /src/lib/repo/configure.sh
parent7e41adf00bb93cf6e016b9a7cd8ebdc693666077 (diff)
fix(clone): ssh connection may require user input (key unlocking etc)
Anything that requires user input (such as a key unlock or hostkey verify) will block the terminal and wait for input which will never come. When cloning or configuring a repo via ssh we therefore initially connect to gitlab to warm the connection. Afterwards users are expected to either have setup a ssh ControlMaster or use something like a ssh agent. Fixes #148 Component: pkgctl repo clone/configure Co-Authored-by: Christian Heusel <christian@heusel.eu> Signed-off-by: Christian Heusel <christian@heusel.eu> Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'src/lib/repo/configure.sh')
-rw-r--r--src/lib/repo/configure.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/repo/configure.sh b/src/lib/repo/configure.sh
index 73300ae..1ddb1b8 100644
--- a/src/lib/repo/configure.sh
+++ b/src/lib/repo/configure.sh
@@ -10,6 +10,8 @@ _DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
# shellcheck source=src/lib/api/gitlab.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/api/gitlab.sh
+# shellcheck source=src/lib/util/git.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/git.sh
source /usr/share/makepkg/util/config.sh
source /usr/share/makepkg/util/message.sh
@@ -188,6 +190,12 @@ pkgctl_repo_configure() {
if [[ -n ${BOLD} ]]; then
export DEVTOOLS_COLOR=always
fi
+
+ # warm up ssh connection as it may require user input (key unlock, hostkey verification etc)
+ if [[ ${proto} == ssh ]]; then
+ git_warmup_ssh_connection
+ fi
+
if ! parallel --bar --jobs "${jobs}" "${command}" ::: "${paths[@]}"; then
die 'Failed to configure some packages, please check the output'
exit 1