[Pkg-javascript-commits] [jquery] 04/15: check against upstream build as a DEP-8 test

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Sep 2 14:44:32 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 6e787e8f672eb782003f0108298feb60eb7eeeb2
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sun Aug 30 21:21:14 2015 -0300

    check against upstream build as a DEP-8 test
---
 debian/changelog                          |  3 +++
 debian/release-check                      | 13 +------------
 debian/tests/check-against-upstream-build | 28 ++++++++++++++++++++++++++++
 debian/tests/control                      |  2 ++
 4 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 22b2f4a..32993b9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 jquery (1.11.3+dfsg-4) UNRELEASED; urgency=medium
 
   * debian/watch: also look for alpha/beta versions
+  * Added DEP-8 tests:
+    - debian/tests/check-against-upstream-build: checks that our build matches
+      upstream's.
 
  -- Antonio Terceiro <terceiro at debian.org>  Sun, 30 Aug 2015 21:08:41 -0300
 
diff --git a/debian/release-check b/debian/release-check
index 1f0553a..a081d3e 100755
--- a/debian/release-check
+++ b/debian/release-check
@@ -2,19 +2,8 @@
 
 set -e
 
-
-cachedir=$HOME/.cache/jquery-debian
-mkdir -p $cachedir
-version=$(dpkg-parsechangelog -SVersion | cut -d + -f 1)
-if [ ! -f $cachedir/jquery-${version}.js ]; then
-  wget --directory-prefix=$cachedir http://code.jquery.com/jquery-${version}.js
-fi
-
 ./debian/rules dist/jquery.js
 rc=0
-diff --ignore-blank-lines \
-  --ignore-matching-lines=Date:.*Z \
-  -u $cachedir/jquery-${version}.js dist/jquery.js || rc=$?
+./debian/tests/check-against-upstream-build dist/jquery.js
 ./debian/rules clean
-
 exit $rc
diff --git a/debian/tests/check-against-upstream-build b/debian/tests/check-against-upstream-build
new file mode 100755
index 0000000..4c2ba86
--- /dev/null
+++ b/debian/tests/check-against-upstream-build
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+exec 2>&1
+
+set -ex
+
+version=$(dpkg-parsechangelog -SVersion | cut -d + -f 1 | sed 's/~/-/')
+
+our_build="$1"
+if [ -z "$our_build" ]; then
+  our_build='/usr/share/javascript/jquery/jquery.js'
+fi
+
+upstream_cache="$ADTTMP"
+if [ -z "$upstream_cache" ]; then
+  upstream_cache=$HOME/.cache/jquery-debian
+  mkdir -p "$upstream_cache"
+fi
+upstream_build=$upstream_cache/jquery-${version}.js
+
+if [ ! -f "$upstream_build" ]; then
+  wget --output-document="$upstream_build" \
+    http://code.jquery.com/jquery-${version}.js
+fi
+
+diff --ignore-blank-lines \
+  --ignore-matching-lines=Date:.*Z \
+  -u "$upstream_build" "$our_build"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..1fb8037
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: check-against-upstream-build
+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