From 2509bb8908b8527ff4338f6cd5d928c792bfb26b Mon Sep 17 00:00:00 2001 From: Terrell Russell Date: Thu, 28 Jan 2016 21:33:52 -0500 Subject: [PATCH] [#7] require iRODS 4.1.8 for v1.2 --- packaging/irods_auth_plugin_krb.list.template | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/packaging/irods_auth_plugin_krb.list.template b/packaging/irods_auth_plugin_krb.list.template index fbec769..8dc5d23 100644 --- a/packaging/irods_auth_plugin_krb.list.template +++ b/packaging/irods_auth_plugin_krb.list.template @@ -2,7 +2,7 @@ # EPM Variables # =-=-=-=-=-=-=- %product iRODS KRB Auth Plugin -%copyright 2014, The University of North Carolina at Chapel Hill +%copyright 2016, The University of North Carolina at Chapel Hill %vendor Renaissance Computing Institute %license LICENSE %readme README @@ -29,36 +29,21 @@ $IRODS_HOME_DIR=/var/lib/irods $OS_IRODS_ACCT=irods + # =-=-=-=-=-=-=- # preinstall # =-=-=-=-=-=-=- %preinstall << END_PREINSTALL - -# determine whether this is an upgrade -if [ "$$1" -eq "$$1" ] 2>/dev/null ; then - # integer, therefore rpm - if [ $$1 -gt 1 ] ; then - PACKAGEUPGRADE="true" - else - PACKAGEUPGRADE="false" - fi -else - # string, therefore deb - if [ "$$1" = "upgrade" ] ; then - PACKAGEUPGRADE="true" - else - PACKAGEUPGRADE="false" - fi +REQUIRED_VERSION="4.1.8" +DETECTED_VERSION=`python -c 'import json; print json.loads(open("/var/lib/irods/VERSION.json").read())["irods_version"]'` +if [ "$$DETECTED_VERSION" != "$$REQUIRED_VERSION" ] ; then + echo "Local iRODS is $$DETECTED_VERSION" + echo "This plugin requires iRODS $$REQUIRED_VERSION" + exit 1 fi - -if [ "$$PACKAGEUPGRADE" = "true" ] ; then - echo "NOP" > /dev/null -else - echo "NOP" > /dev/null -fi - END_PREINSTALL + # =-=-=-=-=-=-=- # post install # =-=-=-=-=-=-=-