summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-08-14 14:58:53 -0400
committerAdam Jackson <ajax@redhat.com>2018-08-14 14:58:53 -0400
commit82bfede89c515b283e5d29da55bcd69449819443 (patch)
treebdecb933c1d5497242377e6b645005456faa271b
parent955410b7d8fd69fc1154768b38d71a0261716cb1 (diff)
release.sh: Make project slug detection a bit more robust
Typical gitlab remote urls look like: git@gitlab.freedesktop.org:xorg/driver/xf86-video-v4l.git The existing code would fail to parse this, because it looks for /xorg/ not :xorg/. So first, fix the match pattern. After that we'd break down the slug wrong because we're counting /s wrong. Rather than carefully know how many to care about: reverse the string, pick out the first two fields from that, and reverse the result, so we're always picking off the last two fields of the URL whatever it is. Signed-off-by: Adam Jackson <ajax@redhat.com>
-rwxr-xr-xrelease.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/release.sh b/release.sh
index 6b8e441..57893fd 100755
--- a/release.sh
+++ b/release.sh
@@ -235,9 +235,9 @@ get_section() {
fi
# The last part of the git url will tell us the section. Look for xorg first
- module_url=`echo "$full_module_url" | $GREP -o "/xorg/.*"`
+ module_url=`echo "$full_module_url" | $GREP -o "xorg/.*"`
if [ $? -eq 0 ]; then
- module_url=`echo $module_url | cut -d'/' -f3,4`
+ module_url=`echo $module_url | rev | cut -d'/' -f1,2 | rev`
else
# The look for mesa, xcb, etc...
module_url=`echo "$full_module_url" | $GREP -o -e "mesa/.*" -e "/xcb/.*" -e "/xkeyboard-config" -e "/nouveau/xf86-video-nouveau" -e "/libevdev" -e "/wayland/.*" -e "/evemu"`