From 1317860ba25950d40ddb7e91a6a688aacaa26ffc Mon Sep 17 00:00:00 2001 From: Antheas Kapenekakis Date: Sun, 4 Aug 2024 06:52:39 +0300 Subject: [PATCH] fixup uid/gid being non-zero --- src/rechunk/ostree.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rechunk/ostree.py b/src/rechunk/ostree.py index 9d85b9a..ec1c812 100644 --- a/src/rechunk/ostree.py +++ b/src/rechunk/ostree.py @@ -14,7 +14,7 @@ def get_ostree_map(repo: str, ref: str): # Prefix has a fixed length # unless filesize is larger than what fits - prefix = len("d00555 0 0") + prefix = len("d00555 ") hash_len = 64 proc = None @@ -47,10 +47,20 @@ def get_ostree_map(repo: str, ref: str): continue ofs = prefix - 1 - # Link count + # UID while line[ofs] != " ": ofs += 1 # Space after + while line[ofs] == " ": + ofs += 1 + # GID + while line[ofs] != " ": + ofs += 1 + while line[ofs] == " ": + ofs += 1 + # Link count + while line[ofs] != " ": + ofs += 1 while line[ofs] == " ": ofs += 1 # Size