From ee67ce29eb34c56740bf985166194aad034e3cd3 Mon Sep 17 00:00:00 2001 From: Oscar Lesta Date: Sun, 30 Apr 2023 06:29:29 -0300 Subject: [PATCH] Support commented out lines in the PATCHES section. We could have commented out lines in PROVIDES, and REQUIRES, but not in PATCHES, as those lines weren't being filtered out, ending on "file not found" errors further down. --- HaikuPorter/Port.py | 4 +++- HaikuPorter/Source.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/HaikuPorter/Port.py b/HaikuPorter/Port.py index 1dc3782a..52d73ec3 100644 --- a/HaikuPorter/Port.py +++ b/HaikuPorter/Port.py @@ -338,7 +338,9 @@ def validateRecipeFile(self, showWarnings=False): # collect all referenced patches into a single list if key in entries and entries[key]: for index in entries[key].keys(): - allPatches += entries[key][index] + allPatches += [ + e for e in entries[key][index] if not e.strip(' \t').startswith('#') + ] # store extension-specific value under base key recipeKeys[baseKey] = entries[key] diff --git a/HaikuPorter/Source.py b/HaikuPorter/Source.py index b286a9c5..f62e5cfa 100644 --- a/HaikuPorter/Source.py +++ b/HaikuPorter/Source.py @@ -63,7 +63,8 @@ def __init__(self, port, index, uris, fetchTargetName, checksum, # make those absolute paths. if self.patches and port.patchesDir: self.patches = [ - port.patchesDir + '/' + patch for patch in self.patches + port.patchesDir + '/' + + patch for patch in self.patches if not patch.strip(' \t').startswith('#') ] # ADDITIONAL_FILES refers to the files relative to the additional-files