File: publicsuffix.patch

package info (click to toggle)
golang-golang-x-net 1%3A0.0%2Bgit20191112.2180aed%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,624 kB
  • sloc: makefile: 37; asm: 18
file content (39 lines) | stat: -rw-r--r-- 1,126 bytes parent folder | download | duplicates (2)
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
Last-Update: 2019-12-30
Forwarded: not-needed
Author: Dmitry Smirnov <onlyjob@debian.org>
Description: avoid download on build time; use data from "publicsuffix" package.

--- a/publicsuffix/gen.go
+++ b/publicsuffix/gen.go
@@ -135,25 +135,20 @@
 	if *version == "" {
 		if *url != defaultURL {
 			return fmt.Errorf("-version was not specified, and the -url is not the default one")
 		}
-		sha, date, err := gitCommit()
-		if err != nil {
-			return err
-		}
-		*version = fmt.Sprintf("publicsuffix.org's public_suffix_list.dat, git revision %s (%s)", sha, date)
+		*version = fmt.Sprintf("publicsuffix's public_suffix_list.dat")
 	}
 	var r io.Reader = os.Stdin
 	if *url != "" {
-		res, err := http.Get(*url)
+		etd_fh, err := os.Open("/usr/share/publicsuffix/effective_tld_names.dat")
 		if err != nil {
 			return err
 		}
-		if res.StatusCode != http.StatusOK {
-			return fmt.Errorf("bad GET status for %s: %d", *url, res.Status)
-		}
-		r = res.Body
-		defer res.Body.Close()
+		etd_data := new(bytes.Buffer)
+		etd_data.ReadFrom(etd_fh)
+		r = etd_data
+		defer etd_fh.Close()
 	}
 
 	var root node
 	icann := false