Bug 93901 - [patch] can't find portsnap mirrors
Summary: [patch] can't find portsnap mirrors
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Colin Percival
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 14:50 UTC by Auster Vl.
Modified: 2006-05-27 00:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Auster Vl. 2006-02-27 14:50:03 UTC
 fbsd4 sysutils/portsnap-1.0:
 portsnap.FreeBSD.org mirrors... none found.

Fix: 

--- /usr/local/sbin/portsnap
+++ /usr/local/sbin/portsnap.4example-only
@@ -351,9 +351,12 @@
 	echo -n "Looking up ${SERVERNAME} mirrors..."
 
 # Issue the SRV query and pull out the Priority, Weight, and Target fields.
-	host -t srv "_http._tcp.${SERVERNAME}" |
-	    grep -E "^_http._tcp.${SERVERNAME} has SRV record" |
-	    cut -f 5,6,8 -d ' ' > serverlist
+	b='[[:blank:]]+'
+	d='[[:digit:]]+'
+	a='[[:alnum:]]+'
+	s="_http._tcp.$SERVERNAME"
+	host -v -t srv "$s" |
+	sed -nE "s/^$s\.?$b$d${b}IN${b}SRV$b($d)$b($d)$b$d$b($a)/\1 \2 \3/w serverlist"
 
 # If no records, give up -- we'll just use the server name we were given.
 	if [ `wc -l < serverlist` -eq 0 ]; then
How-To-Repeat: 
 % uname -sr
 FreeBSD 4.11-STABLE

 % strings `which host` | grep '$Id: host.c'
 $Id: host.c,v 8.55.8.1 2003/06/02 09:24:38 marka Exp $

 # /usr/local/sbin/portsnap fetch
 Looking up portsnap.FreeBSD.org mirrors... none found.
 ...
Comment 1 Marcus Alves Grando freebsd_committer freebsd_triage 2006-02-27 15:19:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->cperciva

Over to maintainer.
Comment 2 Colin Percival freebsd_committer freebsd_triage 2006-04-02 02:35:05 UTC
State Changed
From-To: open->analyzed

Different versions of host(1) produce their output formatted 
in different ways; the submitters patch looks plausible, but 
I want to check all the recent FreeBSD versions when I fix 
this.
Comment 3 Colin Percival freebsd_committer freebsd_triage 2006-05-27 00:38:06 UTC
State Changed
From-To: analyzed->closed

Fixed in HEAD, RELENG_6, and RELENG_5 in the src tree, and in 
version 1.1 of portsnap in the ports tree.