[gnome-shell] Remove pre-GNOME-2.26 panel-replacement code



commit 3adec65e2002f4adb67a55861843a71c39e05af3
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Aug 27 16:19:35 2009 -0400

    Remove pre-GNOME-2.26 panel-replacement code
    
    gnome-shell.in: Remove the code to replace gnome-panel by attaching
      to it with GDB; this was always problematical (required gdb, debug
      symbols, finding the pid of gnome-panel, etc.)
    
    gnome-shell-build-setup.sh: Require 2.26 to be in place before building
      the shell; remove gdb from the list of required packages.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=593325

 src/gnome-shell.in                     |   59 --------------------------------
 tools/build/gnome-shell-build-setup.sh |   21 ++++++++++-
 2 files changed, 19 insertions(+), 61 deletions(-)
---
diff --git a/src/gnome-shell.in b/src/gnome-shell.in
index 9be3fe8..a9003a3 100644
--- a/src/gnome-shell.in
+++ b/src/gnome-shell.in
@@ -14,63 +14,6 @@ import termios
 import time
 import errno
 
-def find_cmd (cmd_list):
-    """
-    Takes a list of command candidates and returns the first one that exists.
-    Raises a system exit if none of the commands exist.
-    """
-    for cmd in cmd_list:
-        if os.path.exists(cmd):
-            return cmd
-    
-    raise SystemExit("None of the commands %s exist" % cmd_list)
-    
-def pidof(command):
-    pidof_cmd = find_cmd(["/sbin/pidof", "/bin/pidof", "/usr/bin/pidof"])
-    pidof = subprocess.Popen([pidof_cmd, command], stdout=subprocess.PIPE)
-    pids = pidof.communicate()[0].split()
-    pidof.wait()
-
-    # pidof doesn't have a "current user only" option, so we may have
-    # gotten the pids of other users' processes. Fix that.
-    for pid in pids:
-        try:
-            os.kill(int(pid), 0)
-            return pid
-        except Exception, e:
-            pass
-    return None
-
-def kill_legacy_gnome_panel():
-    # Do import lazily to save time and memory
-    import dbus
-
-    # In Gnome 2.26 the panel grabs a dbus name and allows replacement
-    bus = dbus.Interface(dbus.SessionBus().get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'),
-                         'org.freedesktop.DBus')
-    names = bus.ListNames()
-    if 'org.gnome.Panel' in names:
-        # OK, we have the new replaceable gnome panel (or gnome-shell), all we have to
-        # do is start the shell
-        return
-
-    gnome_panel_pid = pidof("gnome-panel")
-    if gnome_panel_pid is None:
-        # No gnome-panel, nothing to do
-        return
-
-    if options.verbose:
-        print "Terminating panel process %s" % pid
-
-    # We can't just kill it, since the session will auto-start it again, so
-    # we do this horrible thing
-    devnull = open("/dev/null", "w")
-    subprocess.call(["gdb", "-batch-silent",
-                     "-ex", "call panel_session_do_not_restart()",
-                     "-ex", "call exit(0)",
-                     "-p", gnome_panel_pid], stdout=devnull, stderr=devnull)
-    devnull.close()
-
 def start_xephyr():
     tmpdir = tempfile.mkdtemp("", "gnome-shell.")
     atexit.register(shutil.rmtree, tmpdir)
@@ -317,8 +260,6 @@ try:
         shell = start_shell()
     else:
         xephyr = None
-        if options.replace:
-            kill_legacy_gnome_panel()
         shell = start_shell()
 
     # Wait for shell to exit
diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh
index 5bcda53..885f0fc 100755
--- a/tools/build/gnome-shell-build-setup.sh
+++ b/tools/build/gnome-shell-build-setup.sh
@@ -10,6 +10,23 @@
 # Copyright (C) 2006, 2007, 2008 Imendio AB
 #
 
+# Pre-check on GNOME version
+
+gnome_version=`gnome-session --version 2>/dev/null | (read name version && echo $version)`
+have_gnome_26=false
+case $gnome_version in
+    2.2[6789]*|2.[3456789]*|3.*)
+	have_gnome_26=true
+    ;;
+esac
+
+if $have_gnome_26 ; then : ; else
+   echo "GNOME 2.26 or newer is required to build GNOME Shell" 1>&2
+   exit 1
+fi
+
+############################################################
+
 if which lsb_release > /dev/null 2>&1; then
   system=`lsb_release -is`
 elif [ -f /etc/fedora-release ] ; then
@@ -35,7 +52,7 @@ fi
 # ({mozilla,firefox,xulrunner}-js), xdamage
 #
 # Non-devel packages needed by gnome-shell and its deps:
-# gdb, glxinfo, gstreamer-plugins-base, gstreamer-plugins-good,
+# glxinfo, gstreamer-plugins-base, gstreamer-plugins-good,
 # python, Xephyr, xeyes*, xlogo*, xterm*, zenity
 #
 # (*)ed packages are only needed because gnome-shell launches them
@@ -88,7 +105,7 @@ if test x$system = xFedora ; then
     librsvg2-devel libwnck-devel mesa-libGL-devel python-devel readline-devel \
     xulrunner-devel libXdamage-devel \
     gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good \
-    gdb glx-utils xorg-x11-apps xorg-x11-server-Xephyr xterm zenity \
+    glx-utils xorg-x11-apps xorg-x11-server-Xephyr xterm zenity \
     ; do
       if ! rpm -q $pkg > /dev/null 2>&1; then
         reqd="$pkg $reqd"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]