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
RPM can't be built if project version contains '-' character #49
Comments
IIRC, a dash is not legal in a RPM version number, and hence the check. So You should be able to set the version in the way you suggested though, so On Fri, Sep 5, 2014 at 4:06 AM, sshcherbakov notifications@github.com
|
Tried
and
Unfortunately, same result: "illegal character -" if the main project version contains a minus. |
Try
That worked for me. As stated earlier, hypen is an illegal RPM character so it should be stripped. |
Tried that as first attempt (please see initial description). It is fully OK, that dash is illegal character in RPM name. The problem is that the dash is a legal Gradle project version character. And I don't see why RPM version must be same as Gradle project version. As far as I can tell, this wasn't a problem at times of TrigonicSolution plugin The check that throws exception looks to be in the Redline library. The dash must not be passed to Redline, I guess. I'll try to find time a bit to dig in and find the reason for this behaviour. |
That's strange that you're having that issue. If I specify the A quick workaround for you would be to change your version from "1.2.3-SNAPSHOT" to "1.2.3.SNAPSHOT". Both are valid Java version conventions so at least you're covered there. |
Sure, thanks. That's how I workaround this at the moment. |
@sshcherbakov Can you try the latest 2.2.x version of the plugin? We built in some validation for RPM versions. |
@bmuschko it looks like the 2.2.x version is not compatible with Gradle 1.12 that we are still on:
It will take some time to migrate the build script to the Gradle 2.x |
@sshcherbakov That is correct. We won't continue putting fixes into the 1.12.x branch. You'll need to upgrade your project. |
@sshcherbakov Did you have a chance to test out the latest version? I guess we'll close the issue if we don't hear back from you. |
I am having the same problem with trying to override the project version and rpm not "seeing" the new version. I have a multi-module gradle project. When I build an individual module it works without a problem, but when I build the entire project from the top (all modules) then rpm does not get the modified version. |
I have logged a bug that may be related. It seems some combination of gradle and ospacakage are 'overly aggressive' at caching. If I make a build only or script only change it doesnt take without a clean. As for versioning I run into confusion over the scope of properties, and trying to integrate the publishing with S3 , Ivy and Artifactory -- all have different naming conventions and rules for versions. First ... for consistancy in the main project I define a Version class class Version {
//String originalVersion
String version
String originalRelease
String release
String revision
String status
Date buildTime
String publishDir = 'dev'
Version( String versionValue , String releaseValue ) {
buildTime = new Date()
version = versionValue
originalRelease = releaseValue
if (releaseValue.endsWith('-SNAPSHOT')) {
status = 'integration'
publishDir = 'dev'
release = releaseValue.substring(0, releaseValue.length() - '-SNAPSHOT'.length()) + '.' + getTimestamp()
} else {
status = 'release'
release = releaseValue
// publishDir = 'release'
}
// RPM format name-[ver-release].arch.ext
revision = "${version}-${release}"
}
String getTimestamp() {
// Convert local file timestamp to UTC
def format = new SimpleDateFormat('yyyyMMddHHmmss')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')));
return format.format(buildTime)
}
String toString() {
}
} Then in allProjects I create an ext property allprojects {
apply plugin: 'net.saliman.properties'
apply plugin: 'eclipse'
apply plugin: 'com.jfrog.artifactory'
group = 'com.me.com'
ext {
version = new Version( "${project.version}" , "${project.release}" )
rpmVersion = version.version
rpmRelease = version.release
module = project.name
rpmPackage = 'nexstra-' + module
}
status = ext.version.status
version = ext.version;
} then I apply subprojects a generic buildRpm task task buildRpm(type: Rpm) {
packageName project.ext.rpmPackage
version project.ext.rpmVersion
release project.ext.rpmRelease
arch NOARCH
os LINUX
user 'root'
permissionGroup 'root'
createDirectoryEntry false
addParentDirs false
duplicatesStrategy DuplicatesStrategy.WARN
...
} In the child project all I do is add the copyspecs buildRpm {
requires 'jdk'
fileMode 0550
user 'root'
group 'root'
into('/'){
into('usr/local/'){
from ( tarTree(resources.gzip('dist/fop-0.94.tar.gz')) )
}
from ('install.d/' )
}
link( '/usr/local/fop' , '/usr/local/fop-0.94' )
} |
As mentioned earlier, I had been experiencing this issue. I discovered that by using the ospackage dsl to define the version and release instead of doing it in the Rpm task fixed the problem. Seems to me that this would still be a bug that should be fixed, but at least I have a workaround. |
I am using the latest version 3.2.1, still see the same issue. Rather more than that nebula-release plugin generates -SNAPSHOTs, which is what i am trying to use for nebula-ospackage as well the same version for my RPMs. It throws an error ~ is an illegal character. Its replacing - with ~ signs :( |
I am using version 4.2.2 and still seeing this problem. BTW, AFAIK '-' is a valid rpm version character and I see it used in a whole bunch of rpms on my Fedora system when I do a "rpm -qa | less" command. I would be grateful for a high priority fix for this issue as it is a blocker for me. I do not have option to use workaround as versionNames are set by the customer product and I have no say in the conventions used. TIA. |
I'm using version 4.1.0 and has same issue.
|
rpm.org's docs state
In addition to the workarounds proposed above in this thread, it's also possible to replace all the illegal characters in an auto-calculated version: def sanitizedVersion = version.toString().replaceAll('(~|-)', '') // or an allowable character like ':' or '+'
ospackage {
version sanitizedVersion
// ...
} The ~ issue mentioned in recent comments is being tracked by #213. |
Hello all,
just run into as issue when building an RPM using plugin version 1.12.2 and Gradle 1.12.
My project has '.BUILD-SNAPSHOT' in the version.
The buildRpm task fails with the message in this case:
Setting version explicitly to a value without '-' doesn't help:
Only if I change the main Gradle project version I get the RPM built.
Is this something that needs to be fixed?
The text was updated successfully, but these errors were encountered: