diff options
author | dotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2007-01-07 03:19:22 +0000 |
---|---|---|
committer | dotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e> | 2007-01-07 03:19:22 +0000 |
commit | 6b8007761b66db36f7863cfb42270a8d0c8b9077 (patch) | |
tree | b0c8be67cdefa42aea872bda19a09b75d109238f /xdelta3 | |
parent | bae7eb2b3db9664a5041a8dbefef5a2fa3847376 (diff) |
Fixes the python module, there were some bugs in main.
Diffstat (limited to 'xdelta3')
-rwxr-xr-x | xdelta3/Makefile | 8 | ||||
-rwxr-xr-x | xdelta3/setup.py | 21 | ||||
-rwxr-xr-x | xdelta3/xdelta3-main.h | 67 | ||||
-rwxr-xr-x | xdelta3/xdelta3-regtest.py | 67 | ||||
-rwxr-xr-x | xdelta3/xdelta3.prj | 6 |
5 files changed, 81 insertions, 88 deletions
diff --git a/xdelta3/Makefile b/xdelta3/Makefile index 644b98a..0b68a2f 100755 --- a/xdelta3/Makefile +++ b/xdelta3/Makefile | |||
@@ -22,22 +22,22 @@ TARGETS = xdelta3 xdelta3-debug xdelta3-64 xdelta3-everything \ | |||
22 | xdelta3-notools | 22 | xdelta3-notools |
23 | 23 | ||
24 | PYTHON = python | 24 | PYTHON = python |
25 | PYTGT = build/temp.linux-i686-2.3/xdelta3.so | 25 | PYTGT = build/lib.linux-i686-2.4/xdelta3.so |
26 | 26 | ||
27 | PYFILES = xdelta3-regtest.py setup.py | 27 | PYFILES = xdelta3-regtest.py setup.py |
28 | 28 | ||
29 | EXTRA = Makefile COPYING linkxd3lib.c badcopy.c www | 29 | EXTRA = Makefile COPYING linkxd3lib.c badcopy.c www |
30 | 30 | ||
31 | # $Format: "REL=$Xdelta3Version$" $ | 31 | # $Format: "REL=$Xdelta3Version$" $ |
32 | REL=0i | 32 | REL=0j |
33 | RELDIR = xdelta3$(REL) | 33 | RELDIR = xdelta3$(REL) |
34 | 34 | ||
35 | XDELTA1 = ../xdelta11/xdelta | ||
36 | |||
37 | all: xdelta3-debug xdelta3 $(PYTGT) | 35 | all: xdelta3-debug xdelta3 $(PYTGT) |
38 | 36 | ||
39 | all-targets: $(TARGETS) | 37 | all-targets: $(TARGETS) |
40 | 38 | ||
39 | pytgt: $(PYTGT) | ||
40 | |||
41 | tar: | 41 | tar: |
42 | tar --exclude ".svn" -czf /tmp/$(RELDIR)-tmp.tar.gz $(SOURCES) $(PYFILES) $(EXTRA) | 42 | tar --exclude ".svn" -czf /tmp/$(RELDIR)-tmp.tar.gz $(SOURCES) $(PYFILES) $(EXTRA) |
43 | rm -rf /tmp/$(RELDIR) | 43 | rm -rf /tmp/$(RELDIR) |
diff --git a/xdelta3/setup.py b/xdelta3/setup.py index 9d717e8..8691bfb 100755 --- a/xdelta3/setup.py +++ b/xdelta3/setup.py | |||
@@ -1,5 +1,5 @@ | |||
1 | # xdelta 3 - delta compression tools and library | 1 | # xdelta 3 - delta compression tools and library |
2 | # Copyright (C) 2004 and onward. Joshua P. MacDonald | 2 | # Copyright (C) 2004, 2007. Joshua P. MacDonald |
3 | # | 3 | # |
4 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
5 | # it under the terms of the GNU General Public License as published by | 5 | # it under the terms of the GNU General Public License as published by |
@@ -20,14 +20,21 @@ from distutils.core import setup, Extension | |||
20 | 20 | ||
21 | xdelta3_ext = Extension('xdelta3', | 21 | xdelta3_ext = Extension('xdelta3', |
22 | ['xdelta3.c'], | 22 | ['xdelta3.c'], |
23 | define_macros = [('PYTHON_MODULE',1), | 23 | define_macros = [ |
24 | ('XD3_POSIX',1), | ||
25 | ('REGRESSION_TEST',1), | ||
26 | ('XD3_DEBUG',1), | ||
27 | ('EXTCOMP',1), | 24 | ('EXTCOMP',1), |
25 | ('REGRESSION_TEST',1), | ||
26 | ('SECONDARY_DJW',1), | ||
27 | ('SECONDARY_FGK',1), | ||
28 | ('VCDIFF_TOOLS',1), | 28 | ('VCDIFF_TOOLS',1), |
29 | ('XD3_USE_LARGEFILE64',1)]) | 29 | ('XD3_DEBUG',1), |
30 | ('XD3_POSIX',1), | ||
31 | ('XD3_USE_LARGEFILE64',1), | ||
32 | ('PYTHON_MODULE',1), | ||
33 | ]) | ||
34 | |||
35 | # $Format: "REL='$Xdelta3Version$'" $ | ||
36 | REL='0j' | ||
30 | 37 | ||
31 | setup(name='xdelta3', | 38 | setup(name='xdelta3', |
32 | version='pre', | 39 | version=REL, |
33 | ext_modules=[xdelta3_ext]) | 40 | ext_modules=[xdelta3_ext]) |
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h index c4e6bf5..6374361 100755 --- a/xdelta3/xdelta3-main.h +++ b/xdelta3/xdelta3-main.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* xdelta 3 - delta compression tools and library | 1 | /* xdelta 3 - delta compression tools and library |
2 | * Copyright (C) 2001 and onward. Joshua P. MacDonald | 2 | * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
3 | * Joshua P. MacDonald | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -67,7 +68,7 @@ const char* xd3_mainerror(int err_num); | |||
67 | #define NT stderr, "xdelta3: " | 68 | #define NT stderr, "xdelta3: " |
68 | 69 | ||
69 | #define VC fprintf | 70 | #define VC fprintf |
70 | #define UT vcout, | 71 | #define UT stdout, |
71 | 72 | ||
72 | /* If none are set, default to posix. */ | 73 | /* If none are set, default to posix. */ |
73 | #if (XD3_POSIX + XD3_STDIO + XD3_WIN32) == 0 | 74 | #if (XD3_POSIX + XD3_STDIO + XD3_WIN32) == 0 |
@@ -252,7 +253,6 @@ static char* option_smatch_config = NULL; | |||
252 | static int option_no_compress = 0; | 253 | static int option_no_compress = 0; |
253 | static int option_no_output = 0; /* go through the motions, but do not open or write output */ | 254 | static int option_no_output = 0; /* go through the motions, but do not open or write output */ |
254 | static const char *option_source_filename = NULL; | 255 | static const char *option_source_filename = NULL; |
255 | static const char *option_xdelta1 = "xdelta1"; | ||
256 | 256 | ||
257 | static usize_t option_winsize = XD3_DEFAULT_WINSIZE; | 257 | static usize_t option_winsize = XD3_DEFAULT_WINSIZE; |
258 | static usize_t option_srcwinsz = XD3_DEFAULT_SRCWINSZ; | 258 | static usize_t option_srcwinsz = XD3_DEFAULT_SRCWINSZ; |
@@ -305,9 +305,6 @@ static main_extcomp extcomp_types[] = | |||
305 | { "gzip", "-cf", "gzip", "-dcf", "G", "\037\213", 2, 0 }, | 305 | { "gzip", "-cf", "gzip", "-dcf", "G", "\037\213", 2, 0 }, |
306 | { "compress", "-cf", "uncompress", "-cf", "Z", "\037\235", 2, 0 }, | 306 | { "compress", "-cf", "uncompress", "-cf", "Z", "\037\235", 2, 0 }, |
307 | 307 | ||
308 | /* TODO: xdelta1 isn't working */ | ||
309 | /*{ "xdelta1", "delta", "xdelta1", "patch", "1", "%XD", 3, RD_EXTERNAL_V1 },*/ | ||
310 | |||
311 | /* TODO: add commandline support for magic-less formats */ | 308 | /* TODO: add commandline support for magic-less formats */ |
312 | /*{ "lzma", "-cf", "lzma", "-dcf", "M", "]\000", 2, 0 },*/ | 309 | /*{ "lzma", "-cf", "lzma", "-dcf", "M", "]\000", 2, 0 },*/ |
313 | }; | 310 | }; |
@@ -321,7 +318,7 @@ static int | |||
321 | main_version (void) | 318 | main_version (void) |
322 | { | 319 | { |
323 | /* $Format: " P(RINT \"VERSION=3.$Xdelta3Version$\\n\");" $ */ | 320 | /* $Format: " P(RINT \"VERSION=3.$Xdelta3Version$\\n\");" $ */ |
324 | P(RINT "VERSION=3.0i\n"); | 321 | P(RINT "VERSION=3.0j\n"); |
325 | return EXIT_SUCCESS; | 322 | return EXIT_SUCCESS; |
326 | } | 323 | } |
327 | 324 | ||
@@ -395,6 +392,7 @@ main_free (void *ptr) | |||
395 | { | 392 | { |
396 | IF_DEBUG (main_mallocs -= 1); | 393 | IF_DEBUG (main_mallocs -= 1); |
397 | main_free1 (NULL, ptr); | 394 | main_free1 (NULL, ptr); |
395 | IF_DEBUG (XD3_ASSERT(main_mallocs >= 0)); | ||
398 | } | 396 | } |
399 | } | 397 | } |
400 | 398 | ||
@@ -613,8 +611,9 @@ main_file_init (main_file *xfile) | |||
613 | static void | 611 | static void |
614 | main_file_cleanup (main_file *xfile) | 612 | main_file_cleanup (main_file *xfile) |
615 | { | 613 | { |
616 | if (xfile->filename_copy) { | 614 | if (xfile->filename_copy != NULL) { |
617 | main_free(xfile->filename_copy); | 615 | main_free(xfile->filename_copy); |
616 | xfile->filename_copy = NULL; | ||
618 | } | 617 | } |
619 | } | 618 | } |
620 | 619 | ||
@@ -901,7 +900,7 @@ main_file_seek (main_file *xfile, xoff_t pos) | |||
901 | #if VCDIFF_TOOLS | 900 | #if VCDIFF_TOOLS |
902 | /* This function prints a single VCDIFF window, mainly for debugging purposes. */ | 901 | /* This function prints a single VCDIFF window, mainly for debugging purposes. */ |
903 | static int | 902 | static int |
904 | main_print_window (xd3_stream* stream, FILE *vcout) | 903 | main_print_window (xd3_stream* stream) |
905 | { | 904 | { |
906 | int ret; | 905 | int ret; |
907 | usize_t size = 0; | 906 | usize_t size = 0; |
@@ -965,13 +964,11 @@ main_print_window (xd3_stream* stream, FILE *vcout) | |||
965 | return XD3_INTERNAL; | 964 | return XD3_INTERNAL; |
966 | } | 965 | } |
967 | 966 | ||
968 | IF_DEBUG (VC(UT "SIZE=%u TGTLEN=%u\n", size, stream->dec_tgtlen)); | ||
969 | |||
970 | return 0; | 967 | return 0; |
971 | } | 968 | } |
972 | 969 | ||
973 | static void | 970 | static void |
974 | main_print_vcdiff_file (main_file *file, const char *type, FILE *vcout) | 971 | main_print_vcdiff_file (main_file *file, const char *type) |
975 | { | 972 | { |
976 | if (file->filename) { VC(UT "XDELTA filename (%s): %s\n", type, file->filename); } | 973 | if (file->filename) { VC(UT "XDELTA filename (%s): %s\n", type, file->filename); } |
977 | if (file->compressor) { VC(UT "XDELTA ext comp (%s): %s\n", type, file->compressor->recomp_cmdname); } | 974 | if (file->compressor) { VC(UT "XDELTA ext comp (%s): %s\n", type, file->compressor->recomp_cmdname); } |
@@ -982,18 +979,6 @@ static int | |||
982 | main_print_func (xd3_stream* stream, main_file *xfile) | 979 | main_print_func (xd3_stream* stream, main_file *xfile) |
983 | { | 980 | { |
984 | int ret; | 981 | int ret; |
985 | FILE *vcout; | ||
986 | #if XD3_POSIX | ||
987 | if (! (vcout = fdopen (dup(xfile->file), "w"))) | ||
988 | { | ||
989 | ret = get_errno (); | ||
990 | XPR(NT "fdopen: %s: %s\n", xfile->filename, xd3_mainerror (ret)); | ||
991 | return ret; | ||
992 | } | ||
993 | #elif XD3_STDIO | ||
994 | vcout = xfile->file; | ||
995 | #endif | ||
996 | XD3_ASSERT (vcout); | ||
997 | if (stream->dec_winstart == 0) | 982 | if (stream->dec_winstart == 0) |
998 | { | 983 | { |
999 | VC(UT "VCDIFF version: 0\n"); | 984 | VC(UT "VCDIFF version: 0\n"); |
@@ -1021,7 +1006,7 @@ main_print_func (xd3_stream* stream, main_file *xfile) | |||
1021 | main_file i, o, s; | 1006 | main_file i, o, s; |
1022 | XD3_ASSERT (apphead != NULL); | 1007 | XD3_ASSERT (apphead != NULL); |
1023 | VC(UT "VCDIFF application header: "); | 1008 | VC(UT "VCDIFF application header: "); |
1024 | fwrite (apphead, 1, appheadsz, vcout); | 1009 | fwrite (apphead, 1, appheadsz, stdout); |
1025 | VC(UT "\n"); | 1010 | VC(UT "\n"); |
1026 | 1011 | ||
1027 | main_file_init (& i); | 1012 | main_file_init (& i); |
@@ -1030,8 +1015,8 @@ main_print_func (xd3_stream* stream, main_file *xfile) | |||
1030 | option_quiet = 1; | 1015 | option_quiet = 1; |
1031 | main_get_appheader (stream, &i, & o, & s); | 1016 | main_get_appheader (stream, &i, & o, & s); |
1032 | option_quiet = sq; | 1017 | option_quiet = sq; |
1033 | main_print_vcdiff_file (& o, "output", vcout); | 1018 | main_print_vcdiff_file (& o, "output"); |
1034 | main_print_vcdiff_file (& s, "source", vcout); | 1019 | main_print_vcdiff_file (& s, "source"); |
1035 | main_file_cleanup (& i); | 1020 | main_file_cleanup (& i); |
1036 | main_file_cleanup (& o); | 1021 | main_file_cleanup (& o); |
1037 | main_file_cleanup (& s); | 1022 | main_file_cleanup (& s); |
@@ -1092,10 +1077,9 @@ main_print_func (xd3_stream* stream, main_file *xfile) | |||
1092 | } | 1077 | } |
1093 | else if ((stream->flags & XD3_SKIP_WINDOW) == 0) | 1078 | else if ((stream->flags & XD3_SKIP_WINDOW) == 0) |
1094 | { | 1079 | { |
1095 | ret = main_print_window (stream, vcout); | 1080 | ret = main_print_window (stream); |
1096 | } | 1081 | } |
1097 | 1082 | ||
1098 | fclose (vcout); | ||
1099 | return ret; | 1083 | return ret; |
1100 | } | 1084 | } |
1101 | #endif /* VCDIFF_TOOLS */ | 1085 | #endif /* VCDIFF_TOOLS */ |
@@ -1728,6 +1712,8 @@ main_get_appheader_params (main_file *file, char **parsed, int output, const cha | |||
1728 | 1712 | ||
1729 | if (last_slash != NULL) { | 1713 | if (last_slash != NULL) { |
1730 | int dlen = last_slash - other->filename; | 1714 | int dlen = last_slash - other->filename; |
1715 | |||
1716 | XD3_ASSERT(file->filename_copy == NULL); | ||
1731 | file->filename_copy = main_malloc(dlen + 2 + strlen(file->filename)); | 1717 | file->filename_copy = main_malloc(dlen + 2 + strlen(file->filename)); |
1732 | 1718 | ||
1733 | strncpy(file->filename_copy, other->filename, dlen); | 1719 | strncpy(file->filename_copy, other->filename, dlen); |
@@ -2453,7 +2439,8 @@ main_input (xd3_cmd cmd, | |||
2453 | case XD3_WINSTART: | 2439 | case XD3_WINSTART: |
2454 | { | 2440 | { |
2455 | /* Set or unset XD3_SKIP_WINDOW. */ | 2441 | /* Set or unset XD3_SKIP_WINDOW. */ |
2456 | /*if (stream.current_window < option_first_window || stream.current_window > option_last_window) | 2442 | /*if (stream.current_window < option_first_window || |
2443 | stream.current_window > option_last_window) | ||
2457 | { stream_flags |= XD3_SKIP_WINDOW; } | 2444 | { stream_flags |= XD3_SKIP_WINDOW; } |
2458 | else | 2445 | else |
2459 | { stream_flags &= ~XD3_SKIP_WINDOW; }*/ | 2446 | { stream_flags &= ~XD3_SKIP_WINDOW; }*/ |
@@ -2609,13 +2596,19 @@ main_cleanup (void) | |||
2609 | { | 2596 | { |
2610 | int i; | 2597 | int i; |
2611 | 2598 | ||
2612 | if (option_appheader) { appheader_used = NULL; } | 2599 | if (appheader_used != NULL && |
2600 | appheader_used != option_appheader) | ||
2601 | { | ||
2602 | main_free (appheader_used); | ||
2603 | appheader_used = NULL; | ||
2604 | } | ||
2613 | 2605 | ||
2614 | main_free (appheader_used); | ||
2615 | main_free (main_bdata); | 2606 | main_free (main_bdata); |
2607 | main_bdata = NULL; | ||
2616 | 2608 | ||
2617 | #if EXTERNAL_COMPRESSION | 2609 | #if EXTERNAL_COMPRESSION |
2618 | main_free (ext_tmpfile); | 2610 | main_free (ext_tmpfile); |
2611 | ext_tmpfile = NULL; | ||
2619 | #endif | 2612 | #endif |
2620 | 2613 | ||
2621 | for (i = 0; lru && i < lru_size; i += 1) | 2614 | for (i = 0; lru && i < lru_size; i += 1) |
@@ -2624,6 +2617,7 @@ main_cleanup (void) | |||
2624 | } | 2617 | } |
2625 | 2618 | ||
2626 | main_free (lru); | 2619 | main_free (lru); |
2620 | lru = NULL; | ||
2627 | 2621 | ||
2628 | lru_hits = 0; | 2622 | lru_hits = 0; |
2629 | lru_misses = 0; | 2623 | lru_misses = 0; |
@@ -2828,7 +2822,6 @@ main (int argc, char **argv) | |||
2828 | case 'T': option_use_altcodetable = 1; break; | 2822 | case 'T': option_use_altcodetable = 1; break; |
2829 | case 'C': option_smatch_config = my_optarg; break; | 2823 | case 'C': option_smatch_config = my_optarg; break; |
2830 | case 'J': option_no_output = 1; break; | 2824 | case 'J': option_no_output = 1; break; |
2831 | case 'O': option_xdelta1 = my_optarg; break; | ||
2832 | case 'S': if (my_optarg == NULL) { option_use_secondary = 0; } | 2825 | case 'S': if (my_optarg == NULL) { option_use_secondary = 0; } |
2833 | else { option_use_secondary = 1; option_secondary = my_optarg; } break; | 2826 | else { option_use_secondary = 1; option_secondary = my_optarg; } break; |
2834 | case 'A': if (my_optarg == NULL) { option_use_appheader = 0; } | 2827 | case 'A': if (my_optarg == NULL) { option_use_appheader = 0; } |
@@ -2903,9 +2896,6 @@ main (int argc, char **argv) | |||
2903 | goto cleanup; | 2896 | goto cleanup; |
2904 | } | 2897 | } |
2905 | 2898 | ||
2906 | extcomp_types[1].recomp_cmdname = option_xdelta1; | ||
2907 | extcomp_types[1].decomp_cmdname = option_xdelta1; | ||
2908 | |||
2909 | if (option_verbose > 1) | 2899 | if (option_verbose > 1) |
2910 | { | 2900 | { |
2911 | int l = 1; | 2901 | int l = 1; |
@@ -2989,7 +2979,10 @@ main (int argc, char **argv) | |||
2989 | } | 2979 | } |
2990 | 2980 | ||
2991 | #if EXTERNAL_COMPRESSION | 2981 | #if EXTERNAL_COMPRESSION |
2992 | if (ext_tmpfile != NULL) { unlink (ext_tmpfile); } | 2982 | if (ext_tmpfile != NULL) |
2983 | { | ||
2984 | unlink (ext_tmpfile); | ||
2985 | } | ||
2993 | #endif | 2986 | #endif |
2994 | 2987 | ||
2995 | if (0) | 2988 | if (0) |
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py index e8d0339..6590792 100755 --- a/xdelta3/xdelta3-regtest.py +++ b/xdelta3/xdelta3-regtest.py | |||
@@ -42,13 +42,6 @@ MAX_TRIALS = 1 | |||
42 | MIN_STDDEV_PCT = 1.5 # stop | 42 | MIN_STDDEV_PCT = 1.5 # stop |
43 | MAX_RUN = 1000 * 1000 * 10 | 43 | MAX_RUN = 1000 * 1000 * 10 |
44 | 44 | ||
45 | XD3CMD = './xdelta3-64' | ||
46 | #XD3CMD = './xdelta3' | ||
47 | |||
48 | # kind: | ||
49 | PYEXT = 1 | ||
50 | FORK = 0 | ||
51 | |||
52 | # | 45 | # |
53 | # | 46 | # |
54 | RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS/prcs/b' | 47 | RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS/prcs/b' |
@@ -433,14 +426,11 @@ def RunCommandIO(args,infn,outfn): | |||
433 | if not os.WIFEXITED(s[1]) or o != 0: | 426 | if not os.WIFEXITED(s[1]) or o != 0: |
434 | raise CommandError(args, 'exited %d' % o) | 427 | raise CommandError(args, 'exited %d' % o) |
435 | 428 | ||
436 | def RunXdelta3(args,kind=FORK): | 429 | def RunXdelta3(args): |
437 | if 0: # kind == FORK: | 430 | try: |
438 | RunCommand([XD3CMD] + args) | 431 | xdelta3.main(args) |
439 | else: | 432 | except Exception, e: |
440 | try: | 433 | raise CommandError(args, "xdelta3.main exception") |
441 | xdelta3.main(args) | ||
442 | except Exception, e: | ||
443 | raise CommandError(args, "xdelta3.main exception") | ||
444 | 434 | ||
445 | class GzipInfo: | 435 | class GzipInfo: |
446 | def __init__(self,target,delta): | 436 | def __init__(self,target,delta): |
@@ -449,13 +439,7 @@ class GzipInfo: | |||
449 | 439 | ||
450 | class Xdelta3Info: | 440 | class Xdelta3Info: |
451 | def __init__(self,target,delta): | 441 | def __init__(self,target,delta): |
452 | RunXdelta3(['printhdr', | 442 | self.extcomp = 0 # @@@ |
453 | '-f', | ||
454 | delta, | ||
455 | HFILE]) | ||
456 | o = open(HFILE, "r") | ||
457 | l = o.readline() | ||
458 | self.extcomp = 0 | ||
459 | self.hdrsize = 0 | 443 | self.hdrsize = 0 |
460 | self.tgtsize = os.stat(target).st_size | 444 | self.tgtsize = os.stat(target).st_size |
461 | self.dsize = os.stat(delta).st_size | 445 | self.dsize = os.stat(delta).st_size |
@@ -463,19 +447,25 @@ class Xdelta3Info: | |||
463 | self.ideal = 100.0 * self.dsize / self.tgtsize; | 447 | self.ideal = 100.0 * self.dsize / self.tgtsize; |
464 | else: | 448 | else: |
465 | self.ideal = 0.0 | 449 | self.ideal = 0.0 |
466 | while l: | 450 | # RunXdelta3(['printhdr', |
467 | #print l.strip() | 451 | # '-f', |
468 | m = RE_HDRSZ.match(l) | 452 | # delta, |
469 | if m: | 453 | # HFILE]) |
470 | self.hdrsize = int(m.group(1)) | 454 | # o = open(HFILE, "r") |
471 | m = RE_EXTCOMP.match(l) | 455 | # l = o.readline() |
472 | if m: | 456 | # while l: |
473 | #print 'EXTCOMP', m.group(0) | 457 | # #print l.strip() |
474 | self.extcomp = 1 | 458 | # m = RE_HDRSZ.match(l) |
475 | l = o.readline() | 459 | # if m: |
476 | if self.hdrsize == 0: | 460 | # self.hdrsize = int(m.group(1)) |
477 | raise CommandError(cmd, 'no hdrsize') | 461 | # m = RE_EXTCOMP.match(l) |
478 | o.close() | 462 | # if m: |
463 | # #print 'EXTCOMP', m.group(0) | ||
464 | # self.extcomp = 1 | ||
465 | # l = o.readline() | ||
466 | # if self.hdrsize == 0: | ||
467 | # raise CommandError(cmd, 'no hdrsize') | ||
468 | # o.close() | ||
479 | 469 | ||
480 | class Xdelta3Pair: | 470 | class Xdelta3Pair: |
481 | def __init__(self): | 471 | def __init__(self): |
@@ -542,16 +532,15 @@ def Decimals(max): | |||
542 | return l | 532 | return l |
543 | 533 | ||
544 | class Xdelta3Run1: | 534 | class Xdelta3Run1: |
545 | def __init__(self,file,kind,reps=0): | 535 | def __init__(self,file,reps=0): |
546 | self.file = file | 536 | self.file = file |
547 | self.reps = reps | 537 | self.reps = reps |
548 | self.canrep = 1 | 538 | self.canrep = 1 |
549 | self.kind = kind | ||
550 | def Run(self,trial,reps): | 539 | def Run(self,trial,reps): |
551 | if self.reps: | 540 | if self.reps: |
552 | assert(reps == 1) | 541 | assert(reps == 1) |
553 | reps = self.reps | 542 | reps = self.reps |
554 | RunXdelta3(['-vvv', '-P', '%d' % reps, '-efq', self.file, DFILE],kind=self.kind) | 543 | RunXdelta3(['-P', '%d' % reps, '-efq', self.file, DFILE]) |
555 | if trial > 0: | 544 | if trial > 0: |
556 | return None | 545 | return None |
557 | return Xdelta3Info(self.file,DFILE) | 546 | return Xdelta3Info(self.file,DFILE) |
@@ -580,7 +569,7 @@ def ReportSpeed(L,tr,desc): | |||
580 | def RunSpeed(): | 569 | def RunSpeed(): |
581 | for L in Decimals(MAX_RUN): | 570 | for L in Decimals(MAX_RUN): |
582 | SetFileSize(RUNFILE, L) | 571 | SetFileSize(RUNFILE, L) |
583 | trx = TimeRun(Xdelta3Run1(RUNFILE,kind=PYEXT)) | 572 | trx = TimeRun(Xdelta3Run1(RUNFILE)) |
584 | ReportSpeed(L,trx,'xdelta3') | 573 | ReportSpeed(L,trx,'xdelta3') |
585 | trg = TimeRun(GzipRun1(RUNFILE)) | 574 | trg = TimeRun(GzipRun1(RUNFILE)) |
586 | ReportSpeed(L,trg,'gzip ') | 575 | ReportSpeed(L,trg,'gzip ') |
diff --git a/xdelta3/xdelta3.prj b/xdelta3/xdelta3.prj index fda614b..4bb85e5 100755 --- a/xdelta3/xdelta3.prj +++ b/xdelta3/xdelta3.prj | |||
@@ -9,7 +9,7 @@ | |||
9 | (Checkin-Login jmacd) | 9 | (Checkin-Login jmacd) |
10 | (Populate-Ignore ()) | 10 | (Populate-Ignore ()) |
11 | (Project-Keywords | 11 | (Project-Keywords |
12 | (Xdelta3Version "0i") | 12 | (Xdelta3Version "0j") |
13 | (WWWLeftNavBar "<table cellpadding=\"20px\" width=700> <tr> <td class=\"leftbdr\" valign=top height=600 width=100> <div class=\"leftbody\"> <h1>Xdelta</h1> <a href=\"xdelta3.html\">overview</a><br> <a href=\"xdelta3-cmdline.html\">command line</a><br> <a href=\"xdelta3-api-guide.html\">api guide</a><br> <br><a href=\"http://xdelta.org\">xdelta.org</a></h2> </div> </td> <td valign=top width=500>") | 13 | (WWWLeftNavBar "<table cellpadding=\"20px\" width=700> <tr> <td class=\"leftbdr\" valign=top height=600 width=100> <div class=\"leftbody\"> <h1>Xdelta</h1> <a href=\"xdelta3.html\">overview</a><br> <a href=\"xdelta3-cmdline.html\">command line</a><br> <a href=\"xdelta3-api-guide.html\">api guide</a><br> <br><a href=\"http://xdelta.org\">xdelta.org</a></h2> </div> </td> <td valign=top width=500>") |
14 | ) | 14 | ) |
15 | (Files | 15 | (Files |
@@ -40,6 +40,10 @@ | |||
40 | (badcopy.c (xdelta3/20_badcopy.c 1.1 644)) | 40 | (badcopy.c (xdelta3/20_badcopy.c 1.1 644)) |
41 | (linkxd3lib.c (xdelta3/19_linkxd3lib 1.1 644)) | 41 | (linkxd3lib.c (xdelta3/19_linkxd3lib 1.1 644)) |
42 | (rcs_junk.cc (xdelta3/15_rcs_junk.c 1.1 644)) | 42 | (rcs_junk.cc (xdelta3/15_rcs_junk.c 1.1 644)) |
43 | |||
44 | (README ()) | ||
45 | (badcopy.vcproj ()) | ||
46 | (xdelta3.vcproj ()) | ||
43 | ) | 47 | ) |
44 | (Merge-Parents) | 48 | (Merge-Parents) |
45 | (New-Merge-Parents) | 49 | (New-Merge-Parents) |