Permalink
Browse files

added support for autoversioning script

  • Loading branch information...
1 parent b86db51 commit 3e222213b9af153b9be5b90b8d4036b8b747e880 @lirazsiri lirazsiri committed Aug 11, 2011
Showing with 13 additions and 8 deletions.
  1. +13 −8 pylib/debian_pylib.py
View
@@ -2,7 +2,8 @@
import os
import sys
from distutils.core import setup as _setup
-from executil import getoutput
+
+from executil import getoutput, ExecError
from os.path import *
class SetupBase:
@@ -74,13 +75,17 @@ def parse_email(email):
@staticmethod
def get_version():
- if not exists("debian/changelog"):
- return None
+ try:
+ if not exists("debian/changelog"):
+ return getoutput("autoversion HEAD")
- output = getoutput("dpkg-parsechangelog")
- version = [ line.split(" ")[1]
- for line in output.split("\n")
- if line.startswith("Version:") ][0]
- return version
+ output = getoutput("dpkg-parsechangelog")
+ version = [ line.split(" ")[1]
+ for line in output.split("\n")
+ if line.startswith("Version:") ][0]
+ return version
+
+ except ExecError:
+ return None
setup = Setup.setup

0 comments on commit 3e22221

Please sign in to comment.