[elbe-devel] [PATCH 4/5] python3: Make py3 the only referenced version
bage at linutronix.de
bage at linutronix.de
Fri Aug 28 18:05:36 CEST 2020
From: Bastian Germann <bage at linutronix.de>
Remove all functional Python 2 references. This includes package names,
shebang lines, other python executable names, and paths.
Signed-off-by: Bastian Germann <bage at linutronix.de>
---
.gitignore | 4 ----
README.adoc | 4 ++--
contrib/debug/memory-profiling-for-elbe-daemon.patch | 4 ++--
elbe | 2 +-
elbe.spec | 10 +++++-----
elbepack/aptpkgutils.py | 2 +-
elbepack/commands/adjustpkgs.py | 2 +-
elbepack/version.py | 8 ++++----
test/updated.py | 2 +-
9 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/.gitignore b/.gitignore
index e7179728a..28fb7420f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,13 +2,9 @@ tags
.pybuild
elbe.egg-info
debian/elbe-bootup-check/
-debian/python-elbe-buildenv/
debian/python3-elbe-buildenv/
-debian/python-elbe-bin/
debian/python3-elbe-bin/
-debian/python-elbe-common/
debian/python3-elbe-common/
-debian/python-elbe-control/
debian/python3-elbe-control/
debian/elbe-daemon/
debian/elbe-debianize/
diff --git a/README.adoc b/README.adoc
index f81b564e0..72ddbcfa0 100644
--- a/README.adoc
+++ b/README.adoc
@@ -13,12 +13,12 @@ Software Dependencies
---------------------
If using ELBE from git repository directly, you'll need following packages installed:
- apt install python python-debian python-mako python-lxml python-apt python-gpg python-suds python-libvirt qemu-utils qemu-kvm p7zip-full make
+ apt install python3 python3-debian python3-mako python3-lxml python3-apt python3-gpg python3-suds python3-libvirt qemu-utils qemu-kvm p7zip-full make
Crash Course
------------
-1. use a Elbe XML file (e.g. from /usr/share/doc/elbe/examples or
+1. use an Elbe XML file (e.g. from /usr/share/doc/elbe/examples or
examples/ in the elbe source tree)
2. run "./elbe initvm create ./examples/armhf-ti-beaglebone-black.xml
diff --git a/contrib/debug/memory-profiling-for-elbe-daemon.patch b/contrib/debug/memory-profiling-for-elbe-daemon.patch
index f6b7b99ec..f14ff1ab9 100644
--- a/contrib/debug/memory-profiling-for-elbe-daemon.patch
+++ b/contrib/debug/memory-profiling-for-elbe-daemon.patch
@@ -4,8 +4,8 @@ Only useful in --devel mode. And its required, that some dependencies
are installed manually into the initvm
--------------------------------------------------------------------
-apt-get install python-pip
-pip install dozer
+apt install python3-pip
+pip3 install Dozer
/etc/init.d/elbe-daemon restart
--------------------------------------------------------------------
diff --git a/elbe b/elbe
index 76ab43a40..d5886d174 100755
--- a/elbe
+++ b/elbe
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
#
# ELBE - Debian Based Embedded Rootfilesystem Builder
# Copyright (c) 2013, 2017 Manuel Traut <manut at linutronix.de>
diff --git a/elbe.spec b/elbe.spec
index 073781da7..540cd325a 100644
--- a/elbe.spec
+++ b/elbe.spec
@@ -11,12 +11,12 @@ URL: http://elbe-rfs.org
Source0: http://elbe-rfs.org/download/elbe-2.0/elbe-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: python-devel
-BuildRequires: python-setuptools
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
BuildRequires: asciidoc
BuildRequires: xmlto
-requires: qemu-kvm, python-lxml, python-mako, wget, python-suds, libvirt-python
+requires: qemu-kvm, python3-lxml, python3-mako, wget, python3-suds, libvirt-python
%description
ELBE (Embedded Linux Build Environment)
@@ -26,11 +26,11 @@ Debian based system to generate root-filesystems for embedded devices.
%setup -q -n elbe-%{version}
%build
-python setup.py build
+python3 setup.py build
%install
rm -rf $RPM_BUILD_ROOT
-python setup.py install --skip-build --root $RPM_BUILD_ROOT --install-lib=%{python_sitearch}
+python3 setup.py install --skip-build --root $RPM_BUILD_ROOT --install-lib=%{python_sitearch}
%clean
rm -rf $RPM_BUILD_ROOT
diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
index a2608e260..0d96c0ff3 100644
--- a/elbepack/aptpkgutils.py
+++ b/elbepack/aptpkgutils.py
@@ -106,7 +106,7 @@ def fetch_binary(version, destdir='', progress=None):
is used.
taken from python-apt-1.8.4
- (/usr/lib/python2.7/dist-packages/apt/package.py).
+ https://salsa.debian.org/apt-team/python-apt/-/blob/1.8.4/apt/package.py
---------------------------------------------------------
Copyright (c) 2005-2009 Canonical
diff --git a/elbepack/commands/adjustpkgs.py b/elbepack/commands/adjustpkgs.py
index e2640e543..72f1154aa 100644
--- a/elbepack/commands/adjustpkgs.py
+++ b/elbepack/commands/adjustpkgs.py
@@ -96,7 +96,7 @@ def run_command(argv):
# we need to introduce additional arguments for this
# in default copy mode chroot to the target and remove elbe-daemon
# and its dependencies (if it is not in target/pkg-list.
- buildenv_pkgs = ["python-elbe-buildenv"]
+ buildenv_pkgs = ["python3-elbe-buildenv"]
if xml.has("./project/buildimage/pkg-list"):
buildenv_pkgs.extend([p.et.text for p in xml.node(
"project/buildimage/pkg-list")])
diff --git a/elbepack/version.py b/elbepack/version.py
index 998d8822b..3d311d178 100644
--- a/elbepack/version.py
+++ b/elbepack/version.py
@@ -9,14 +9,14 @@ from elbepack.directories import pack_dir
elbe_version = "12.5"
-elbe_initvm_packagelist = ['python-elbe-buildenv',
+elbe_initvm_packagelist = ['python3-elbe-buildenv',
'elbe-soap',
- 'python-elbe-common',
+ 'python3-elbe-common',
'elbe-daemon',
'elbe-schema',
- 'python-elbe-bin']
+ 'python3-elbe-bin']
-if pack_dir == '/usr/lib/python2.7/dist-packages/elbepack':
+if pack_dir.startswith('/usr/lib/python'):
is_devel = False
else:
is_devel = True
diff --git a/test/updated.py b/test/updated.py
index 3d2b7f1d3..3b10d2f4c 100755
--- a/test/updated.py
+++ b/test/updated.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
#
# ELBE - Debian Based Embedded Rootfilesystem Builder
# Copyright (c) 2014, 2017 Manuel Traut <manut at linutronix.de>
--
2.28.0
More information about the elbe-devel
mailing list