From nobody@FreeBSD.org  Sat Nov  3 02:26:48 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 52C3A51E
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  3 Nov 2012 02:26:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 392378FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  3 Nov 2012 02:26:48 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qA32Ql66067593
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 3 Nov 2012 02:26:47 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qA32Qlmj067592;
	Sat, 3 Nov 2012 02:26:47 GMT
	(envelope-from nobody)
Message-Id: <201211030226.qA32Qlmj067592@red.freebsd.org>
Date: Sat, 3 Nov 2012 02:26:47 GMT
From: Adam McDougall <mcdouga9@egr.msu.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pkg doesn't work well with a proxy cache + frequent repo updates
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         173317
>Category:       ports
>Synopsis:       ports-mgmt/pkg doesn't work well with a proxy cache + frequent repo updates
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 03 02:30:01 UTC 2012
>Closed-Date:    Sat Dec 28 23:50:21 UTC 2013
>Last-Modified:  Sat Dec 28 23:50:21 UTC 2013
>Originator:     Adam McDougall
>Release:        9-STABLE amd64
>Organization:
MSU
>Environment:
FreeBSD test 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Fri Oct  5 10:17:48 EDT 2012     root@build9:/usr/obj/proto/src9/src/sys/AMD64-9  amd64
>Description:
This may be more of a feature request than a bug report, but if possible, it would be helpful if pkg update worked better with a HTTP cache proxy which tends to deliver a cached repo.txz (at the least).  In my case I am using squid with a fairly basic configuration.  Is there a way for pkg to make HTTP requests so that the cache server will either not cache the files, or cache them shorter, or always verify with the real server if the file has changed instead of assuming it has not?  Eventually (for example the next day) the cache will assume the file is expired and fetch it for real, but I run into trouble when I make frequent repo updates and pkg update cannot see them because of the cache proxy.  I believe this applies to the package files too since their filenames don't change when rebuilt without a version bump.  If I recompile a package with new options, the old cached package will not match the checksum on a newly fetched repo.txz or vice versa.
>How-To-Repeat:
setenv HTTP_PROXY=http://my.favorite.proxy:3128
pkg update
(put new repo and/or packages on the pkg server you are using)
pkg update
'Repository catalogue is up-to-date, no need to fetch fresh copy'
>Fix:
Workaround: don't use a caching proxy (unsetenv HTTP_PROXY), or find a way to fiddle with the proxy or client configuration so that it does not use the proxy for your pkg server, or doesn't cache files from your pkg server if it does proxy it.  Maybe pkg can send hints in its http requests to make a cache behave better.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->portmgr 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sat Nov 3 04:13:33 UTC 2012 
Responsible-Changed-Why:  
fix synopsis and assign 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173317 

From: Baptiste Daroussin <bapt@freebsd.org>
To: bug-followup@freebsd.org, mcdouga9@egr.msu.edu
Cc:  
Subject: Re: ports/173317: ports-mgmt/pkg doesn&#39;t work well with a proxy
 cache frequent repo updates
Date: Sat, 3 Nov 2012 13:34:48 +0100

 --f46d04428c228c505a04cd967bd3
 Content-Type: text/plain; charset=ISO-8859-1
 
 There is not much pkgng can do about this, you need to fix your http server
 serving the packages so that it provides the required header to not cache
 things related to packages for example.
 
 regards,
 Bapt
 
 --f46d04428c228c505a04cd967bd3
 Content-Type: text/html; charset=ISO-8859-1
 
 There is not much pkgng can do about this, you need to fix your http server serving the packages so that it provides the required header to not cache things related to packages for example.<div><br></div><div>regards,</div>
 
 <div>Bapt</div>
 
 --f46d04428c228c505a04cd967bd3--
State-Changed-From-To: open->closed 
State-Changed-By: bapt 
State-Changed-When: Sat Dec 28 23:50:20 UTC 2013 
State-Changed-Why:  
pkgng cannot do much to help here. 

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