• Home
  • Raw
  • Download

Lines Matching +full:path +full:- +full:is +full:- +full:absolute

3 # Use of this source code is governed by a BSD-style license that can be
9 from pathlib import Path
14 def InChroot() -> bool:
19 def VerifyInsideChroot() -> None:
29 def VerifyOutsideChroot() -> None:
39 def VerifyChromeOSRoot(chromeos_root: Union[Path, str]) -> None: argument
40 """Checks whether the path actually points to ChromiumOS checkout root.
43 AssertionError: The path is not ChromiumOS checkout root.
46 subdir = "src/third_party/chromiumos-overlay"
47 path = Path(chromeos_root).expanduser() / subdir
48 msg = f"Wrong ChromeOS path. No {subdir} directory in {chromeos_root} ."
49 assert path.is_dir(), msg
52 def FindChromeOSRootAbove(chromeos_tree_path: Path) -> Path: argument
53 """Returns the root of a ChromeOS tree, given a path in said tree.
58 ValueError if the given path is not in a ChromeOS tree.
66 raise ValueError(f"{chromeos_tree_path} is not in a repo checkout")
70 chromeos_root: Union[Path, str], argument
74 ) -> List[str]:
75 """Gets the chroot path(s) of the package(s).
78 chromeos_root: The absolute path to the chromeos tree to use.
80 be used to find their chroot path.
88 ValueError: Failed to get the chroot path of a package.
95 f"--chroot={chroot_name}",
96 f"--out-dir={out_dir}",
99 # Find the chroot path for each package's ebuild.
102 cros_sdk + ["--", "equery", "w", package],
104 encoding="utf-8",
114 ) -> List[str]:
115 """Converts the chroot path(s) to absolute symlink path(s).
118 chromeos_root: The absolute path to the chroot.
119 chroot_paths: A list of chroot paths to convert to absolute paths.
122 A list of absolute path(s).
125 ValueError: Invalid prefix for the chroot path or
132 # For each chroot file path, remove '/mnt/host/source/' prefix
133 # and combine the chroot path with the result and add it to the list.
137 "Invalid prefix for the chroot path: %s" % chroot_path
140 # combine the chromeos root path + '/src/...'
141 abs_path = os.path.join(chromeos_root, rel_path)