From yx@grannus.ixn.net.ua  Mon Feb 27 14:42:30 2006
Return-Path: <yx@grannus.ixn.net.ua>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 17F9316A42F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Feb 2006 14:42:30 +0000 (GMT)
	(envelope-from yx@grannus.ixn.net.ua)
Received: from relay1.ixn.net.ua (relay1.ixn.net.ua [80.70.80.11])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9351143D46
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Feb 2006 14:42:25 +0000 (GMT)
	(envelope-from yx@grannus.ixn.net.ua)
Received: from grannus.ixn.net.ua (grannus [80.70.66.5])
	by relay1.ixn.net.ua (8.13.1/8.13.1) with ESMTP id k1REgJ1S098369
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Feb 2006 16:42:19 +0200 (EET)
	(envelope-from yx@grannus.ixn.net.ua)
Received: from grannus.ixn.net.ua (localhost [127.0.0.1])
	by grannus.ixn.net.ua (8.13.3/8.13.3) with ESMTP id k1REgJhZ050919
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 27 Feb 2006 16:42:19 +0200 (EET)
	(envelope-from yx@grannus.ixn.net.ua)
Received: (from yx@localhost)
	by grannus.ixn.net.ua (8.13.3/8.12.8/Submit) id k1REgIn9050913;
	Mon, 27 Feb 2006 16:42:18 +0200 (EET)
Message-Id: <200602271442.k1REgIn9050913@grannus.ixn.net.ua>
Date: Mon, 27 Feb 2006 16:42:18 +0200 (EET)
From: "Auster Vl." <yx@x.ua>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject:
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         93901
>Category:       ports
>Synopsis:       [patch] can't find portsnap mirrors
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cperciva
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 27 14:50:03 GMT 2006
>Closed-Date:    Fri May 26 23:39:15 GMT 2006
>Last-Modified:  Fri May 26 23:39:15 GMT 2006
>Originator:     Auster Vl.
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
>Environment:
System: FreeBSD 4.11-STABLE i386

>Description:
 fbsd4 sysutils/portsnap-1.0:
 portsnap.FreeBSD.org mirrors... none found.


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


>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


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->cperciva 
Responsible-Changed-By: mnag 
Responsible-Changed-When: Mon Feb 27 15:19:15 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93901 
State-Changed-From-To: open->analyzed 
State-Changed-By: cperciva 
State-Changed-When: Sun Apr 2 01:35:05 UTC 2006 
State-Changed-Why:  
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. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93901 
State-Changed-From-To: analyzed->closed 
State-Changed-By: cperciva 
State-Changed-When: Fri May 26 23:38:06 UTC 2006 
State-Changed-Why:  
Fixed in HEAD, RELENG_6, and RELENG_5 in the src tree, and in 
version 1.1 of portsnap in the ports tree. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93901 
>Unformatted:
