Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Sep 1999 02:18:38 +0300 (EEST)
From:      Jaakko Salomaa <jsalomaa@saunalahti.fi>
To:        hackers@freebsd.org
Subject:   A new package fetching utility, pkg_get
Message-ID:  <Pine.BSF.4.10.9909240149250.1295-100000@kone.kala.net>

next in thread | raw e-mail | index | archive | help
Hello,

I have made this little program named pkg_get. It's decided to ease
fetching and installing of FreeBSD (and why not Open- or NetBSD) binary
packages, by making a database out of packages at a ftp server's packages
directory.

I had the idea from Debian Linux's atp-get utility, which my friend
praised a lot. The source tarball can be fetched from the following URL:
http://www.saunalahti.fi/~jsalomaa/pkg_get.tar.gz

The program has already been tested by a few geeks (hope no-one gets hurt)
at IRCNET, but of course I'd like some more testers, creative ideas how
things should really be done (I'm not much of a C-guru nor UN*X guru)
and flame about segmentation faults and uselessnes.

And yes, I know what ports are. But fetching and installing packages is
much faster than fetching the bigger source tarball and compiling it. And
yes, I know about the remote fetching ability of pkg_add, but it is pretty
poor in my opinion. I think we need something like this. I'll make a port
out of this if you want, or if it's my lucky day, perhaps it should even
be added to the base distribution (damn, I'm ambitious :-]).

For those of you without enough time/interest to try it out, I
add some "screen shots" (things typed by the user are surrounded by
asterisks.)

% ** ./pkg_get -h **
Syntax: ./pkg_get [options] [package]

Available options:
-h : Get help
-i : Install package
-U : Upgrade database
-s : Server (if not set, first check PKGSERVER environment
     variable, then the server database (./database)
-p : Port to use with ftp server, default 21
-d : FTP directory at server (if not set, first check PKGDIR environment
     variable, then appropriate entry in the server db
-P : Use passive ftp
-n : Username at ftp server, default anonymous
-f : Only fetch package to CWD, don't install.
-a : Automatically fetch any not previously installed or
     fetched dependancys of the package to be installed.

The package-argument may be a regular expression.

----------------------------------------------------------------------

% ** ./pkg_get -i gtk **
Current server is the main distribution site, ftp.freebsd.org.
Do you want to use it? (Y/N) ** n **
Enter hostname of your FreeBSD mirror site: nic.funet.fi
No entry found in database for server 'nic.funet.fi'.
Enter ftp directory at server (D for default, /pub/FreeBSD/packages/All)
:** D **
URL to packages dir:
ftp://anonymous@nic.funet.fi:21/%2Fpub/FreeBSD/packages/All
No database entry for server nic.funet.fi, making one.
Done.
No package entry for server nic.funet.fi, making one.
Making tcp connection to nic.funet.fi:21
Sending username anonymous...done.
Sending password operator@kone.kala.net...done.
Changing working dir to /pub/FreeBSD/packages/All...done.
Sending PORT command...done.
Listing ftp
directory....................................................................
....................................done.
Terminating control connection...done.
Matching packages:
1. asclock-gtk-beta-2.1.10.tgz
2. gtk---1.0.0.tgz
3. gtk-1.0.6.tgz
4. gtk-1.1.2.tgz
< clippety clip >
17. gtksql-0.3.tgz
18. gtkstep-1.8.tgz
19. gtkyahoo-0.16.tgz
20. ja-gtkicq-0.60.tgz
Press enter to continue. ** enter **
21. ko-gtk-1.0.6.tgz
Enter too big or non-numeral value to re-show choices.
Select package [1-21]: ** 5 **
Receiving gtk-1.2.3.tgz (1474260 bytes): 100%
1474260 bytes transferred in 194.6 seconds  (7.40 Kbytes/s)
New dependancy: glib-1.2.3
Package gtk-1.2.3.tgz has dependancys (glib-1.2.3). Do you want to:
(A)utomatically fetch them
(F)etch this one only
(Q)uit, already fetched packages will besaved in the packages directory
(./packages)
Enter your choice [AFQ]: ** a **
Receiving glib-1.2.3.tgz (166214 bytes): 100%
166214 bytes transferred in 21.9 seconds  (7.40 Kbytes/s)
/usr/sbin/pkg_add gtk-1.2.3.tgz

---------------------------------------------

The last line meant that it echoed what it would do. Both of the files
were fetches to the packages/ subdir, and the gettext dependancy was
ignored, because it's already installed. This was the first run of the
program, of course next time it will know more, for example the last used
ftp server, the directory at it and stuff.

So, there it was.

May you live long and prosper.
Jaakko Salomaa



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9909240149250.1295-100000>