Browse Source

add support for announces that were sent to multiple mailing lists..

sed part:
Submitted-by: Nick Hibma
main
John-Mark Gurney 2 years ago
parent
commit
623a2732cf
Signed by: jmg GPG Key ID: 205F0B33DD006ADA
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      snapaid.sh

+ 9
- 5
snapaid.sh View File

@@ -124,17 +124,21 @@ get_raw() {
# get the location, it's a database lookup # get the location, it's a database lookup
loc=$($WGET --max-redirect=0 --method=HEAD -S -o - -O - 'https://docs.freebsd.org/cgi/mid.cgi?'"$mid" 2>/dev/null | awk 'tolower($1) == "location:" { print $2; exit }') loc=$($WGET --max-redirect=0 --method=HEAD -S -o - -O - 'https://docs.freebsd.org/cgi/mid.cgi?'"$mid" 2>/dev/null | awk 'tolower($1) == "location:" { print $2; exit }')


# Some emails are sent to both -current and -snapshot,
# we can't handle them for now
# such as 20160529215940.GA11785@FreeBSD.org
if [ x"$loc" = x"" ]; then if [ x"$loc" = x"" ]; then
return 1
# Some emails are sent to both -current and -snapshot,
# such as 20160529215940.GA11785@FreeBSD.org
# try w/ some magic sed
loc=$($WGET -O - 'https://docs.freebsd.org/cgi/mid.cgi?'"$mid" 2>/dev/null |
sed -Ee '/.*(getmsg.cgi?[^"]*).*/!d;s//\/cgi\/\1/' | head -1)
fi fi


# if it's relative, add https
# if it's host relative, add https
if [ x"$loc" != x"${loc#//}" ]; then if [ x"$loc" != x"${loc#//}" ]; then
# add https # add https
loc="https:$loc" loc="https:$loc"
elif [ x"$loc" != x"${loc#/[^/]}" ]; then
# add https+host
loc="https://docs.freebsd.org$loc"
fi fi


# get the raw part # get the raw part


Loading…
Cancel
Save