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 3c9e6db03df2820b8e66b8aae0da83e2e7fd10db..52ed82a7f2d61422ebbb84d917bda3c581371d4e 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 bdfca5bec127cc2eb3921cd119795a904730c8e0..70ba0847cd5f6398e06fe79665734f0c7cc40996 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 553db141db4ea74390898ff7c966f056ed9114c3..f1bd13721b5b8f4eb5715098497ec65c1eda1e8f 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
 #
index 4706c05de989f710aa63389679655258f5268226..d95e88262f17f515640fd13353c73cfa78a956b0 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2009, 2010, 2011 Intel, Inc.
 #
index 1faa5153d057b14c3bc9948f7123761901805a5b..fd42d78780262e577ccde89b451caffbdbf28c4b 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 c220d0960ecb5fef7a48f646d47d1fb30ce210e0..75270ecf4f23c6fdfd2f21d854c0c1ffe508bad6 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 aca197472b29d4fee5784e0d6529af7bdf458faf..c864e8ffb434a1c0fabecd63cf7d55cdb0aabb05 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 10d6f7292319f7ef836e2d45e9cdc4347cadbac5..799af465cc1708a53ed6356dcfea726ea013bb3b 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 cae0453c9b12277c7b0d29a81fa03bcb8d46cb39..43ac5f92e0d459ab4312cf55c63a23707a0f1740 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 f2ccb7826dac0c3151516f2a347f4d93bd19ff41..0fd6b46dd00300d33893907af379edb7745566c9 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index cfa360215df79e40e859559df80b8986edbd1ffa..8056ffb821d18943e09bbe76511d33739a0590c7 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 470114124dd94a828c817fd4c974c2acf971e030..983e94204e6eaf6cd582fc407318493b8f78f5f8 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index b2b4376cf62c64af955952504e5cdedf1b59966e..318b8bf1a1e66f922ca4b7716fd10f89ecfb8ab1 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 a2359b3c58c77330afaefb0dd22a457c8c4bf532..f69939ba8436f0a2db0cc864391b329ff4fbb00b 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2008, 2009, 2010 Intel, Inc.
 #
index 01deb76bbdd1cb0de553db0a0cd38eb84b08e94b..31d9136045ba58c971ed123b16737a047e48adc6 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2013 Intel, Inc.
 #
index 66d1678aa74b04d8998177276fd3a098ced845da..2fa563949275841493dae8d6695c936d2f4ddd9b 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2008, 2009, 2010 Intel, Inc.
 #
index 341e8dc4b4925f8a5d683ba5bd0422600ad52b71..69d0d13a6f8e5705cabee8547b82d574748365ea 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Marko Saukko <marko.saukko@cybercom.com>
 #
index 88a3081645edd5c0424eedaa0301808a92e66370..e8ad9e8977d17628608809122979877b32303a78 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index db438b6d94392941d0eb125a341d0f646ecd0160..0bb1badf16be193f15afe67cd4cde11d5dcaa3ea 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 856f795448c9cade672d76c300005b7dbc8f5af6..43b15de1b964850a341c24602033e9d44b0e981a 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 eb13f222ac62382608265f3410326871f8e8bffb..35d49d2e525a35e8939f2158fe3e8aee1b56dffa 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 34dc4364c47cf505810e040d8d8a902340dd8a34..5c770eb677a7fb8b21d2abc20e100bcc8ccaa3a6 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2013 Intel, Inc.
 #
index a87d5a4c15782aa62e3c42fe5c7084e23bc2c4c6..afbd267951f36363b307ac87169d5a48b0c805e1 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2014 Intel, Inc.
 #
index 581765a5b3a35ba0c11c66254674433d40a5b38a..36294a3594f76b23475e504a089fcc808929ae77 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2010, 2011 Intel Inc.
 #
index 40f4a463c09cc9a5cff7cafba905bd51d1cf4013..ddd29ee378e1b976ffb130a30ea43c80b6554b6c 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 7cbdd402693d3b27200389feed22cca8328cb755..af6ab3e504e6e803b1910770424a3c712b197ef7 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2010, 2011 Intel, Inc.
 #
index 0f469503da48afac579efaeecfe027044fdaa8e7..b22e1366d82c8f3eb567ebdc6811dcc665e7d7df 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2008, 2009, 2010, 2011 Intel, Inc.
 #
index 1b97f5b0a6440a15b5f901c6979882c0a1e9ba34..56ca86f1e457f907a0dbe396b25049f83b09e565 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 8de484b0f0d52d14418b02d4ddb7a2431a9f34aa..cf859a8b896e5cf4b82910721cb4a12eaba41f46 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 86093d747ec99dc65367905342c346b0a6bd3dee..8a3b2281b57730a872539106a1dd17087516fe38 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 2411423c87f16381c5c9a35631cd03d74983114d..60a4a7d04a40ea1eb30d376dd16a3820c0a77396 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2010, 2011 Intel, Inc.
 #
index 397585d8c1592144ea04a18e6a311d95c4b25bc5..25e5663126d32e1c4e6841a657b1ed71b8804e39 100644 (file)
@@ -1,3 +1,3 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # TODO: plugin base for hooks
index 70b0d6caf1e38f9979f0cffdcd8babc9b9c71185..d08e3ffd862d23dafb6ecf22fad2a01030848c1c 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index ceaa351803795b4f9678aa85afc086b907201dd9..beba62c99c61186cc2078348aadd8afaa1a53b38 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index fa245830a6640dd2c33a5cb7bcd1ce54ff46ae06..bb6661c732894584f29a311a723c12724476c612 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 #
 # Copyright (c) 2011 Intel, Inc.
 #
index 61ba22015afcb6951bbbee10d87bc060d2b4a399..8b428b89ea54c2ce286206dccae04c225ec5dfd6 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import BackendPlugin
 class Yum(BackendPlugin):
index 6ebe1f36b9c0d2a959e004a9dbfa610840d37952..8976ea51a5320fd0ff1540eb5107d87008337718 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import BackendPlugin
 class Zypp(BackendPlugin):
index ced1ce2ebb0e473e25e70a9c1691a74011707f84..e6c464be68360152b66ab4bc4723eb25d1e7854f 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import ImagerPlugin
 class FsPlugin(ImagerPlugin):
index 5fb515cd42e6ddc64d4440d3a39d6c3ecf62ad78..ada60254a4d2e35c26e64c3b7d67c244bc3f1930 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python -tt
+#!/usr/bin/python3 -tt
 
 from mic.pluginbase import ImagerPlugin
 class LoopPlugin(ImagerPlugin):
index 752abbf2069c7e9d4110126e9c872e7f864e9003..fe39e7d114b172d615bcf0d122a8ca96651e00e6 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index e9ae73740853105b01a31397778a5c9aa842c1d7..e31c36edede3485c78e7331a17b65d56d656d08f 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 40d8d1c517a87a7118bda65bea42e62bb03fa091..d97c752eb1bd1734e1ce780c4221e81ba62c0073 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 1a8751afef106a46d9b5a77acd382ae70d75465f..126a5749447cece3e1f3e94b9bf8d3d37d527863 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 9655b582e73c7be163969f26242fd926d7038f22..3c9fe18e48cb24b0e4e90d8cfc404d84757b4bcf 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import unittest
 from mic.utils import proxy
index 7136ee02fecc581c971de7d4b4a6f068ee8599e8..e4819394a71c9a308441ccaca5e77f8007aa45d2 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import os
 import sys
index 74a11f0dba72fed0c343526bbafd6c2bf674fa1c..968118d9f319655489cb82e2ae89ff215b735d68 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.
 #