Bug 176889 - ports-mgmt/pkg: pkg update doesn't fetch updated repo from private copy
Summary: ports-mgmt/pkg: pkg update doesn't fetch updated repo from private copy
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: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 19:30 UTC by Vick Khera
Modified: 2014-06-16 15:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vick Khera 2013-03-12 19:30:01 UTC
	

I use tinderbox to make a local package repository with my customizations. On
another system I request pkg to update the repo index, but will only ever do
it if I specify "-f" flag to force it. Otherwise it always says there is no
update needed, even if there is an updated list.

Fix: 

workaround is to always use pkg update -f.
How-To-Repeat: 	

Set up package server running lighttpd-1.4.32_1. I use this configuration for
the virtual host:

$HTTP["host"] == "pkg.kcilink.com" {
  server.document-root        = "/usr/local/tinderbox/packages/"
}

and in pkg.conf on the clients I set this:

PACKAGESITE         : http://pkg.kcilink.com/9.1-FreeBSD/All



This is the current repo file on that server:

% ls -l /usr/local/tinderbox/packages/9.1-FreeBSD/All/repo.txz
-rw-r--r--  1 root  wheel  146096 Mar 12 14:02 /usr/local/tinderbox/packages/9.1-FreeBSD/All/repo.txz

Now, on the client system using those packages, run update:

[root@sandbox]# pkg -v
1.0.8
[root@sandbox]# ls -l /var/db/pkg/repo.sqlite
-rw-r--r--  1 root  wheel  601088 Mar 12 09:03 /var/db/pkg/repo.sqlite
[root@sandbox]# pkg update
Updating repository catalogue
Repository catalogue is up-to-date, no need to fetch fresh copy
[root@sandbox]# ls -l /var/db/pkg/repo.sqlite
-rw-r--r--  1 root  wheel  601088 Mar 12 09:03 /var/db/pkg/repo.sqlite
[root@sandbox]# pkg update -f
Updating repository catalogue
repo.txz                            100%  143KB 142.7KB/s 142.7KB/s   00:00
[root@sandbox]# ls -l /var/db/pkg/repo.sqlite
-rw-r--r--  1 root  wheel  605184 Mar 12 14:29 /var/db/pkg/repo.sqlite


The only curiosity I see is that the first "pkg update" logs this on the
package server lighttpd.conf file:

192.168.7.23 pkg.kcilink.com - [12/Mar/2013:14:29:03 -0400] "GET /9.1-FreeBSD/All/repo.txz HTTP/1.1" 200 146096 "-" "pkg libfetch/2.0"

and the second update with -f logs this:

192.168.7.23 pkg.kcilink.com - [12/Mar/2013:14:29:16 -0400] "GET /9.1-FreeBSD/All/repo.txz HTTP/1.1" 200 146096 "-" "pkg libfetch/2.0"

Fetching via a snooping proxy, the only difference I see is that the "-f"
request does not send the "If-Modified-Since" header, but in either case
lighttpd sends back the same byte stream and headers in its response.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-03-13 05:31:32 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2014-06-16 06:08:26 UTC
That may have been fixed in the meantime, can you confirm?
Comment 3 Vick Khera 2014-06-16 14:32:28 UTC
Yes, this appears to not be a problem anymore. The pkg command fetches the repo unconditionally on every command that needs it now.