Skip to content

Commit

Permalink
Merge branch 'f36-devel' into f36-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jkonecny12 committed Mar 28, 2022
2 parents 724daca + 8e93822 commit d227ad5
Show file tree
Hide file tree
Showing 24 changed files with 197 additions and 58 deletions.
15 changes: 15 additions & 0 deletions .packit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ specfile_path: anaconda.spec
upstream_package_name: anaconda
upstream_tag_template: anaconda-{version}-1
copy_upstream_release_description: true
srpm_build_deps:
- automake
- autoconf
- autogen
- glib2-devel
- gettext-devel
- python3-polib
- gobject-introspection-devel
- glade-devel
- libxklavier-devel
- libarchive-devel
- rpm-devel
- audit-libs-devel
- nss_wrapper
- npm
actions:
post-upstream-clone:
- ./autogen.sh
Expand Down
3 changes: 1 addition & 2 deletions anaconda.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ def setup_environment():
# The module-level _() calls are ok here because the language may
# be set from the live environment in this case, and anaconda's
# language setup hasn't happened yet.
# FIXME: change the line below back to found-_-in-module-class once it works in pylint
# pylint: disable=W9902
# pylint: disable=found-_-in-module-class
util.execWithRedirect("zenity",
["--error", "--title", _("Unable to create PID file"), "--text",
_("Anaconda is unable to create %s because the file"
Expand Down
1 change: 1 addition & 0 deletions anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ BuildRequires: desktop-file-utils
Requires: anaconda-gui = %{version}-%{release}
Requires: usermode
Requires: zenity
Requires: xisxwayland
Recommends: xhost

%description live
Expand Down
5 changes: 5 additions & 0 deletions pyanaconda/core/configuration/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ def can_configure_keyboard(self):
"""Can we configure the keyboard?"""
return self._is_boot_iso or self._is_live_os or self._is_booted_os

@property
def can_run_on_xwayland(self):
"""Could we run on XWayland?"""
return self._is_live_os

@property
def can_modify_syslog(self):
"""Can we modify syslog?"""
Expand Down
3 changes: 3 additions & 0 deletions pyanaconda/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ def sigusr1_too_late_handler(num, frame):
def sigusr1_preexec():
signal.signal(signal.SIGUSR1, signal.SIG_IGN)

old_sigalrm_handler = None
old_sigusr1_handler = None
childproc = None
try:
old_sigusr1_handler = signal.signal(signal.SIGUSR1, sigusr1_success_handler)
old_sigalrm_handler = signal.signal(signal.SIGALRM, sigalrm_handler)
Expand Down
48 changes: 46 additions & 2 deletions pyanaconda/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from pyanaconda.core.configuration.anaconda import conf
from pyanaconda import localization
from pyanaconda.core.constants import DEFAULT_KEYBOARD
from pyanaconda.core.util import execWithRedirect
from pyanaconda.modules.common.task import sync_run_task
from pyanaconda.modules.common.constants.services import LOCALIZATION

Expand Down Expand Up @@ -55,6 +56,49 @@ class InvalidLayoutVariantSpec(Exception):
pass


def _is_xwayland():
"""Is Anaconda running in XWayland environment?
This can't be easily detected from the Anaconda because Anaconda
is running as XWayland app. Use xisxwayland tool for the detection.
"""
try:
rc = execWithRedirect('xisxwayland', [])

if rc == 0:
return True

log.debug(
"Anaconda doesn't run on XWayland. "
"See xisxwayland --help for more info."
)
except FileNotFoundError:
log.warning(
"The xisxwayland tool is not available! "
"Taking the environment as not Wayland."
)

return False


def can_configure_keyboard():
"""Can we configure the keyboard?
FIXME: This is a temporary solution.
The is_wayland logic is not part of the configuration so we would
have to add it to the configuration otherwise it won't be accessible
in the Anaconda modules.
"""
if not conf.system.can_configure_keyboard:
return False

if conf.system.can_run_on_xwayland and _is_xwayland():
return False

return True


def parse_layout_variant(layout_variant_str):
"""
Parse layout and variant from the string that may look like 'layout' or
Expand Down Expand Up @@ -180,7 +224,7 @@ def set_x_keyboard_defaults(localization_proxy, xkl_wrapper):
new_layouts = [DEFAULT_KEYBOARD]

localization_proxy.SetXLayouts(new_layouts)
if conf.system.can_configure_keyboard:
if can_configure_keyboard():
xkl_wrapper.replace_layouts(new_layouts)

# the console layout configured should be "native" by default,
Expand All @@ -193,7 +237,7 @@ def set_x_keyboard_defaults(localization_proxy, xkl_wrapper):
# initialize layout switching if needed
localization_proxy.SetLayoutSwitchOptions(["grp:alt_shift_toggle"])

if conf.system.can_configure_keyboard:
if can_configure_keyboard():
xkl_wrapper.set_switching_options(["grp:alt_shift_toggle"])
# activate the language-default layout instead of the additional
# one
Expand Down
16 changes: 9 additions & 7 deletions pyanaconda/modules/network/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,17 @@ def _copy_device_config_files(self, root):
:param root: path to the root of the target system
:type root: str
"""
for config_file in os.listdir(self.NETWORK_SCRIPTS_DIR_PATH):
if config_file.startswith(self.NETWORK_SCRIPTS_CONFIG_FILE_PREFIXES):
config_file_path = os.path.join(self.NETWORK_SCRIPTS_DIR_PATH,
if os.path.exists(self.NETWORK_SCRIPTS_DIR_PATH):
for config_file in os.listdir(self.NETWORK_SCRIPTS_DIR_PATH):
if config_file.startswith(self.NETWORK_SCRIPTS_CONFIG_FILE_PREFIXES):
config_file_path = os.path.join(self.NETWORK_SCRIPTS_DIR_PATH,
config_file)
self._copy_file_to_root(root, config_file_path)
if os.path.exists(self.NM_SYSTEM_CONNECTIONS_DIR_PATH):
for config_file in os.listdir(self.NM_SYSTEM_CONNECTIONS_DIR_PATH):
config_file_path = os.path.join(self.NM_SYSTEM_CONNECTIONS_DIR_PATH,
config_file)
self._copy_file_to_root(root, config_file_path)
for config_file in os.listdir(self.NM_SYSTEM_CONNECTIONS_DIR_PATH):
config_file_path = os.path.join(self.NM_SYSTEM_CONNECTIONS_DIR_PATH,
config_file)
self._copy_file_to_root(root, config_file_path)

def _copy_dhclient_config_files(self, root, network_ifaces):
"""Copy dhclient configuration files to target system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ def _fill_var_subdirectories(self):
Next, run tmpfiles to make subdirectories of /var. We need this for both mounts like
/home (really /var/home) and %post scripts might want to write to e.g. `/srv`, `/root`,
`/usr/local`, etc. The /var/lib/rpm symlink is also critical for having e.g. `rpm -qa`
work in %post. We don't iterate *all* tmpfiles because we don't have the matching NSS
`/usr/local`, etc. We don't iterate *all* tmpfiles because we don't have the matching NSS
configuration inside Anaconda, and we can't "chroot" to get it because that would require
mounting the API filesystems in the target.
"""
make_directories(self._sysroot + '/var/lib')
self._create_tmpfiles('/var/home')
self._create_tmpfiles('/var/roothome')
self._create_tmpfiles('/var/lib/rpm')
self._create_tmpfiles('/var/opt')
self._create_tmpfiles('/var/srv')
self._create_tmpfiles('/var/usrlocal')
Expand Down
15 changes: 13 additions & 2 deletions pyanaconda/ui/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import gi
gi.require_version("Gdk", "3.0")
gi.require_version("Gtk", "3.0")
gi.require_version("AnacondaWidgets", "3.3")
gi.require_version("AnacondaWidgets", "3.4")
gi.require_version("Keybinder", "3.0")
gi.require_version("GdkPixbuf", "2.0")
gi.require_version("GObject", "2.0")
Expand All @@ -41,8 +41,9 @@
from pyanaconda import threading as anaconda_threading

from pyanaconda.core.glib import Bytes, GError
from pyanaconda.keyboard import can_configure_keyboard
from pyanaconda.ui import UserInterface, common
from pyanaconda.ui.gui.utils import unbusyCursor
from pyanaconda.ui.gui.utils import unbusyCursor, really_hide
from pyanaconda.core.async_utils import async_action_wait
from pyanaconda.ui.gui.utils import watch_children, unwatch_children
from pyanaconda.ui.gui.helpers import autoinstall_stopped
Expand Down Expand Up @@ -159,6 +160,16 @@ class in the action list instead of going on to

self.builder.connect_signals(self)

# Hide keyboard indicator if we can't configure the keyboard
# It doesn't really give you any benefit of seeing something which could
# give you wrong values.
# This has to be applied to every spoke and hub - we have to ignore dialog and other
# non full screen parts.
if not can_configure_keyboard() and isinstance(self.window, AnacondaWidgets.BaseWindow):
layout_indicator = self.window.get_layout_indicator_box()
really_hide(layout_indicator)
layout_indicator.set_sensitive(False)

def _findUIFile(self):
path = os.environ.get("UIPATH", "./:/usr/share/anaconda/ui/")
dirs = path.split(":")
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/ui/gui/hubs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _createBox(self):
import gi

gi.require_version("Gtk", "3.0")
gi.require_version("AnacondaWidgets", "3.3")
gi.require_version("AnacondaWidgets", "3.4")

from gi.repository import Gtk, AnacondaWidgets

Expand Down
3 changes: 2 additions & 1 deletion pyanaconda/ui/gui/main.glade
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<child internal-child="vbox">
<object class="GtkBox" id="quitDialog-vbox1">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child internal-child="action_area">
Expand Down Expand Up @@ -136,7 +137,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">application-exit-symbolic</property>
<property name="icon_size">6</property>
<property name="icon_size">5</property>
</object>
<packing>
<property name="expand">False</property>
Expand Down
13 changes: 6 additions & 7 deletions pyanaconda/ui/gui/spokes/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from pyanaconda import keyboard
from pyanaconda import flags
from pyanaconda.core.i18n import _, N_, CN_
from pyanaconda.core.configuration.anaconda import conf
from pyanaconda.core.constants import DEFAULT_KEYBOARD, THREAD_KEYBOARD_INIT, THREAD_ADD_LAYOUTS_INIT
from pyanaconda.ui.communication import hubQ
from pyanaconda.core.string import strip_accents, have_word_match
Expand Down Expand Up @@ -381,7 +380,7 @@ def initialize(self):
self._add_dialog = AddLayoutDialog(self.data)
self._add_dialog.initialize()

if conf.system.can_configure_keyboard:
if keyboard.can_configure_keyboard():
self.builder.get_object("warningBox").hide()

# We want to store layouts' names but show layouts as
Expand All @@ -401,7 +400,7 @@ def initialize(self):

self._layoutSwitchLabel = self.builder.get_object("layoutSwitchLabel")

if not conf.system.can_configure_keyboard:
if not keyboard.can_configure_keyboard():
# Disable area for testing layouts as we cannot make
# it work without modifying runtime system

Expand Down Expand Up @@ -453,7 +452,7 @@ def refresh(self):

def _addLayout(self, store, name):
# first try to add the layout
if conf.system.can_configure_keyboard:
if keyboard.can_configure_keyboard():
self._xkl_wrapper.add_layout(name)

# valid layout, append it to the store
Expand All @@ -466,7 +465,7 @@ def _removeLayout(self, store, itr):
"""

if conf.system.can_configure_keyboard:
if keyboard.can_configure_keyboard():
self._xkl_wrapper.remove_layout(store[itr][0])
store.remove(itr)

Expand Down Expand Up @@ -558,7 +557,7 @@ def on_up_clicked(self, button):
return

store.swap(cur, prev)
if conf.system.can_configure_keyboard:
if keyboard.can_configure_keyboard():
self._flush_layouts_to_X()

if not store.iter_previous(cur):
Expand All @@ -581,7 +580,7 @@ def on_down_clicked(self, button):
return

store.swap(cur, nxt)
if conf.system.can_configure_keyboard:
if keyboard.can_configure_keyboard():
self._flush_layouts_to_X()

if activate_default:
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/ui/gui/spokes/lib/accordion.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pyanaconda.ui.gui.utils import escape_markup, really_hide, really_show

import gi
gi.require_version("AnacondaWidgets", "3.3")
gi.require_version("AnacondaWidgets", "3.4")
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, AnacondaWidgets

Expand Down
15 changes: 5 additions & 10 deletions pyanaconda/ui/gui/spokes/network.glade
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,8 @@
<property name="halign">end</property>
<property name="valign">start</property>
<property name="xalign">1</property>
<property name="pixel_size">48</property>
<property name="icon_name">network-wired-symbolic</property>
<property name="icon_size">6</property>
<property name="icon_size">3</property>
</object>
<packing>
<property name="left_attach">0</property>
Expand Down Expand Up @@ -1003,9 +1002,8 @@
<property name="halign">end</property>
<property name="valign">start</property>
<property name="xalign">1</property>
<property name="pixel_size">48</property>
<property name="icon_name">network-wireless-symbolic</property>
<property name="icon_size">6</property>
<property name="icon_size">3</property>
</object>
<packing>
<property name="left_attach">0</property>
Expand Down Expand Up @@ -1471,9 +1469,8 @@
<property name="halign">end</property>
<property name="valign">start</property>
<property name="xalign">1</property>
<property name="pixel_size">48</property>
<property name="icon_name">network-cellular-connected-symbolic</property>
<property name="icon_size">6</property>
<property name="icon_size">3</property>
</object>
<packing>
<property name="left_attach">0</property>
Expand Down Expand Up @@ -1788,9 +1785,8 @@
<property name="halign">end</property>
<property name="valign">start</property>
<property name="xalign">1</property>
<property name="pixel_size">48</property>
<property name="icon_name">network-vpn-symbolic</property>
<property name="icon_size">6</property>
<property name="icon_size">3</property>
</object>
<packing>
<property name="left_attach">0</property>
Expand Down Expand Up @@ -2054,9 +2050,8 @@
<property name="halign">end</property>
<property name="valign">start</property>
<property name="xalign">1</property>
<property name="pixel_size">48</property>
<property name="icon_name">preferences-system-network-symbolic</property>
<property name="icon_size">6</property>
<property name="icon_size">3</property>
</object>
<packing>
<property name="left_attach">0</property>
Expand Down
5 changes: 3 additions & 2 deletions pyanaconda/ui/gui/spokes/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,10 @@ def vbox(self):

def _add_device_columns(self, treeview):
rnd = Gtk.CellRendererPixbuf()
rnd.set_property("stock-size", Gtk.IconSize.DND)
rnd.set_property("stock-size", Gtk.IconSize.MENU)
# TODO Gtk3 icon-name? (also at other places)
col = Gtk.TreeViewColumn("Icon", rnd, **{"icon-name":0})
col.set_min_width(27)
treeview.append_column(col)

rnd = Gtk.CellRendererText()
Expand Down Expand Up @@ -1032,7 +1033,7 @@ def _refresh_header_ui(self, dev_cfg, state=None):
if dev_type_str == "wired":
# update icon according to device status
img = self.builder.get_object("image_wired_device")
img.set_from_icon_name(self._dev_icon_name(dev_cfg), Gtk.IconSize.DIALOG)
img.set_from_icon_name(self._dev_icon_name(dev_cfg), Gtk.IconSize.LARGE_TOOLBAR)

# TODO: is this necessary? Isn't it static from glade?
device_type_label = _(self.device_type_name.get(dev_cfg.device_type, ""))
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/ui/gui/spokes/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
gi.require_version("AnacondaWidgets", "3.3")
gi.require_version("AnacondaWidgets", "3.4")
from gi.repository import Gdk, AnacondaWidgets, Gtk

log = get_module_logger(__name__)
Expand Down
Loading

0 comments on commit d227ad5

Please sign in to comment.