aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-03 21:39:44 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-03 22:07:28 +0300
commit15aae9d6ccad133defdb4270dbd6d76b7f370063 (patch)
tree1d90ffc2fd6d723589b2298b1033493d20093b97
parent0bbd98cffae9274936a0ac7cc579756182579e4e (diff)
Make submit-git handler to authorize package owner without regards to potential .git extension in control repository URL
-rw-r--r--brep/handler/submit/submit-git.bash.in6
-rw-r--r--brep/handler/submit/submit-git.in3
2 files changed, 6 insertions, 3 deletions
diff --git a/brep/handler/submit/submit-git.bash.in b/brep/handler/submit/submit-git.bash.in
index a36164c..56cce33 100644
--- a/brep/handler/submit/submit-git.bash.in
+++ b/brep/handler/submit/submit-git.bash.in
@@ -211,7 +211,7 @@ function auth_package () # <project> <package> <control> <repo-dir>
local prj="$1"
local pkg="$2"
- local ctl="$3"
+ local ctl="${3%.git}" # Strip the potential .git extension.
local rep="$4"
local d
@@ -238,9 +238,11 @@ function auth_package () # <project> <package> <control> <repo-dir>
#
manifest_parser_start "$m"
+ # Match the control URL without regards to the potential .git extension.
+ #
local n v
while IFS=: read -ru "$manifest_parser_ofd" -d '' n v; do
- if [ "$n" == "control" -a "$v" == "$ctl" ]; then
+ if [ "$n" == "control" -a "${v%.git}" == "$ctl" ]; then
r="package"
break
fi
diff --git a/brep/handler/submit/submit-git.in b/brep/handler/submit/submit-git.in
index 5f95b7f..0ae0f3f 100644
--- a/brep/handler/submit/submit-git.in
+++ b/brep/handler/submit/submit-git.in
@@ -109,7 +109,8 @@
#
# If the submission package is already known, then the handler script loads
# its package-owner.manifest and verifies that at least one of the 'control'
-# values matches the submitted control repository URL.
+# values matches the submitted control repository URL. Note that the URL is
+# matched without regards to the potential .git extension.
#
# If all these ownership authentication tests pass, the handler script clones
# (shallow) the build2-control branch of the control repository and verifies