Currently there is no validation (or automatic translation) of the Debian package name when building the .deb package. This can result in a situation where the produced Debian packages are not actually installable via apt as packages which do not conform to the naming convention are ignored.
Below is an example which will produce a .deb file, however when it is uploaded to a Debian repository (such as jfrog.io) it will not be installable as apt just says that the package could not be found.
[package]
name = "tedge_agent"
The problem is also not just limited to Debian repositories/apt, but also additional tooling such as equivs-build which is used to create meta Debian packages. The command fails when you try to reference any non-name-conform package in the dependencies fields (e.g. Pre-Depends, Depends, Recommends etc.).
Currently the only work around is to set the package name in the configuration under [packages.metadata.deb].name. This is unexpected for people who are not familiar with Debian packaging.
[package]
name = "tedge_agent"
[package.metadata.deb]
# Change to use `-` instead of `_`
name = "tedge-agent"
Background
The Debian standard states that following under the package naming convention:
Package names (both source and binary, see Package) must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character.
Possible solutions
Throw an error (with warning) if package names do not conform to regex pattern ^[a-z0-9][a-z0-9\-\.\+]+$ (not 100% sure about the escape chars in rust). This would at least give the user a hint that there is something that they need to change.
Automatically transform the package name, e.g. replace _ with - (though this might be unexpected for some users, and use lower case characters. Then still throw an error if it still does not conform. This would be more convenient for users, and encourages bad habits for users.
Currently there is no validation (or automatic translation) of the Debian package name when building the
.deb
package. This can result in a situation where the produced Debian packages are not actually installable viaapt
as packages which do not conform to the naming convention are ignored.Below is an example which will produce a
.deb
file, however when it is uploaded to a Debian repository (such as jfrog.io) it will not be installable asapt
just says that the package could not be found.The problem is also not just limited to Debian repositories/apt, but also additional tooling such as
equivs-build
which is used to create meta Debian packages. The command fails when you try to reference any non-name-conform package in the dependencies fields (e.g.Pre-Depends
,Depends
,Recommends
etc.).Currently the only work around is to set the package name in the configuration under
[packages.metadata.deb].name
. This is unexpected for people who are not familiar with Debian packaging.Background
The Debian standard states that following under the package naming convention:
Possible solutions
^[a-z0-9][a-z0-9\-\.\+]+$
(not 100% sure about the escape chars in rust). This would at least give the user a hint that there is something that they need to change._
with-
(though this might be unexpected for some users, and use lower case characters. Then still throw an error if it still does not conform. This would be more convenient for users, and encourages bad habits for users.