mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-24 19:38:36 +09:00
🐛 Removed duplicate patches
This commit is contained in:
@@ -40,7 +40,11 @@ def main() -> None:
|
||||
logger.exception(f"Failed to build {app} because of {e}")
|
||||
if len(config.alternative_youtube_patches) and "youtube" in config.apps:
|
||||
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)
|
||||
if was_inverted:
|
||||
logger.info(
|
||||
@@ -58,7 +62,11 @@ def main() -> None:
|
||||
)
|
||||
if len(config.alternative_youtube_music_patches) and "youtube_music" in config.apps:
|
||||
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)
|
||||
if was_inverted:
|
||||
logger.info(
|
||||
|
||||
+6
-4
@@ -50,10 +50,12 @@ class Parser(object):
|
||||
patches."""
|
||||
try:
|
||||
patch_index = self._PATCHES.index(name)
|
||||
if self._PATCHES[patch_index - 1] == "-e":
|
||||
self._PATCHES[patch_index - 1] = "-i"
|
||||
else:
|
||||
self._PATCHES[patch_index - 1] = "-e"
|
||||
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":
|
||||
self._PATCHES[patch_index - 1] = "-i"
|
||||
else:
|
||||
self._PATCHES[patch_index - 1] = "-e"
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user