wpkg --ignore-empty-packages ...

When creating a large number of packages in a very symetrical manner (because your build system was created that way) it may happen that you create packages that end up being completely empty. By default wpkg generates an error saying that it cannot create a package that's empty.

This is because the data.tar file cannot be empty. Although we could always put the root directory in it, it makes more sense to not do anything of the sort and instead to fail the build. It is likely useless to create an empty package except for a virtual package (i.e. a package used to define a list of packages to install on a system--we may later add an option in order to allow for such packages without having any files at all, but even virtual packages should include a copyright notice and a changelog file.)

The packaging mechanism of Debian binary packages does not allow for an empty or non-existant data.tar file.

An example of where this may apply in your build system. Say you are installing the following targets to build the final binary and source packages:

  • runtime
  • development
  • documentation
  • source

The runtime package may end up empty if you are creating a library which only offers an archive (.a) file. That archive file ends up in the development package and the runtime is completely empty (unless you also offer the copyright, changelog, and any other similar files and always stick those in the runtime package.) This results in an error and wpkg exists with code 1.

Similarly, if you compile a tool that has no documentation at all, the documentation package would end up being empty.

In those cases, having the --ignore-empty-packages option may be useful. Note that the packager still generates a warning in such cases.

Syndicate content