@@ -78,8 +78,9 @@ def get(self, path: str) -> ZipFile:
7878class ZipROFS (Operations ):
7979 zip_factory = CachedZipFactory ()
8080
81- def __init__ (self , root ):
81+ def __init__ (self , root , zip_check ):
8282 self .root = realpath (root )
83+ self .zip_check = zip_check
8384 # odd file handles are files inside zip, even fhs are system-wide files
8485 self ._zip_file_fh : Dict [int , zipfile .ZipExtFile ] = {}
8586 self ._zip_zfile_fh : Dict [int , ZipFile ] = {}
@@ -95,8 +96,7 @@ def _get_free_zip_fh(self):
9596 i += 2
9697 return i
9798
98- @staticmethod
99- def get_zip_path (path : str ) -> Optional [str ]:
99+ def get_zip_path (self , path : str ) -> Optional [str ]:
100100 parts = []
101101 head , tail = os .path .split (path )
102102 while tail :
@@ -106,8 +106,8 @@ def get_zip_path(path: str) -> Optional[str]:
106106 cur_path = '/'
107107 for part in parts :
108108 cur_path = os .path .join (cur_path , part )
109- if part [- 4 :] == '.zip' and is_zipfile ( cur_path ,
110- os .lstat (cur_path ).st_mtime ):
109+ if part [- 4 :] == '.zip' and (
110+ not self . zip_check or is_zipfile ( cur_path , os .lstat (cur_path ).st_mtime ) ):
111111 return cur_path
112112 return None
113113
@@ -297,7 +297,8 @@ def parse_mount_opts(in_str):
297297 help = "filesystem mount point" )
298298 parser .add_argument (
299299 '-o' , metavar = 'options' , dest = 'opts' ,
300- help = "comma separated list of options: foreground, debug, allowother, async, cachesize=N" ,
300+ help = "comma separated list of options: foreground, debug, allowother, "
301+ "nozipcheck, async, cachesize=N" ,
301302 type = parse_mount_opts , default = {})
302303 arg = parser .parse_args ()
303304
@@ -310,10 +311,12 @@ def parse_mount_opts(in_str):
310311 logging .basicConfig (
311312 level = logging .DEBUG if 'debug' in arg .opts else logging .INFO )
312313
314+ zip_check = 'nozipcheck' not in arg .opts
315+
313316 if 'debug' in arg .opts :
314- fs = ZipROFSDebug (arg .root )
317+ fs = ZipROFSDebug (arg .root , zip_check )
315318 else :
316- fs = ZipROFS (arg .root )
319+ fs = ZipROFS (arg .root , zip_check )
317320
318321 fuse = ZipROFuse (
319322 fs ,
0 commit comments