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-05-24 02:40:52 +0200
committerLevente Polyak <anthraxx@archlinux.org>2023-05-24 02:50:08 +0200
commita08bc2acf49c68061284c7991d41dc78c46ae2b4 (patch)
tree2f7a6480de3cfc5d6922d719ad411ac8882aa7a0 /src/lib/repo/configure.sh
parentf11cb9018e7d926b6b61660e418d8beb7b39ea62 (diff)
feature(clone): add protocol option to force cloning over HTTPS
This is a rather quick and simple implementation to override the current logic and force clone with HTTPS. Allowing to explicitly clone over HTTPS is currently required to unblock reproducible builds where no ssh keys and GitLab user accounts are set up as of now. Hence this quick solution comes into play to mitigate the regression on reproducible builds builders. Revisit the overall auto detection and protocol logic approach for a later release related to some ideas floating around in pending merge-requests. Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'src/lib/repo/configure.sh')
-rw-r--r--src/lib/repo/configure.sh21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/lib/repo/configure.sh b/src/lib/repo/configure.sh
index a5708a0..81b7d19 100644
--- a/src/lib/repo/configure.sh
+++ b/src/lib/repo/configure.sh
@@ -33,6 +33,7 @@ pkgctl_repo_configure_usage() {
read-only HTTPS otherwise.
OPTIONS
+ --protocol https Configure remote url to use https
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
-h, --help Show this help text
@@ -94,6 +95,7 @@ pkgctl_repo_configure() {
local GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS}
local official=0
local proto=https
+ local proto_force=0
local jobs=
jobs=$(nproc)
local paths=()
@@ -109,6 +111,19 @@ pkgctl_repo_configure() {
pkgctl_repo_configure_usage
exit 0
;;
+ --protocol=https)
+ proto_force=1
+ shift
+ ;;
+ --protocol)
+ (( $# <= 1 )) && die "missing argument for %s" "$1"
+ if [[ $2 == https ]]; then
+ proto_force=1
+ else
+ die "unsupported protocol: %s" "$2"
+ fi
+ shift 2
+ ;;
-j|--jobs)
(( $# <= 1 )) && die "missing argument for %s" "$1"
jobs=$2
@@ -152,8 +167,10 @@ pkgctl_repo_configure() {
fi
if is_packager_email_official "${packager_email}"; then
official=1
- proto=ssh
- GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_SSH}
+ if (( ! proto_force )); then
+ proto=ssh
+ GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_SSH}
+ fi
fi
fi