Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/repo/clone.sh15
-rw-r--r--src/lib/repo/configure.sh21
2 files changed, 32 insertions, 4 deletions
diff --git a/src/lib/repo/clone.sh b/src/lib/repo/clone.sh
index a02d799..08bded4 100644
--- a/src/lib/repo/clone.sh
+++ b/src/lib/repo/clone.sh
@@ -26,12 +26,13 @@ pkgctl_repo_clone_usage() {
Clone Git packaging repositories from the canonical namespace.
The configure command is subsequently invoked to synchronize the distro
- specs and makepkg.conf settings. The unprivileged option can be used
+ specs and makepkg.conf settings. The protocol option can be used
for cloning packaging repositories without SSH access using read-only
HTTPS.
OPTIONS
-m, --maintainer=NAME Clone all packages of the named maintainer
+ --protocol https Clone the repository over https
--switch VERSION Switch the current working tree to a specified version
--universe Clone all existing packages, useful for cache warming
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
@@ -69,11 +70,21 @@ pkgctl_repo_clone() {
pkgctl_repo_clone_usage
exit 0
;;
- -u|--unprivileged)
+ --protocol=https)
GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS}
CONFIGURE_OPTIONS+=("$1")
shift
;;
+ --protocol)
+ (( $# <= 1 )) && die "missing argument for %s" "$1"
+ if [[ $2 == https ]]; then
+ GIT_REPO_BASE_URL=${GIT_PACKAGING_URL_HTTPS}
+ else
+ die "unsupported protocol: %s" "$2"
+ fi
+ CONFIGURE_OPTIONS+=("$1" "$2")
+ shift 2
+ ;;
-m|--maintainer)
(( $# <= 1 )) && die "missing argument for %s" "$1"
MAINTAINER="$2"
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