Skip to content

Commit

Permalink
Improve handling of Windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed May 29, 2024
1 parent 841b41d commit d2b6e44
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def create_directories(self) -> None:
os.environ,
"PATH",
os.path.join(self._builder_dest_dir, "bin"),
separator=";" if platform.system() == "Windows" else ":",
separator=os.pathsep,
)

def _build_with_autoconf(self, package: Package, for_builder: bool) -> None:
Expand Down Expand Up @@ -416,11 +416,10 @@ def _environment(self, *, for_builder: bool) -> dict[str, str]:

def _mangle_path(self, path: str) -> str:
if platform.system() == "Windows":
return (
path.replace(os.path.sep, "/").replace("C:", "/c").replace("D:", "/d")
)
else:
return path
path = path.replace(os.path.sep, "/")
if path[1] == ':':
path = f"/{path[0].lower()}{path[2:]}"
return path

def _prefix(self, *, for_builder: bool) -> str:
if for_builder:
Expand Down

0 comments on commit d2b6e44

Please sign in to comment.