From 15aae9d6ccad133defdb4270dbd6d76b7f370063 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 3 Aug 2019 21:39:44 +0300 Subject: Make submit-git handler to authorize package owner without regards to potential .git extension in control repository URL --- brep/handler/submit/submit-git.bash.in | 6 ++++-- brep/handler/submit/submit-git.in | 3 ++- 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 () # 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 () # # 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 -- cgit v1.1