[Pkg-javascript-commits] [jquery] 01/01: debian/minify: remove `//# sourceMappingURL=..` magic comment, as uptream does (Closes: #799825)

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Sep 23 12:33:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository jquery.

commit 24aa9dd9c5f5d46637e3e76e42770d3121dedd9d
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Wed Sep 23 09:24:44 2015 -0300

    debian/minify: remove `//# sourceMappingURL=..` magic comment, as uptream does (Closes: #799825)
---
 debian/changelog                |  2 ++
 debian/minify                   |  3 +++
 debian/release-check            |  3 ++-
 debian/tests/check-minification | 18 ++++++++++++++++++
 debian/tests/control            |  2 +-
 5 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f787ef9..e6a6b55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 jquery (3.0.0~alpha1+dfsg-2) UNRELEASED; urgency=medium
 
   * remove unused lintian overrides
+  * debian/minify: remove `//# sourceMappingURL=..` magic comment, as uptream
+    does (Closes: #799825)
 
  -- Antonio Terceiro <terceiro at debian.org>  Wed, 02 Sep 2015 11:46:51 -0300
 
diff --git a/debian/minify b/debian/minify
index 3f8e043..c5a3aa3 100755
--- a/debian/minify
+++ b/debian/minify
@@ -9,3 +9,6 @@ uglifyjs \
 	--source-map-url jquery.min.map \
 	--output ${output%%.js}.min.js \
 	"$output"
+
+# remove sourceMappingURL comment, as upstream does
+sed -i -e '/\/\/# sourceMappingURL=\S\+/ d' ${output%%.js}.min.js
diff --git a/debian/release-check b/debian/release-check
index a93bffd..cc98101 100755
--- a/debian/release-check
+++ b/debian/release-check
@@ -2,8 +2,9 @@
 
 set -e
 
-./debian/rules dist/jquery.js dist-compat/jquery.js
+./debian/rules override_dh_auto_build
 rc=0
 ./debian/tests/check-against-upstream-build dist/jquery.js dist-compat/jquery.js || rc=$?
+./debian/tests/check-minification dist/jquery.min.js dist-compat/jquery.min.js || rc=$?
 ./debian/rules clean
 exit $rc
diff --git a/debian/tests/check-minification b/debian/tests/check-minification
new file mode 100755
index 0000000..f84c227
--- /dev/null
+++ b/debian/tests/check-minification
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+rc=0
+
+if [ $# -eq 0 ]; then
+  eval set -- /usr/share/javascript/jquery/jquery.min.js /usr/share/javascript/jquery-compat/jquery.min.js
+fi
+
+for minjs in "$@"; do
+  if grep -q '^..# sourceMappingURL=' $minjs; then
+    echo "E: $minjs contains '//# sourceMappingURL=.*'"
+    rc=1
+  fi
+done
+
+exit $rc
diff --git a/debian/tests/control b/debian/tests/control
index 1fb8037..33c37c1 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,2 @@
-Tests: check-against-upstream-build
+Tests: check-against-upstream-build, check-minification
 Depends: @, wget

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jquery.git



More information about the Pkg-javascript-commits mailing list