Revision: 6400 http://ipcop.svn.sourceforge.net/ipcop/?rev=6400&view=rev Author: dotzball Date: 2012-02-21 21:06:36 +0000 (Tue, 21 Feb 2012) Log Message: ----------- Modify version check for addons to make 'isversion 2.0.3 newer' working on 2.1.0.
Modified Paths: -------------- ipcop/trunk/src/libs/library.sh ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0 Modified: ipcop/trunk/src/libs/library.sh =================================================================== --- ipcop/trunk/src/libs/library.sh 2012-02-21 20:50:51 UTC (rev 6399) +++ ipcop/trunk/src/libs/library.sh 2012-02-21 21:06:36 UTC (rev 6400) @@ -25,7 +25,7 @@ # Some helper functions useable by IPCop addons # Return values are 0 if ok, otherwise error -export LIBVERSION=2 +export LIBVERSION=3 export IPCOPVERSION=`/usr/bin/perl -e "require '/usr/lib/ipcop/general-functions.pl';print \\$General::version;"` export IPCOPMACHINE=`/usr/bin/perl -e "require '/usr/lib/ipcop/general-functions.pl';print \\$General::machine;"` @@ -40,8 +40,6 @@ # isversion 2.0.2 newer tests for version v2.0.2 and newer (e.g. 2.0.3, 2.0.4 ...) isversion() { - local i - # Test for exact match if [ "x${1}" = "x${IPCOPVERSION}" -o "x${2}" = "x${IPCOPVERSION}" ]; then return 0 @@ -51,18 +49,32 @@ fi # Now test if version is within wanted range - for i in `seq 1 3`; do - if [ "x${1}" != "xolder" ]; then - if [ 0`echo ${IPCOPVERSION} | cut -d"." -f ${i}` -lt 0`echo ${1} | cut -d"." -f ${i}` ]; then + if [ "x${1}" != "xolder" ]; then + if [ 0`echo ${IPCOPVERSION} | cut -d"." -f 1` -lt 0`echo ${1} | cut -d"." -f 1` ]; then + return 1 + elif [ 0`echo ${IPCOPVERSION} | cut -d"." -f 1` -eq 0`echo ${1} | cut -d"." -f 1` ]; then + if [ 0`echo ${IPCOPVERSION} | cut -d"." -f 2` -lt 0`echo ${1} | cut -d"." -f 2` ]; then return 1 + elif [ 0`echo ${IPCOPVERSION} | cut -d"." -f 2` -eq 0`echo ${1} | cut -d"." -f 2` ]; then + if [ 0`echo ${IPCOPVERSION} | cut -d"." -f 3` -lt 0`echo ${1} | cut -d"." -f 3` ]; then + return 1 + fi fi fi - if [ "x${2}" != "xnewer" ]; then - if [ 0`echo ${IPCOPVERSION} | cut -d"." -f ${i}` -gt 0`echo ${2} | cut -d"." -f ${i}` ]; then + fi + if [ "x${2}" != "xnewer" ]; then + if [ 0`echo ${IPCOPVERSION} | cut -d"." -f 1` -gt 0`echo ${2} | cut -d"." -f 1` ]; then + return 1 + elif [ 0`echo ${IPCOPVERSION} | cut -d"." -f 1` -eq 0`echo ${2} | cut -d"." -f 1` ]; then + if [ 0`echo ${IPCOPVERSION} | cut -d"." -f 2` -gt 0`echo ${2} | cut -d"." -f 2` ]; then return 1 + elif [ 0`echo ${IPCOPVERSION} | cut -d"." -f 2` -eq 0`echo ${2} | cut -d"." -f 2` ]; then + if [ 0`echo ${IPCOPVERSION} | cut -d"." -f 3` -gt 0`echo ${2} | cut -d"." -f 3` ]; then + return 1 + fi fi fi - done + fi if [ "x${1}" == "xolder" -a "x${2}" == "xnewer" ]; then return 1 Modified: ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0 =================================================================== --- ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0 2012-02-21 20:50:51 UTC (rev 6399) +++ ipcop/trunk/updates/2.1.0/ROOTFILES.i486-2.1.0 2012-02-21 21:06:36 UTC (rev 6400) @@ -12,6 +12,7 @@ /home/httpd/cgi-bin/urlfilter.cgi /home/httpd/html/images/redirect-background.png /usr/lib/ipcop/general-functions.pl +/usr/lib/ipcop/library.sh /usr/local/bin/blacklistupdate.pl /usr/share/locale/af_ZA/LC_MESSAGES/ipcop.mo /usr/share/locale/bg_BG/LC_MESSAGES/ipcop.mo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn