From d505c3d5ba9087c64010b93e5ed8cd46e4e1fc24 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 24 May 2016 12:11:13 -0700 Subject: [PATCH] Build: Use dash for deb package version and underscore for rpm This change tweaks the metadata version associated with the deb and rpm packages. For rpm, dashes are allowed in versions, so we can use the version as it already exists. For rpm, dashes are not allowed, so this uses underscores instead. This only affects prerelease versions (eg alpha/beta/rc), and usually someone doesn't specify the version, so the inconsistency doesn't matter that much. --- distribution/build.gradle | 4 ---- distribution/deb/build.gradle | 2 ++ distribution/rpm/build.gradle | 10 ++-------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/distribution/build.gradle b/distribution/build.gradle index 0df2f24fef0..12bb17b807f 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -302,10 +302,6 @@ configure(subprojects.findAll { ['deb', 'rpm'].contains(it.name) }) { '''.stripIndent().replace('\n', ' ').trim() url 'https://www.elastic.co/' - /* The version of the package can't contain -SNAPSHOT so we rip it off if - we see it. We'll add it back on to the file name though. */ - version project.version.replace('-SNAPSHOT', '') - // signing setup if (project.hasProperty('signing.password') && System.getProperty('build.snapshot', 'true') == 'false') { signingKeyId = project.hasProperty('signing.keyId') ? project.property('signing.keyId') : 'D88E42B4' diff --git a/distribution/deb/build.gradle b/distribution/deb/build.gradle index a3d42a2c042..89d33597888 100644 --- a/distribution/deb/build.gradle +++ b/distribution/deb/build.gradle @@ -22,6 +22,8 @@ task buildDeb(type: Deb) { baseName 'elasticsearch' // this is what pom generation uses for artifactId // Follow elasticsearch's deb file naming convention archiveName "${packageName}-${project.version}.deb" + version = project.version + packageGroup 'web' requires 'libc6' requires 'adduser' diff --git a/distribution/rpm/build.gradle b/distribution/rpm/build.gradle index 72ed58e52c3..185f558ff02 100644 --- a/distribution/rpm/build.gradle +++ b/distribution/rpm/build.gradle @@ -25,14 +25,8 @@ task buildRpm(type: Rpm) { packageGroup 'Application/Internet' prefix '/usr' packager 'Elasticsearch' - if (version.contains('~')) { - def tokenized = version.tokenize('~') - version tokenized[0] - release tokenized[1] - } else { - version version - release '1' - } + version = project.version.replace('-', '_') + release = '1' arch 'NOARCH' os 'LINUX' license '2009'