!45 Update to version 0.3.94

From: @wang--ge 
Reviewed-by: @wu-leilei 
Signed-off-by: @wu-leilei
This commit is contained in:
openeuler-ci-bot 2023-10-08 06:44:16 +00:00 committed by Gitee
commit c585f89ff9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 42 additions and 386 deletions

View File

@ -1,41 +0,0 @@
From b916778474e4181e5a2cc287bde414231427234c Mon Sep 17 00:00:00 2001
From: xu_lei_123 <xulei@xfusion.com>
Date: Fri, 30 Dec 2022 13:19:45 +0800
Subject: [PATCH] Adapt to category title translation fix in Anaconda
---
initial_setup/common.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/initial_setup/common.py b/initial_setup/common.py
index ce7a144..e617000 100644
--- a/initial_setup/common.py
+++ b/initial_setup/common.py
@@ -4,7 +4,7 @@ import os
from pyanaconda.ui.common import collect
from pyanaconda.core.constants import FIRSTBOOT_ENVIRON
-from pyanaconda.core.i18n import N_
+from initial_setup.i18n import _, N_
from pyanaconda.ui.categories import SpokeCategory
from initial_setup.product import eula_available
@@ -145,7 +145,11 @@ def get_quit_message():
"You might end up with unusable system if you do.")
class LicensingCategory(SpokeCategory):
- displayOnHubGUI = "ProgressHub"
- displayOnHubTUI = "SummaryHub"
- sortOrder = 100
- title = N_("LICENSING")
+
+ @staticmethod
+ def get_title():
+ return _("LICENSING")
+
+ @staticmethod
+ def get_sort_order():
+ return 100
--
2.21.0

View File

@ -1,39 +0,0 @@
From d33a1c1f05b707cead2d5ead060f63d118cd8468 Mon Sep 17 00:00:00 2001
From: xu_lei_123 <xulei@xfusion.com>
Date: Fri, 30 Dec 2022 15:10:38 +0800
Subject: [PATCH] Add Packit support for initial-setup
---
.packit.yml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 .packit.yml
diff --git a/.packit.yml b/.packit.yml
new file mode 100644
index 0000000..cac2945
--- /dev/null
+++ b/.packit.yml
@@ -0,0 +1,20 @@
+specfile_path: initial-setup.spec
+upstream_package_name: initial-setup
+upstream_tag_template: r{version}-1
+actions:
+ create-archive:
+ - "make BUILD_ARGS=sdist archive"
+ - 'bash -c "cp dist/*.tar.gz ."'
+ - 'bash -c "ls -1 initial-setup-*.tar.gz"'
+ jobs:
+ - job: tests
+ trigger: pull_request
+ metadata:
+ targets:
+ - fedora-rawhide
+
+ - job: copr_build
+ trigger: pull_request
+ metadata:
+ targets:
+ - fedora-eln
--
2.21.0

View File

@ -1,36 +0,0 @@
From 9c8ba1568f48079626d7cce2912420ba30064ef3 Mon Sep 17 00:00:00 2001
From: Vendula Poncova <vponcova@redhat.com>
Date: Fri, 12 Feb 2021 10:14:50 +0100
Subject: [PATCH] Drop python-nose from the dependencies (#1916799)
The initial setup doesn't use it.
Resolves: rhbz#1916799
---
initial-setup.spec | 1 -
setup.py | 1 -
2 files changed, 2 deletions(-)
diff --git a/initial-setup.spec b/initial-setup.spec
index 37bd5bf..2d75b6c 100644
--- a/initial-setup.spec
+++ b/initial-setup.spec
@@ -20,7 +20,6 @@ Group: System Environment/Base
BuildRequires: gettext
BuildRequires: python3-devel
BuildRequires: python3-setuptools
-BuildRequires: python3-nose
BuildRequires: systemd-units
BuildRequires: gtk3-devel
BuildRequires: glade-devel
diff --git a/setup.py b/setup.py
index 73cc025..9ab4ff9 100644
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,6 @@ setup(
"": ["*.glade"]
},
data_files = data_files,
- setup_requires= ['nose>=1.0'],
test_suite = "initial_setup",
long_description=read('README.rst'),
classifiers=[

View File

@ -1,193 +0,0 @@
From 0634c145af32d17e2e272a30fba4c5421c23761f Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Sat, 8 Aug 2020 23:10:59 +0200
Subject: [PATCH 060/116] Make sure the output from custom_getpass() is
serialized after stdout
custom_getpass() writes the prompt to the file descriptor of the console where
the last input came from. At the same time, run() races with it, piping the
sys.stdout data to the same file descriptor (and others).
To make matters worse, the stdout data is buffered and with nobody flushing it
always loses the race, with important stuff being written out only after
custom_getpass() returns and somebody cares to flush it out:
Password:
Password (confirm):
Password:
Password (confirm):
================================================================================
================================================================================
Root password
Please select new root password. You will have to type it twice.
The passwords you entered were different. Please try again.
================================================================================
================================================================================
Root password
Please select new root password. You will have to type it twice.
The password is too short
This patch turns on line buffering, removing the necessity of explicit flushes
from the stdout writer side.
That alone wouldn't be sufficient because the stdout traffic could still be
delayed until the piper thread is awoken; though things wouldn't be mixed up
nearly as severely. To cope with this race the active console traffic is piped
to the piper thread as well and it is now responsible for ordering things.
It is still ugly but hey.
---
initial_setup/tui/tui.py | 90 ++++++++++++++++++++++++++--------------
1 file changed, 59 insertions(+), 31 deletions(-)
diff --git a/initial_setup/tui/tui.py b/initial_setup/tui/tui.py
index 47f876d..347053e 100644
--- a/initial_setup/tui/tui.py
+++ b/initial_setup/tui/tui.py
@@ -34,9 +34,14 @@ class MultipleTTYHandler(object):
self._tui_stdin_fd = tui_stdin_fd
self._tui_stdin = os.fdopen(tui_stdin_fd, "w")
+ self._tui_active_out_fd, active_out_fd = os.pipe()
+ self._tui_active_out = os.fdopen(self._tui_active_out_fd, "r")
+ self._active_out = os.fdopen(active_out_fd, "w")
+
self._shutdown = False
- self._active_console = None
+ self._active_console_in = None
+ self._active_console_out = None
self._console_read_fos = {}
self._console_write_fos = []
@@ -82,6 +87,7 @@ class MultipleTTYHandler(object):
fds = list(self._console_read_fos.keys())
# as well as from the anaconda stdout
fds.append(self._tui_stdout_fd)
+ fds.append(self._tui_active_out_fd)
log.info("multi TTY handler starting")
while True:
# Watch the consoles and IS TUI stdout for data and
@@ -93,41 +99,58 @@ class MultipleTTYHandler(object):
if self._shutdown:
log.info("multi TTY handler shutting down")
break
- for fd in rlist:
- if fd == self._tui_stdout_fd:
- # We need to set the TUI stdout fd to non-blocking,
- # as otherwise reading from it would (predictably) result in
- # the readline() function blocking once it runs out of data.
- os.set_blocking(fd, False)
-
- # The IS TUI wants to write something,
- # read all the lines.
- lines = self._tui_stdout.readlines()
-
- # After we finish reading all the data we need to set
- # the TUI stdout fd to blocking again.
- # Otherwise the fd will not be usable when we try to read from
- # it again for unclear reasons.
- os.set_blocking(fd, True)
-
- lines.append("\n") # seems to get lost somewhere on the way
-
- # Write all the lines IS wrote to stdout to all consoles
- # that we consider usable for the IS TUI.
- for console_fo in self._console_write_fos.values():
- for one_line in lines:
- try:
- console_fo.write(one_line)
- except OSError:
- log.exception("failed to write %s to console %s", one_line, console_fo)
- else:
+ if self._tui_stdout_fd in rlist:
+ # We need to set the TUI stdout fd to non-blocking,
+ # as otherwise reading from it would (predictably) result in
+ # the readline() function blocking once it runs out of data.
+ os.set_blocking(self._tui_stdout_fd, False)
+
+ # The IS TUI wants to write something,
+ # read all the lines.
+ lines = self._tui_stdout.readlines()
+
+ # After we finish reading all the data we need to set
+ # the TUI stdout fd to blocking again.
+ # Otherwise the fd will not be usable when we try to read from
+ # it again for unclear reasons.
+ os.set_blocking(self._tui_stdout_fd, True)
+
+ lines.append("\n") # seems to get lost somewhere on the way
+
+ # Write all the lines IS wrote to stdout to all consoles
+ # that we consider usable for the IS TUI.
+ for console_fo in self._console_write_fos.values():
+ for one_line in lines:
+ try:
+ console_fo.write(one_line)
+ except OSError:
+ log.exception("failed to write %s to console %s", one_line, console_fo)
+
+ # Don't go processing the events on other file descriptors until
+ # we're done with everything that's supposed to be on stdout
+ continue
+ elif self._tui_active_out_fd in rlist:
+ # Essentially the same as above but for the acrive console only
+ os.set_blocking(self._tui_active_out_fd, False)
+ lines = self._tui_active_out.readlines()
+ os.set_blocking(self._tui_active_out_fd, True)
+ write_fo = self._active_console_out
+ try:
+ for one_line in lines:
+ write_fo.write(one_line)
+ write_fo.flush()
+ except OSError:
+ log.exception("failed to write %s to active console", lines)
+ else:
+ for fd in rlist:
# Someone typed some input to a console and hit enter,
# forward the input to the IS TUI stdin.
read_fo = self._console_read_fos[fd]
write_fo = self._console_write_fos[fd]
# as the console is getting input we consider it to be
# the currently active console
- self._active_console = read_fo, write_fo
+ self._active_console_in = read_fo
+ self._active_console_out = write_fo
try:
data = read_fo.readline()
except TypeError:
@@ -148,7 +171,10 @@ class MultipleTTYHandler(object):
Always restores terminal settings before returning.
"""
- input_fo, output_fo = self._active_console
+
+ input_fo = self._active_console_in
+ output_fo = self._active_out
+
passwd = None
with contextlib.ExitStack() as stack:
input_fd = input_fo.fileno()
@@ -179,6 +205,7 @@ class MultipleTTYHandler(object):
passwd = self._fallback_getpass(prompt, output_fo, input_fo)
output_fo.write('\n')
+ output_fo.flush()
return passwd
def _fallback_getpass(self, prompt='Password: ', output_fo=None, input_fo=None):
@@ -239,6 +266,7 @@ class InitialSetupTextUserInterface(TextUserInterface):
# stdout
tui_stdout_fd, stdout_fd = os.pipe()
sys.stdout = os.fdopen(stdout_fd, "w")
+ sys.stdout.reconfigure(line_buffering=True)
# instantiate and start the multi TTY handler
self.multi_tty_handler = MultipleTTYHandler(tui_stdin_fd=tui_stdin_fd, tui_stdout_fd=tui_stdout_fd)
--
2.38.1.windows.1

View File

@ -1,50 +0,0 @@
From 6995fc0923d61bd4d42380a34aefc17e4e94f13a Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Tue, 30 May 2023 09:34:35 +0800
Subject: [PATCH] Remove deprecated support for add-ons
---
initial_setup/__init__.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/initial_setup/__init__.py b/initial_setup/__init__.py
index a418cbe..5273a91 100644
--- a/initial_setup/__init__.py
+++ b/initial_setup/__init__.py
@@ -125,14 +125,14 @@ class InitialSetup(object):
gi.overrides.__path__.insert(0, p)
log.debug("GI overrides imported")
- from pyanaconda.addons import collect_addon_paths
+ from pyanaconda.ui.lib.addons import collect_addon_ui_paths
addon_paths = ["/usr/share/initial-setup/modules", "/usr/share/anaconda/addons"]
# append ADDON_PATHS dirs at the end
sys.path.extend(addon_paths)
- self._addon_module_paths = collect_addon_paths(addon_paths, self.gui_mode_id)
+ self._addon_module_paths = collect_addon_ui_paths(addon_paths, self.gui_mode_id)
log.info("found %d addon modules:", len(self._addon_module_paths))
for addon_path in self._addon_module_paths:
log.debug(addon_path)
@@ -202,7 +202,7 @@ class InitialSetup(object):
commandMap = dict((k, kickstart.commandMap[k]) for k in SUPPORTED_KICKSTART_COMMANDS)
# Prepare new data object
- self.data = kickstart.AnacondaKSHandler(self._addon_module_paths["ks"], commandUpdates=commandMap)
+ self.data = kickstart.AnacondaKSHandler(commandUpdates=commandMap)
kickstart_path = INPUT_KICKSTART_PATH
if os.path.exists(OUTPUT_KICKSTART_PATH):
@@ -329,7 +329,6 @@ class InitialSetup(object):
# Configure all addons
log.info("executing addons")
- self.data.addons.execute(storage=None, ksdata=self.data, users=None, payload=None)
boss_proxy = BOSS.get_proxy()
task_path = boss_proxy.InstallSystemWithTask()
--
2.33.0

19
anaconda-template.json Normal file
View File

@ -0,0 +1,19 @@
{
"_comment_": [
"This is a comment",
"with multiple lines."
],
"_default_": {
"file": "default-help.xml",
"anchor": ""
},
"installation-summary": {
"file": "anaconda-help.xml",
"anchor": ""
},
"user-configuration": {
"file": "anaconda-help.xml",
"anchor": "creating-a-user-account"
}
}

View File

@ -1,11 +0,0 @@
diff -uNrp a/initial_setup/product.py b/initial_setup/product.py
--- a/initial_setup/product.py 2018-07-27 20:51:58.000000000 +0800
+++ b/initial_setup/product.py 2019-08-12 22:19:17.280000000 +0800
@@ -7,7 +7,7 @@ import os
import glob
RELEASE_STRING_FILE = "/etc/os-release"
-LICENSE_FILE_GLOB = "/usr/share/redhat-release*/EULA*"
+LICENSE_FILE_GLOB = "/usr/share/openeuler-release*/EULA*"
log = logging.getLogger("initial-setup")

View File

@ -1,24 +1,21 @@
Name: initial-setup
Version: 0.3.83
Release: 5
Version: 0.3.94
Release: 1
Summary: Initialize system configuration for a newly installed computer
License: GPLv2+
URL: https://github.com/rhinstaller/initial-setup
Source0: https://github.com/rhinstaller/initial-setup/archive/r0.3.83-1.tar.gz
Patch0001: Drop-python-nose-from-the-dependencies.patch
Patch9001: initial-setup-add-support-openeuler.patch
Patch9002: Adapt-to-category-title-translation-fix-in-Anaconda.patch
Patch9003: Add-Packit-support-for-initial-setup.patch
Patch9004: Make-sure-the-output-from-custom_getpass-is-serializ.patch
Patch9005: Remove-deprecated-support-for-add-ons.patch
Source0: https://github.com/rhinstaller/initial-setup/archive/r%{version}-1.tar.gz
Source1: anaconda-template.json
%define debug_package %{nil}
BuildRequires: gettext python3-devel python3-setuptools systemd-units
BuildRequires: gtk3-devel glade-devel anaconda >= 29.13 intltool
Requires: python3 anaconda-tui >= 29.13 systemd >= 235 python3-libreport util-linux
Requires: gtk3 anaconda-gui >= 29.13 firstboot(windowmanager) xorg-x11-xinit
BuildRequires: gtk3-devel glade-devel anaconda >= 36.7 intltool
Requires: python3 anaconda-tui >= 36.7 systemd >= 235 python3-libreport util-linux
Requires: gtk3 anaconda-gui >= 36.7 firstboot(windowmanager) xorg-x11-xinit
Requires: xorg-x11-server-Xorg
Requires: python3-simpleline >= 1.4
Requires: isocut
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@ -32,17 +29,22 @@ The initial-setup application run during the first start of a newly installed co
makes it possible to configure the computer according to the needs of the user.
%prep
%autosetup -n initial-setup-r0.3.83-1 -p1
%autosetup -n initial-setup-r%{version}-1 -p1
rm -rf *.egg-info
#Source0 is not a git project, generate empty changlog
touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' > ChangeLog
sed -i 's/\/root\/anaconda-ks.cfg/\/etc\/isocut\/anaconda-ks.cfg/g' initial_setup/__init__.py
%build
%make_build
%check
make test
%install
%make_install
install -d -m 0755 %{buildroot}%{_datadir}/anaconda/help
cp %{SOURCE1} %{buildroot}%{_datadir}/anaconda/help/anaconda-tui.json
cp %{SOURCE1} %{buildroot}%{_datadir}/anaconda/help/anaconda-gui.json
%clean
rm -rf %{buildroot}
@ -57,6 +59,7 @@ rm -rf %{buildroot}
%systemd_postun %{name}.service
%files
#-f %{name}.lang
%doc README.rst COPYING
%{python3_sitelib}/{initial_setup*,initial_setup/gui/*}
%{_libexecdir}/%{name}/{run-initial-setup,firstboot-windowmanager,reconfiguration-mode-enabled}
@ -65,9 +68,13 @@ rm -rf %{buildroot}
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/conf.d
%config %{_sysconfdir}/%{name}/conf.d/*
%{_datadir}/anaconda/help/*
%exclude %{_defaultdocdir}/%{name}/ChangeLog
%changelog
* Sat Oct 07 2023 Ge Wang <wang__ge@126.com> - 0.3.94-1
- Update to version 0.3.94
* Mon Aug 28 2023 wangkai <13474090681@163.com> - 0.3.83-5
- Remove deprecated support for add-ons
- Remove old failing pre scriptlet

Binary file not shown.

BIN
r0.3.94-1.tar.gz Normal file

Binary file not shown.