pkg(5) archive and temporary source support

With the putback of changeset 2219 to the pkg(5) gate, pkg(1) supports the use of temporary package sources and package archives, and pkgrecv(1) supports the creation of package archives. These changes are also present in build 159 and later.

Support for temporary package sources enables users to perform operations such as install and update without first configuring the source for use with the image.

What changed?

pkgrecv(1) now provides functionality to create package archives from existing package repositories.  Examples:

Create a package archive containing the package "SUNWemacs" and all of its dependencies from the repository located at http://example.com:10000:

  $ pkgrecv -s http://example.com:10000 -d emacs.p5p -a -r SUNWemacs

Copy all of the packages in a package archive to an existing repository located at '/export/repo':

  $ pkgrecv -s archive.p5p -d /export/repo '\*'

pkg(1) now supports the use of temporary package sources for operations such as list, info, and contents.  For example, a user can list the package available for installation in a repository or package archive as follows:

  $ pkg list -g /my/archive.p5p
  $ pkg list -g http://example.com:10000

Multiple sources can be combined:

  $ pkg list -g /my/archive.p5p -g http://example.com:10000

pkg(1) now supports the use of temporary package sources for operations such as install, update, change-variant, and change-facet.  For example, a user could install a package from any package repository or package archive as follows (any required dependencies will also be installed automatically):

  $ pkg install -g http://example.com:10000 <pkg_name1> <pkg_name2> ...
  $ pkg install -g /my/archive.p5p <pkg_name1> <pkg_name2> ...

Likewise, they could update any packages found in a package archive or in any package repository as follows:

  $ pkg update -g http://example.com:10000
  $ pkg update -g /my/newarchive.p5p

Or update specific packages from a package archive as follows:

  $ pkg update -g /my/newarchive.p5p <pkg_name1> <pkg_name2> ...

Multiple sources can also be combined:

  $ pkg install -g http://example.com:10000 -g /my/archive.p5p \\
    <pkg_name1> <pkg_name2> ...

pkg(1) now allows the location of filesystem repositories to be specified as relative or absolute paths.  Previously, they had to be specified as absolute paths using URI syntax (e.g. file:///path/to/repo).  Example:

  $ pkg set-publisher -p myrepo         (relative to $CWD)
  $ pkg set-publisher -p /path/to/repo  (absolute)

pkg(1) now supports the use of package archives as an origin for a publisher.  For example, you could copy all of the packages from an existing repository into an archive and then add a publisher using that archive as a source of package data:

  $ pkgrecv -s http://example.com:10000/on-nightly \\
     -a -d /my/on-nightly.p5p '\*'
  $ pkg set-publisher -p /my/on-nightly.p5p

What are the potential issues?

Packages installed from a package archive or other temporary source from a publisher that was not previously configured in the image will be added without any origin or mirror information.  If a program is parsing the output of the pkg system and expecting origins or mirrors to always be listed, it will fail.

For now, publishers without origins or mirrors show as follows in the output of 'pkg publisher':

$ pkg publisher
PUBLISHER        TYPE     STATUS   URI
opensolaris.org  origin   online   http://pkg.opensolaris.org/release/
example

The above simply indicates that publisher 'example' doesn't have any origins.

Also be aware that pkgrecv(1) currently only supports the creation of new package archives.  Existing package archives may not be updated. This limitation may be removed at a future date.

Thanks

Many thanks to the individuals who collaborated on, reviewed, or contributed to this project.
Comments:

Post a Comment:
Comments are closed for this entry.
About

user12609878

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today