Add conflicts for default and oss packages

This commit adds conflicts between the default and oss packages so that
a user can not install both via a package manager (as they share paths).
This commit is contained in:
Jason Tedor 2018-03-22 18:20:46 -04:00 committed by Ryan Ernst
parent e64e6d8996
commit 0750f5d6f3
3 changed files with 13 additions and 0 deletions

View File

@ -199,6 +199,9 @@ Closure commonPackageConfig(String type, boolean oss) {
copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', 0750)
copyEmptyDir('/var/lib/elasticsearch', 'elasticsearch', 'elasticsearch', 0750)
copyEmptyDir('/usr/share/elasticsearch/plugins', 'root', 'root', 0755)
// the oss package conflicts with the default distribution and vice versa
conflicts('elasticsearch' + (oss ? '' : '-oss'))
}
}

View File

@ -49,6 +49,11 @@ setup() {
dpkg -I elasticsearch-oss-$(cat version).deb | grep "Depends:.*bash.*"
}
@test "[DEB] package conflicts" {
dpkg -I elasticsearch-oss-$(cat version).deb | grep "^ Conflicts: elasticsearch$"
dpkg -I elasticsearch-$(cat version).deb | grep "^ Conflicts: elasticsearch-oss$"
}
##################################
# Install DEB package
##################################

View File

@ -48,6 +48,11 @@ setup() {
rpm -qpR elasticsearch-oss-$(cat version).rpm | grep '/bin/bash'
}
@test "[RPM] package conflicts" {
rpm -qp --conflicts elasticsearch-oss-$(cat version).rpm | grep "^elasticsearch\s*$"
rpm -qp --conflicts elasticsearch-$(cat version).rpm | grep "^elasticsearch-oss\s*$"
}
##################################
# Install RPM package
##################################