()
| 1546 | |
| 1547 | |
| 1548 | def buildInstaller(): |
| 1549 | |
| 1550 | # Zap all compiled files |
| 1551 | for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')): |
| 1552 | for fn in filenames: |
| 1553 | if fn.endswith('.pyc') or fn.endswith('.pyo'): |
| 1554 | os.unlink(os.path.join(dirpath, fn)) |
| 1555 | |
| 1556 | outdir = os.path.join(WORKDIR, 'installer') |
| 1557 | if os.path.exists(outdir): |
| 1558 | shutil.rmtree(outdir) |
| 1559 | os.mkdir(outdir) |
| 1560 | |
| 1561 | pkgroot = os.path.join(outdir, 'Python.mpkg', 'Contents') |
| 1562 | pkgcontents = os.path.join(pkgroot, 'Packages') |
| 1563 | os.makedirs(pkgcontents) |
| 1564 | for recipe in pkg_recipes(): |
| 1565 | packageFromRecipe(pkgcontents, recipe) |
| 1566 | |
| 1567 | rsrcDir = os.path.join(pkgroot, 'Resources') |
| 1568 | |
| 1569 | fn = os.path.join(pkgroot, 'PkgInfo') |
| 1570 | fp = open(fn, 'w') |
| 1571 | fp.write('pmkrpkg1') |
| 1572 | fp.close() |
| 1573 | |
| 1574 | os.mkdir(rsrcDir) |
| 1575 | |
| 1576 | makeMpkgPlist(os.path.join(pkgroot, 'Info.plist')) |
| 1577 | pl = dict( |
| 1578 | IFPkgDescriptionTitle="Python", |
| 1579 | IFPkgDescriptionVersion=getVersion(), |
| 1580 | ) |
| 1581 | |
| 1582 | writePlist(pl, os.path.join(pkgroot, 'Resources', 'Description.plist')) |
| 1583 | for fn in os.listdir('resources'): |
| 1584 | if fn == '.svn': continue |
| 1585 | if fn.endswith('.jpg'): |
| 1586 | shutil.copy(os.path.join('resources', fn), os.path.join(rsrcDir, fn)) |
| 1587 | else: |
| 1588 | patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn)) |
| 1589 | |
| 1590 | |
| 1591 | def installSize(clear=False, _saved=[]): |
no test coverage detected
searching dependent graphs…