wpkg --compress

Options Comments
--compressor The name of the compressor to use.
--force-all For all the possible force flag for this command.
--force-hold Keep the original (uncompressed) files.
--force-overwrite Overwrite destination if it exists.
--no-force-all Do not force hold or overwrite.
--no-force-hold Remove the original (uncompressed) files.
--no-force-overwrite Prevent overwriting destination files.
--output-filename Path and filename where to write the result.
--refuse-all Do not force hold or overwrite.
--refuse-hold Remove the original (uncompressed) files.
--refuse-overwrite Prevent overwriting destination files.
--verbose Print out information about files skipped.
--zlevel The compress level used by the function.

The --compress command is a request for wpkg to compress a currently non-compressed file. This function works by specifying the final filename as wpkg is expected to use the compression extension of that new filename to determine the compressor to use to compress the file.

For example, to compress the wpkg.tar file with gzip one uses:

wpkg --compress wpkg.tar.gz

By default the --compress command does not overwrite existing files. If the wpkg.tar and wpkg.tar.gz files both exist, then nothing happens. You can use the --force-overwrite option to overwrite the existing destination file when it exists.

IMPORTANT NOTE

It is important to note that the original file is not deleted if the --no-force-overwrite is used and the destination file already exists.

The normal behavior of the compress command is to delete the source file once the destination was successfully written. The --force-hold option can be used to avoid the deletion of the orignal, uncompressed file. This is somewhat similar to the -c command line option of tools such as gzip and bzip2, although in their case they write the decompressed stream to stdout which we do not do.

If you want to specify the name of the output as something completely different from the input filename then you can make use of the --output-filename option. However, only one input filename can be specified and the --compressor must be explicitly specified in this case.

wpkg -z 9 -Z gzip --force-hold --force-overwrite --output-filename changelog.Debian.gz --compress ChangeLog

The opposite of the --compress command is the --decompress command.

IMPORTANT NOTE
Note that the --no-force-all, in this case, has the side effect of allowing removal of source files which is the opposite of what would be expected of the --no-force-all command (i.e. it should protect all files.)