Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example package name does not follow Debian naming conventions. #143

Closed
ghost opened this issue Mar 26, 2020 · 1 comment · Fixed by #389
Closed

example package name does not follow Debian naming conventions. #143

ghost opened this issue Mar 26, 2020 · 1 comment · Fixed by #389
Labels
documentation P3 An issue that we are not working on but will review quarterly

Comments

@ghost
Copy link

ghost commented Mar 26, 2020

This line appears to be incorrect

https://github.com/bazelbuild/rules_pkg/blob/master/pkg/pkg.bzl

line 375 out_deb = "%s_%s_%s.deb" % (package, version, architecture)
The the name is not following the correct syntax.
<foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
(https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html)

foo_VVV-RRR_AAA.deb (where VVV, RRR and AAA are the version, revision and architecture of the package in question, respectively)
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.
Regular expressions are not currently supported. however some simple checks should be possible for example:

if '_' not in name:
   for x in name.elems():
     if x.isupper():
          fail("Uppercase characters are not allowed in package names", "name")
     elif x in "+-.":
            continue
     elif not x.alnum():
          fail("Only lowercase characters and numbers are allowed in package names", "name")
     else
        fail("_ is not allowed in package names", "name")
               

@aiuto aiuto added the P3 An issue that we are not working on but will review quarterly label Apr 7, 2020
@aiuto
Copy link
Collaborator

aiuto commented Apr 7, 2020

It is not really inconsistent. version is just a string. If the user wants a conformant name, they can specify a version for the form version-revision, and you'll get a result that is fine.

We should change the documentation to recommend version-revision formatting for the version attribute.

@aiuto aiuto changed the title Package Name is not compliant with Debian naming conventions. example package name does not follow Debian naming conventions. Jan 21, 2021
aiuto added a commit to aiuto/rules_pkg that referenced this issue Jul 26, 2021
@aiuto aiuto closed this as completed in #389 Aug 2, 2021
aiuto added a commit that referenced this issue Aug 2, 2021
* Change the Debian example to reflect standard Debian naming.

Closes #143

* naming nits

* format blocks

* more formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation P3 An issue that we are not working on but will review quarterly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant