You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OPM requires all package version numbers to only consist of digits, dots, alphabetic letters, and underscores.
That is the hyphen is not allowed. However, the only place where the hyphen is not actually allowed is the version field of the dist.ini file. More specifically,
(1) opm build, version from dist.ini — ERROR, the hyphen is not allowed:
$ opm build
...
ERROR: dist.ini: bad version number: 1-0
Any char is accepted (some chars are swallowed, e.g., ;,'"), as long as there is at least one digit.
(3) opm build, requires from dist.ini; opm get, version from PACKAGE arg; opm get, requires from dist.ini; opm remove, version from PACKAGE arg — OK (all use parse_deps()):
(4) opm upload (uses do_build internally) — OK, any char is allowed (!), but ultimately rejected by the server:
$ opm --cwd --verbose upload
...
extracted verson number 1-0!=!@~ from main_module file lib/main.lua.
opm-test-package-1-0!=!@~/
opm-test-package-1-0!=!@~/dist.ini
opm-test-package-1-0!=!@~/README.md
opm-test-package-1-0!=!@~/lib/
opm-test-package-1-0!=!@~/lib/main.lua
* Trying 18.138.237.72:443...
* Connected to opm.openresty.org (18.138.237.72) port 443 (#0)
...
ERROR: bad uploaded file name.
* Connection #0 to host opm.openresty.org left intact
(2) and (4) is almost certainly a bug, there should be a stricter regex.
(1) matches the documentation.
(3) in addition, allows the hyphen.
Which is correct? On one hand, (1) is documented, on the other hand, in my opinion, (3) is better in regard to compatibility. For example, luarocks uses the hyphen to separate a version of a package and a version of a rockspec: 1.2.7-2. If the hyphen is allowed, one can use exactly the same version when publishing a package on opm as on luarocks.
The text was updated successfully, but these errors were encountered:
It is not possible to unambiguously separate a name and a version when a name ends with digits:
name: project-2, version: 7-3.0 → project-2-7-3.0 — is it (project 2-7-3.0 or project-2 7-3.0 or project-2-7 3.0?).
Therefore, the hyphen should not be allowed in the version, at least with the current tarball filename scheme. That means that (2), (3), and (4) do not conform the naming convention.
According to the documentation,
That is the hyphen is not allowed. However, the only place where the hyphen is not actually allowed is the
version
field of thedist.ini
file. More specifically,(1)
opm build
,version
fromdist.ini
— ERROR, the hyphen is not allowed:opm/bin/opm
Line 324 in 315e56b
/[^.\w]/
→. A-Z a-z 0-9 _
(2)
opm build
, version from the main module — OK, any char is allowed (!):opm/bin/opm
Lines 452 to 454 in 315e56b
Any char is accepted (some chars are swallowed, e.g.,
;,'"
), as long as there is at least one digit.(3)
opm build
,requires
fromdist.ini
;opm get
, version fromPACKAGE
arg;opm get
,requires
fromdist.ini
;opm remove
, version fromPACKAGE
arg — OK (all useparse_deps()
):opm/bin/opm
Line 770 in 315e56b
/[^-.\w]/
→- . A-Z a-z 0-9 _
(4)
opm upload
(usesdo_build
internally) — OK, any char is allowed (!), but ultimately rejected by the server:(2) and (4) is almost certainly a bug, there should be a stricter regex.
(1) matches the documentation.
(3) in addition, allows the hyphen.
Which is correct? On one hand, (1) is documented, on the other hand, in my opinion, (3) is better in regard to compatibility. For example, luarocks uses the hyphen to separate a version of a package and a version of a rockspec:
1.2.7-2
. If the hyphen is allowed, one can use exactly the same version when publishing a package on opm as on luarocks.The text was updated successfully, but these errors were encountered: