apply python3 as interpreter 12/278812/6
authorbiao716.wang <biao716.wang@samsung.com>
Tue, 26 Jul 2022 09:19:24 +0000 (18:19 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Thu, 4 Aug 2022 08:05:33 +0000 (17:05 +0900)
Change-Id: I4c3c99132c7cfa8751fdcbc9742335e573c84b36
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
46 files changed:
debian/control
mic/3rdparty/pykickstart/sections.py
mic/bootstrap.py
mic/chroot.py
mic/cmd_chroot.py
mic/cmd_create.py
mic/conf.py
mic/helpformat.py
mic/imager/baseimager.py
mic/imager/fs.py
mic/imager/loop.py
mic/imager/raw.py
mic/kickstart/__init__.py
mic/kickstart/custom_commands/desktop.py
mic/kickstart/custom_commands/installerfw.py
mic/kickstart/custom_commands/micboot.py
mic/kickstart/custom_commands/partition.py
mic/plugin.py
mic/pluginbase.py
mic/rt_util.py
mic/utils/fs_related.py
mic/utils/gpt_parser.py
mic/utils/grabber.py
mic/utils/misc.py
mic/utils/partitionedfs.py
mic/utils/proxy.py
mic/utils/rpmmisc.py
mic/utils/runner.py
packaging/mic.spec
plugins/backend/yumpkgmgr.py
plugins/backend/zypppkgmgr.py
plugins/hook/empty_hook.py
plugins/imager/fs_plugin.py
plugins/imager/loop_plugin.py
plugins/imager/raw_plugin.py
tests/pluginmgr_fixtures/backend/yumtest.py
tests/pluginmgr_fixtures/backend/zypptest.py
tests/pluginmgr_fixtures/imager/fs_test.py
tests/pluginmgr_fixtures/imager/loop_test.py
tests/test_baseimager.py
tests/test_chroot.py
tests/test_configmgr.py
tests/test_pluginmgr.py
tests/test_proxy.py
tests/test_runner.py
tools/mic

index 3c9e6db..52ed82a 100644 (file)
@@ -2,7 +2,7 @@ Source: mic
 Section: devel
 Priority: extra
 Maintainer: Jian-feng Ding <jian-feng.ding@intel.com>
-Build-Depends: debhelper (>= 7.0.15), cdbs, python3,python-is-python3, python3-all, python3-dev, dh-python, python3-docutils
+Build-Depends: debhelper (>= 7.0.15), cdbs, python3, python3-requests, python3-all, python3-dev, dh-python, python3-docutils
 Standards-Version: 3.8.0
 Homepage: http://www.tizen.org
 
@@ -10,13 +10,14 @@ Package: mic
 Architecture: all
 Depends: ${misc:Depends}, ${python3:Depends},
  rpm,
- python-is-python3,
  python3-rpm,
  python3-urlgrabber,
  python3-requests,
+ python3-distro,
  cpio,
  bzip2,
  gzip,
+ yum
 Conflicts:
  mic2
 Description: image creator for Linux distributions
index bdfca5b..70ba084 100644 (file)
@@ -168,9 +168,9 @@ class ScriptSection(Section):
                         The error message will direct you to where the cause of
                         the failure is logged.""", version=FC4)
         op.add_argument("--interpreter", dest="interpreter", default="/bin/sh",
-                        version=FC4, metavar="/usr/bin/python", help="""
+                        version=FC4, metavar="/usr/bin/python3", help="""
                         Allows you to specify a different scripting language,
-                        such as Python. Replace /usr/bin/python with the
+                        such as Python. Replace /usr/bin/python3 with the
                         scripting language of your choice.
                         """)
         op.add_argument("--log", "--logfile", dest="log", version=FC4,
index 553db14..f1bd137 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
 #
index 4706c05..d95e882 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
 #
index 1faa515..fd42d78 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 # vim: ai ts=4 sts=4 et sw=4
 #
 # Copyright (c) 2012 Intel, Inc.
index c220d09..75270ec 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 # vim: ai ts=4 sts=4 et sw=4
 #
 # Copyright (c) 2012 Intel, Inc.
index aca1974..c864e8f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 10d6f72..799af46 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 # vim: ai ts=4 sts=4 et sw=4
 #
 # Copyright (c) 2011 Intel, Inc.
index cae0453..43ac5f9 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2007 Red Hat  Inc.
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
index f2ccb78..0fd6b46 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index cfa3602..8056ffb 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 4701141..983e942 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index b2b4376..318b8bf 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2007 Red Hat, Inc.
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
index a2359b3..f69939b 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2008, 2009, 2010 Intel, Inc.
 #
index 01deb76..31d9136 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2013 Intel, Inc.
 #
index 66d1678..2fa5639 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2008, 2009, 2010 Intel, Inc.
 #
index 341e8dc..69d0d13 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Marko Saukko <marko.saukko@cybercom.com>
 #
index 88a3081..e8ad9e8 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index db438b6..0bb1bad 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 856f795..43b15de 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
 #
@@ -234,7 +234,7 @@ def sync_mic(bootstrap, binpth = '/usr/bin/mic',
 
     # correct python interpreter
     mic_cont = file(_path(binpth)).read()
-    mic_cont = "#!/usr/bin/python\n" + mic_cont
+    mic_cont = "#!/usr/bin/python3\n" + mic_cont
     with open(_path(binpth), 'w') as wf:
         wf.write(mic_cont)
 
index eb13f22..35d49d2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2007, Red Hat, Inc.
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
index 34dc436..5c770eb 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2013 Intel, Inc.
 #
index a87d5a4..afbd267 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2014 Intel, Inc.
 #
index 581765a..36294a3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2010, 2011 Intel Inc.
 #
index 40f4a46..ddd29ee 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
 # Copyright (c) 2007, 2008 Red Hat, Inc.
index 7cbdd40..af6ab3e 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2010, 2011 Intel, Inc.
 #
index 0f46950..b22e136 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2008, 2009, 2010, 2011 Intel, Inc.
 #
index 1b97f5b..56ca86f 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 8de484b..cf859a8 100755 (executable)
@@ -1,5 +1,3 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_version: %define python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
 
 %define rc_version 0
 
@@ -17,33 +15,29 @@ BuildArch:  noarch
 URL:        http://www.tizen.org
 Source0:    %{name}_%{version}.tar.gz
 
-Requires:   python >= 2.6
+Requires:   python3 >= 3.1
 Requires:   python3-urlgrabber >= 3.9.0
 Requires:   yum
-Requires:   python-requests
+Requires:   python3-requests
 
 %if 0%{?suse_version} || 0%{?tizen_version:1}
-Requires:   python-xml
-%endif
-
-%if "%{?python_version}" < "2.7"
-Requires:   python-argparse
+Requires:   python3-xml
 %endif
 
 %if 0%{?tizen_version:1}
-Requires:   python-rpm
+Requires:   python3-rpm
 %else
 Requires:   rpm-python
 %endif
-
+Requires:   python3-distro
 Requires:   cpio
 # not neccessary
 Requires:   gzip
 Requires:   bzip2
 
-BuildRequires:  python-devel
+BuildRequires:  python3-devel
 %if ! 0%{?tizen_version:1}
-BuildRequires:  python-docutils
+BuildRequires:  python3-docutils
 %endif
 
 Obsoletes:  mic2
@@ -61,15 +55,15 @@ an image.
 %setup -q -n %{name}-%{version}
 
 %build
-CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+CFLAGS="$RPM_OPT_FLAGS" python3 setup.py build
 make man
 
 %install
 rm -rf $RPM_BUILD_ROOT
 %if 0%{?suse_version}
-%{__python} setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
+python3 setup.py install --root=$RPM_BUILD_ROOT --prefix=%{_prefix}
 %else
-%{__python} setup.py install --root=$RPM_BUILD_ROOT -O1
+python3 setup.py install --root=$RPM_BUILD_ROOT -O1
 %endif
 
 # install man page
@@ -93,7 +87,7 @@ install -Dp -m0755 etc/zsh_completion.d/_%{name} %{buildroot}/%{_sysconfdir}/zsh
 %endif
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
-%{python_sitelib}/*
+%{python3_sitelib}/*
 %dir %{_prefix}/lib/%{name}
 %{_prefix}/lib/%{name}/*
 %{_bindir}/mic
index 86093d7..8a3b228 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2007 Red Hat  Inc.
 # Copyright (c) 2010, 2011 Intel, Inc.
index 2411423..60a4a7d 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2010, 2011 Intel, Inc.
 #
index 397585d..25e5663 100644 (file)
@@ -1,3 +1,3 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # TODO: plugin base for hooks
index 70b0d6c..d08e3ff 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index ceaa351..beba62c 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index fa24583..bb6661c 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 61ba220..8b428b8 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import BackendPlugin
 class Yum(BackendPlugin):
index 6ebe1f3..8976ea5 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import BackendPlugin
 class Zypp(BackendPlugin):
index ced1ce2..e6c464b 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import ImagerPlugin
 class FsPlugin(ImagerPlugin):
index 5fb515c..ada6025 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import ImagerPlugin
 class LoopPlugin(ImagerPlugin):
index 752abbf..fe39e7d 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index e9ae737..e31c36e 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 40d8d1c..d97c752 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 1a8751a..126a574 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 9655b58..3c9fe18 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import unittest
 from mic.utils import proxy
index 7136ee0..e481939 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 74a11f0..968118d 100755 (executable)
--- a/tools/mic
+++ b/tools/mic
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 #Copyright (c) 2011 Intel, Inc.
 #