Skip to content

Commit

Permalink
added support for autoversioning script
Browse files Browse the repository at this point in the history
  • Loading branch information
lirazsiri committed Aug 11, 2011
1 parent b86db51 commit 3e22221
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pylib/debian_pylib.py
Expand Up @@ -2,7 +2,8 @@
import os import os
import sys import sys
from distutils.core import setup as _setup from distutils.core import setup as _setup
from executil import getoutput
from executil import getoutput, ExecError
from os.path import * from os.path import *


class SetupBase: class SetupBase:
Expand Down Expand Up @@ -74,13 +75,17 @@ def parse_email(email):


@staticmethod @staticmethod
def get_version(): def get_version():
if not exists("debian/changelog"): try:
return None if not exists("debian/changelog"):
return getoutput("autoversion HEAD")


output = getoutput("dpkg-parsechangelog") output = getoutput("dpkg-parsechangelog")
version = [ line.split(" ")[1] version = [ line.split(" ")[1]
for line in output.split("\n") for line in output.split("\n")
if line.startswith("Version:") ][0] if line.startswith("Version:") ][0]
return version return version

except ExecError:
return None


setup = Setup.setup setup = Setup.setup

0 comments on commit 3e22221

Please sign in to comment.