Debian Codegraph @

debian/patches/use-local-jquery.patch

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