/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-27 17:36:23 UTC
  • mto: (0.23.23 groupcompress_rabin)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090227173623-wbwvxgznqacu6u48
Start stripping out the actual GroupCompressor
in preparation for using the diff-delta code.
Add some tests that we can generate and apply diff deltas.

We need to start adding some exceptions, and consider moving the
core of the patch-delta loop back into a pure C function, as the
generated code is very messy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
unavailable_files = []
49
49
 
50
50
 
51
 
def add_pyrex_extension(module_name, **kwargs):
 
51
def add_pyrex_extension(module_name, extra_source=[]):
52
52
    """Add a pyrex module to build.
53
53
 
54
54
    This will use Pyrex to auto-generate the .c file if it is available.
67
67
    # Manually honour package_dir :(
68
68
    module_name = 'bzrlib.plugins.groupcompress.' + module_name
69
69
    if have_pyrex:
70
 
        ext_modules.append(Extension(module_name, [pyrex_name]))
 
70
        source = [pyrex_name]
 
71
    elif not os.path.isfile(c_name):
 
72
        unavailable_files.append(c_name)
 
73
        return
71
74
    else:
72
 
        if not os.path.isfile(c_name):
73
 
            unavailable_files.append(c_name)
74
 
        else:
75
 
            ext_modules.append(Extension(module_name, [c_name]))
 
75
        source = [c_name]
 
76
    source.extend(extra_source)
 
77
    ext_modules.append(Extension(module_name, source))
76
78
 
77
 
add_pyrex_extension('_groupcompress_c')
 
79
add_pyrex_extension('_groupcompress_c',
 
80
                    extra_source=['diff-delta.c', 'patch-delta.c'])
78
81
 
79
82
 
80
83
if __name__ == '__main__':