fontgen: assume plain .patch for single string patch
This commit is contained in:
parent
8b2e1c69f2
commit
27e598f3fa
2 changed files with 12 additions and 5 deletions
|
@ -12,7 +12,7 @@
|
||||||
],
|
],
|
||||||
"bpp": 1,
|
"bpp": 1,
|
||||||
"size": 20,
|
"size": 20,
|
||||||
"patches": [["patch", "{file}", "{file}_zero.patch"]]
|
"patches": ["{file}_zero.patch"]
|
||||||
},
|
},
|
||||||
"jetbrains_mono_42": {
|
"jetbrains_mono_42": {
|
||||||
"sources": [
|
"sources": [
|
||||||
|
|
|
@ -66,11 +66,18 @@ def main():
|
||||||
subprocess.check_call(line)
|
subprocess.check_call(line)
|
||||||
if patches:
|
if patches:
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
try: patch = patch.format(name=name, file=name+'.c')
|
try:
|
||||||
except: pass
|
# Try and patch, if given a string
|
||||||
try: patch = [arg.format(name=name, file=name+'.c') for arg in patch]
|
patch = patch.format(name=name, file=name+'.c')
|
||||||
|
subprocess.check_call(['/usr/bin/patch', name+'.c', patch])
|
||||||
|
continue
|
||||||
except: pass
|
except: pass
|
||||||
|
try:
|
||||||
|
# otherwise, assume a "advanced" patch, which is a list of strings.
|
||||||
|
patch = [arg.format(name=name, file=name+'.c') for arg in patch]
|
||||||
subprocess.check_call(patch)
|
subprocess.check_call(patch)
|
||||||
|
except Exception as e:
|
||||||
|
sys.exit('Failed to patch using "{patch}"\n{err}'.format(patch=patch,err=e))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue