diff --git a/Makefile b/Makefile index 1b2bbef..61fb32d 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,13 @@ install-notmodule: cp -R distros/* $(DESTDIR)$(SYSCONFDIR)/yumbootstrap/suites tarball: - python setup.py sdist --formats=zip + python3 setup.py sdist --formats=zip egg: - python setup.py bdist_egg + python3 setup.py bdist_egg clean: - python setup.py clean --all + python3 setup.py clean --all rm -rf dist lib/*.egg-info # rm -rf $(SPHINX_DOCTREE) $(SPHINX_OUTPUT) diff --git a/bin/yumbootstrap b/bin/yumbootstrap index 6b27bd2..3003364 100755 --- a/bin/yumbootstrap +++ b/bin/yumbootstrap @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import sys @@ -361,7 +361,7 @@ def do_install(opts, suite_name, target): def do_list_suites(opts): for suite in yumbootstrap.suites.list_suites(opts.suite_dir): - print suite + print(suite) #----------------------------------------------------------- @@ -371,7 +371,7 @@ def do_list_scripts(opts, target): else: suite = read_cached_suite(target) for name in suite.post_install.names(): - print name + print(name) #----------------------------------------------------------- @@ -429,4 +429,4 @@ except YBError, e: sys.exit(e.code) #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/distros/gpg/RPM-GPG-KEY-RED-SOFT b/distros/gpg/RPM-GPG-KEY-RED-SOFT new file mode 100644 index 0000000..500d176 --- /dev/null +++ b/distros/gpg/RPM-GPG-KEY-RED-SOFT @@ -0,0 +1,31 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mQENBFkemaABCADg8mX2EBmcmh+tu+rtQPPLiaDXjTZhQfJV6FwsrSYucMCfNBNL +UYRMrcUNfXYjYvAtis9jwJCE+CGrJ1ir5cqttTGZu+hq7S1DGZjYR6VaflrwXVa9 +o//GsA7azDNpZ88LkyQ+u9BgiNY67jzQ4jdpUnSX9JLczVfoS31JH6Pb0UgtJtKf +EoP60vOI+an7J4n7fVJYV/J37SKpECB2HIg0ODloHlm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DCyWEI965yN1/UJ40aH4jHlG2Y0Ka7Vep6uP0Zto +Q0gAHcn+CI38YBegnjs9pomUSopDm3L7jx7hVKRr0z6b0gPEKUXSWxaLa9f0/k6/ +DY3kVSvxF8cdY9jstVQuGeC04dfZdJKDyc0ZXNKd6WC+ABLiI0+Vk08xrWR81H8T +B4gFLG0U0EMNkjq5u8sygCL7YL0/YebaiMSDtSuSX2JXnkDDwThQ6p2Fas4Csmxm +7OvuZQIYYZUgurPbRsMYDHiDA8jhCEkpxxnz5RMMF0/9sUXtcvnU3sPdGObHg1tY ++ulLukIs +=QS0H +-----END PGP PUBLIC KEY BLOCK----- diff --git a/distros/packages/common-redos.list b/distros/packages/common-redos.list new file mode 100644 index 0000000..89ceb63 --- /dev/null +++ b/distros/packages/common-redos.list @@ -0,0 +1,18 @@ +# subset from @Core +coreutils +bash +grep +gawk +basesystem +rpm +initscripts +iproute +less +make +mktemp +vim-minimal +yum +redos-release + +# required to fix RPM DB +/usr/bin/db_load diff --git a/distros/packages/redos-7.list b/distros/packages/redos-7.list new file mode 100644 index 0000000..2cdbe4a --- /dev/null +++ b/distros/packages/redos-7.list @@ -0,0 +1 @@ +common-redhat.list diff --git a/distros/redos-7.suite b/distros/redos-7.suite new file mode 100644 index 0000000..d7a8d1f --- /dev/null +++ b/distros/redos-7.suite @@ -0,0 +1,22 @@ +name = RedOS +release = 7 + +gpg_key = gpg/RPM-GPG-KEY-RED-SOFT + +packages = packages/common-redos.list + +[post_install] +finalize = scripts/fix_rpmdb.py +finalize = scripts/clean_yumbootstrap.py + +[repositories] +base = https://repo1.red-soft.ru/redos/7.3/$basearch/os,https://mirror.yandex.ru/redos/7.3/$basearch/os,http://repo.red-soft.ru/redos/7.3/$basearch/os +kernels = https://repo1.red-soft.ru/redos/7.3/$basearch/kernels,https://mirror.yandex.ru/redos/7.3/$basearch/kernels,http://repo.red-soft.ru/redos/7.3/$basearch/kernels +updates = https://repo1.red-soft.ru/redos/7.3/$basearch/updates,https://mirror.yandex.ru/redos/7.3/$basearch/updates,http://repo.red-soft.ru/redos/7.3/$basearch/updates + +[environment] +#PYTHONPATH=... +#PYTHONPATH +#SUDO_* + +# vim:ft=dosini diff --git a/distros/scripts/clean_yumbootstrap.py b/distros/scripts/clean_yumbootstrap.py index 29c5e84..78ae896 100755 --- a/distros/scripts/clean_yumbootstrap.py +++ b/distros/scripts/clean_yumbootstrap.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import time @@ -7,5 +7,5 @@ target = os.environ['TARGET'] yumbootstrap_dir = os.environ['YUMBOOTSTRAP_DIR'] if os.environ['VERBOSE'] == 'true': - print time.strftime('[%T] ') + 'removing yumbootstrap directory from target' + print(time.strftime('[%T] ') + 'removing yumbootstrap directory from target') shutil.rmtree(os.path.join(target, yumbootstrap_dir)) diff --git a/distros/scripts/fix_rpmdb.old-rpm.py b/distros/scripts/fix_rpmdb.old-rpm.py index 396163d..1a9c34a 100755 --- a/distros/scripts/fix_rpmdb.old-rpm.py +++ b/distros/scripts/fix_rpmdb.old-rpm.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import time @@ -22,4 +22,4 @@ yum.fix_rpmdb(expected_rpmdb_dir = '/var/lib/rpm') #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/distros/scripts/fix_rpmdb.py b/distros/scripts/fix_rpmdb.py index 8ac1c3d..b71d459 100755 --- a/distros/scripts/fix_rpmdb.py +++ b/distros/scripts/fix_rpmdb.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import time @@ -27,4 +27,4 @@ yum.fix_rpmdb() #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/examples/scripts/clean_yumbootstrap.py b/examples/scripts/clean_yumbootstrap.py index 29c5e84..78ae896 100755 --- a/examples/scripts/clean_yumbootstrap.py +++ b/examples/scripts/clean_yumbootstrap.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import time @@ -7,5 +7,5 @@ target = os.environ['TARGET'] yumbootstrap_dir = os.environ['YUMBOOTSTRAP_DIR'] if os.environ['VERBOSE'] == 'true': - print time.strftime('[%T] ') + 'removing yumbootstrap directory from target' + print(time.strftime('[%T] ') + 'removing yumbootstrap directory from target') shutil.rmtree(os.path.join(target, yumbootstrap_dir)) diff --git a/examples/scripts/fix_rpmdb.py b/examples/scripts/fix_rpmdb.py index ead99dc..a7a8031 100755 --- a/examples/scripts/fix_rpmdb.py +++ b/examples/scripts/fix_rpmdb.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import time diff --git a/lib/yumbootstrap/__init__.py b/lib/yumbootstrap/__init__.py index 6e7e1fe..c1393a7 100644 --- a/lib/yumbootstrap/__init__.py +++ b/lib/yumbootstrap/__init__.py @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/lib/yumbootstrap/bdb.py b/lib/yumbootstrap/bdb.py index fb5744a..8a3222a 100644 --- a/lib/yumbootstrap/bdb.py +++ b/lib/yumbootstrap/bdb.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys import bsddb @@ -34,4 +34,4 @@ def db_dump(filename, outfile = sys.stdout): outfile.write("DATA=END\n") #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/lib/yumbootstrap/exceptions.py b/lib/yumbootstrap/exceptions.py index 3a6a321..04812c0 100644 --- a/lib/yumbootstrap/exceptions.py +++ b/lib/yumbootstrap/exceptions.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 #----------------------------------------------------------------------------- @@ -28,4 +28,4 @@ def __repr__(self): return "" % (self._exit) #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/lib/yumbootstrap/log.py b/lib/yumbootstrap/log.py index d86a695..c16e99e 100644 --- a/lib/yumbootstrap/log.py +++ b/lib/yumbootstrap/log.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import logging import time @@ -7,7 +7,7 @@ class ProgressHandler(logging.Handler): def emit(self, record): - print time.strftime('[%T] ') + record.getMessage() + print(time.strftime('[%T] ') + record.getMessage()) #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/lib/yumbootstrap/sh.py b/lib/yumbootstrap/sh.py index 0949d07..979f5a9 100644 --- a/lib/yumbootstrap/sh.py +++ b/lib/yumbootstrap/sh.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import subprocess @@ -99,4 +99,4 @@ def chroot_fun(*args): return OutPipe(command[0], proc) #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/lib/yumbootstrap/suites.py b/lib/yumbootstrap/suites.py index 5f81816..8af69e2 100644 --- a/lib/yumbootstrap/suites.py +++ b/lib/yumbootstrap/suites.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import re import os @@ -375,4 +375,4 @@ def read(self, filename): section.add(**groups) #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/lib/yumbootstrap/yum.py b/lib/yumbootstrap/yum.py index 99bffe2..6ca2aeb 100644 --- a/lib/yumbootstrap/yum.py +++ b/lib/yumbootstrap/yum.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import rpm as rpm_mod import os @@ -151,7 +151,7 @@ def fix_rpmdb(self, expected_rpmdb_dir = None, current_rpmdb_dir = rpm_mod.expandMacro('%{_dbpath}') if expected_rpmdb_dir is None: expected_rpmdb_dir = sh.run( - ['python', '-c', 'import rpm; print rpm.expandMacro("%{_dbpath}")'], + ['python3', '-c', 'import rpm; print(rpm.expandMacro("%{_dbpath}"))'], chroot = self.chroot, pipe = sh.READ, env = self.yum_conf.env, @@ -197,4 +197,4 @@ def fix_rpmdb(self, expected_rpmdb_dir = None, self.rpmdb_fixed = True #----------------------------------------------------------------------------- -# vim:ft=python +# vim:ft=python3 diff --git a/redhat/yumbootstrap.spec b/redhat/yumbootstrap.spec index 8bd5913..0893d2f 100644 --- a/redhat/yumbootstrap.spec +++ b/redhat/yumbootstrap.spec @@ -2,7 +2,8 @@ %define _release 1 %define _packager Stanislaw Klekot -%define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") +%define python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") + Summary: yumbootstrap - chroot installer for Red Hat derivatives Name: yumbootstrap @@ -12,11 +13,10 @@ Group: Development/Tools License: GPL v3 Source0: yumbootstrap-%{_version}.tar.gz BuildRoot: %{_tmppath}/%{name}-root -URL: http://dozzie.jarowit.net/trac/wiki/yumbootstrap BuildArch: noarch Packager: %{_packager} Prefix: %{_prefix} -BuildRequires: python-setuptools +BuildRequires: python3-setuptools Requires: yum >= 3.0 %description @@ -28,11 +28,11 @@ debootstrap. %setup -q %build -CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build +CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT" -%{__python} setup.py install --root "$RPM_BUILD_ROOT" +%{__python3} setup.py install --root "$RPM_BUILD_ROOT" make install-notmodule \ DESTDIR="$RPM_BUILD_ROOT" \ BINDIR=%{_sbindir} SYSCONFDIR=%{_sysconfdir} @@ -51,8 +51,8 @@ cp KNOWN_ISSUES.md LICENSE README.md SUITES.md TODO \ %{_sysconfdir}/yumbootstrap #%{_mandir}/man8 %{_docdir}/yumbootstrap-%{_version} -%{python_sitearch}/yumbootstrap -%{python_sitearch}/yumbootstrap-*.egg-info +%{python3_sitearch}/yumbootstrap +%{python3_sitearch}/yumbootstrap-*.egg-info # %changelog diff --git a/setup.py b/setup.py index 52aa8e9..b0305ab 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 from setuptools import setup, find_packages from glob import glob