(self, skip_version_check=False)
| 1977 | version_file.write(self.name + '\n') |
| 1978 | |
| 1979 | def is_installed(self, skip_version_check=False): |
| 1980 | # If this tool/sdk depends on other tools, require that all dependencies are |
| 1981 | # installed for this tool to count as being installed. |
| 1982 | if self.uses: |
| 1983 | for tool_name in self.uses: |
| 1984 | tool = find_tool(tool_name) |
| 1985 | if tool is None: |
| 1986 | errlog(f"Manifest error: No tool by name '{tool_name}' found! This may indicate an internal SDK error!") |
| 1987 | return False |
| 1988 | if not tool.is_installed(): |
| 1989 | return False |
| 1990 | |
| 1991 | if self.download_url() is None: |
| 1992 | debug_print(f'{self} has no files to download, so is installed by default.') |
| 1993 | return True |
| 1994 | |
| 1995 | content_exists = is_nonempty_directory(self.installation_path()) |
| 1996 | debug_print(f'{self} installation path is {self.installation_path()}, exists: {content_exists}.') |
| 1997 | |
| 1998 | # For e.g. fastcomp clang from git repo, the activated PATH is the |
| 1999 | # directory where the compiler is built to, and installation_path is |
| 2000 | # the directory where the source tree exists. To distinguish between |
| 2001 | # multiple packages sharing the same source (clang-main-32bit, |
| 2002 | # clang-main-64bit, clang-main-32bit and clang-main-64bit each |
| 2003 | # share the same git repo), require that in addition to the installation |
| 2004 | # directory, each item in the activated PATH must exist. |
| 2005 | if self.activated_path and not os.path.exists(self.expand_vars(self.activated_path)): |
| 2006 | content_exists = False |
| 2007 | |
| 2008 | if self.custom_is_installed_script: |
| 2009 | if self.custom_is_installed_script == 'is_binaryen_installed': |
| 2010 | return is_binaryen_installed(self) |
| 2011 | elif self.custom_is_installed_script == 'is_firefox_installed': |
| 2012 | return is_firefox_installed(self) |
| 2013 | else: |
| 2014 | raise Exception(f'Unknown custom_is_installed_script: "{self.custom_is_installed_script}"') |
| 2015 | |
| 2016 | return content_exists and (skip_version_check or self.is_installed_version()) |
| 2017 | |
| 2018 | def is_active(self): |
| 2019 | if not self.is_installed(): |
no test coverage detected