2007-11-27 Brian Cameron <[email protected]>
authoryippi
Tue, 27 Nov 2007 20:57:26 +0000
changeset 11248 8beb301a729a
parent 11247 1923a32b2c35
child 11249 f5704dbb8375
2007-11-27 Brian Cameron <[email protected]> * ext-sources/gnome-cleanup, manpages/man1/gnome-cleanup.1: Add "user" operand so that you can specify which user's configuration files will be erased. Update manpage to add information about this new operand. Fixes bug #6628566. This feature is needed for Trusted JDS. * manpages/man1/yelp.1: Minor cleanup.
ChangeLog
ext-sources/gnome-cleanup
manpages/man1/gnome-cleanup.1
manpages/man1/yelp.1
--- a/ChangeLog	Tue Nov 27 11:45:19 2007 +0000
+++ b/ChangeLog	Tue Nov 27 20:57:26 2007 +0000
@@ -1,3 +1,12 @@
+2007-11-27  Brian Cameron  <[email protected]>
+
+	* ext-sources/gnome-cleanup, manpages/man1/gnome-cleanup.1:
+	  Add "user" operand so that you can specify which user's
+	  configuration files will be erased.  Update manpage to add
+	  information about this new operand.  Fixes bug #6628566.  This
+	  feature is needed for Trusted JDS.
+	* manpages/man1/yelp.1: Minor cleanup.
+
 2007-11-27  Damien Carbery <[email protected]>
 
 	* base-specs/gnome-terminal.spec: Bump to 2.18.3.
@@ -390,9 +399,9 @@
 2007-11-12  Brian Cameron  <[email protected]>
 
 	* manpages/man1/*: Fix orca manpage to include new/missing options,
-	  fix some minor bugs in the GStreamer, gok, and totem-video-thumbnailer
-	  manpages, fix old gaim manpage so it is the same as the pidgin
-	  manpage.
+	  fix some minor bugs in the GStreamer, gok, and
+	  totem-video-thumbnailer manpages, fix old gaim manpage so it is the
+	  same as the pidgin manpage.
 	* manapges/man5/*: Fix gnome-std-options, gst-std-options manpage
 	  to include current arguments.  Minor improvements to the
 	  gnome-interfaces.5 manpage.
--- a/ext-sources/gnome-cleanup	Tue Nov 27 11:45:19 2007 +0000
+++ b/ext-sources/gnome-cleanup	Tue Nov 27 20:57:26 2007 +0000
@@ -1,36 +1,75 @@
-#!/bin/sh
+#!/bin/ksh
 #
-# Cleans up Sun's Gnome Desktop user files to return the user
-# to the default desktop configuration.
+# Cleans up the GNOME Desktop user configuration files.  This
+# will return the user to the default desktop configuration.
+# Useful if the user's configuration has become corrupted.
 # 
 # By: Brian Cameron <[email protected]>
 
+# The first argument can be a user name.  If so, then the script
+# will clean up the files for that specified user (if file
+# permissions permit).  If no argument is given, the default value
+# is the current user.
+#
+if [ $# -ge 1 ]; then
+  LOGNAME="$1"
+  USRHOME=`echo ~$1`
+else
+  USRHOME="$HOME"
+  if [ -z "$LOGNAME" ]; then
+    LOGNAME=`/usr/bin/logname`
+  fi
+fi
+
+# Error if the directory for this user does not exist.
+#
+if [ ! -d "$USRHOME" ]; then
+   echo ""
+   echo "Error: user $LOGNAME does not exist on this system."
+   echo ""
+   exit 1
+fi
+
+# If USRHOME is the root directory, just set USRHOME to nothing
+# to avoid double-slash in the output since we refer to files
+# as $USRHOME/.gconf, for example.
+#
+if [ "$USRHOME" = "/" ]; then
+   USRHOME=""
+fi
+
 # Check if GNOME is running:
 #
-if [ -z "$LOGNAME" ]; then
-  LOGNAME=`/usr/bin/logname`
-fi
 GNOME_PROCESSES='(gnome-session|gconfd|gconfd-2|metacity|esd)'
 RUNNING_PROCESSES=`/usr/bin/pgrep -l -U $LOGNAME "$GNOME_PROCESSES"`
+rc=$?
+if [ $rc -ge 2 ]; then
+   echo ""
+   echo "Error getting user process information for user $LOGNAME..."
+   echo ""
+   exit 1
+fi
 
 if [ ! -z "$RUNNING_PROCESSES" ]; then
-   echo "The following GNOME processes are still running:"
-   echo
+   echo ""
+   echo "The following GNOME processes are still running for user $LOGNAME:"
+   echo ""
    echo "$RUNNING_PROCESSES"
-   echo
-   echo "Please log out from GNOME and stop all your GNOME processes"
-   echo "before running this script."
-
+   echo ""
+   echo "Please log out user $LOGNAME from GNOME, so this user has no"
+   echo "GNOME processes running before using gnome-cleanup.  For example,"
+   echo "log out, and log into a failsafe session to run gnome-cleanup."
+   echo ""
    exit 1
 fi
 
 # GNOME 2.x files
 #
-gnome_files="$HOME/.gconf $HOME/.gconfd $HOME/.gnome $HOME/.gnome-desktop $HOME/.gnome2 $HOME/.gnome2_private $HOME/.metacity $HOME/.nautilus $HOME/.esd_auth $HOME/.gtkrc $HOME/.gtkrc-1.2-gnome2 $HOME/.nautilus-metafile.xml $HOME/.gstreamer-0.10 $HOME/.local/share"
+gnome_files="$USRHOME/.gconf $USRHOME/.gconfd $USRHOME/.gnome $USRHOME/.gnome-desktop $USRHOME/.gnome2 $USRHOME/.gnome2_private $USRHOME/.metacity $USRHOME/.nautilus $USRHOME/.esd_auth $USRHOME/.gtkrc $USRHOME/.gtkrc-1.2-gnome2 $USRHOME/.nautilus-metafile.xml $USRHOME/.gstreamer-0.10 $USRHOME/.local/share"
 
 # GNOME 1.4 files
 #
-gnome_14_files="$HOME/.gimp-1.2 $HOME/.gnome-help-browser $HOME/.gnome_private $HOME/.thumbnails $HOME/Nautilus"
+gnome_14_files="$USRHOME/.gimp-1.2 $USRHOME/.gnome-help-browser $USRHOME/.gnome_private $USRHOME/.thumbnails $USRHOME/Nautilus"
 
 # /var/tmp stuff
 #
@@ -41,7 +80,7 @@
 if [ ! -z "$has_files" ]
 then
    echo ""
-   echo "You currently have the following GNOME configuration files:"
+   echo "User $LOGNAME currently has the following GNOME configuration files:"
    echo ""
    echo "$has_files"
    echo ""
@@ -51,13 +90,18 @@
    if [ "$input" = "Y" -o "$input" = "y" ]
    then
       /bin/rm -fR $has_files
-      echo "Removed..."
+      rc=$?
+      if [ $rc = 0 ]; then
+         echo "Removed..."
+      else
+         echo "Error removing files..."
+      fi
    else
       echo "Not removed..."
    fi
    echo ""
 else
    echo ""
-   echo "You do not have any GNOME configuration files."
+   echo "User $LOGNAME does not have any GNOME configuration files."
    echo ""
 fi
--- a/manpages/man1/gnome-cleanup.1	Tue Nov 27 11:45:19 2007 +0000
+++ b/manpages/man1/gnome-cleanup.1	Tue Nov 27 20:57:26 2007 +0000
@@ -12,45 +12,75 @@
 <refentry id="gnome-cleanup-1">
 <!-- %Z%%M% %I% %E% SMI; -->
 <refmeta><refentrytitle>gnome-cleanup</refentrytitle><manvolnum>1</manvolnum>
-<refmiscinfo class="date">07 Nov 2007</refmiscinfo>
+<refmiscinfo class="date">27 Nov 2007</refmiscinfo>
 <refmiscinfo class="sectdesc">&man1;</refmiscinfo>
 <refmiscinfo class="software">&release;</refmiscinfo>
 <refmiscinfo class="arch">generic</refmiscinfo>
 <refmiscinfo class="copyright">&suncopy;</refmiscinfo>
 </refmeta>
-<indexterm><primary>gnome-cleanup</primary></indexterm><indexterm><primary>
-cleans GNOME user preferences</primary></indexterm><refnamediv id="gnome-cleanup-1-name">
-<refname>gnome-cleanup</refname><refpurpose>cleans GNOME user preferences</refpurpose>
+<indexterm><primary>gnome-cleanup</primary></indexterm><indexterm>
+<primary>
+cleans GNOME user preferences
+</primary></indexterm><refnamediv id="gnome-cleanup-1-name">
+<refname>gnome-cleanup</refname><refpurpose>
+cleans GNOME user preferences
+</refpurpose>
 </refnamediv>
 <refsynopsisdiv id="gnome-cleanup-1-synp"><title>&synp-tt;</title>
 <cmdsynopsis><command>&cmd;</command>
+<arg choice="plain"><option role="nodash"><replaceable>user</replaceable></option></arg>
 </cmdsynopsis></refsynopsisdiv>
 <refsect1 id="gnome-cleanup-1-desc"><title>&desc-tt;</title>
-<para><command>&cmd;</command> erases all GNOME user preferences, returning
-the user to the default look and feel. This can be used to undo an undesired
-preference setting, or to correct the desktop if the preferences become corrupt.
-The GNOME preference files are automatically recreated the next time the user
-logs into a GNOME session. </para>
-<para><command>&cmd;</command> displays all preference files that it will
-delete before erasing any files, and prompts the user to confirm that they
-would like to erase these files. Files are deleted only after receiving a
-positive confirmation from the user.</para>
-<para><command>&cmd;</command> cannot be run while logged into a GNOME session.
+<para>
+<command>&cmd;</command> erases all GNOME user preferences, returning the user
+to the default look and feel.  This can be used to undo undesired preference
+settings, or to correct the desktop if the preferences become corrupt.  The
+GNOME preference files are automatically recreated the next time the user
+logs into a GNOME session.  By default this program erases the configuration
+files for the user running the command.  However, a different user can be
+specified on the command line.  Of course, configuration files are only 
+erased if the user running &cmd; has appropriate file permissions to erase
+the user's configuration files.
+</para>
+<para>
+<command>&cmd;</command> will display a listing of all preference files that it
+will erase before erasing any files, and prompts the user to confirm that they
+would like to erase these files.  Files are erase only after receiving a
+positive confirmation from the user.
+</para>
+<para>
+<command>&cmd;</command> cannot be run while logged into a GNOME session.
 Users should run this program when logged into another session, for example,
-the Failsafe session. If the user tries to run this program while logged into
-GNOME, an error message is displayed.</para>
+the Failsafe session. If the user tries to run this program while already
+logged into GNOME, an error message is displayed.
+</para>
 </refsect1>
 <refsect1 id="gnome-cleanup-1-opts"><title>&opts-tt;</title>
 <para>None.</para>
 </refsect1>
+<refsect1 id="gnome-cleanup-1-oper"><title>&oper-tt;</title>
+<para>The following operands are supported:</para>
+<variablelist termlength="narrow">
+<varlistentry>
+<term><option role="nodash"><replaceable>user</replaceable></option></term>
+<listitem><para>
+Specify the <replaceable>user</replaceable> whose configuration files will
+be erased.  The files will only be erased if the user running &cmd; has file
+permissions to erase the user's configuration files.  This is useful, for
+example, if you want to run the script as the root user to erase the
+configuration files for a specific user.  If <replaceable>user</replaceable>
+is not specified, the user is the same as the user who runs the &cmd; command.
+</para>
+</listitem></varlistentry>
+</variablelist></refsect1>
 <refsect1 id="gnome-cleanup-1-exam"><title>&exam-tt;</title>
-<example role="example"><title>Deleting all GNOME user preferences</title>
+<example role="example"><title>Erase GNOME user preferences</title>
 <para><screen>example% <userinput>&cmd;</userinput></screen></para>
 </example>
-<para>After displaying a list of preference files that will be deleted, the
+<para>After displaying a list of preference files that will be erase, the
 following question is displayed:<screen><computeroutput>Do you wish to remove these files (Y/N)
 </computeroutput></screen></para>
-<para>The files are deleted only if the user provides a positive response.
+<para>The files are erase only if the user provides a positive response.
 </para>
 </refsect1>
 <refsect1 id="gnome-cleanup-1-exit"><title>&exit-tt;</title>
@@ -88,6 +118,14 @@
 </tgroup>
 </informaltable>
 </refsect1>
+<refsect1 id="gnome-cleanup-1-also"><title>&also-tt;</title>
+<!--Reference to another man page-->
+<!--Reference to a Help manual-->
+<!--Reference to a book.-->
+<para>
+<citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+</para>
+</refsect1>
 <refsect1 id="gnome-cleanup-1-note"><title>&note-tt;</title>
 <para>Written by Brian Cameron, Sun Microsystems Inc., 2003, 2007.</para>
 </refsect1>
--- a/manpages/man1/yelp.1	Tue Nov 27 11:45:19 2007 +0000
+++ b/manpages/man1/yelp.1	Tue Nov 27 20:57:26 2007 +0000
@@ -30,9 +30,11 @@
 <arg choice="plain"><option role="nodash"><replaceable>url</replaceable></option></arg>
 </cmdsynopsis></refsynopsisdiv>
 <refsect1 id="yelp-1-desc"><title>&desc-tt;</title>
-<para>The GNOME help browser is a utility that allows users to view documentation
+<para>
+The GNOME help browser is a utility that allows users to view documentation
 for GNOME in several formats including man pages, HTML, SGML(DocBook), and
-GNU info files.</para>
+GNU info files.
+</para>
 </refsect1>
 <refsect1 id="yelp-1-opts"><title>&opts-tt;</title>
 <para>The following options are supported:</para>
@@ -47,25 +49,34 @@
 <listitem><para>
 Specify which cache <replaceable>directory</replaceable> to use.
 </para></listitem></varlistentry>
-<varlistentry><term><option role="nodash"><replaceable>gnome-std-options</replaceable></option></term>
-<listitem><para>Standard options available for use with most GNOME applications.
-See <citerefentry><refentrytitle>gnome-std-options</refentrytitle><manvolnum>
-5</manvolnum></citerefentry> for more information.</para>
+<varlistentry>
+<term><option role="nodash"><replaceable>gnome-std-options</replaceable></option></term>
+<listitem><para>
+Standard options available for use with most GNOME applications.  See
+<citerefentry><refentrytitle>gnome-std-options</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+for more information.
+</para>
 </listitem></varlistentry>
 </variablelist></refsect1>
 <refsect1 id="yelp-1-oper"><title>&oper-tt;</title>
 <para>The following operands are supported:</para>
 <variablelist termlength="narrow">
-<varlistentry><term><option role="nodash"><replaceable>url</replaceable></option></term>
-<listitem><para>This allows you to view a specific help document by providing
-the complete <replaceable>url</replaceable> to the documentation that you wish to
-view.</para>
-<para>If <replaceable>url</replaceable> starts with
-&ldquo;ghelp:&rdquo;, <command>&cmd;</command>
-opens the help document within <command>ghelp</command>. </para>
-<para>If <replaceable>url</replaceable> does not start with &ldquo;ghelp:&rdquo;, <command>&cmd;</command>
-attempts to launch a default Internet browser window and display the contents
-of the help document within this browser window.</para>
+<varlistentry>
+<term><option role="nodash"><replaceable>url</replaceable></option></term>
+<listitem><para>
+This allows you to view a specific help document by providing the complete
+<replaceable>url</replaceable> to the documentation that you wish to view.
+</para>
+<para>
+If <replaceable>url</replaceable> starts with &ldquo;ghelp:&rdquo;,
+<command>&cmd;</command> opens the help document within
+<command>ghelp</command>.
+</para>
+<para>
+If <replaceable>url</replaceable> does not start with &ldquo;ghelp:&rdquo;,
+<command>&cmd;</command> attempts to launch a default Internet browser window
+and display the contents of the help document within this browser window.
+</para>
 </listitem></varlistentry>
 </variablelist></refsect1>
 <refsect1 id="yelp-1-exde"><title>&exde-tt;</title>
@@ -97,30 +108,49 @@
 5</manvolnum></citerefentry> for descriptions of the following environment
 variables:</para>
 <variablelist>
-<varlistentry><term>INFOPATH</term><listitem><para>Location of GNU Info files.
+<varlistentry>
+<term>INFOPATH</term>
+<listitem><para>
+Location of GNU Info files.
 </para>
 </listitem></varlistentry>
-<varlistentry><term>MANPATH</term><listitem><para>Location of man pages.</para>
+<varlistentry>
+<term>MANPATH</term>
+<listitem><para>
+Location of man pages.
+</para>
 </listitem></varlistentry>
 </variablelist></refsect1>
 <refsect1 id="yelp-1-exit"><title>&exit-tt;</title>
 <para>The following exit values are returned:</para>
 <variablelist termlength="xtranarrow">
-<varlistentry><term><returnvalue>0</returnvalue></term><listitem><para>Application
-exited successfully</para>
+<varlistentry>
+<term><returnvalue>0</returnvalue></term>
+<listitem><para>
+Application exited successfully
+</para>
 </listitem></varlistentry>
-<varlistentry><term><returnvalue>>0</returnvalue></term><listitem><para>Application
-exited with failure</para>
+<varlistentry>
+<term><returnvalue>>0</returnvalue></term>
+<listitem><para>
+Application exited with failure
+</para>
 </listitem></varlistentry>
 </variablelist></refsect1>
 <refsect1 id="yelp-1-file"><title>&file-tt;</title>
 <para>The following files are used by this application:</para>
 <variablelist termlength="medium">
-<varlistentry><term><filename>/usr/bin/&cmd;</filename></term><listitem><para>
-Executable for GNOME help browser</para>
+<varlistentry>
+<term><filename>/usr/bin/&cmd;</filename></term>
+<listitem><para>
+Executable for GNOME help browser
+</para>
 </listitem></varlistentry>
-<varlistentry><term><filename>/usr/bin/gnome-help</filename></term><listitem>
-<para>Symbolic link to <command>yelp</command>.</para>
+<varlistentry>
+<term><filename>/usr/bin/gnome-help</filename></term>
+<listitem><para>
+Symbolic link to <command>&cmd;</command>.
+</para>
 </listitem></varlistentry>
 </variablelist></refsect1>
 <refsect1 id="yelp-1-attr"><title>&attr-tt;</title>