JDK-8228660 : .deb files generated by jpackage don't follow naming convention
  • Type: Bug
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: internal
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_debian_3.0
  • CPU: generic
  • Submitted: 2019-07-26
  • Updated: 2019-08-28
  • Resolved: 2019-08-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
internalFixed
Related Reports
Relates :  
Relates :  
Description
As described in https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics#s-pkgname
"The Debian binary package file names conform to the following convention:
<foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb"

Current schema is like:
<foo>-<VersionNumber>.deb
Comments
I just looked carefully at Debian spec and it looks like we implemented --linux-app-release for Debian (JDK-8229138) in a wrong way. There is no "Release:" field in Debian control file. According to https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version Debian revision should be a part of "Version:" field of Debian control file. I.e. template.control file should look like: --- Version: APPLICATION_VERSION-APPLICATION_RELEASE --- instead of the current --- Version: APPLICATION_VERSION Release: APPLICATION_RELEASE --- So I suggest we update help description for --linux-app-release CLI option to make it clear that it sets Debian revision for deb packaging. And we use value of this CLI option to construct deb package name. I take back my suggestion to use java.version. Review: http://cr.openjdk.java.net/~asemenyuk/8228660/webrev.03
27-08-2019

It seems to odd to me to be using the version of java that jpackage is run from, instead of say, the version of java the app will run on, as a default, but if that's the consensus, I have no problem. We just added option --linux-app-release, which is defined to be the release value of the DEB control file. Is that a proper value for the Debian revision number ?
26-08-2019

Review: http://cr.openjdk.java.net/~asemenyuk/8228660
21-08-2019

It seems best to split the Java version on `-` and only take the part before the `-`. So for EA build or internal builds, we would just get 14, 14.0.1, etc. Or maybe even split on `.` or `-` and just use the major version?
21-08-2019

[~asemenyuk] I like the idea of using "java.version". However it may contain "-" which is one of delimiters in the format, e.g. "14-internal". In Debian deb-version may contain '-' as an optional delimiter, while parts are "A-Za-z0-9.+-:~" [1] So the proposal looks ok. If I get it correct, result will look like my-app_1.0-14-internal_i386.deb In the patch there should be testing part, I mean test/jdk/tools/jpackage/linux/base/* and test/jdk/tools/jpackage/linux/deb/install.sh (similar to getRpmArch() in JDK-8222778) Also for Java code it might be more clear to use String.format() instead of concatenation. [1] https://manpages.debian.org/stretch/dpkg-dev/deb-version.5.en.html
21-08-2019

https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html : DebianRevisionNumber: The RRR component is the Debian revision number, and is specified by the Debian developer (or an individual user if he chooses to build the package himself). This number corresponds to the revision level of the Debian package, thus, a new revision level usually signifies changes in the Debian Makefile (debian/rules), the Debian control file (debian/control), the installation or removal scripts (debian/p*), or in the configuration files used with the package. I suggest we use JDK version (value of java.version system property) as a DebianRevisionNumber. [~dchuyko], [~kcr] objections?
21-08-2019

Thank you. I'll user value of java.version system property to set DebianRevisionNumber component of Debian package file name then.
20-08-2019

Given that jpackage is generating the control file, that might be a good choice -- or at least a good default if we later decide to provide a command line option to control it.
20-08-2019

Is there's something that prevents jpackage from following the suggestion? I'd propose at least to have "_<DebianArchitecture>" part to be able to store different arch .deb-s side by side and to be in line with generated .rpm files that have this part.
07-08-2019

https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics#s-pkgname describes not a standard but a suggested convention for naming Debian package files.
05-08-2019