cloning OpenPKG: packages

Run this shell code snippet as OpenPKG management user to obtain another shell script that downloads, builds and installs the latest packages from the appropriate repository. The packages and options are taken from the management users` instance.

openpkg build -kBZa

Explanation of the options:

  • -k keep the downloaded packges. If omitted, downloads are removed after use
  • -B skip building if binary already exists. Makes sense if the script aborts at some point and needs to be restarted
  • -Z ignore installed packages and act as if the instance is empty
  • -a query the instance for installed packages and options and rebuild them all

Note that the -B option and the -Za option combination was introduced in openpkg-tools-0.8.59 which became part of OpenPKG-2-STABLE-20060622 as described in the releasenotes.txt (watch out for -Za).

It is possible to feed the index of a specific package repository into the build tool. This allows transformation of the packages and options to their equivalents of a different age. The procedure will bail out if the specified repository index is missing some packages or options.

openpkg build -r ftp://ftp.openpkg.org/release/2.4 -kBZa openpkg

Note the build tool does clones packages by name and obeys options but it ignores version-release. If the repository contains packages with version-release different from the instance the clone will not be an exact copy. This is a feature as described in the example above showing use of a specific index. It may become a pain if the original instance carries packages collected from different and probably unknown sources. To remedy that problem, make sure to download packages from a single repository while engineering the original instance. To ease reproducibility of instances with packages from mixed sources, it is recommended to maintain an appropriate repository. The build tool that ships with OpenPKG-2-STABLE-20070221 has been modified to download packages before building them. By default, the downloaded packages are removed after use but the new -k option keeps them. These local copies can later be indexed, creating a repository for further clones.

cd `openpkg rpm --eval '%{_srcrpmdir}'`
openpkg index -p `openpkg rpm --eval '%{l_platform}'` -i -o 00INDEX.rdf .
openpkg build -r . -kBZa

Leave a Reply