[csw-devel] SF.net SVN: gar:[14651] csw/mgar/pkg/alternatives/trunk/alternatives

theferret at users.sourceforge.net theferret at users.sourceforge.net
Wed May 25 21:17:00 CEST 2011


Revision: 14651
          http://gar.svn.sourceforge.net/gar/?rev=14651&view=rev
Author:   theferret
Date:     2011-05-25 19:17:00 +0000 (Wed, 25 May 2011)

Log Message:
-----------
alternatives: bugfix for 4774

Modified Paths:
--------------
    csw/mgar/pkg/alternatives/trunk/alternatives

Modified: csw/mgar/pkg/alternatives/trunk/alternatives
===================================================================
--- csw/mgar/pkg/alternatives/trunk/alternatives	2011-05-25 19:16:02 UTC (rev 14650)
+++ csw/mgar/pkg/alternatives/trunk/alternatives	2011-05-25 19:17:00 UTC (rev 14651)
@@ -1,8 +1,9 @@
 #!/bin/ksh -p
 
 # ksh high-level implentation of linux style "alternatives".
-# Author: Philip Brown, phil at bolthole.com, 2010
-# @(#) alternatives 1.8@(#)
+# Adjusted for OpenCSW needs
+# Author: Philip Brown, phil at bolthole.com, 2010-2011
+# 
 
 PRIORITIESDIR=/opt/csw/share/alternatives 
 MANUALDIR=/etc/opt/csw/alternatives  #manual override location
@@ -19,7 +20,6 @@
 	print "  $prog --auto {name}"
 	print "  $prog --set {name} {/full/path}"
 	print "  $prog --config {name}"
-	print "  $prog --list"
 	print "  "
 	print " The following are provided for compatibility, but do not work"
 	print " in exactly the same way as linux variants"
@@ -29,6 +29,9 @@
 	print ""
 	print " The following are opencsw-only:"
 	print "  $prog --relink-missing  : create missing symlinks"
+	print "  $prog --list"
+	print ""
+	print "See /opt/csw/share/doc/alternatives/ for more docs"
 	
 
 # I dont want to bloat up the usage message, so here's some more docs
@@ -303,6 +306,12 @@
 }
 
 # Usage: set_manual_prio shortname /full/path
+# Sets a manual override for priorities, for "shortname", by finding
+# the alternatives file supporting the desired combo, and making
+# a symlink under $MANUALDIR, pointing to it.
+# Attempting to set non-alternatives-supported paths is a user error
+# Will then call our internal "make a symlink" routine to create the
+# user-facing symlink for 'shortname'.
 function set_manual_prio {
 	case $1 in
 		*/*)
@@ -318,7 +327,7 @@
 		print Error: $MANUALDIR does not exist. Cannot continue
 		exit 1
 	fi
-	check=`egrep -l "^[^ ]* $1 $2 " $PRIORITIESDIR/*`
+	check=`egrep -l "^[^ ]* [ ]*$1 [ ]*$2 " $PRIORITIESDIR/*`
 	if [[ "$check" == "" ]] ; then
 		print Error: no installed match found for $1 $2
 		exit 1


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list