pkgexport(1)

NAME

pkgexport - create a native CRUX package from the files on disk

SYNOPSIS

pkgexport <name> [options]

DESCRIPTION

pkgexport creates installable CRUX packages from previously installed components. Its primary use case is to create backups of current packages, usually before performing an upgrade. In this regard it could be useful in providing quick recovery in the event of incompatibility or failure of the upgraded package.

MANDATORY ARGUMENT

<name>
    The name of the installed CRUX package. This argument does not need to correspond to any port among the active collections, it merely has to have an entry in the package database.

OPTIONS

[outputfile|dir]
    Name of the file to be created. outputfile can be specified with full, relative or no path. If a directory is specified, pkgexport will create the file using the conventional CRUX package naming scheme: name#version-release.pkg.tar.?z. It will use the compression suffix specified by PKGMK_COMPRESSION_MODE from /etc/pkgmk.conf(5).

-r <path>
    Specify path to alternate installation root. This option affects which package database is used, and which files are archived by bsdtar, but does not get prepended to the path given for [outputfile|dir]. The latter value will always be interpreted with respect to the parent filesystem (or $PWD if a relative path is given).

-v  Verbose output.

-f  Force pkgexport to overwrite an existing package.

-h  Output help information and exit.

EXAMPLES

To export/backup the "shadow" package, saving the package with the default name to the current directory:

pkgexport shadow

Alternately, saving it under a different directory with the default name:

pkgexport shadow /var/lib/pkg

Or saving it under a custom name:

pkgexport shadow mypackage.tar.gz

To export all the installed packages that do not already have a tarball in the common directory /usr/pkgmk/packages:

comm -23 <(prt-get listinst) <(ls /usr/pkgmk/packages/*.pkg.tar.* | sed 's!.*/!!; s!#.*!!') | while read -r P; do pkgexport $P /usr/pkgmk/packages; done

AUTHORS
Andrew Green <crux@dorkatronix.org>

John McQuah <jmcquah@disroot.org>

SEE ALSO

pkginfo(8), pkgadd(8), pkgrm(8), pkgmk(8), pkgmk.conf(5)