1

I would like my CI/CD to automatically build .deb of my package for each commit, with for instance the version containing the commit hash (e.g. my-package-662b98b), so we can install a specific version by just specifying the version when installing.

However, I don't know how to separate them from regular versions. For instance, the version 3.1 would overwrite version 2abdc4a, or inversly, the commit 924af32 would overwrite 3.1.

Is there a field, for example in the control or changelog file, that state that a version of a package is experimental and should not be installed in place of a regular version?

Hugal31
  • 189

1 Answers1

4

There are two aspects to this.

The first is version numbering. Since you want your versions to remain in sequence, you need to include the version as well as the hash. To ensure that versions are sorted properly, this is usually done by appending the build date before the hash, with a snapshot number between the two if there can be multiple builds per day (see the Debian Go packaging policy for example). In your case, you’d have versions like

  • 3.1 for the latest release
  • 3.1+git20220725.1.2abdc4a for the build corresponding to hash 2abdc4a (assuming this is the first hash today)
  • 3.1+git20220725.2.924af32 for the build corresponding to hash 924af32 (assuming this is the second hash today)

The second is separating release packages from snapshot packages. To handle this, you need to split your repositories, or rather, you need to host one “suite” for release packages and another for snapshot/experimental packages. See Debian’s experimental Release file for an example of the latter; setting “NotAutomatic: yes” ensures that the packages can’t be installed automatically or used as upgrades.

Stephen Kitt
  • 434,908