summaryrefslogtreecommitdiff
path: root/xdelta3
diff options
context:
space:
mode:
authordotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e>2007-01-07 03:33:47 +0000
committerdotdotisdead <dotdotisdead@a3eca27d-f21b-0410-9b4a-6511e771f64e>2007-01-07 03:33:47 +0000
commit08fa3e3b1e873284007e44a6e8402c060f23346a (patch)
tree81a54959fbfeda43a82b8fa2045f86c8f3f6fff5 /xdelta3
parent6b8007761b66db36f7863cfb42270a8d0c8b9077 (diff)
Fixes spurious warning from printhdr.
Diffstat (limited to 'xdelta3')
-rwxr-xr-xxdelta3/xdelta3-main.h6
-rwxr-xr-xxdelta3/xdelta3-regtest.py23
2 files changed, 6 insertions, 23 deletions
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h
index 6374361..7932039 100755
--- a/xdelta3/xdelta3-main.h
+++ b/xdelta3/xdelta3-main.h
@@ -2178,6 +2178,7 @@ main_input (xd3_cmd cmd,
2178 xoff_t last_total_out = 0; 2178 xoff_t last_total_out = 0;
2179 long start_time; 2179 long start_time;
2180 xoff_t input_size = 0; 2180 xoff_t input_size = 0;
2181 int stdout_only = 0;
2181 2182
2182 int (*input_func) (xd3_stream*); 2183 int (*input_func) (xd3_stream*);
2183 int (*output_func) (xd3_stream*, main_file *); 2184 int (*output_func) (xd3_stream*, main_file *);
@@ -2202,6 +2203,7 @@ main_input (xd3_cmd cmd,
2202 input_func = xd3_decode_input; 2203 input_func = xd3_decode_input;
2203 output_func = main_print_func; 2204 output_func = main_print_func;
2204 stream_flags |= XD3_ADLER32_NOVER; 2205 stream_flags |= XD3_ADLER32_NOVER;
2206 stdout_only = 1;
2205 break; 2207 break;
2206#endif 2208#endif
2207#if XD3_ENCODER 2209#if XD3_ENCODER
@@ -2546,10 +2548,10 @@ done:
2546 /* If output file is not open yet because of delayed-open, it means we never encountered 2548 /* If output file is not open yet because of delayed-open, it means we never encountered
2547 * a window in the delta, but it could have had a VCDIFF header? TODO: solve this 2549 * a window in the delta, but it could have had a VCDIFF header? TODO: solve this
2548 * elsewhere. For now, it prints "nothing to output" below, but the check doesn't 2550 * elsewhere. For now, it prints "nothing to output" below, but the check doesn't
2549 * happen in case of option_no_output. */ 2551 * happen in case of option_no_output. */
2550 if (! option_no_output) 2552 if (! option_no_output)
2551 { 2553 {
2552 if (! main_file_isopen (ofile)) 2554 if (!stdout_only && ! main_file_isopen (ofile))
2553 { 2555 {
2554 XPR(NT "nothing to output: %s\n", ifile->filename); 2556 XPR(NT "nothing to output: %s\n", ifile->filename);
2555 return EXIT_FAILURE; 2557 return EXIT_FAILURE;
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py
index 6590792..5e947be 100755
--- a/xdelta3/xdelta3-regtest.py
+++ b/xdelta3/xdelta3-regtest.py
@@ -439,33 +439,14 @@ class GzipInfo:
439 439
440class Xdelta3Info: 440class Xdelta3Info:
441 def __init__(self,target,delta): 441 def __init__(self,target,delta):
442 self.extcomp = 0 # @@@ 442 self.extcomp = 0 # TODO: I removed some code that called printhdr
443 self.hdrsize = 0 443 self.hdrsize = 0 # to compute these, but printhdr uses stdout (now)
444 self.tgtsize = os.stat(target).st_size 444 self.tgtsize = os.stat(target).st_size
445 self.dsize = os.stat(delta).st_size 445 self.dsize = os.stat(delta).st_size
446 if self.tgtsize > 0: 446 if self.tgtsize > 0:
447 self.ideal = 100.0 * self.dsize / self.tgtsize; 447 self.ideal = 100.0 * self.dsize / self.tgtsize;
448 else: 448 else:
449 self.ideal = 0.0 449 self.ideal = 0.0
450# RunXdelta3(['printhdr',
451# '-f',
452# delta,
453# HFILE])
454# o = open(HFILE, "r")
455# l = o.readline()
456# while l:
457# #print l.strip()
458# m = RE_HDRSZ.match(l)
459# if m:
460# self.hdrsize = int(m.group(1))
461# m = RE_EXTCOMP.match(l)
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()
469 450
470class Xdelta3Pair: 451class Xdelta3Pair:
471 def __init__(self): 452 def __init__(self):