_base_provider.py (snapcraft-4.5.1) | : | _base_provider.py (snapcraft-4.5.2) | ||
---|---|---|---|---|
skipping to change at line 314 | skipping to change at line 314 | |||
) | ) | |||
return True | return True | |||
elif pkg_resources.parse_version( | elif pkg_resources.parse_version( | |||
snapcraft._get_version() | snapcraft._get_version() | |||
) < pkg_resources.parse_version(built_by): | ) < pkg_resources.parse_version(built_by): | |||
self.echoer.warning( | self.echoer.warning( | |||
f"Build environment was created with newer snapcraft version {bu ilt_by!r}, cleaning first." | f"Build environment was created with newer snapcraft version {bu ilt_by!r}, cleaning first." | |||
) | ) | |||
return True | return True | |||
instance_project_dir = info.get("host-project-directory") | ||||
if ( | ||||
instance_project_dir is not None | ||||
and self.project._project_dir != instance_project_dir | ||||
): | ||||
self.echoer.warning( | ||||
f"Build environment project directory changed from {instance_pro | ||||
ject_dir!r}, cleaning first." | ||||
) | ||||
return True | ||||
return False | return False | |||
def _ensure_compatible_build_environment(self) -> None: | def _ensure_compatible_build_environment(self) -> None: | |||
"""Force clean of build-environment if project is not compatible.""" | """Force clean of build-environment if project is not compatible.""" | |||
if self._check_environment_needs_cleaning(): | if self._check_environment_needs_cleaning(): | |||
self.clean_project() | self.clean_project() | |||
def _install_file(self, *, path: str, content: str, permissions: str) -> Non e: | def _install_file(self, *, path: str, content: str, permissions: str) -> Non e: | |||
basename = os.path.basename(path) | basename = os.path.basename(path) | |||
skipping to change at line 462 | skipping to change at line 472 | |||
""" | """ | |||
), | ), | |||
permissions="0644", | permissions="0644", | |||
) | ) | |||
def _setup_snapcraft(self) -> None: | def _setup_snapcraft(self) -> None: | |||
self._save_info( | self._save_info( | |||
data={ | data={ | |||
"base": self.project._get_build_base(), | "base": self.project._get_build_base(), | |||
"created-by-snapcraft-version": snapcraft._get_version(), | "created-by-snapcraft-version": snapcraft._get_version(), | |||
"host-project-directory": self.project._project_dir, | ||||
} | } | |||
) | ) | |||
registry_filepath = os.path.join( | registry_filepath = os.path.join( | |||
self.provider_project_dir, "snap-registry.yaml" | self.provider_project_dir, "snap-registry.yaml" | |||
) | ) | |||
# We do not want to inject from the host if not running from the snap | # We do not want to inject from the host if not running from the snap | |||
# or if the provider cannot handle snap mounts. | # or if the provider cannot handle snap mounts. | |||
# This latter problem should go away when API for retrieving snaps | # This latter problem should go away when API for retrieving snaps | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 12 lines changed or added |