From 3665bc3c61c2f2d33b2e77aa771038fe3daec694 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Apr 2009 21:45:51 +0800 Subject: [PATCH] Updated vcsinfo.py generation logic --- setup.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 35df602..298e894 100755 --- a/setup.py +++ b/setup.py @@ -29,18 +29,21 @@ VERSION_NUM = '1.6.0a1' REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' +# change to the directory setup.py is contained in +os.chdir(os.path.abspath(__file)) + try: - try: - os.system('bzr version-info --python > vcsinfo.py') - except: - pass + if os.path.exists('.bzr') and os.system('bzr') == 0: + try: + os.system('bzr version-info --python > vcsinfo.py') + except: + pass import vcsinfo REVISION_NUM = vcsinfo.version_info['revno'] except Exception, e: print 'failed to find revision number:' print e - class configure(Command): description = "configure the paths that Wicd will be installed to"