Skip to content

Commit

Permalink
Cleanup formatting, reduce drive search
Browse files Browse the repository at this point in the history
  • Loading branch information
danyeaw authored and nacho committed Jun 26, 2024
1 parent cbded6f commit af5a653
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions gvsbuild/utils/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
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 @@ -231,10 +230,21 @@ 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):
# 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]
drive_letters = ("C:", "D:", "E:", "F:")
possible_drives = [
drive for drive in drive_letters if os.path.exists(drive)
]
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):
Expand Down

0 comments on commit af5a653

Please sign in to comment.