From 6a9def57f720bebdfa6f14efb548e7ea71e6cab4 Mon Sep 17 00:00:00 2001 From: "Richard.Yu" Date: Tue, 26 Jul 2022 14:35:09 +0800 Subject: [PATCH] Build saithrift with python3.9 in bullseye (#1541) (#1544) * Build saithrift with python3.9 in bullseye Bullseye upgrade the python to python3.9 and other image, like buster still using python 2.7. To build with different python in different image, add a condition for copy differernt install file in different type of image. Signed-off-by: richardyu-ms * change the release name to version number and reuse existing files Signed-off-by: richardyu-ms Co-authored-by: richardyu Co-authored-by: richardyu --- debian/copy_installer.sh | 14 ++++++++++---- .../python-saithriftv1-bullseye.install | 2 ++ debian/installerFiles/python-saithriftv2.install | 1 - ...hriftv1.install => python2.7-saithrift.install} | 0 debian/installerFiles/python3-saithrift.install | 2 ++ 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 debian/installerFiles/python-saithriftv1-bullseye.install delete mode 100644 debian/installerFiles/python-saithriftv2.install rename debian/installerFiles/{python-saithriftv1.install => python2.7-saithrift.install} (100%) create mode 100644 debian/installerFiles/python3-saithrift.install diff --git a/debian/copy_installer.sh b/debian/copy_installer.sh index 8997e87d0..556899e9a 100755 --- a/debian/copy_installer.sh +++ b/debian/copy_installer.sh @@ -1,8 +1,14 @@ if [[ x"$1" =~ x"v2" ]] then - echo "Copy python-saithriftv2.install as python-saithrift.install" - cp ./debian/installerFiles/python-saithriftv2.install ./debian/python-saithrift.install + echo "Copy python3-saithrift.install as python-saithrift.install" + cp ./debian/installerFiles/python3-saithrift.install ./debian/python-saithrift.install else - echo "Copy python-saithriftv1.install as python-saithrift.install" - cp ./debian/installerFiles/python-saithriftv1.install ./debian/python-saithrift.install + if [ $(lsb_release -sr) -ge 11 ] + then + echo "Copy python3-saithrift.install as python-saithrift.install after Ver.11 releases" + cp ./debian/installerFiles/python3-saithrift.install ./debian/python-saithrift.install + else + echo "Copy python2.7-saithrift.install as python-saithrift.install" + cp ./debian/installerFiles/python2.7-saithrift.install ./debian/python-saithrift.install + fi fi diff --git a/debian/installerFiles/python-saithriftv1-bullseye.install b/debian/installerFiles/python-saithriftv1-bullseye.install new file mode 100644 index 000000000..5745e926a --- /dev/null +++ b/debian/installerFiles/python-saithriftv1-bullseye.install @@ -0,0 +1,2 @@ +#compatiable with bullseye python 3.9 environment +debian/usr/local/lib/python3.9/site-packages/* /usr/lib/python3/dist-packages/ diff --git a/debian/installerFiles/python-saithriftv2.install b/debian/installerFiles/python-saithriftv2.install deleted file mode 100644 index e3d2e8c13..000000000 --- a/debian/installerFiles/python-saithriftv2.install +++ /dev/null @@ -1 +0,0 @@ -debian/usr/local/lib/python3*/site-packages/* /usr/lib/python3/dist-packages/ diff --git a/debian/installerFiles/python-saithriftv1.install b/debian/installerFiles/python2.7-saithrift.install similarity index 100% rename from debian/installerFiles/python-saithriftv1.install rename to debian/installerFiles/python2.7-saithrift.install diff --git a/debian/installerFiles/python3-saithrift.install b/debian/installerFiles/python3-saithrift.install new file mode 100644 index 000000000..38be43db2 --- /dev/null +++ b/debian/installerFiles/python3-saithrift.install @@ -0,0 +1,2 @@ +#compatiable with bullseye python 3.9 environment and saithriftv2 build with python3 +debian/usr/local/lib/python3*/site-packages/* /usr/lib/python3/dist-packages/