summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@gentoo.org>2014-10-16 15:16:58 -0400
committerDevan Franchini <twitch153@gentoo.org>2015-06-19 15:47:38 -0400
commita72f0889c57d2bff26078123ca1b6c814c547c21 (patch)
tree6851df74f5430662f5a68f756cc0575c660be612
parentconfig.py: Modifies --list_unused_installed to nargs = "*" (diff)
downloadwebapp-config-a72f0889c57d2bff26078123ca1b6c814c547c21.tar.gz
webapp-config-a72f0889c57d2bff26078123ca1b6c814c547c21.tar.bz2
webapp-config-a72f0889c57d2bff26078123ca1b6c814c547c21.zip
config.py: Improves package version checking
With the previous method of setting the package version you were unable to pass the package version to webapp-config if it had more than one decimal point (ex: 1.0.1 wouldn't work), this commit attempts to fix that issue.
-rw-r--r--WebappConfig/config.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 10a6f26..5eb4584 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -990,11 +990,18 @@ class Config:
else:
OUT.die('Invalid package name')
- try:
- self.config.set('USER', 'pvr', str(float(args[1])))
- except ValueError:
+ argsvr = args[1].split('.')
+ if len(argsvr) == 1:
OUT.die('Invalid package version: %(pvr)s' % {'pvr': args[1]})
+ pvr = ''
+ for i in range(0, len(argsvr)):
+ if not i == len(argsvr) - 1:
+ pvr += argsvr[i] + '.'
+ else:
+ pvr += argsvr[i]
+ self.config.set('USER', 'pvr', pvr)
+
# --------------------------------------------------------------------
# Helper functions