[csw-devel] SF.net SVN: gar:[14649] csw/mgar/pkg/alternatives/trunk/alternatives
theferret at users.sourceforge.net
theferret at users.sourceforge.net
Wed May 25 20:27:58 CEST 2011
Revision: 14649
http://gar.svn.sourceforge.net/gar/?rev=14649&view=rev
Author: theferret
Date: 2011-05-25 18:27:57 +0000 (Wed, 25 May 2011)
Log Message:
-----------
alternatives: added --relink-missing
Modified Paths:
--------------
csw/mgar/pkg/alternatives/trunk/alternatives
Modified: csw/mgar/pkg/alternatives/trunk/alternatives
===================================================================
--- csw/mgar/pkg/alternatives/trunk/alternatives 2011-05-25 18:03:41 UTC (rev 14648)
+++ csw/mgar/pkg/alternatives/trunk/alternatives 2011-05-25 18:27:57 UTC (rev 14649)
@@ -26,6 +26,10 @@
print " See comments in usage function code for more information."
print " $prog --install {/full/path/name} {name} {#priority}"
print " $prog --remove {name} {/full/path}"
+ print ""
+ print " The following are opencsw-only:"
+ print " $prog --relink-missing : create missing symlinks"
+
# I dont want to bloat up the usage message, so here's some more docs
#
@@ -98,10 +102,9 @@
nawk '$2 == "'$1'" {print}' | sort -nr +3
}
-# User facing function.
+# User facing function, as well as internal
# enables "alternatives --list"
function list_alternatives {
- echo "List of installed software that uses the alternatives system:"
cat $PRIORITIESDIR/* 2>/dev/null| nawk '{print $2}' | sort -u
}
@@ -136,7 +139,7 @@
exit 1
}
-# Called only by set_alternative.
+# Called only internally, by set_alternative.
# args: {target} {shortname} {implementation-path}
# Split out, because one "alternatives" line may have multiple "slave" links
function set_link {
@@ -384,6 +387,15 @@
set_manual_prio $1 $fullpath
}
+# User facing function: --relink-missing
+# Used as a damage control function for zones that are non-sparse.
+# Even though we dont officially support non-sparse zones :-)
+# Go through and create links for all alternatives known.
+function relink_missing {
+ for alt in `list_alternatives` ; do
+ set_alternative $alt
+ done
+}
############################################################
# Return to "main" area below
@@ -422,6 +434,7 @@
revert_to_auto $1
;;
--list)
+ echo "List of installed software that uses the alternatives system:"
list_alternatives
;;
--display)
@@ -436,6 +449,9 @@
shift
set_manual_prio $1 $2
;;
+ --relink-missing)
+ relink_missing
+ ;;
*)
print -- $1 is not a recognized command.
usage
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