fix deprecation warnings in regular expressions (!1804)
From https://docs.python.org/3/library/re.html "Backslashes are not handled in any special way in a string literal prefixed with 'r'." Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
This commit is contained in:
parent
2c4dae736a
commit
3b240e46f7
|
@ -357,7 +357,7 @@ def frontend(args):
|
||||||
" or \"none\"")
|
" or \"none\"")
|
||||||
extra = pmb.helpers.cli.ask(args, "Extra packages", None,
|
extra = pmb.helpers.cli.ask(args, "Extra packages", None,
|
||||||
args.extra_packages,
|
args.extra_packages,
|
||||||
validation_regex="^([-.+\w]+)(,[-.+\w]+)*$")
|
validation_regex=r"^([-.+\w]+)(,[-.+\w]+)*$")
|
||||||
cfg["pmbootstrap"]["extra_packages"] = extra
|
cfg["pmbootstrap"]["extra_packages"] = extra
|
||||||
|
|
||||||
# Configure timezone info
|
# Configure timezone info
|
||||||
|
|
|
@ -170,7 +170,7 @@ def configure_apk(args):
|
||||||
pmb.helpers.run.root(args, ["cp", key, rootfs + "/etc/apk/keys/"])
|
pmb.helpers.run.root(args, ["cp", key, rootfs + "/etc/apk/keys/"])
|
||||||
|
|
||||||
# Disable pmbootstrap repository
|
# Disable pmbootstrap repository
|
||||||
pmb.helpers.run.root(args, ["sed", "-i", "/\/mnt\/pmbootstrap-packages/d",
|
pmb.helpers.run.root(args, ["sed", "-i", r"/\/mnt\/pmbootstrap-packages/d",
|
||||||
rootfs + "/etc/apk/repositories"])
|
rootfs + "/etc/apk/repositories"])
|
||||||
pmb.helpers.run.user(args, ["cat", rootfs + "/etc/apk/repositories"])
|
pmb.helpers.run.user(args, ["cat", rootfs + "/etc/apk/repositories"])
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ def setup_hostname(args):
|
||||||
suffix = "rootfs_" + args.device
|
suffix = "rootfs_" + args.device
|
||||||
pmb.chroot.root(args, ["sh", "-c", "echo " + shlex.quote(hostname) +
|
pmb.chroot.root(args, ["sh", "-c", "echo " + shlex.quote(hostname) +
|
||||||
" > /etc/hostname"], suffix)
|
" > /etc/hostname"], suffix)
|
||||||
regex = ("s/^127\.0\.0\.1.*/127.0.0.1\t" + re.escape(hostname) +
|
regex = (r"s/^127\.0\.0\.1.*/127.0.0.1\t" + re.escape(hostname) +
|
||||||
" localhost.localdomain localhost/")
|
" localhost.localdomain localhost/")
|
||||||
pmb.chroot.root(args, ["sed", "-i", "-e", regex, "/etc/hosts"], suffix)
|
pmb.chroot.root(args, ["sed", "-i", "-e", regex, "/etc/hosts"], suffix)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue