[PATCH] win32 installer for bzr 0.9: rev.2

Alexander Belchenko bialix at ukr.net
Mon Jul 31 20:08:23 BST 2006


John Arbash Meinel пишет:
...
 >> +import os
 >> +import sys
 >> +import _winreg
 >
 > ...
 >
 >> +    batch_path = "bzr.bat"
 >> +    prefix = sys.prefix
 >> +    try:
 >> +        ##
 >> +        # try to create
 >> +        scripts_dir = os.path.join(prefix, "Scripts")
 >> +        script_path = os.path.join(scripts_dir, "bzr")
 >> +        python_path = os.path.join(prefix, "python.exe")
 >> +        batch_str = "@%s %s %%*\n" % (python_path, script_path)
 >
 > ^- This is unsafe when paths contain spaces. It is pbetter to do:
 > batch_str = '@"%s" "%s" %%*\n' % (python_path, script_path)

I rework it in slightly different way (quote path only if it contains
spaces). I also do minor support of win98 (instead of %* args
palceholder I use '%1 ... %9' sequence when installed on win98).

 > I also feel like it would be better to use
 > sys.executable, rather than joining prefix + 'python.exe'.

No. Your feelings is wrong. This script (bzr-win32-bdist-postinstall.py)
launched during installation phase when user runs bzr-0.9.win32.exe
installer. And for this script sys.executable equals to full path to
installer. Not to python interpreter. So "prefix + 'python.exe'" is right.

 >> === modified file 'bzrlib/doc/api/__init__.py'
 >> --- bzrlib/doc/api/__init__.py	2006-06-06 08:09:09 +0000
 >> +++ bzrlib/doc/api/__init__.py	2006-06-29 08:41:31 +0000
 >> @@ -28,7 +28,11 @@
 >>  import os
 >>
 >>  def test_suite():
 >> -    candidates = os.listdir(os.path.dirname(__file__))
 >> +    dir_ = os.path.dirname(__file__)
 >> +    if os.path.isdir(dir_):
 >> +        candidates = os.listdir(dir_)
 >> +    else:
 >> +        candidates = []
 >>      scripts = [candidate for candidate in candidates
 >>                 if candidate.endswith('.txt')]
 >>      return doctest.DocFileSuite(*scripts)
 >
 > ^- Why is this failing? Because the standalone doesn't have a 'doc/api'
 > directory?

It's failing because in standalone bzr.exe bzrlib itself packed inside
library.zip archive. So it simply cannot be os-listdir-able. When I work
on installer in early may I ask about this. You can search trough
maillist archive. Someone point me that doctest could be improved to use
zipimport module to actually obtain list of packed *.txt files with
doctests. But I looks too complex for this minor issue.


All other issues also was reworked.
Attached diff of recent changes; not full diff because it will be too big.

Log of my changes (attached diff for -r 1869..-1):

   1880 Alexander Belchenko	2006-07-31
        HACKING: mention where to get instructions for building windows
installers

   1879 Alexander Belchenko	2006-07-31
        Makefile: cross-platform actions for building installer

   1878 Alexander Belchenko	2006-07-31
        No full path to iscc (Inno Setup compiler).
        You should have directory where Inno Setup installed listed in $PATH

   1877 Alexander Belchenko	2006-07-31
        new official bzr.ico

   1876 Alexander Belchenko	2006-07-31
        English phrases corrected as John Meinel suggested.

   1875 Alexander Belchenko	2006-07-31
        generate_docs (man/rstx): fixed description of configuration file
        (as John Meinel suggested)

   1874 Alexander Belchenko	2006-07-31
        generate_docs (man/rstx): get help with .help() method, otherwise
help for merge incomplete

   1873 Alexander Belchenko	2006-07-30
        setup.py: get version info from bzrlib

   1872 Alexander Belchenko	2006-07-30
        improved postinstall script for python installer; added minimal
support of win98

   1871 Alexander Belchenko	2006-07-30
        setup.py: improved bzr.bat creation

   1870 Alexander Belchenko	2006-07-30
        rename  gpl.txt => COPYING.txt

   1869 Alexander Belchenko	2006-07-30
        More branding: bazaar-ng -> Bazaar; bazaar-ng.org -> bazaar-vcs.org

   1868 Alexander Belchenko	2006-07-30
        merge bzr.dev

   1867 Alexander Belchenko	2006-07-30
        branding: change Bazaar-NG to Bazaar

   1866 Alexander Belchenko	2006-07-25
        show text of GPL license during installation of standalone bzr.exe

   1865 Alexander Belchenko	2006-07-25
        merge improvements to doc-generator: show aliases, more
environment variables

   1864 Alexander Belchenko	2006-07-25
        - merge improvements to python-based installer
        - don't restrict python-based installer to python 2.4 only
because 2.5 is coming

   1863 Alexander Belchenko	2006-07-25
        script bzr_test_dependencies.py removed from installer.
        TODO: push that functionality to plugin 'dependencies'

   1862 Alexander Belchenko	2006-07-17
        merged installer work


If you think it's OK to merge then I can prepare bundle for merging.

--
Alexander


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32.installer.0.9.v2-1.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060731/8c744ab7/attachment.diff 


More information about the bazaar mailing list