Skip to content

Commit f28f926

Browse files
author
David Scott
committed
Work with both tar-format.0.2.1 and tar-format.0.3.0
Fixes xapi-project#21 Signed-off-by: David Scott <dave.scott@citrix.com>
1 parent 0bdafc5 commit f28f926

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/impl.ml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,11 @@ module TarStream = struct
319319
}
320320

321321
let make_tar_header prefix counter suffix file_size =
322-
Tar.Header.({
323-
file_name = Printf.sprintf "%s%08d%s" prefix counter suffix;
324-
file_mode = 0o644;
325-
user_id = 0;
326-
group_id = 0;
327-
file_size = Int64.of_int file_size;
328-
mod_time = Int64.of_float (Unix.gettimeofday ());
329-
link_indicator = Tar.Header.Link.Normal;
330-
link_name = ""
331-
})
322+
Tar.Header.make
323+
~mod_time:(Int64.of_float (Unix.gettimeofday ()))
324+
~file_mode:0o0644
325+
(Printf.sprintf "%s%08d%s" prefix counter suffix)
326+
(Int64.of_int file_size)
332327
end
333328

334329
let stream_tar common c s _ prefix ?(progress = no_progress_bar) () =

0 commit comments

Comments
 (0)