forked from distok/cutthecord
patchport: Fix a bug preventing patches from being ported
This commit is contained in:
parent
f437434a2d
commit
9a613e374e
1 changed files with 9 additions and 1 deletions
10
patchport.py
10
patchport.py
|
@ -20,6 +20,9 @@ cutthecord_folder = os.path.dirname(os.path.realpath(__file__))
|
||||||
debug = False
|
debug = False
|
||||||
tmp_folder = "/tmp/patchport"
|
tmp_folder = "/tmp/patchport"
|
||||||
|
|
||||||
|
if debug:
|
||||||
|
print(f"ctc folder: {cutthecord_folder}")
|
||||||
|
|
||||||
|
|
||||||
def modify_patch(patch_name, patch_path):
|
def modify_patch(patch_name, patch_path):
|
||||||
with open(patch_path) as f:
|
with open(patch_path) as f:
|
||||||
|
@ -112,8 +115,13 @@ with open(os.path.join(apk_folder, "res", "values", "strings.xml")) as f:
|
||||||
failures = []
|
failures = []
|
||||||
|
|
||||||
for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
|
for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
|
||||||
|
if debug:
|
||||||
|
print(f"going over patch: {patch}")
|
||||||
|
|
||||||
# Ignore non-dirs
|
# Ignore non-dirs
|
||||||
if not os.path.isdir(patch):
|
if not os.path.isdir(os.path.join(cutthecord_folder, "patches", patch)):
|
||||||
|
if debug:
|
||||||
|
print(f"patch is not a folder, skipping: {patch}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
patch_path = os.path.join(cutthecord_folder, "patches", patch,
|
patch_path = os.path.join(cutthecord_folder, "patches", patch,
|
||||||
|
|
Loading…
Reference in a new issue