8004726: Link bug ids to jbs rather than monaco
Reviewed-by: ohair, chegar, katleman
This commit is contained in:
parent
dab327e501
commit
574897c629
@ -19,7 +19,7 @@
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
# This script takes a file list and a workspace and builds a set of html files
|
||||
@ -27,7 +27,7 @@
|
||||
# Documentation is available via 'webrev -h'.
|
||||
#
|
||||
|
||||
WEBREV_UPDATED=23.18-hg
|
||||
WEBREV_UPDATED=23.18-hg+jbs
|
||||
|
||||
HTML='<?xml version="1.0"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
@ -146,7 +146,7 @@ html_quote()
|
||||
#
|
||||
bug2url()
|
||||
{
|
||||
sed -e 's|[0-9]\{5,\}|<a href=\"'$BUGURL'&\">&</a>|g'
|
||||
sed -e 's|[0-9]\{5,\}|<a href=\"'$BUGURL$IDPREFIX'&\">&</a>|g'
|
||||
}
|
||||
|
||||
#
|
||||
@ -230,8 +230,8 @@ strip_unchanged()
|
||||
# $ sdiff_to_html old/usr/src/tools/scripts/webrev.sh \
|
||||
# new/usr/src/tools/scripts/webrev.sh \
|
||||
# webrev.sh usr/src/tools/scripts \
|
||||
# '<a href="http://monaco.sfbay.sun.com/detail.jsp?cr=1234567">
|
||||
# 1234567</a> my bugid' > <file>.html
|
||||
# '<a href="https://jbs.oracle.com/bugs/browse/JDK-1234567">
|
||||
# JDK-1234567</a> my bugid' > <file>.html
|
||||
#
|
||||
# framed_sdiff() is then called which creates $2.frames.html
|
||||
# in the webrev tree.
|
||||
@ -2521,10 +2521,16 @@ print " Output to: $WDIR"
|
||||
# Bug IDs will be replaced by a URL. Order of precedence
|
||||
# is: default location, $WEBREV_BUGURL, the -O flag.
|
||||
#
|
||||
BUGURL='http://monaco.sfbay.sun.com/detail.jsp?cr='
|
||||
BUGURL='https://jbs.oracle.com/bugs/browse/'
|
||||
[[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL"
|
||||
[[ -n "$Oflag" ]] && \
|
||||
if [[ -n "$Oflag" ]]; then
|
||||
CRID=`echo $CRID | sed -e 's/JDK-//'`
|
||||
BUGURL='http://bugs.sun.com/bugdatabase/view_bug.do?bug_id='
|
||||
IDPREFIX=''
|
||||
else
|
||||
IDPREFIX='JDK-'
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Likewise, ARC cases will be replaced by a URL. Order of precedence
|
||||
@ -3000,21 +3006,30 @@ fi
|
||||
# external URL has a <title> like:
|
||||
# <title>Bug ID: 6641309 Wrong Cookie separator used in HttpURLConnection</title>
|
||||
# while internal URL has <title> like:
|
||||
# <title>6641309: Wrong Cookie separator used in HttpURLConnection</title>
|
||||
# <title>[#JDK-6641309] Wrong Cookie separator used in HttpURLConnection</title>
|
||||
#
|
||||
if [[ -n $CRID ]]; then
|
||||
for id in $CRID
|
||||
do
|
||||
if [[ -z "$Oflag" ]]; then
|
||||
#add "JDK-" to raw bug id for jbs links.
|
||||
id=`echo ${id} | sed 's/^\([0-9]\{5,\}\)$/JDK-\1/'`
|
||||
fi
|
||||
print "<tr><th>Bug id:</th><td>"
|
||||
url="${BUGURL}${id}"
|
||||
if [[ -n $WGET ]]; then
|
||||
msg=`$WGET -q $url -O - | grep '<title>' | sed 's/<title>\(.*\)<\/title>/\1/' | sed 's/Bug ID://'`
|
||||
fi
|
||||
if [[ -n $msg ]]; then
|
||||
print "<a href=\"$url\">$msg</a>"
|
||||
if [[ -n "$Oflag" ]]; then
|
||||
cleanup='s/Bug ID: \([0-9]\{5,\}\) \(.*\)/JDK-\1 : \2/'
|
||||
else
|
||||
print $id | bug2url
|
||||
cleanup='s|\[#\(JDK-[0-9]\{5,\}\)\] \(.*\)|\1 : \2|'
|
||||
fi
|
||||
if [[ -n $WGET ]]; then
|
||||
msg=`$WGET --timeout=10 --tries=1 -q $url -O - | grep '<title>' | sed 's/<title>\(.*\)<\/title>/\1/' | sed "$cleanup"`
|
||||
fi
|
||||
if [[ -z $msg ]]; then
|
||||
msg="${id}"
|
||||
fi
|
||||
|
||||
print "<a href=\"$url\">$msg</a>"
|
||||
|
||||
print "</td></tr>"
|
||||
done
|
||||
@ -3179,4 +3194,3 @@ exec 3<&- # close FD 3.
|
||||
|
||||
print "Done."
|
||||
print "Output to: $WDIR"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user