From 72aec0c55cff6ecd70e1a25c59246bc4c49a41b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Tue, 9 Aug 2005 16:24:26 +0000 Subject: [PATCH] * version: range hatasi! * config.options olmasa da calis * test'leri duzelt --- pisi/installdb.py | 3 +-- pisi/version.py | 2 +- tests/archivetests.py | 3 ++- tests/versiontests.py | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pisi/installdb.py b/pisi/installdb.py index fc16c1ea..5cef9af2 100644 --- a/pisi/installdb.py +++ b/pisi/installdb.py @@ -91,10 +91,9 @@ class InstallDB: """install package with specific version and release""" pkg = str(pkg) from config import config - #print "INSTALLDB", config.options#, config.options.ignore_comar if self.is_installed(pkg): raise InstallDBError("already installed") - if config.options.ignore_comar: + if config.options and config.options.ignore_comar: state = 'ip' self.dp[pkg] = True else: diff --git a/pisi/version.py b/pisi/version.py index a6874d06..bef9a39f 100644 --- a/pisi/version.py +++ b/pisi/version.py @@ -23,7 +23,7 @@ class Version: return self.verstring def pred(self,rhs,pred): - for i in range(0, len(self.comps)-1): + for i in range(0, len(self.comps)): if pred(self.comps[i],rhs.comps[i]): return True else: diff --git a/tests/archivetests.py b/tests/archivetests.py index 0c8a1f50..56a745e3 100644 --- a/tests/archivetests.py +++ b/tests/archivetests.py @@ -18,6 +18,7 @@ from pisi import sourcearchive from pisi import fetcher from pisi import util from pisi import context +from pisi.config import config from pisi import purl class ArchiveFileTestCase(unittest.TestCase): @@ -94,7 +95,7 @@ class ArchiveFileTestCase(unittest.TestCase): ctx = context.BuildContext("tests/sandbox/pspec.xml") url = purl.PUrl(ctx.spec.source.archiveUri) targetDir = ctx.pkg_work_dir() - filePath = join(ctx.archives_dir(), url.filename()) + filePath = join(config.archives_dir(), url.filename()) # check cached if util.sha1_file(filePath) != ctx.spec.source.archiveSHA1: diff --git a/tests/versiontests.py b/tests/versiontests.py index b5532612..e831619c 100644 --- a/tests/versiontests.py +++ b/tests/versiontests.py @@ -30,3 +30,6 @@ class VersionTestCase(unittest.TestCase): self.assert_(v4 >= v4) suite = unittest.makeSuite(VersionTestCase) + +if __name__ == '__main__': + unittest.main()