From c9b76ce3cb0d1f7680bf0b5bf52223e1a0ac933c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 21 Jun 2005 13:14:36 +0000 Subject: [PATCH] =?UTF-8?q?Olmayan=20test=20suite=20=C3=A7=C4=B1kart=C4=B1?= =?UTF-8?q?ld=C4=B1=20[=20yerine=20konunca=20ekleriz=20],=20birazdan=20aut?= =?UTF-8?q?otools=20gelecek,=20b=C3=B6cek=20ezmekle=20u=C4=9Fra=C5=9F?= =?UTF-8?q?=C4=B1yorum=20actionsapi=20i=C3=A7inde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/gnuconfig.py | 31 +++++++++++++++++-------------- tests/run.py | 6 ++---- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/pisi/actionsapi/gnuconfig.py b/pisi/actionsapi/gnuconfig.py index e07c757a..05d51a85 100644 --- a/pisi/actionsapi/gnuconfig.py +++ b/pisi/actionsapi/gnuconfig.py @@ -4,6 +4,8 @@ import os, string, re, shutil from shell import * +from pisi.ui import ui + def gnuconfig_findnewest(): ''' find the newest config.* file according to timestamp and return it''' @@ -15,25 +17,26 @@ def gnuconfig_findnewest(): '/usr/share/automake-1.6/config.sub', '/usr/share/automake-1.5/config.sub', '/usr/share/automake-1.4/config.sub', - 'share/config.sub'] + 'share/config.sub'] newer_location = {} for i in locations: if not os.path.exists(i): continue - newer_location[i] = re.sub('\'', - '', - string.split((cat(i) | - tr(str.rstrip) | - grep ('^timestamp') | - join), '=')[1]) + newer_location[i] = re.sub('\'', '', + string.split((cat(i) | tr(str.rstrip) + | grep ('^timestamp') + | join), '=')[1]) keys = newer_location.keys() keys.sort() - map(newer_location.get, keys) - return os.path.dirname(newer_location.popitem()[0]) + thelist=[] + for i in keys: + thelist.append((i, newer_location[i])) + + return os.path.dirname(thelist[0][0]) def gnuconfig_update(): ''' copy newest config.* onto source's ''' @@ -42,11 +45,11 @@ def gnuconfig_update(): try: shutil.copyfile(newer_location + '/config.sub', - os.getcwd() + '/config.sub') + os.getcwd() + '/config.sub') shutil.copyfile(newer_location + '/config.guess', - os.getcwd() + '/config.guess') - except IOError: - print 'Hata mata...' + os.getcwd() + '/config.guess') + except IOError, e: + ui.error ("Error : %s\n" % e) sys.exit() - print 'GNU Config Update Finished...' + ui.info('GNU Config Update Finished...\n') diff --git a/tests/run.py b/tests/run.py index 8d2911e8..c705ba0b 100755 --- a/tests/run.py +++ b/tests/run.py @@ -14,16 +14,14 @@ def run_all(): import archivetests import installdbtests import packagedbtests - import versiontests alltests = unittest.TestSuite(( specfiletests.suite, contexttests.suite, fetchertests.suite, archivetests.suite, - versiontests.suite, - installdbtests.suite, - packagedbtests. suite + installdbtests.suite, + packagedbtests. suite )) runTestSuite(alltests)