From bf71b4668e7e4426a3127d2a7dc8acbf9517bbfa Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 28 Mar 2024 18:35:40 +0100 Subject: fix(abbrevURL): and we are back with POSIX shell! Although, this looks really hackish. --- abbrevURL | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'abbrevURL') diff --git a/abbrevURL b/abbrevURL index b6b102d..5c0f6ee 100755 --- a/abbrevURL +++ b/abbrevURL @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Abbreviate according to # https://en.opensuse.org/openSUSE:Packaging_Patches_guidelines#Current_set_of_abbreviations set -eu @@ -25,13 +25,13 @@ fi STR="$(echo "$STR" | sed -E -e 's@https?://github.com/(.*)/issues/([0-9]+)@gh#\1#\2@')" STR="$(echo "$STR" | sed -E -e 's@https?://github.com/(.*)/pull/([0-9]+)@gh#\1!\2@')" STR="$(echo "$STR" | sed -E -e 's@https?://github.com/(.*)/discussions/([0-9]+)@gh#\1\$\2@')" -STR="$(ID=${STR#*/commit/}; echo "$STR" | sed -E -e 's!https?://github.com/(.*)/commit/([a-zA-Z0-9]+)!gh#\1@'"${ID:0:11}"'!')" +STR="$(ID=${STR#*/commit/}; echo "$STR" | sed -E -e 's!https?://github.com/(.*)/commit/([a-zA-Z0-9]+)!gh#\1@'"${ID%"${ID#????????????}"}"'!')" STR="$(echo "$STR" | sed -E -e 's@https?://gitlab.com/(.*)/issues/([0-9]+)@gl#\1#\2@')" STR="$(echo "$STR" | sed -E -e 's@https?://gitlab.com/(.*)/pull/([0-9]+)@gl#\1!\2@')" STR="$(echo "$STR" | sed -E -e 's@https?://gitlab.com/(.*)/-/issues/([0-9]+)@gl#\1#\2@')" STR="$(echo "$STR" | sed -E -e 's@https?://gitlab.com/(.*)/-/pull/([0-9]+)@gl#\1!\2@')" STR="$(echo "$STR" | sed -E -e 's@https?://gitlab.com/(.*)/-/merge-requests/([0-9]+)@gl#\1!\2@')" -STR="$(ID=${STR#*/commit/}; echo "$STR" | sed -E -e 's!https?://gitlab.com/(.*)/-/commit/([a-zA-Z0-9]+)!gl#\1@'"${ID:0:11}"'!')" +STR="$(ID=${STR#*/commit/}; echo "$STR" | sed -E -e 's!https?://gitlab.com/(.*)/-/commit/([a-zA-Z0-9]+)!gl#\1@'"${ID%"${ID#????????????}"}"'!')" STR="$(echo "$STR" | sed -E -e 's@https?://sourceforge.net/support/tracker.php\?aid=([0-9]+)@sh#\1@')" STR="$(echo "$STR" | sed -E -e 's@https?://sf.net/support/tracker.php\?aid=([0-9]+)@sh#\1@')" STR="$(echo "$STR" | sed -E -e 's@https?://sourceforge.net/p/(.*)/patches/([0-9]+)/@shp#\1#\2@')" -- cgit