pentoo-overlay/dev-python/pefile/files/pefile-1.2.10_issue65.patch
2016-01-20 13:32:38 +08:00

64 lines
1.6 KiB
Diff

From 4f685a2f8b732db4803a47ba42ece688f1e72a89 Mon Sep 17 00:00:00 2001
From: Joachim Metz <joachim.metz@gmail.com>
Date: Sun, 17 May 2015 09:07:25 +0200
Subject: [PATCH] Changes for deployment.
---
pefile.py | 4 ++--
setup.py | 14 +++++++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
mode change 100644 => 100755 setup.py
diff --git a/pefile.py b/pefile.py
index afbd581..8e18591 100644
--- a/pefile.py
+++ b/pefile.py
@@ -20,9 +20,9 @@
the root of the distribution archive.
"""
-__revision__ = "$LastChangedRevision$"
+__revision__ = '139'
__author__ = 'Ero Carrera'
-__version__ = '1.2.10-%d' % int( __revision__[21:-2] )
+__version__ = '1.2.10-%d' % int( __revision__ )
__contact__ = 'ero.carrera@gmail.com'
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755
index 2a32c22..5891068
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,7 @@
-#!/usr/bin/env python
+#!/usr/bin/python
+
+import os
+import sys
try:
from setuptools import setup
@@ -6,14 +9,19 @@
from distutils.core import setup
import pefile
-import os
+
os.environ['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true'
os.environ['COPYFILE_DISABLE'] = 'true'
+# build_msi does not support the 1.2.10-139 versioning schema
+# (or 1.2.10.139), hence the revision number is stripped.
+pefile_version = pefile.__version__
+if 'bdist_msi' in sys.argv:
+ pefile_version, _, _ = pefile_version.partition('-')
setup(name = 'pefile',
- version = pefile.__version__,
+ version = pefile_version,
description = 'Python PE parsing module',
author = pefile.__author__,
author_email = pefile.__contact__,