parent
93514ae149
commit
f598a7fd41
|
@ -33,9 +33,9 @@ def replace_variable(apkbuild, value: str) -> str:
|
||||||
apkbuild[match.group(1)]))
|
apkbuild[match.group(1)]))
|
||||||
value = value.replace(match.group(0), apkbuild[match.group(1)], 1)
|
value = value.replace(match.group(0), apkbuild[match.group(1)], 1)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logging.debug("{}: key '{}' for replacing '{}' not found, ignoring"
|
logging.verbose("{}: key '{}' for replacing '{}' not found, ignoring"
|
||||||
"".format(apkbuild["pkgname"], match.group(1),
|
"".format(apkbuild["pkgname"], match.group(1),
|
||||||
match.group(0)))
|
match.group(0)))
|
||||||
|
|
||||||
# $foo
|
# $foo
|
||||||
for match in revar2.finditer(value):
|
for match in revar2.finditer(value):
|
||||||
|
@ -46,9 +46,9 @@ def replace_variable(apkbuild, value: str) -> str:
|
||||||
newvalue))
|
newvalue))
|
||||||
value = value.replace(match.group(0), newvalue, 1)
|
value = value.replace(match.group(0), newvalue, 1)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logging.debug("{}: key '{}' for replacing '{}' not found, ignoring"
|
logging.verbose("{}: key '{}' for replacing '{}' not found, ignoring"
|
||||||
"".format(apkbuild["pkgname"], match.group(1),
|
"".format(apkbuild["pkgname"], match.group(1),
|
||||||
match.group(0)))
|
match.group(0)))
|
||||||
|
|
||||||
# ${var/foo/bar}, ${var/foo/}, ${var/foo}
|
# ${var/foo/bar}, ${var/foo/}, ${var/foo}
|
||||||
for match in revar3.finditer(value):
|
for match in revar3.finditer(value):
|
||||||
|
@ -63,9 +63,9 @@ def replace_variable(apkbuild, value: str) -> str:
|
||||||
apkbuild["pkgname"], match.group(0), newvalue))
|
apkbuild["pkgname"], match.group(0), newvalue))
|
||||||
value = value.replace(match.group(0), newvalue, 1)
|
value = value.replace(match.group(0), newvalue, 1)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logging.debug("{}: key '{}' for replacing '{}' not found, ignoring"
|
logging.verbose("{}: key '{}' for replacing '{}' not found, ignoring"
|
||||||
"".format(apkbuild["pkgname"], match.group(1),
|
"".format(apkbuild["pkgname"], match.group(1),
|
||||||
match.group(0)))
|
match.group(0)))
|
||||||
|
|
||||||
# ${foo#bar}
|
# ${foo#bar}
|
||||||
rematch4 = revar4.finditer(value)
|
rematch4 = revar4.finditer(value)
|
||||||
|
@ -79,9 +79,9 @@ def replace_variable(apkbuild, value: str) -> str:
|
||||||
apkbuild["pkgname"], match.group(0), newvalue))
|
apkbuild["pkgname"], match.group(0), newvalue))
|
||||||
value = value.replace(match.group(0), newvalue, 1)
|
value = value.replace(match.group(0), newvalue, 1)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logging.debug("{}: key '{}' for replacing '{}' not found, ignoring"
|
logging.verbose("{}: key '{}' for replacing '{}' not found, ignoring"
|
||||||
"".format(apkbuild["pkgname"], match.group(1),
|
"".format(apkbuild["pkgname"], match.group(1),
|
||||||
match.group(0)))
|
match.group(0)))
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue