|
@@ -381,6 +381,23 @@ class Archive:
|
|
|
item.update(self.stat_attrs(st, path))
|
|
|
self.add_item(item)
|
|
|
|
|
|
+ def process_stdin(self, path, cache):
|
|
|
+ uid, gid = 0, 0
|
|
|
+ fd = sys.stdin.buffer # binary
|
|
|
+ chunks = []
|
|
|
+ for chunk in self.chunker.chunkify(fd):
|
|
|
+ chunks.append(cache.add_chunk(self.key.id_hash(chunk), chunk, self.stats))
|
|
|
+ self.stats.nfiles += 1
|
|
|
+ item = {
|
|
|
+ b'path': path,
|
|
|
+ b'chunks': chunks,
|
|
|
+ b'mode': 0o100660, # regular file, ug=rw
|
|
|
+ b'uid': uid, b'user': uid2user(uid),
|
|
|
+ b'gid': gid, b'group': gid2group(gid),
|
|
|
+ b'mtime': int_to_bigint(int(time.time()) * 1000000000)
|
|
|
+ }
|
|
|
+ self.add_item(item)
|
|
|
+
|
|
|
def process_file(self, path, st, cache):
|
|
|
safe_path = make_path_safe(path)
|
|
|
# Is it a hard link?
|