1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
Description: Use local jQuery artifacts
The upstream source downloads jQuery 2.0.3 during testing.
.
The Debian package should never assume that Internet access is available
during building. Also, the Debian policy does not allow the embedded
code copies.
.
This patch does:
* disables the jQuery downloading (Internet access).
* use Debian package jQuery (libjs-jquery).
* disable jQuery version-specific integrity tests.
Bug-Debian: https://bugs.debian.org/927227
Author: Jongmin Kim <jmkim@pukyong.ac.kr>
---
consumer_test.go | 10 ++++++++--
example_test.go | 10 +++++++---
2 files changed, 15 insertions(+), 5 deletions(-)
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/consumer_test.go
+++ b/consumer_test.go
@@ -10,12 +10,16 @@
"gopkg.in/sourcemap.v1"
)
-const jqSourceMapURL = "http://code.jquery.com/jquery-2.0.3.min.map"
+const jqSourceMapURL = "file:///usr/share/javascript/jquery/jquery.min.map"
var jqSourceMapBytes []byte
func init() {
- resp, err := http.Get(jqSourceMapURL)
+ trans := &http.Transport{}
+ trans.RegisterProtocol("file", http.NewFileTransport(http.Dir("/")))
+
+ cli := &http.Client{Transport: trans}
+ resp, err := cli.Get(jqSourceMapURL)
if err != nil {
panic(err)
}
@@ -165,6 +169,7 @@
}
}
+/*
func TestJQuerySourceMap(t *testing.T) {
smap, err := sourcemap.Parse(jqSourceMapURL, jqSourceMapBytes)
if err != nil {
@@ -185,6 +190,7 @@
test.assert(t, smap)
}
}
+*/
// This is a test mapping which maps functions from two different files
// (one.js and two.js) to a minified generated source.
--- a/example_test.go
+++ b/example_test.go
@@ -9,8 +9,13 @@
)
func ExampleParse() {
- mapURL := "http://code.jquery.com/jquery-2.0.3.min.map"
- resp, err := http.Get(mapURL)
+ mapURL := "file:///usr/share/javascript/jquery/jquery.min.map"
+
+ trans := &http.Transport{}
+ trans.RegisterProtocol("file", http.NewFileTransport(http.Dir("/")))
+
+ cli := &http.Client{Transport: trans}
+ resp, err := cli.Get(mapURL)
if err != nil {
panic(err)
}
@@ -29,5 +34,4 @@
line, column := 5, 6789
file, fn, line, col, ok := smap.Source(line, column)
fmt.Println(file, fn, line, col, ok)
- // Output: http://code.jquery.com/jquery-2.0.3.js apply 4360 27 true
}
|