| 
														
															@@ -1,4 +1,5 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import configparser 
														 | 
														
														 | 
														
															 import configparser 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import json 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import os 
														 | 
														
														 | 
														
															 import os 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import shutil 
														 | 
														
														 | 
														
															 import shutil 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import stat 
														 | 
														
														 | 
														
															 import stat 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -407,6 +408,7 @@ Chunk index:    {0.total_unique_chunks:20d} {0.total_chunks:20d}""" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def __init__(self, iec=False): 
														 | 
														
														 | 
														
															     def __init__(self, iec=False): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.iec = iec 
														 | 
														
														 | 
														
															         self.iec = iec 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        self.pre12_meta = {}  # here we cache archive metadata for borg < 1.2 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def __str__(self): 
														 | 
														
														 | 
														
															     def __str__(self): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return self.str_format.format(self.format_tuple()) 
														 | 
														
														 | 
														
															         return self.str_format.format(self.format_tuple()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -511,6 +513,8 @@ class LocalCache(CacheStatsMixin): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         os.makedirs(os.path.join(self.path, 'chunks.archive.d')) 
														 | 
														
														 | 
														
															         os.makedirs(os.path.join(self.path, 'chunks.archive.d')) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         with SaveFile(os.path.join(self.path, files_cache_name()), binary=True): 
														 | 
														
														 | 
														
															         with SaveFile(os.path.join(self.path, files_cache_name()), binary=True): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             pass  # empty file 
														 | 
														
														 | 
														
															             pass  # empty file 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        with SaveFile(os.path.join(self.path, 'pre12-meta'), binary=False) as fd: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            json.dump(self.pre12_meta, fd, indent=4) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def _do_open(self): 
														 | 
														
														 | 
														
															     def _do_open(self): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.cache_config.load() 
														 | 
														
														 | 
														
															         self.cache_config.load() 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -521,6 +525,11 @@ class LocalCache(CacheStatsMixin): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             self.files = None 
														 | 
														
														 | 
														
															             self.files = None 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         else: 
														 | 
														
														 | 
														
															         else: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             self._read_files() 
														 | 
														
														 | 
														
															             self._read_files() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        try: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            with open(os.path.join(self.path, 'pre12-meta')) as fd: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                self.pre12_meta = json.load(fd) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        except (FileNotFoundError, json.JSONDecodeError): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            pass 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def open(self): 
														 | 
														
														 | 
														
															     def open(self): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if not os.path.isdir(self.path): 
														 | 
														
														 | 
														
															         if not os.path.isdir(self.path): 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -529,6 +538,9 @@ class LocalCache(CacheStatsMixin): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.rollback() 
														 | 
														
														 | 
														
															         self.rollback() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def close(self): 
														 | 
														
														 | 
														
															     def close(self): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        # save the pre12_meta cache in any case 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        with open(os.path.join(self.path, 'pre12-meta'), 'w') as fd: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            json.dump(self.pre12_meta, fd, indent=4) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if self.cache_config is not None: 
														 | 
														
														 | 
														
															         if self.cache_config is not None: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             self.cache_config.close() 
														 | 
														
														 | 
														
															             self.cache_config.close() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             self.cache_config = None 
														 | 
														
														 | 
														
															             self.cache_config = None 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1066,6 +1078,7 @@ Chunk index:    {0.total_unique_chunks:20d}             unknown""" 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.security_manager = SecurityManager(repository) 
														 | 
														
														 | 
														
															         self.security_manager = SecurityManager(repository) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         self.security_manager.assert_secure(manifest, key, lock_wait=lock_wait) 
														 | 
														
														 | 
														
															         self.security_manager.assert_secure(manifest, key, lock_wait=lock_wait) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        self.pre12_meta = {} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         logger.warning('Note: --no-cache-sync is an experimental feature.') 
														 | 
														
														 | 
														
															         logger.warning('Note: --no-cache-sync is an experimental feature.') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # Public API 
														 | 
														
														 | 
														
															     # Public API 
														 |