Merge lp:~broder/squid-deb-proxy/no-output-on-error into lp:squid-deb-proxy

Proposed by Evan Broder
Status: Needs review
Proposed branch: lp:~broder/squid-deb-proxy/no-output-on-error
Merge into: lp:squid-deb-proxy
Diff against target: 13 lines (+2/-0)
1 file modified
apt-avahi-discover (+2/-0)
To merge this branch: bzr merge lp:~broder/squid-deb-proxy/no-output-on-error
Reviewer Review Type Date Requested Status
squid-deb-proxy-developers Pending
Review via email:
To post a comment you must log in.

Unmerged revisions

60. By Evan Broder

apt-avahi-discover: Only print anything if the proxy URL is successfully resolved

If it fails to find a proxy for any reason (i.e. there is no proxy
being advertised on Avahi, or Avahi is down), it previously would
print "http://:/", which apt would dutifully try to use.

If nothing is printed, apt will ignore it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apt-avahi-discover'
2--- apt-avahi-discover 2011-03-23 15:32:12 +0000
3+++ apt-avahi-discover 2011-11-14 23:58:27 +0000
4@@ -6,7 +6,9 @@
5 SERVICE="_apt_proxy._tcp"
7 out=$(avahi-browse -kprt $SERVICE|grep '^=;.*;IPv4;.*'|head -n1)
8+[ -n "$out" ] || exit
9 PORT=$(echo "$out" | cut -d ';' -f9)
10 HOST=$(echo "$out" | cut -d ';' -f7)
11 IP=$(avahi-resolve -n4 "$HOST" | cut -f2)
12+[ -n "$IP" ] || exit
13 echo "http://$IP:$PORT/"


People subscribed via source and target branches

to all changes: