aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devel/mercurial/Makefile4
-rw-r--r--devel/mercurial/files/patch-unknown-egg51
2 files changed, 54 insertions, 1 deletions
diff --git a/devel/mercurial/Makefile b/devel/mercurial/Makefile
index 28cc71211d66..f47656a7146c 100644
--- a/devel/mercurial/Makefile
+++ b/devel/mercurial/Makefile
@@ -16,7 +16,9 @@ COMMENT= A fast, lightweight source control management system
USE_GETTEXT= yes
USE_PYTHON= 2.3+
USE_PYDISTUTILS=yes
-PYDISTUTILS_NOEGGINFO= yes
+PYDISTUTILS_PKGNAME= ${PORTNAME}
+PYDISTUTILS_PKGVERSION= ${PORTVERSION}
+PYDISTUTILS_EGGINFO= ${PORTNAME}-${PORTVERSION}-${PYTHON_VERSION:S/thon//}.egg-info
CONTRIB_FILES= bash_completion \
convert-repo \
diff --git a/devel/mercurial/files/patch-unknown-egg b/devel/mercurial/files/patch-unknown-egg
new file mode 100644
index 000000000000..c179eb0e017a
--- /dev/null
+++ b/devel/mercurial/files/patch-unknown-egg
@@ -0,0 +1,51 @@
+diff -r 4d79ed5b9ecd mercurial-1.2.1/setup.py
+--- setup.py Fri May 15 13:58:32 2009 +0400
++++ setup.py Fri May 15 14:02:00 2009 +0400
+@@ -97,10 +97,7 @@
+ except ImportError:
+ pass
+
+-def getversion():
+- if not os.path.exists('.hg'):
+- return None # not in a repository
+-
++if os.path.exists('.hg'):
+ # execute hg out of this directory with a custom environment which
+ # includes the pure Python modules in mercurial/pure
+ pypath = os.environ.get('PYTHONPATH', '')
+@@ -108,6 +105,7 @@
+ os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath])
+ os.environ['HGRCPATH'] = '' # do not read any config file
+ cmd = '%s hg id -it' % sys.executable
++ version = None
+
+ try:
+ l = os.popen(cmd).read().split()
+@@ -122,16 +120,18 @@
+ version = l[-1] # latest tag or revision number
+ if version.endswith('+'):
+ version += time.strftime('%Y%m%d')
+- return version
+
+-version = getversion()
+-if version:
+- f = file("mercurial/__version__.py", "w")
+- f.write('# this file is autogenerated by setup.py\n')
+- f.write('version = "%s"\n' % version)
+- f.close()
+-else:
+- version = "unknown"
++ if version:
++ f = file("mercurial/__version__.py", "w")
++ f.write('# this file is autogenerated by setup.py\n')
++ f.write('version = "%s"\n' % version)
++ f.close()
++
++try:
++ from mercurial import __version__
++ version = __version__.version
++except ImportError:
++ version = 'unknown'
+
+ class install_package_data(install_data):
+ def finalize_options(self):