[csw-users] welcome questions to pkg-get

Philip Brown phil at bolthole.com
Thu Jul 29 21:53:09 CEST 2010


> Guillaume wrote:
> We want to create a machine with packages OPENCSW and then duplicate the
> same machine locally, can be used locally OPENCSW if you download all the
> packages?


hi Guillaume,
Sorry for the slow reply; i only read the users' list infrequently.
You are welcome to email me directly with questions about pkg-get.

The one above, can easily be solved by pkg-get's -l option.

pkg-get -l

will give you a list to stdout, of all csw installed package.

You can then do

oldmachine$ pkg-get -l >somefile


newmachine$ pkg-get -i `cat somefile`

(presuming that you have already set up pkg-get on newmachine to know
about some local package repository, at least. Which can be as simple
as manually copying /opt/csw/bin/pkg-get to the new machine, and
running "pkg-get -U")

You can get a "local" copy of all packages easily and efficiently,  by
rsyncing all the packages you want from one of the rsync sites
mentioned on http://www.opencsw.org/get-it/mirrors/

Or, if you only have a relatively small subset of packages, and you
only want a static, non-updating copy, you could do

 pkg-get -i -d `cat somefile`     # the file mentioned in above steps
and then copy /var/pkg-get/catalog-xxxx into the same directory.

erm.. you would then have to make the directory be named
 [something]/`uname -p`/`uname -r`/

and then you could set the [something] as your pkg-get site url.



   ------

Also, relevant to your prior question, if you are curious how many
packages will be pulled in by "pkg-get -i", you can run it in verbose
mode.

It may not be in a convenient format for you, but it may still be useful.
Example:

$ pkg-get -v -i aide
DEBUG-ONLY/VERBOSE MODE: level=1
No existing install of CSWaide found. Installing...
             CSWaide                           aide 115216 bytes
         CSWlibmhash                       libmhash 318179 bytes


If you run this command on a machine with no CSW packages, then it
will naturally show you "all the dependancies of the given package" :)


It does this by parsing the dependency information that is in the catalog file.



If you really wanted to get at the information more directly, and were
okay with doing some coding, you could actually write something to
parse the catalog yourself, which would reside locally for you in
/var/pkg-get/catalog-xxxxx

The catalog format is fairly simple. The files probably you care about are:

normalname f2 CSWpkgname f4 f5 f6 CSWdep1|CSWdep2|CSWdep2

So,the above gives you the first level dependancies of "normalname".
You would then have to recursively parse through the file for CSWdep1,
CSWdep2, and so on.


More information about the users mailing list