This commit is contained in:
Gregory 2023-04-05 18:07:23 -07:00
parent 63c6df152b
commit 686ece1eb7

View File

@ -494,7 +494,7 @@ def _current_root(self):
if not os.path.exists(self.root): if not os.path.exists(self.root):
return None return None
view = self.view(created_path=False) view = self.view()
orig_path = view.metadata.get("created_path", None) orig_path = view.metadata.get("created_path", None)
if orig_path: if orig_path:
return orig_path return orig_path
@ -537,7 +537,7 @@ def get_projection_for_spec(self, spec):
view = self.view() view = self.view()
return view.get_projection_for_spec(spec) return view.get_projection_for_spec(spec)
def view(self, new=None, created_path=True): def view(self, new=None, created_path=False):
""" """
Generate the FilesystemView object for this ViewDescriptor Generate the FilesystemView object for this ViewDescriptor
@ -550,6 +550,10 @@ def view(self, new=None, created_path=True):
new (str or None): If a string, create a FilesystemView new (str or None): If a string, create a FilesystemView
rooted at that path. Default None. This should only be used to rooted at that path. Default None. This should only be used to
regenerate the view, and cannot be used to access specs. regenerate the view, and cannot be used to access specs.
created_path (bool): Pass metadata on the path the view was created in to the
underlying view implementation. Default False. This option should be enabled
when creating a view to add packages to, but not when creating a view object
to query an existing view.
""" """
root = new if new else self.root root = new if new else self.root
@ -708,7 +712,7 @@ def regenerate(self, concretized_root_specs, force=False):
if specs: if specs:
tty.msg("Updating view at {0}".format(self.root)) tty.msg("Updating view at {0}".format(self.root))
view = self.view(new=new_root) view = self.view(new=new_root, created_path=True)
# Create a new view # Create a new view
try: try: