Skip to content

Commit

Permalink
Correct - Extend msys search to all possible drives
Browse files Browse the repository at this point in the history
Corrected version - Previously, the code was only checking for the msys installation in the C drive. This commit extends the search to all possible drives on the system. It generates all possible paths by combining each drive letter with each possible path, and then checks each one. This ensures that the msys installation can be found regardless of the drive it's installed on.
I proposed a change for a mid file by mistake, this one is working fine with a different drive letter.
  • Loading branch information
raikoug authored and nacho committed Jun 26, 2024
1 parent c41b35d commit cbded6f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gvsbuild/utils/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from typing import Optional
from urllib.error import ContentTooShortError, URLError
from urllib.request import urlopen
from string import ascii_uppercase

from .base_expanders import dirlist2set, make_zip
from .base_project import Project
Expand Down Expand Up @@ -230,13 +231,12 @@ def __check_tools(self, opts):
log.start("Checking msys tool")
msys_path = opts.msys_dir
if not msys_path or not Path.exists(msys_path):
msys_paths = [
Path(r"C:\msys64"),
Path(r"C:\msys32"),
Path(r"C:\tools\msys64"),
Path(r"C:\tools\msys32"),
]
for path in msys_paths:
# list of drive letters to check
possible_drives = ['%s:' % d for d in ascii_uppercase if os.path.exists('%s:' % d)]
possible_paths = [r"\msys64", r"\tools\msys64", r"\msys32", r"\tools\msys32"]
all_possible_paths = [Path(drive + path) for drive in possible_drives for path in possible_paths]

for path in all_possible_paths:
if Path.exists(path):
msys_path = path
self.opts.msys_dir = str(msys_path)
Expand Down

0 comments on commit cbded6f

Please sign in to comment.