From: Jason Ish Date: Fri, 8 Dec 2017 13:08:48 +0000 (-0600) Subject: setup: don't try to write revision of .git doesn't exist X-Git-Tag: 1.0.0b1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a831d5be8b5c1b2635da98bc212127c159de1e2d;p=thirdparty%2Fsuricata-update.git setup: don't try to write revision of .git doesn't exist --- diff --git a/setup.py b/setup.py index 99dec9a..a7af0ca 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,12 @@ +import os.path import subprocess from setuptools import setup from suricata.update.version import version -def write_revision(): +def write_git_revision(): + if not os.path.exists(".git"): + return try: revision = subprocess.check_output( ["git", "rev-parse", "--short", "HEAD"]) @@ -12,7 +15,7 @@ def write_revision(): except Exception as err: print("Failed to get current git revision: %s" % (err)) -write_revision() +write_git_revision() setup( name="suricata-update",