/hg/release/icedtea-web-1.6: html-gen.sh: now don't generate mer...
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Tue Jan 5 09:27:33 UTC 2016
changeset f589afe6e008 in /hg/release/icedtea-web-1.6
details: http://icedtea.classpath.org/hg/release/icedtea-web-1.6?cmd=changeset;node=f589afe6e008
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Jan 05 10:27:13 2016 +0100
html-gen.sh: now don't generate mercurial changesets' links if .hg is missing
diffstat:
ChangeLog | 5 +++++
NEWS | 1 +
html-gen.sh | 26 ++++++++++++++++++++------
3 files changed, 26 insertions(+), 6 deletions(-)
diffs (78 lines):
diff -r ee907deeda19 -r f589afe6e008 ChangeLog
--- a/ChangeLog Thu Dec 31 13:29:17 2015 +0100
+++ b/ChangeLog Tue Jan 05 10:27:13 2016 +0100
@@ -1,3 +1,8 @@
+2016-01-05 Jiri Vanek <jvanek at redhat.com>
+
+ * NEWS: mentioned PR2779
+ * html-gen.sh: now don't generate mercurial changesets' links if .hg is missing
+
2015-12-23 Jiri Vanek <jvanek at redhat.com>
Small properties parser in C (plugin) now unescapes \= \\ \: \t \n and \r correctly
diff -r ee907deeda19 -r f589afe6e008 NEWS
--- a/NEWS Thu Dec 31 13:29:17 2015 +0100
+++ b/NEWS Tue Jan 05 10:27:13 2016 +0100
@@ -10,6 +10,7 @@
New in release 1.6.2 (YYYY-MM-DD):
* all connection restrictions now consider also port
+* PR2779: html-gen.sh: Don't try to call hg if .hg directory isn't present
* NetX
- main-class attribute trimmed by default
- in strict mode, main-class attribute checked for invalid characters
diff -r ee907deeda19 -r f589afe6e008 html-gen.sh
--- a/html-gen.sh Thu Dec 31 13:29:17 2015 +0100
+++ b/html-gen.sh Tue Jan 05 10:27:13 2016 +0100
@@ -67,13 +67,23 @@
if [ -z "$CHANGESETS" ] || [ "$CHANGESETS" -lt 0 ]; then CHANGESETS=10; fi
NEWS_ITEMS=2
-REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')"
+
+if [ -d .hg ]; then
+ REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')"
+else
+ unset REPO_URL
+fi
start_time="$(date +%s.%N)"
+if [ ! -e html-gen ]; then
+ echo "No html-gen directory, exiting. See Makefile.am for usage"
+ exit 1
+fi
+
cd html-gen
-print_debug "Generating HTML content for javaws -about for $REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items"
+print_debug "Generating HTML content for javaws -about${REPO_URL:+ for }$REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items"
print_debug "Starting sed substitutions"
for FILE in NEWS AUTHORS COPYING ChangeLog
do
@@ -99,7 +109,9 @@
sed -i '5i <br><img src="jamIcon.jpg" alt="Jam Icon" width="87" height="84"><br><br>' AUTHORS.html
echo "</center>" >> AUTHORS.html
-REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`)
+if [ -n "${REPO_URL}" ]; then
+ REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`)
+fi
print_debug "Done. Starting formatting (bolding, mailto and hyperlink creation)"
@@ -132,9 +144,11 @@
if [[ "$LINE" =~ $date_regex* ]] # Matches line starting with eg 2013-07-01
then
html_space="\ \ "
- REV="${REVS["$COUNTER"]}"
- # Turn the date into a hyperlink for the revision this changelog entry describes
- LINE=$(echo "$LINE" | sed -r "s|($date_regex)($html_space.*$html_space.*)|<a href=http://icedtea.classpath.org/$REPO_URL/rev/$REV>\1</a>\2|")
+ if [ -n "${REPO_URL}" ]; then
+ REV="${REVS["$COUNTER"]}"
+ # Turn the date into a hyperlink for the revision this changelog entry describes
+ LINE=$(echo "$LINE" | sed -r "s|($date_regex)($html_space.*$html_space.*)|<a href=http://icedtea.classpath.org/$REPO_URL/rev/$REV>\1</a>\2|")
+ fi
COUNTER="$(( COUNTER + 1 ))"
fi
if [ "$COUNTER" -gt "$CHANGESETS" ] # Cut to ten changesets
More information about the distro-pkg-dev
mailing list