Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/asp.in
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2017-07-08 09:25:13 -0400
committerDave Reisner <dreisner@archlinux.org>2017-07-08 13:25:43 -0400
commit6def64c8e0b6d6d41b8768db6d8448f8bc320bbf (patch)
tree6763bad2cbc332dc705f6070f2caae34b3ff3501 /asp.in
parent19dcc3111174284babb30742539bdef4fa8808c9 (diff)
add set-git-protocol command
While we're at it, separate our help output into two sections, since we're accumulating a growing list of subcommands which operate not on packages, but on the meta level of the asp repo. Closes #15.
Diffstat (limited to 'asp.in')
-rw-r--r--asp.in54
1 files changed, 37 insertions, 17 deletions
diff --git a/asp.in b/asp.in
index e2dd60d..8d43055 100644
--- a/asp.in
+++ b/asp.in
@@ -25,23 +25,27 @@ Options:
-h Show this help
-V Show package version
-Commands:
- checkout NAME... Create a mutable git repository for packages
- difflog NAME Show revision history with diffs
- disk-usage Show amount of disk used by locally tracked packages
- export NAME... Export packages
- gc Cleanup and optimize the local repository
- help Show this help
- list-all List all known packages
- list-arches NAME... List architectures for packages
- list-local List tracked packages
- list-repos NAME... List repos for packages
- log NAME Show revision history
- ls-files NAME List files for package
- shortlog NAME Show revision history in short form
- show NAME [FILE] Show the PKGBUILD or other FILE
- untrack NAME... Remove a package from the local repository
- update [NAME...] Update packages (update all tracked if none specified)
+Package Commands:
+ checkout NAME... Create a mutable git repository for packages
+ difflog NAME Show revision history with diffs
+ export NAME... Export packages
+ list-all List all known packages
+ list-arches NAME... List architectures for packages
+ list-local List tracked packages
+ list-repos NAME... List repos for packages
+ log NAME Show revision history
+ ls-files NAME List files for package
+ shortlog NAME Show revision history in short form
+ show NAME [FILE] Show the PKGBUILD or other FILE
+ untrack NAME... Remove a package from the local repository
+ update [NAME...] Update packages (update all tracked if none specified)
+
+Meta Commands:
+ disk-usage Show amount of disk used by locally tracked packages
+ gc Cleanup and optimize the local repository
+ help Show this help
+ set-git-protocol PROTO Change git protocol (one of: git, http, https)
+
EOF
}
@@ -288,6 +292,22 @@ action__ls-files() {
package_list_files "$1"
}
+action__set-git-protocol() {
+ __require_argc 1 $#
+
+ case $1 in
+ git|http|https)
+ ;;
+ *)
+ log_fatal 'invalid protocol: %s' "$1"
+ ;;
+ esac
+
+ for remote in "${ARCH_GIT_REPOS[@]}"; do
+ git remote set-url "$remote" "$1://git.archlinux.org/svntogit/$remote.git"
+ done
+}
+
dispatch_action() {
local candidates