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 --- 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 }