FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development Java

 
 
LinkBack Thread Tools
 
Old 02-16-2012, 10:50 PM
"Brian C. Lane"
 
Default empty versions shouldn't be upgradable or traceback (#791317)

From: "Brian C. Lane" <bcl@redhat.com>

Also don't use float to compare 2 numbers. Use Decimal instead.
---
pyanaconda/installclasses/fedora.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/installclasses/fedora.py b/pyanaconda/installclasses/fedora.py
index e96d525..e7b5c57 100644
--- a/pyanaconda/installclasses/fedora.py
+++ b/pyanaconda/installclasses/fedora.py
@@ -33,6 +33,7 @@ from pyanaconda import installmethod
from pyanaconda import yuminstall

import rpmUtils.arch
+from decimal import Decimal

class InstallClass(BaseInstallClass):
# name has underscore used for mnemonics, strip if you dont need it
@@ -113,10 +114,13 @@ class InstallClass(BaseInstallClass):
return False

def versionMatches(self, oldver):
+ if oldver is None:
+ return False
+
try:
- oldVer = float(oldver)
+ oldVer = Decimal(oldver)
# Trim off any "-Alpha" or "-Beta".
- newVer = float(productVersion.split('-')[0])
+ newVer = Decimal(productVersion.split('-')[0])
except ValueError:
return True

--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org