tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg_add and remote packages

Joerg Sonnenberger wrote:
On Fri, Apr 04, 2008 at 01:04:52PM -0400, Johnny C. Lam wrote:
(1) Modify pkg_add(1) to use libfetch to fetch the remote binary package and store it locally, then install the local binary package. I'm not sure precisely what advantage using libfetch is over using ftp(1) if that's all that we're doing; could you explain?

I always have to use temporary files to get e.g. remote directory
listenings. One reason to switch to libfetch is to avoid that.
The other reason to make pkg_install itself completely standalone.
I would like to discuss at a later stage if we want to do stream
installation without storing the package in the filesystem at all, but
that is something I want to do after the more important item of inplace
installation is done.

That's true and it's an important technical improvement in using libfetch over a separate ftp(1) process. The thought that crossed my mind was that ftp(1) might have better support for things like proxies and perhaps other protocols than libfetch, so I was (slightly) worried about regressions in this area. At least HTTP_PROXY and FTP_PROXY are relevant given the nature of some corporate setups. I admit I haven't looked at libfetch to see what features are missing (if at all).

(2) Modify pkg_add(1) to use libarchive to extract the local binary package directly into ${LOCALBASE} and ${PKG_DBDIR} instead of the staged installation via /var/tmp (as is currently done).

That is the primary goal. The problem for me is that pkg_add has two
slightly different code pathes here:
(1) Local binary package calls pax/tar to extract to /var/tmp
(2) Remote binary package fetches via "get foo | tar xf -" to /var/tmp

I would like to get rid of the second code path first and only deal with
the second part.

I think that sounds fine, as long as both parts are eventually done. Very often, the trade-off for disk space and bandwidth is biased toward "disk space is cheap", but I find that I usually fetch "remote" packages across my local network and really don't want the extra copies of packages everywhere.

The local copy will normally be deleted after the installation (unless
requested otherwise), so it is "just" temporary disk space.

The point I was making was that downloading, extracting, then copying the files into place takes more room than now, but that if the "extract directly into place" step is implemented (which I think you said you were eventually going to do), then I would be happy.

Again, I would like to see both changes made. It should simplify the code for pkg_install quite a bit, which is a good thing.


        -- Johnny C. Lam

Home | Main Index | Thread Index | Old Index