`maker/rpm` modifies version string in generated asset name
- Dominant language
- TypeScript
- Stars
- 7.1k
- Forks
- 641
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 30
Description
### Pre-flight checklist
- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.
### Electron Forge version
6.2.1
### Electron version
25.2.0
### Operating system
Ubuntu 22.04 (GitHub Hosted Runner)
### Last known working Electron Forge version
(always used Electron Builder until now for RPM builds)
### Expected behavior
The makers should use the version string from package.json unmodified to name the assets produced via `make` so that, e.g., CI actions can process those assets further. Those scripts rely on the fact that the asset names are reproducible, which is not given if the version string may change internally in forge.
The debian-maker works as expected and does not change the version contained in the package.json.
### Actual behavior
I found out the hard way that – curiously enough, only the rpm-maker – tampers with the version string and replaces hyphens with dots. For example, I noticed that the RPM asset had the version `3.0.0.beta.7.nightly` instead of what is written in the package.json, `3.0.0-beta.7.nightly`. This broke my scripts because they relied on the fact that the package.json version string would be used unaltered.
**Note:** This behavior does not happen with the debian maker.
### Steps to reproduce
1. Set a version string in the package.json of any Electron project that uses hyphens, e.g., `3.0.0-beta.3`
2. `make` an RPM package
3. Observe how hyphens are replaced with dots in the generated asset name
### Additional information
**Workaround**: This can be fixed by manually replacing any hyphens with dots in the version string that the CI script uses, for example with `export rpmver=$(echo $VERSION | tr '-' '.')`. Then, one can rename the asset after the fact. However, I suspect that this should be necessary.
Note, again, that the Debian maker does not show this behavior: it uses the version string as expected.
Also, N.B.: I see that there is a "1." added in front of the architecture, which seems to correspond to a revision. I understand that sometimes this may be wanted, but is there a way of completely removing this if it is not needed? My project doesn't use revisions, so it would be great if the revision could be left out if not set. (See this file: https://github.com/electron/forge/blob/main/packages/maker/rpm/src/MakerRpm.ts) I can open another issue for that, if wanted.
Contributor guide
Assessment
This issue has not been assessed yet.