10139N/A# This version of 'remove-gnome' does not prompt the user when '-q' is 10139N/A# present on the command line. This allows the script to be incorporated into 10139N/A# Modified by Damien Carbery, 19 May 2003. 10139N/A# -f option added by Laca, 25 Feb 2004 10139N/A# jds support added by Laca, 10 Mar 2004 10139N/A# List of JDS packages without JDS category. Will be removed if specified 10139N/A# category is JDS and the packages are present. 10139N/AEXTRA_PKGS_TO_REMOVE=
"SUNWmozgm SUNWmoznss SUNWmozpsm SUNWgnome-l10ndocument-ja SUNWgnome-l10nmessages-ja SUNWsogm SUNWsom SUNWsoagm SUNWsoam" 10139N/A echo "$0 [-h|--help|-q|--quiet|-f|--force|--version 2.0|1.4|JDS|JDS<n>|-R rootdir]" 10139N/A echo " -h, --help display this help" 10139N/A echo " --version x remove version x (default: 2.0)" 10139N/A echo " --quiet, -q don't prompt for confirmation before deletion." 10139N/A echo " --force, -f ignore any errors and continue." 10139N/A echo " -R rootdir remove packages from an alternative root directory." 10139N/A echo " --no_extras, -n don't remove extra packages, only jds/gnome ones." 10139N/A# If the script is called 'remove-jds' the category will include all JDS 10139N/A GNOME_CATEGORY=
"JDSosol,JDS,JDS2,JDS3,JDS3x,JDS4,JDS5,JDS6,JDS7,JDS8,JDS9,APOC,EVO146,EVO25,GLOW,JAI,JAVAAPPS,MUSCLE,FF15,FIREFOX,TB15," 10139N/A echo "Error: argument expected after --version" 10139N/A GNOME_CATEGORY=
"JDS,JDS2,JDS3,JDS4,JDS5,JDS6,JDS7,JDS8,JDS9,JDS3x,JDSosol" 10139N/A echo "Error: version should be one of 1.4, 2.0, opensolaris or JDS" 10139N/A echo "Option -R requires an argument" 10139N/A echo "Error: $1: invalid argument" 10139N/A echo "Use for -f or --force option to ignore errors." 10139N/A echo "WARNING: Run this script as root or make sure you have been assigned" 10139N/A echo "the 'Software Installation' profile to be able to uninstall packages." 10139N/A echo "See the user_attr(4) and profiles(1) man pages for more details" 10139N/A /.*<uniquename>@PACKAGE_TO_REMOVE@\n[ ]*<\/uniquename>.*$/d 10139N/A# Add JDS extra packages that do not have the JDS category. 10139N/A # Turn off traps - '$PKGINFO -q $pkg' triggers ERR if $pkg not installed. 10139N/A # If package is present then add to list to be removed. 10139N/A # Later code expects $PKGINFO style output which contains the 10139N/A # "Category package_name Description" 10139N/A # Restore the original trap triggers. 10139N/A ( echo "The following packages were found:" 10139N/A echo "Would you like to remove the above packages? (y/n)" 10139N/A echo "The following packages were found:" 10139N/A# Packages need to be removed and we must be root to do this. 10139N/A msg_error "ERROR: You must be root or have the 'Software Installation' profile to uninstall packages." 10139N/A echo "Completed with warnings. Some packages could not be removed." 10139N/A echo "Successfully removed all packages." 10139N/A # Delete backup product registry if unchanged. 10139N/A echo "Product registry unchanged, removing backup file."