[Fedora-spins] [spin-kickstarts] desktop: prevent unintended failures in the livesys initscript

Matthias Clasen mclasen at fedoraproject.org
Wed Mar 23 15:59:59 UTC 2011


commit 8141a790b574b7a352da54459e6f31081299dab3
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Wed Mar 23 11:58:48 2011 -0400

    desktop: prevent unintended failures in the livesys initscript
    
    Some of the tweaks we do there may fail if the packages containing
    the touched files are not present. Better be careful.

 fedora-live-desktop.ks |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/fedora-live-desktop.ks b/fedora-live-desktop.ks
index f722e99..dc94c14 100644
--- a/fedora-live-desktop.ks
+++ b/fedora-live-desktop.ks
@@ -27,24 +27,25 @@ cat >> /usr/share/glib-2.0/schemas/org.gnome.desktop.screensaver.gschema.overrid
 lock-enabled=false
 FOE
 
-# Show harddisk install in shell dash
-sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop
-# need to move it to anaconda.desktop to make shell happy
-mv /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
-
-cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
+# make the installer show up
+if [ -f /usr/share/applications/liveinst.desktop ]; then
+  # Show harddisk install in shell dash
+  sed -i -e 's/NoDisplay=true/NoDisplay=false/' /usr/share/applications/liveinst.desktop ""
+  # need to move it to anaconda.desktop to make shell happy
+  mv /usr/share/applications/liveinst.desktop /usr/share/applications/anaconda.desktop
+
+  cat >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override << FOE
 [org.gnome.shell]
 favorite-apps=['mozilla-firefox.desktop', 'evolution.desktop', 'empathy.desktop', 'rhythmbox.desktop', 'shotwell.desktop', 'openoffice.org-writer.desktop', 'nautilus.desktop', 'anaconda.desktop']
 FOE
-glib-compile-schemas /usr/share/glib-2.0/schemas
 
-# add installer to user menu
-mkdir -p ~liveuser/.local/share/gnome-shell/extensions/Installer at shell-extensions.fedoraproject.org
-cat >> ~liveuser/.local/share/gnome-shell/extensions/Installer at shell-extensions.fedoraproject.org/metadata.json << FOE
+  # add installer to user menu
+  mkdir -p ~liveuser/.local/share/gnome-shell/extensions/Installer at shell-extensions.fedoraproject.org
+  cat >> ~liveuser/.local/share/gnome-shell/extensions/Installer at shell-extensions.fedoraproject.org/metadata.json << FOE
 {"shell-version": ["2.91.91"], "uuid": "Installer at shell-extensions.fedoraproject.org", "name": "Installer", "description": "Install OS from user menu"}
 FOE
 
-cat >> ~liveuser/.local/share/gnome-shell/extensions/Installer at shell-extensions.fedoraproject.org/extension.js << FOE
+  cat >> ~liveuser/.local/share/gnome-shell/extensions/Installer at shell-extensions.fedoraproject.org/extension.js << FOE
 const PopupMenu = imports.ui.popupMenu;
 const Shell = imports.gi.Shell;
 const Main = imports.ui.main;
@@ -59,6 +60,11 @@ function main() {
 }
 FOE
 
+fi
+
+# rebuild schema cache with any overrides we installed
+glib-compile-schemas /usr/share/glib-2.0/schemas
+
 # set up timed auto-login for after 60 seconds
 cat >> /etc/gdm/custom.conf << FOE
 [daemon]
@@ -67,7 +73,9 @@ AutomaticLogin=liveuser
 FOE
 
 # Turn off PackageKit-command-not-found while uninstalled
-sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
+if [ -f /etc/PackageKit/CommandNotFound.conf ]; then
+  sed -i -e 's/^SoftwareSourceSearch=true/SoftwareSourceSearch=false/' /etc/PackageKit/CommandNotFound.conf
+fi
 
 EOF
 


More information about the spins mailing list