Description: Get version details from the Debian source package, rather than VCS
 Return the Debian package version in sys.version.
 Return null strings in sys._mercurial.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: not-needed
Last-Update: 2013-02-23

--- a/rpython/tool/version.py
+++ b/rpython/tool/version.py
@@ -17,6 +17,16 @@
 def get_repo_version_info(hgexe=None, root=rpythonroot):
     '''Obtain version information by invoking the 'hg' or 'git' commands.'''
 
+    # Debian: built from a source tarball
+    p = Popen(('dpkg-parsechangelog',), stdout=PIPE, cwd=rpythonroot)
+    if p.wait() != 0:
+        maywarn(p.stderr.read(), 'dpkg-parsechangelog')
+        return default_retval
+    for line in p.stdout.read().split('\n'):
+        if line.split(':', 1)[0].strip() == 'Version':
+            version = line.split(':', 1)[1].strip()
+            return '', version
+
     # Try to see if we can get info from Git if hgexe is not specified.
     if not hgexe:
         if os.path.isdir(os.path.join(root, '.git')):
--- a/pypy/module/sys/version.py
+++ b/pypy/module/sys/version.py
@@ -84,6 +84,7 @@
     return space.wrap(('PyPy', '', ''))
 
 def get_repo_info(space):
+    return space.wrap(('PyPy', '', ''))
     info = get_repo_version_info(root=pypyroot)
     if info:
         repo_tag, repo_version = info
