Marc Espie wrote:
On Fri, Jan 01, 2010 at 07:22:19PM -0600, Chris Bennett wrote:
I'm just looking for a list of the NEWER packages so that I can
download what is missing from an existing cache.
I wouldn't care at all at this step for getting more than a list of
names to download, download them, then skip the ftp part of the
update and just bang away at an already good set of packages freshly
downloaded in the cache.

I already do this for an identical machine (as far as packages) and
am manually updating another machine's cache from results of first
update.

Why are you using -n, then ? PKG_CACHE works perfectly fine if you update
the first machine, then use the resulting cache on the second machine.

The whole design of pkg_add revolves around the fact that you have to
download the packages anyways, so it tries really hard to be as responsive
as possible in installing stuff on the fly.

It's been a few years now, but it is installing the package in its entirety,
so even if you skip the PKG_CACHE part, it is possible to recreate the
packages from an installed machine.

If pkg_add or some other existing tool can't do this step, then I
will come up with a script to do this anyway.
My available time to do useful stuff just went up quite a lot and
for a good while.

Good luck in writing something that will be better than pkg_add in figuring
out what changed.

One question. Is the index.txt from PKG_PATH used? I have been
adding latest copy to pkg_cache, just in case.
Nope, it's not. on ftp, pkg_add is using nlist *.tgz to get its list of
package names. And on http, it's using index.html.

Actually I may have just thought of something easier and rather
obvious as a much simpler solution from what I just asked.
I can just diff the correct fields of old and new index.txt and find
all the packages I need to add/delete from cache

I am assuming that index.txt is updated with every file change, right?

I have no idea. Possibly. I don't ever use it.

You will possibly retrieve more packages than you strictly need, since
pkg_add looks inside packages, and doesn't retrieve them unless they have
different signatures.

Also, -n -u is on my list of things to fix eventually. I don't know if you've
noticed how massively improved pkg_add is in -current compared to 4.6, and
other improvements are still coming.
t


I'd have to be blind not to notice the improvements!
Thanks, I appreciate the changes. Much better!

Which, of course is what motivated me to look closer at all of the pkg tools.
I had overlooked PKG_CACHE earlier, to my regret.

I had no idea that -n -u was broken.
I wasn't using it, basically just asking if I should. Now I know. No.

And of course, I have felt the effects of these hard economic times, so it seemed responsible to see if I could improve things on my end to reduce unnecessary downloading of the same copy of packages. Bandwidth isn't free, after all.

--
A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.
  -- Robert Heinlein

Reply via email to