diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-09-21 17:52:52 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-09-24 19:28:18 +0300 |
commit | 8c3da8abdb16ecad007dc60068deb90e151737ea (patch) | |
tree | db69db08961a042dcac9e21d84b7f2c8fe4ba8bc /brep/handler/submit/submit-git.bash.in | |
parent | 880f96e9325646dc792e1c4e37879f3810b9e8f1 (diff) |
Fix submission handler issues arising due to package archive name ambiguity
Now we take into account the fact that the foo-bar-1.0.tar.gz archive may
contain either foo-bar/1.0 or foo/bar-1.0 package.
Diffstat (limited to 'brep/handler/submit/submit-git.bash.in')
-rw-r--r-- | brep/handler/submit/submit-git.bash.in | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/brep/handler/submit/submit-git.bash.in b/brep/handler/submit/submit-git.bash.in index 9f25c28..983d7b5 100644 --- a/brep/handler/submit/submit-git.bash.in +++ b/brep/handler/submit/submit-git.bash.in @@ -77,15 +77,20 @@ function check_package_duplicate () # <name> <version> <repo-dir> # local s for s in "${!sections[@]}"; do - local d="$rep/${sections[$s]}" + local p + IFS=$'\n' eval \ + 'p=($(run pkg_find_archive "$nam-$ver.*" "$rep/${sections[$s]}"))' - if [ -d "$d" ]; then - local f - f="$(run find "$d" -name "$nam-$ver.*")" + if [ "${#p[@]}" -ne 0 ]; then + local n="${p[0]}" + local v="${p[1]}" - if [ -n "$f" ]; then - trace "found: $f" + trace "found: $n/$v in ${p[3]}" + + if [ "$n" == "$nam" ]; then exit_with_manifest 422 "duplicate submission" + else + exit_with_manifest 422 "submission conflicts with $n/$v" fi fi done |