🐛 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
+6 -4
View File
@@ -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