| 1 | #!/bin/sh |
| 2 | |
| 3 | RUN_DIR=$(pwd) |
| 4 | cd $(dirname "$0") |
| 5 | SCRIPT_DIR=$(pwd) |
| 6 | |
| 7 | # ============ vars specific to the versions ============== |
| 8 | |
| 9 | NAME_PRE=18 |
| 10 | NAME_POST=19 |
| 11 | |
| 12 | TAG_PRE_COMM=BETA_18_END |
| 13 | TAG_POST_COMM=tip #BETA_19_END |
| 14 | TAG_PRE_MOZ=FIREFOX_BETA_18_END |
| 15 | TAG_POST_MOZ=tip #FIREFOX_BETA_19_END |
| 16 | TAG_PRE_EXT=SEAMONKEY_2_15_RELEASE |
| 17 | TAG_POST_EXT=tip #SEAMONKEY_2_16_RELEASE |
| 18 | |
| 19 | # ===================== process repos ===================== |
| 20 | |
| 21 | REPO_LIST="COMM MOZ MOZB DOMI CZ" |
| 22 | |
| 23 | HG_COMM_DIR=/mnt/mozilla/hg/comm-beta |
| 24 | COMM_HG_OPTIONS= |
| 25 | COMM_DIR=suite/themes/classic/ |
| 26 | COMM_TAG_PRE=$TAG_PRE_COMM |
| 27 | COMM_TAG_POST=$TAG_POST_COMM |
| 28 | COMM_NAME_EXTRA=" (suite)" |
| 29 | COMM_LOG=$RUN_DIR/theme-suitedefault.$NAME_PRE-$NAME_POST.log |
| 30 | |
| 31 | HG_MOZ_DIR=/mnt/mozilla/hg/comm-beta/mozilla |
| 32 | MOZ_HG_OPTIONS= |
| 33 | MOZ_DIR=toolkit/themes/winstripe/ |
| 34 | MOZ_TAG_PRE=$TAG_PRE_MOZ |
| 35 | MOZ_TAG_POST=$TAG_POST_MOZ |
| 36 | MOZ_NAME_EXTRA=" (toolkit)" |
| 37 | MOZ_LOG=$RUN_DIR/theme-toolkitwin.$NAME_PRE-$NAME_POST.log |
| 38 | |
| 39 | HG_MOZB_DIR=/mnt/mozilla/hg/comm-beta/mozilla |
| 40 | MOZB_HG_OPTIONS= |
| 41 | MOZB_DIR=browser/themes/winstripe/ |
| 42 | MOZB_TAG_PRE=$TAG_PRE_MOZ |
| 43 | MOZB_TAG_POST=$TAG_POST_MOZ |
| 44 | MOZB_NAME_EXTRA=" (browser)" |
| 45 | MOZB_LOG=$RUN_DIR/theme-browserwin.$NAME_PRE-$NAME_POST.log |
| 46 | |
| 47 | HG_DOMI_DIR=/mnt/mozilla/hg/comm-beta/mozilla/extensions/inspector |
| 48 | DOMI_HG_OPTIONS= |
| 49 | DOMI_DIR=resources/skin/classic/ |
| 50 | DOMI_TAG_PRE=$TAG_PRE_EXT |
| 51 | DOMI_TAG_POST=$TAG_POST_EXT |
| 52 | DOMI_NAME_EXTRA= |
| 53 | DOMI_LOG=$RUN_DIR/theme-domiclassic.$NAME_PRE-$NAME_POST.log |
| 54 | |
| 55 | HG_CZ_DIR=/mnt/mozilla/hg/comm-beta/mozilla/extensions/irc |
| 56 | CZ_HG_OPTIONS= |
| 57 | CZ_DIR=xul/skin/ |
| 58 | CZ_TAG_PRE=$TAG_PRE_EXT |
| 59 | CZ_TAG_POST=$TAG_POST_EXT |
| 60 | CZ_NAME_EXTRA= |
| 61 | CZ_LOG=$RUN_DIR/theme-chatzilla.$NAME_PRE-$NAME_POST.log |
| 62 | |
| 63 | for repo in $REPO_LIST; do |
| 64 | HG_DIR_VAR="HG_${repo}_DIR" |
| 65 | HG_DIR=${!HG_DIR_VAR} |
| 66 | HG_OPTIONS_VAR="${repo}_HG_OPTIONS" |
| 67 | HG_OPTIONS=${!HG_OPTIONS_VAR} |
| 68 | SKIN_DIR_VAR="${repo}_DIR" |
| 69 | SKIN_DIR=${!SKIN_DIR_VAR} |
| 70 | TAG_PRE_VAR="${repo}_TAG_PRE" |
| 71 | TAG_PRE=${!TAG_PRE_VAR} |
| 72 | TAG_POST_VAR="${repo}_TAG_POST" |
| 73 | TAG_POST=${!TAG_POST_VAR} |
| 74 | LOG_VAR="${repo}_LOG" |
| 75 | LOG_NAME=${!LOG_VAR} |
| 76 | if [ ! -e $LOG_NAME ]; then |
| 77 | echo "Getting $LOG_NAME..." |
| 78 | cd $HG_DIR |
| 79 | LC_ALL=C hg log -r $TAG_PRE:$TAG_POST $HG_OPTIONS $SKIN_DIR > $LOG_NAME |
| 80 | fi |
| 81 | done |
| 82 | cd $RUN_DIR |
| 83 | |
| 84 | for repo in $REPO_LIST; do |
| 85 | HG_DIR_VAR="HG_${repo}_DIR" |
| 86 | TAG_PRE_VAR="${repo}_TAG_PRE" |
| 87 | TAG_PRE=${!TAG_PRE_VAR} |
| 88 | TAG_POST_VAR="${repo}_TAG_POST" |
| 89 | TAG_POST=${!TAG_POST_VAR} |
| 90 | LOG_VAR="${repo}_LOG" |
| 91 | NAME_EXTRA_VAR="${repo}_NAME_EXTRA" |
| 92 | NAME_EXTRA=${!NAME_EXTRA_VAR} |
| 93 | HG_URL=`awk -F ' *= *' '/default *=/ { print $2 }' ${!HG_DIR_VAR}/.hg/hgrc` |
| 94 | REPO_NAME=`basename $HG_URL`$NAME_EXTRA |
| 95 | LOG_NAME=${!LOG_VAR} |
| 96 | HTML_NAME=${LOG_NAME/.log/.html} |
| 97 | echo "Writing $HTML_NAME..." |
| 98 | echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' > $HTML_NAME |
| 99 | echo "<html>" >> $HTML_NAME |
| 100 | echo " <head>" >> $HTML_NAME |
| 101 | echo " <title>$REPO_NAME Theme Changes</title>" >> $HTML_NAME |
| 102 | echo " </head>" >> $HTML_NAME |
| 103 | echo " <body>" >> $HTML_NAME |
| 104 | echo " <h1>$REPO_NAME Theme Changes</h1>" >> $HTML_NAME |
| 105 | echo " <h2>$TAG_PRE to $TAG_POST</h2>" >> $HTML_NAME |
| 106 | echo " <pre>" >> $HTML_NAME |
| 107 | sed -e "s/&/\&/g" -e "s/</\</g" -e "s/>/\>/g" \ |
| 108 | -e "s|\(changeset: *[0-9]*\):\([0-9a-f]*\)|\1:<a href=\"$HG_URL/rev/\2\">\2</a>|" \ |
| 109 | $LOG_NAME >> $HTML_NAME |
| 110 | echo " </pre>" >> $HTML_NAME |
| 111 | echo " </body>" >> $HTML_NAME |
| 112 | echo "</html>" >> $HTML_NAME |
| 113 | done |
| 114 | |
| 115 | echo "done." |