[pve-devel] [PATCH zfsonlinux 2/6] Use installed python3
Stoiko Ivanov
s.ivanov at proxmox.com
Wed May 13 19:59:09 CEST 2020
From: Antonio Russo <antonio.e.russo at gmail.com>
adapted from debian-upstream [0] commit
594e747e14f3051513ea499c40c17cadb5d0e92b
[0] https://salsa.debian.org/zfsonlinux-team/zfs.git
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
.../patches/0007-Use-installed-python3.patch | 60 +++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 1 +
3 files changed, 62 insertions(+)
create mode 100644 debian/patches/0007-Use-installed-python3.patch
diff --git a/debian/patches/0007-Use-installed-python3.patch b/debian/patches/0007-Use-installed-python3.patch
new file mode 100644
index 00000000..59769d63
--- /dev/null
+++ b/debian/patches/0007-Use-installed-python3.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Antonio Russo <antonio.e.russo at gmail.com>
+Date: Tue, 5 May 2020 22:15:16 -0600
+Subject: [PATCH] Use installed python3
+
+---
+ debian/patches/0004-prefer-python3-tests.patch | 0
+ .../functional/cli_root/zfs_program/zfs_program_json.ksh | 6 +++---
+ .../tests/functional/rsend/send_encrypted_files.ksh | 2 +-
+ .../tests/functional/rsend/send_realloc_dnode_size.ksh | 2 +-
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+ create mode 100644 debian/patches/0004-prefer-python3-tests.patch
+
+diff --git a/debian/patches/0004-prefer-python3-tests.patch b/debian/patches/0004-prefer-python3-tests.patch
+new file mode 100644
+index 000000000..e69de29bb
+diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh
+index 3788543b0..c7ee4ae9a 100755
+--- a/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh
++++ b/tests/zfs-tests/tests/functional/cli_root/zfs_program/zfs_program_json.ksh
+@@ -100,10 +100,10 @@ typeset -a pos_cmds_out=(
+ # the same as the input and the --sort-keys option was added. Detect when
+ # --sort-keys is supported and apply the option to ensure the expected order.
+ #
+-if python -m json.tool --sort-keys <<< "{}"; then
+- JSON_TOOL_CMD="python -m json.tool --sort-keys"
++if python3 -m json.tool --sort-keys <<< "{}"; then
++ JSON_TOOL_CMD="python3 -m json.tool --sort-keys"
+ else
+- JSON_TOOL_CMD="python -m json.tool"
++ JSON_TOOL_CMD="python3 -m json.tool"
+ fi
+
+ typeset -i cnt=0
+diff --git a/tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh b/tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh
+index 6288178f8..d4475b369 100755
+--- a/tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh
++++ b/tests/zfs-tests/tests/functional/rsend/send_encrypted_files.ksh
+@@ -87,7 +87,7 @@ log_must xattrtest -f 10 -x 3 -s 32768 -r -k -p /$TESTPOOL/$TESTFS2/xattrsadir
+ # ZoL issue #7432
+ log_must zfs set compression=on xattr=sa $TESTPOOL/$TESTFS2
+ log_must touch /$TESTPOOL/$TESTFS2/attrs
+-log_must eval "python -c 'print \"a\" * 4096' | \
++log_must eval "python3 -c 'print \"a\" * 4096' | \
+ attr -s bigval /$TESTPOOL/$TESTFS2/attrs"
+ log_must zfs set compression=off xattr=on $TESTPOOL/$TESTFS2
+
+diff --git a/tests/zfs-tests/tests/functional/rsend/send_realloc_dnode_size.ksh b/tests/zfs-tests/tests/functional/rsend/send_realloc_dnode_size.ksh
+index 12a72fa09..aceec7880 100755
+--- a/tests/zfs-tests/tests/functional/rsend/send_realloc_dnode_size.ksh
++++ b/tests/zfs-tests/tests/functional/rsend/send_realloc_dnode_size.ksh
+@@ -93,7 +93,7 @@ log_must zfs snapshot $POOL/fs at c
+ # 4. Create an empty file and add xattrs to it to exercise reclaiming a
+ # dnode that requires more than 1 slot for its bonus buffer (Zol #7433)
+ log_must zfs set compression=on xattr=sa $POOL/fs
+-log_must eval "python -c 'print \"a\" * 512' | attr -s bigval /$POOL/fs/attrs"
++log_must eval "python3 -c 'print \"a\" * 512' | attr -s bigval /$POOL/fs/attrs"
+ log_must zfs snapshot $POOL/fs at d
+
+ # 5. Generate initial and incremental streams
diff --git a/debian/patches/series b/debian/patches/series
index 8fe3840a..33a76ef1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
0004-import-with-d-dev-disk-by-id-in-scan-service.patch
0005-Enable-zed-emails.patch
0006-dont-symlink-zed-scripts.patch
+0007-Use-installed-python3.patch
diff --git a/debian/rules b/debian/rules
index bb44c376..47fdb669 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,6 +33,7 @@ override_dh_auto_configure:
--with-zfsexecdir=/usr/lib/zfs-linux \
--enable-systemd \
--enable-pyzfs \
+ --with-python=python3 \
--with-systemdunitdir=/lib/systemd/system \
--with-systemdpresetdir=/lib/systemd/system-preset \
--with-systemdgeneratordir=/lib/systemd/system-generators \
--
2.20.1
More information about the pve-devel
mailing list