[pypy-svn] r71921 - in pypy/trunk/pypy/tool: . test

fijal at codespeak.net fijal at codespeak.net
Mon Mar 8 22:52:47 CET 2010


Author: fijal
Date: Mon Mar  8 22:52:46 2010
New Revision: 71921

Modified:
   pypy/trunk/pypy/tool/package.py
   pypy/trunk/pypy/tool/test/test_package.py
Log:
Improve a bit packaging tool


Modified: pypy/trunk/pypy/tool/package.py
==============================================================================
--- pypy/trunk/pypy/tool/package.py	(original)
+++ pypy/trunk/pypy/tool/package.py	Mon Mar  8 22:52:46 2010
@@ -37,7 +37,7 @@
     if not pypy_c.check():
         raise PyPyCNotFound('Please compile pypy first, using translate.py')
     builddir = udir.ensure("build", dir=True)
-    pypydir = builddir.ensure("pypy", dir=True)
+    pypydir = builddir.ensure(name, dir=True)
     shutil.copytree(str(basedir.join('lib-python')),
                     str(pypydir.join('lib-python')),
                     ignore=ignore_patterns('.svn'))
@@ -50,8 +50,9 @@
     old_dir = os.getcwd()
     try:
         os.chdir(str(builddir))
+        os.system("strip " + str(builddir.join('bin', 'pypy-c')))
         os.system('tar cvjf ' + str(builddir.join(name + '.tar.bz2')) +
-                  " pypy")
+                  " " + name)
     finally:
         os.chdir(old_dir)
     return builddir # for tests

Modified: pypy/trunk/pypy/tool/test/test_package.py
==============================================================================
--- pypy/trunk/pypy/tool/test/test_package.py	(original)
+++ pypy/trunk/pypy/tool/test/test_package.py	Mon Mar  8 22:52:46 2010
@@ -8,17 +8,17 @@
     # make sure we have sort of pypy-c
     pypy_c = py.path.local(pypydir).join('translator', 'goal', 'pypy-c')
     if not pypy_c.check():
-        pypy_c.write("xxx")
+        shutil.copy("/usr/bin/echo", pypy_c)
         fake_pypy_c = True
     else:
         fake_pypy_c = False
     try:
         builddir = main(py.path.local(pypydir).dirpath(), 'test')
-        assert builddir.join('pypy', 'lib-python', '2.5.2', 'test').check()
-        assert builddir.join('pypy', 'bin', 'pypy-c').check()
-        assert builddir.join('pypy', 'pypy', 'lib', 'syslog.py').check()
+        assert builddir.join('test', 'lib-python', '2.5.2', 'test').check()
+        assert builddir.join('test', 'bin', 'pypy-c').check()
+        assert builddir.join('test', 'pypy', 'lib', 'syslog.py').check()
         th = tarfile.open(str(builddir.join('test.tar.bz2')))
-        assert th.getmember('pypy/pypy/lib/syslog.py')
+        assert th.getmember('test/pypy/lib/syslog.py')
     finally:
         if fake_pypy_c:
             pypy_c.remove()



More information about the Pypy-commit mailing list