From 4ca7239b9224fde0a8998b5fa760eb6d12a72a77 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Jan 2014 12:54:00 -0500 Subject: html-gen made more idiomatic and removed some bashisms --- ChangeLog | 8 ++++++-- html-gen.sh | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e210d3..4a5f80c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2014-01-06 Jiri Vanek +2014-01-09 Andrew Azores + + * html-gen.sh: made more idiomatic and removed some bashisms + +2014-01-06 Jiri Vanek Copy all button in console controls sorts by date by default. * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: added @@ -9,7 +13,7 @@ * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: added abstraction for (importList) to allow sorting via parameter -2014-01-06 Jiri Vanek +2014-01-06 Jiri Vanek Removed dependence on sun.misc.BASE64Decoder * configure.ac: removed check for sun.misc.BASE64Decoder diff --git a/html-gen.sh b/html-gen.sh index 535a834..5912286 100755 --- a/html-gen.sh +++ b/html-gen.sh @@ -69,7 +69,7 @@ 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/')" -start_time=$(date +%s.%N) +start_time="$(date +%s.%N)" cd html-gen @@ -99,54 +99,54 @@ sed -i '4i
' AUTHORS.html sed -i '5i
Jam Icon

' AUTHORS.html echo "
" >> AUTHORS.html -REVS=(`hg log -l$CHANGESETS | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`) +REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`) print_debug "Done. Starting formatting (bolding, mailto and hyperlink creation)" for FILE in NEWS.html ChangeLog.html do print_debug "Processing $FILE..." - mv $FILE "$FILE.old" + mv "$FILE" "$FILE.old" COUNTER=0 while read LINE do BOLD=1 - if [[ $FILE == "NEWS.html" ]] + if [ "$FILE" = "NEWS.html" ] then - if [[ $LINE =~ New\ in\ release* ]] + if [[ "$LINE" =~ New\ in\ release* ]] then BOLD=0 - COUNTER=$(( $COUNTER + 1 )) + COUNTER="$(( COUNTER + 1 ))" fi - if [[ $COUNTER -gt $NEWS_ITEMS ]] # Cut to two releases + if [ "$COUNTER" -gt "$NEWS_ITEMS" ] # Cut to two releases then break fi else email_regex=".*\<.*\@.*\>" - if [[ $LINE =~ $email_regex ]] # Matches eg , after HTML-escaping + if [[ "$LINE" =~ $email_regex ]] # Matches eg , after HTML-escaping then BOLD=0 fi - date_regex="[0-9]{4}-[0-9]{2}-[0-9]{2}" - if [[ $LINE =~ $date_regex* ]] # Matches line starting with eg 2013-07-01 + date_regex=[0-9]{4}-[0-9]{2}-[0-9]{2} + if [[ "$LINE" =~ $date_regex* ]] # Matches line starting with eg 2013-07-01 then html_space="\ \ " - REV=${REVS[$COUNTER]} + 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.*)|\1\2|") - COUNTER=$(( $COUNTER + 1 )) + COUNTER="$(( COUNTER + 1 ))" fi - if [[ $COUNTER -gt $CHANGESETS ]] # Cut to ten changesets + if [ "$COUNTER" -gt "$CHANGESETS" ] # Cut to ten changesets then break fi fi - if [[ $BOLD -eq 0 ]] # Highlight "New In Release" in News, and author name lines in ChangeLog + if [ "$BOLD" -eq 0 ] # Highlight "New In Release" in News, and author name lines in ChangeLog then LINE="$LINE" fi - echo "$LINE" >> $FILE + echo "$LINE" >> "$FILE" done < "$FILE.old" rm "$FILE.old" print_debug "$FILE finished" @@ -154,7 +154,7 @@ done sed -i -r 's|(\*\ .*):|\1:|' ChangeLog.html # Underline changed files in ChangeLog, eg "* Makefile.am:" -end_time=$(date +%s.%N) +end_time="$(date +%s.%N)" print_debug "HTML generation complete" print_debug "Total elapsed time: $(echo "$end_time - $start_time" | bc )" -- cgit v1.2.3