wpkg --fsys-tarfile

Options Comments
--admindir Define the administration directory, where the database of the installed packages resides.
--debug Define a set of flags of things to print out for debug purposes.
--instdir Define the installation directory, where the data files are installed on the target.
--quiet Not used.
--root Define the installation root path.
--verbose Not used.

The --fsys-tarfile command prints the decompressed version of data.tar.gz file found in a package to stdout. The name of the package must be a valid Debian (.deb) file version 2.0.

In most cases this command line option is used to extract the data files with the tar utility and thus have the possibility to choose which file(s) to extract (opposed to the --extract (-x) command which extracts the entire archive.) For example, say you have a file named test under /usr/bin it would look like this:

wpkg --fsys-tarfile my-package.deb | tar tf - usr/bin/test

(If the package was created with dpkg, the path is likely to be ./usr/bin/test instead, wpkg does not include the ./ as it doesn't serve any purpose.)

Note that in this case wpkg does NOT attempt to fix the path of files. In other words, if one includes a ".." the file could get extracted outside of the destination folder specified on the tar command line (the current folder or whatever folder you specified with -C). Under Linux, this is generally safe because tar uses the GNU version (also called gnutar) which prevents ".." from moving outside of the extraction folder (i.e. the tar tool itself is safe and thus the whole process is safe.)

Under other systems, it may not be as safe.

This function can also be used to extract special files which the --extract (-x) command does not extract since that command only extracts regular files and symbolic links.

IMPORTANT NOTE

This function has changed since version 0.7.1. Before you could extract the data.tar.gz file to a file in your current directory (similar to the --control command line option.) Also you could specify an output directory which is now prohibited.

This function is not work (crashes) in version 0.8.0 with data.tar files that are larger than 64Kb.