summaryrefslogtreecommitdiffstats
path: root/js/src/doc/lib/make-watermark.sh
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/doc/lib/make-watermark.sh
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/doc/lib/make-watermark.sh')
-rwxr-xr-xjs/src/doc/lib/make-watermark.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/js/src/doc/lib/make-watermark.sh b/js/src/doc/lib/make-watermark.sh
new file mode 100755
index 000000000..a39ff5436
--- /dev/null
+++ b/js/src/doc/lib/make-watermark.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Generate an HTML watermark for the given file. Claim the text was
+# generated from SOURCE.
+#
+# Usage:
+#
+# make-watermark.sh FILE SOURCE
+
+set -eu
+
+# Include the watermark as visible text in the page, as suggested in bug 990662.
+
+echo '<h4>Source Metadata</h4>'
+echo '<dl>'
+echo ' <dt>Generated from file:<dt>'
+echo " <dd>$2</dd>"
+echo ' <dt>Watermark:</dt>'
+echo " <dd id='watermark'>sha256:$(cat "$1" | shasum -a 256 | sed 's/ .*$//')</dd>"
+
+# If we have Mercurial changeset ID, include it.
+if [ "${JS_DOC_HG_IDENTIFY:+set}" = set ]; then
+ # If the changeset ID has a '+' on the end (indicating local
+ # modifications), omit that from the link.
+ cat <<EOF
+ <dt>Changeset:</dt>
+ <dd><a href="https://hg.mozilla.org/mozilla-central/rev/${JS_DOC_HG_IDENTIFY%+}">${JS_DOC_HG_IDENTIFY}</a></dd>
+EOF
+fi
+
+echo '</dl>'