xbps/doc/BINPKG_REPOSITORY
Juan RP 7aebea684b Implemented support for working with remote repositories.
libfetch from NetBSD's pkgsrc has been imported into lib/fetch, but
the objects are embedded into libxbps. Only a public function to fetch
files has been implemented: xbps_fetch_file().

The library now is built with -fvisibility=hidden by default, and
exported symbols are the ones that use the SYMEXPORT macro.

The code works well enough, but will need many more cleanups.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027004600-0lq9aao67lisbzxv
2009-10-27 01:46:00 +01:00

112 lines
3.6 KiB
Plaintext

------------------------------------------------------------------------------
BRIEF INTRODUCTION
------------------------------------------------------------------------------
A repository for binary packages contains the packages itself, and
an index file describing the information about available packages.
The structure for this file is just the same than the plist file used
to register installed packages, aka "an array of dictionaries" and
a "dictionary per package". Additional objects are added into the
main dictionary to specify more info, like:
- pkgindex-version: version used to build the index.
- total-pkgs: total of number of available packages.
The package dictionary will be the same than the one available in
package's metadata directory "/var/db/xbps/metadata/$pkgname/props.plist",
but some additional objects are added to provide enough info for
the repository itself:
- filename: name (and path relative to current dir) for the binary
package.
- filename-sha256: SHA256 hash of the binary package.
Here's how the package index plist file shall look like in a repository:
<dict>
<key>pkgindex-version</key>
<string>1.0</string>
<key>total-pkgs</key>
<integer>666</integer>
<key>available-packages</key>
<array>
<dict>
<key>pkgname</key>
<string>klibc</string>
<key>version</key>
<string>1.5.17</string>
<key>filename</key>
<string>klibc-1.5.17.x86_64.xbps</string>
<key>filename-sha256</key>
<string>7b0de0521983037107cc33f2b1514126432f86ac2be1ef9b9dc51a1e959ea777</string>
<key>architecture</key>
<string>x86_64</string>
<key>installed_size</key>
<integer>9471141</integer>
<key>maintainer</key>
<string>Juan RP xtraeme@gmail.com</string>
<key>short_desc</key>
<string>Minimal libc subset for use with initramfs</key>
<key>long_desc</key>
<string>
klibc is intended to be a minimalistic libc subset for use with initramfs.
It is deliberately written for small size, minimal entanglement, and
portability, not speed. It is definitely a work in progress and a lot of
things are still missing.</string>
...
</dict>
...
</array>
</dict>
------------------------------------------------------------------------------
HOW TO USE BINPKGS WITH REPOSITORIES
------------------------------------------------------------------------------
To build binary packages from all currently installed packages in
XBPS_MASTERDIR:
$ xbps-src build-pkg all
To generate the repository package index for your $XBPS_PACKAGESDIR
setting in the configuration file:
$ xbps-repo genindex /path/to/dir
Alternatively if you only want to register a single package:
$ xbps-repo add-pkgidx /package/repo /package/repo/<arch>/foo-1.2.xbps
After this you can add your own local repository with binary packages:
$ xbps-repo add /path/to/dir
Added repository at /path/to/dir (1.0) with 6 packages.
$
Once it's registered, you can start searching/installing/removing
binary packages. You can add multiple repositories, the order for searching
is the same than they were added; check it with:
$ xbps-repo list
/storage/xbps/binpkgs
/path/to/dir
$
The first repository that has the metadata for a package wins, if not found
it will search in all them until it's found. A repository can also be
unregistered from the pool:
$ xbps-repo remove /path/to/dir
To show information about available packages in the repository pool:
$ xbps-repo show package
To search for binary packages by specifying a shell pattern (see fnmatch(3)):
$ xbps-repo search 'foo*'
------------------------------------------------------------------------------
Juan Romero Pardines <xtraeme@gmail.com>