[initial-setup][rhel7-branch] Split GUI code into a separate package (#999464)
Martin Kolman
mkolman at redhat.com
Thu Sep 11 09:58:02 UTC 2014
----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Thursday, September 11, 2014 9:16:47 AM
> Subject: [initial-setup][rhel7-branch] Split GUI code into a separate package (#999464)
>
> This is needed to have the Initial Setup utility available on installations
> without graphical stack.
>
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
> MANIFEST.in | 3 +--
> initial-setup.spec | 25 +++++++++++++++++--------
> initial_setup/__main__.py | 10 ++++++++--
> 3 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/MANIFEST.in b/MANIFEST.in
> index 60d27e6..9c43888 100644
> --- a/MANIFEST.in
> +++ b/MANIFEST.in
> @@ -3,6 +3,5 @@ include Makefile
> recursive-include systemd *
> recursive-include scripts *
> recursive-include po *.po *.pot Makefile
> -recursive-include modules *.py *.glade *.txt
> -recursive-include initial_setup *.py *.glade *.txt
> +recursive-include initial_setup *.py *.glade
> recursive-exclude modules *.pyc *.pyo
> diff --git a/initial-setup.spec b/initial-setup.spec
> index 6447734..9ccc1d1 100644
> --- a/initial-setup.spec
> +++ b/initial-setup.spec
> @@ -29,9 +29,9 @@ BuildRequires: glade-devel
> BuildRequires: pygobject3
> BuildRequires: anaconda >= %{anacondaver}
> BuildRequires: python-di
> -Requires: gtk3
> +
> Requires: python
> -Requires: anaconda >= %{anacondaver}
> +Requires: anaconda-tui >= %{anacondaver}
> Requires(post): systemd
> Requires(preun): systemd
> Requires(postun): systemd
> @@ -44,6 +44,15 @@ Conflicts: firstboot < 19.2
> The initial-setup utility runs after installation. It guides the user
> through
> a series of steps that allows for easier configuration of the machine.
>
> +%package gui
> +Summary: Graphical user interface for the initial-setup utility
> +Requires: gtk3
> +Requires: anaconda-gui >= %{anacondaver}
> +
> +%description gui
> +The initial-setup-gui package contains a graphical user interface for the
> +initial-setup utility.
> +
> %prep
> %setup -q
>
> @@ -83,14 +92,10 @@ fi
>
> %files -f %{name}.lang
> %doc COPYING README
> -%dir %{_datadir}/initial-setup/
> -%dir %{_datadir}/initial-setup/modules/
> -%{python_sitelib}/*
> +%{python_sitelib}/initial_setup*
> +%exclude %{python_sitelib}/initial_setup/gui
> %{_bindir}/initial-setup
> %{_bindir}/firstboot-windowmanager
> -%{_datadir}/initial-setup/modules/*
> -
> -%{_unitdir}/initial-setup-graphical.service
> %{_unitdir}/initial-setup-text.service
>
> %ifarch s390 s390x
> @@ -98,6 +103,10 @@ fi
> %{_sysconfdir}/profile.d/initial-setup.csh
> %endif
>
> +%files gui
> +%{python_sitelib}/initial_setup/gui/*
> +%{_unitdir}/initial-setup-graphical.service
> +
>
> %changelog
> * Mon Sep 8 2014 Martin Kolman <mkolman at redhat.com> - 0.3.9.13-1
> diff --git a/initial_setup/__main__.py b/initial_setup/__main__.py
> index 4682167..429008a 100644
> --- a/initial_setup/__main__.py
> +++ b/initial_setup/__main__.py
> @@ -78,8 +78,14 @@ except pykickstart.errors.KickstartError as kserr:
> sys.exit(1)
>
> if mode == "gui":
> - # Import IS gui specifics
> - import gui
> + try:
> + # Try to import IS gui specifics
> + import gui
> + except ImportError:
> + mode = "tui"
> +
> +if mode == "gui":
> + # gui already imported (see above)
>
> # Add addons to search paths
> gui.InitialSetupGraphicalUserInterface.update_paths(addon_module_paths)
> --
> 1.9.3
>
Looks good - thanks & ACK! :)
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list