[poldek home]

3. Package repositories

Like other packages management tools poldek uses package repositories (sources) to obtain meta-information about available packages. Repository consist of database (package index) of package meta-data (dependencies, files, description, etc) and, of course packages itself. Various types of repositories are supported including apt-get and yum ones.

Supported repositories

pndir (features: read, write, update, incremental update)

Native poldek index format. Based on tndb (cdb-like) DBM library. Consist of 3 database files: first, packages.ndir with essential package meta-data, second packages.ndir.dscr with with common (BuildHost, Distribution, etc) and "C" package descriptions and third, packages.ndir.dscr.i18n with all non-English descriptions (if any)

metadata (features: read, update)

XML Package Metadata format

hdrl (features: read, update)

Native apt-get and other tools (urpmi AFAIK) index format. Consist of one file (pkglist.%{repository}.bz2, hdlist) with raw, often cut down, RPM package headers.

Aliases: apt

yum (features: read, update)

Native yum index format. Consist of one file with list of packages IDs and directory of *.hdr files with raw RPM package headers.

pdir (features: read, write, update, incremental update)

Native poldek index format prior to 0.20 version. Based on custom binary format. Consist of one database file (packages.dir) with all needed package header data.

dir (features: read)

Dynamic index built by scanning directory with a bunch of packages in it, no indexing required.

Native poldek repositories 'pndir' and 'pdir' have “incremental updates” feature consist in creation of package index delta files with differences between already created and previous package index. Deltas are used later to perform update of local indexes what noticeably reduces amout of data downloaded. In the other words, when repository was changed by adding a few packages, only information about those few packages will be retrieved on update (see Update subsection).

3.1. Repositories configuration

Although repositories can be specified directly at command line, they are usually configured. Every repository has its own configuration section “[source]”, for example:

[source]
type   = pndir                                      # package index type 
name   = distro                                     # name of the source
path   = http://my-favourite-distro.org/1.0/RPMS/   # path 
signed = yes                                        # verify package signatures

[source]
type   = pndir                                 
name   = distro-updates                        
path   = http://my-favourite-distro.org/1.0/updates/
signed = yes                                 

[source]
type = dir
name = home
path = ${HOME}/rpm/RPMS
auto = no                                            # load on demand only

type is not obligatory - if not set, then type is taken from default index type configuration option value. For all possible source configuration and extensible option description see Configuration and and *source.conf files supplied with poldek.

poldek is can read apt-get's /etc/apt/sources.list directly. It is controlled by load apt sources list, to load apt's sources do:

load apt sources list = yes

3.2. Using repositories

3.2.1. Selection

poldek loads all configured repositories at startup Executed without repository selection options poldek loads all configured repositories at startup, except they which have auto turned off. To use particular repositories use --sn (-n) option, for example, to use only home source, do:

$ poldek -n home

Repository name can be also a glob, to use all sources with “distro” prefix, do:

$ poldek -n distro\*

Non configured repositories can be specified directly at command line by --source (-s) option. The syntax is:

$ poldek [--st=TYPE] --source=SOURCEPATH [--prefix=PATH]

where TYPE is one of index supported types, and SOURCEPATH is the path or URL of repository. If package index and packages are located in different paths/URLs then --prefix can be used to point packages location. Examples:

$ poldek -s ~/rpm/RPMS
$ poldek --st pdir -s ftp://foo.bar.org/RPMS/
$ poldek -s ftp://foo.bar.org/RPMS.index/ --prefix ftp://foo.bar.org/RPMS/
$ poldek -s /tmp/packages.ndir.gz --prefix /media/cdrom

3.2.2. Updating

To resynchronize the package index from its repository use --update (--up) or --update-whole (--upa):

$ poldek [-s PATH] [-n NAME] --update
$ poldek [-s PATH] [-n NAME] --update-whole

With --update program looks for an index delta files which can be used to update local package index. If they are unavailable, then whole index is downloaded. With --update-whole program updates whole package index if it is outdated. It is a good idea to run do updates regularly to keep indexes up to date.

Update requested for local repositories causes verification integrity of indexes.

Examples:

$ poldek --st pdir -s ftp://foo.bar.org/RPMS/ --up 
$ poldek -s ftp://foo.bar.org/RPMS.index/ --prefix ftp://foo.bar.org/RPMS/ --upa
$ poldek -n home --up

3.2.3. Listing available repositories

To list all configured repositories use --sl (-l):

$ poldek -l
distro          http://my-favourite-distro.org/1.0/RPMS/    (sign,type=pndir)
distro-updates  http://my-favourite-distro.org/1.0/updates/ (sign,type=pndir)
home            /home/me/rpm/RPMS/  (noauto,type=dir)

3.2.4. Listing available repository types

To list all available repository types, use --stl:

$ poldek --stl
dir    r--  Dynamic index built by scanning directory for packages
             (aliases: rpmdir)
hdrl   r-u  File with raw RPM package headers; used by apt-rpm
             (aliases: apt)
pdir   rwu  Native poldek's index format prior to 0.20 version
             (aliases: pidx)
pndir  rwu  Native poldek's index format
rpmdb  r--  RPM package database
yum    r-u  Yum index format
Legend: r - readable, w - writeable, u - updateable

3.3. Creating

Creation of poldek's repositories is quite simple, the syntax is:

$ poldek -s PATH --mkidx[=PATH] [--mt=TYPE[,TYPE]...] [--nodesc] [--nocompress] [--nodiff]
$ poldek -n NAME --mkidx[=PATH] [--mt=TYPE[,TYPE]...] [--nodesc] [--nocompress] [--nodiff]

what creates package index of repository specified by -n or -s and saves it under directory specified by --mkidx (a package directory by default). Type of created index is the same as specified by default index type configuration option. To make index of the other type or make many indexes of different types at once, use --mt option.

For 'pndir' and 'pdir' indexes delta files are created if previous repository index is different from currently created one. Outdated deltas are automatically removed. To skip deltas creation use --nodiff option.

Other related options are: --nodesc with that package descriptions are not saved to repository index and --nocompress means that uncompressed index will be created.

Examples:

$ poldek -s ~/rpm/RPMS --mkidx --nodiff
$ poldek -s /cdrom/RPMS --mkidx=/tmp
$ poldek -n home --mkidx 
$ poldek -n pld --mkidx --mt=pdir,pndir

3.4. Cache

By default only package index files are cached. To cache packages too, i.e. keep them even after successful installation, set keep downloads configuration option. Default cache directory is $HOME/.poldek-cache, it can be set to different location by cachedir configuration option. Cached files can be removed by three options:

  • --clean remove source index files

  • --clean-pkg remove cached packages.

  • --clean-whole remove all files from cache directory

In conjunction with -n or -s cleannig may be limited to files belongs to specified repositories only. Examples:

$ poldek -s http://foo.bar/RPMS --clean
$ poldek -n foo --clean-whole
$ poldek --clean-pkg