updated apt state
This commit is contained in:
parent
6bbd1f9256
commit
9fbe6854f5
@ -17,8 +17,8 @@ apt-proxy-detect-go:
|
|||||||
file.managed:
|
file.managed:
|
||||||
- name: /usr/local/bin/apt-proxy-detect
|
- name: /usr/local/bin/apt-proxy-detect
|
||||||
- source: {{ apt.fetch_url }}/apt_{{ apt.arch }}
|
- source: {{ apt.fetch_url }}/apt_{{ apt.arch }}
|
||||||
|
- source_hash: {{ apt.fetch_url }}/hashes
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- skip_verify: true
|
|
||||||
- mode: "0755"
|
- mode: "0755"
|
||||||
|
|
||||||
{% for key, value in apt.config.items() -%}
|
{% for key, value in apt.config.items() -%}
|
||||||
|
@ -17,13 +17,18 @@ type Proxy struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Proxy) Format() string {
|
func (p *Proxy) Format() string {
|
||||||
|
if p.PORT == 0 {
|
||||||
|
return fmt.Sprintf(TMPL_WITHOUT_PORT, p.SCHEME, p.HOSTNAME)
|
||||||
|
} else {
|
||||||
return fmt.Sprintf(TMPL, p.SCHEME, p.HOSTNAME, p.PORT)
|
return fmt.Sprintf(TMPL, p.SCHEME, p.HOSTNAME, p.PORT)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var DEFAULT_PORT = 8000
|
var DEFAULT_PORT = 8000
|
||||||
var DEFAULT_PROXY = Proxy{SCHEME: "http", HOSTNAME: "apt.paulbsd.com", PORT: 8001}
|
var DEFAULT_PROXY = Proxy{SCHEME: "https", HOSTNAME: "apt.paulbsd.com", PORT: 0}
|
||||||
|
|
||||||
const TMPL = "%s://%s:%d"
|
const TMPL = "%s://%s:%d"
|
||||||
|
const TMPL_WITHOUT_PORT = "%s://%s"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
addr, err := net.ResolveUDPAddr("udp", mdns.DefaultAddress)
|
addr, err := net.ResolveUDPAddr("udp", mdns.DefaultAddress)
|
||||||
|
Loading…
Reference in New Issue
Block a user