🐛 Removed duplicate patches

This commit is contained in:
Nikhil Badyal
2023-07-05 22:17:20 +05:30
parent 1b0e5fd27e
commit 6decdc0efb
2 changed files with 16 additions and 6 deletions
+10 -2
View File
@@ -40,7 +40,11 @@ def main() -> None:
logger.exception(f"Failed to build {app} because of {e}") logger.exception(f"Failed to build {app} because of {e}")
if len(config.alternative_youtube_patches) and "youtube" in config.apps: if len(config.alternative_youtube_patches) and "youtube" in config.apps:
for alternative_patch in config.alternative_youtube_patches: for alternative_patch in config.alternative_youtube_patches:
_, version, is_experimental = patcher.get_app_configs("youtube") parser = Parser(patcher, config)
app_all_patches, version, is_experimental = patcher.get_app_configs(
"youtube"
)
patcher.include_exclude_patch("youtube", parser, app_all_patches)
was_inverted = parser.invert_patch(alternative_patch) was_inverted = parser.invert_patch(alternative_patch)
if was_inverted: if was_inverted:
logger.info( logger.info(
@@ -58,7 +62,11 @@ def main() -> None:
) )
if len(config.alternative_youtube_music_patches) and "youtube_music" in config.apps: if len(config.alternative_youtube_music_patches) and "youtube_music" in config.apps:
for alternative_patch in config.alternative_youtube_music_patches: for alternative_patch in config.alternative_youtube_music_patches:
_, version, is_experimental = patcher.get_app_configs("youtube_music") parser = Parser(patcher, config)
app_all_patches, version, is_experimental = patcher.get_app_configs(
"youtube_music"
)
patcher.include_exclude_patch("youtube_music", parser, app_all_patches)
was_inverted = parser.invert_patch(alternative_patch) was_inverted = parser.invert_patch(alternative_patch)
if was_inverted: if was_inverted:
logger.info( logger.info(
+2
View File
@@ -50,6 +50,8 @@ class Parser(object):
patches.""" patches."""
try: try:
patch_index = self._PATCHES.index(name) patch_index = self._PATCHES.index(name)
indices = [i for i in range(len(self._PATCHES)) if self._PATCHES[i] == name]
for patch_index in indices:
if self._PATCHES[patch_index - 1] == "-e": if self._PATCHES[patch_index - 1] == "-e":
self._PATCHES[patch_index - 1] = "-i" self._PATCHES[patch_index - 1] = "-i"
else: else: