zsh-workers
 help / color / mirror / code / Atom feed
* Re: update-alternatives on mandrake
  2001-05-29 15:44 update-alternatives on mandrake Chmouel Boudjnah
@ 2001-05-29 15:06 ` Clint Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Clint Adams @ 2001-05-29 15:06 UTC (permalink / raw)
  To: Chmouel Boudjnah; +Cc: zsh-workers

> update-alternatives is also used under mandrake, would be possible to
> commit this patch (i wait for Clint approvation) :

Looks fine to me.  I had no idea it was used elsewhere.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* update-alternatives on mandrake
@ 2001-05-29 15:44 Chmouel Boudjnah
  2001-05-29 15:06 ` Clint Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Chmouel Boudjnah @ 2001-05-29 15:44 UTC (permalink / raw)
  To: zsh-workers


update-alternatives is also used under mandrake, would be possible to
commit this patch (i wait for Clint approvation) :

--- _update-alternatives.~1.3.~	Tue May 29 15:21:25 2001
+++ _update-alternatives	Tue May 29 16:41:46 2001
@@ -1,8 +1,14 @@
 #compdef update-alternatives
 
-local curcontext="$curcontext" context state line expl ret
+local curcontext="$curcontext" context state line expl ret alterdir
 typeset -A opt_args
 
+if [[ -d /var/lib/dpkg/alternatives ]];then
+    alterdir=/var/lib/dpkg/alternatives
+elif [[ -d /var/lib/rpm/alternatives/ ]];then
+    alterdir=/var/lib/rpm/alternatives
+fi
+
 _arguments -C '--verbose' \
            '--quiet' \
            '--test' \
@@ -12,9 +18,9 @@
            '--admindir:admindir:_files -/' \
     '--install:*::alt:= ->install' \
     '--remove:*::alt:= ->remove' \
-    '--auto:name:_files -W /var/lib/dpkg/alternatives' \
-    '--display:name:_files -W /var/lib/dpkg/alternatives' \
-    '--config:name:_files -W /var/lib/dpkg/alternatives' && return 0
+    '--auto:name:_files -W $alterdir' \
+    '--display:name:_files -W $alterdir' \
+    '--config:name:_files -W $alterdir' && return 0
 
 while true; do
 case "$state" in
@@ -22,7 +28,7 @@
         _call_function ret _update_alternatives_$state && return ret
 	state=
 	_arguments -C '1:link:_files' \
-                   '2:name:_files -W /var/lib/dpkg/alternatives' \
+                   '2:name:_files -W $alterdir' \
                    '3:path:_files' \
                    '--slave:*::more:= ->islave' && return 0
         [[ -z $state ]] && return 1
@@ -31,7 +37,7 @@
 	install)
         _call_function ret _update_alternatives_$state && return ret
 	_arguments -C '1:link:_files' \
-                   '2:name:_files -W /var/lib/dpkg/alternatives' \
+                   '2:name:_files -W $alterdir' \
                    '3:path:_files' \
                    '4:priority:' \
                    '--slave:*::slave:= ->islave' && return 0
@@ -41,7 +47,7 @@
 	remove)
         _call_function ret _update_alternatives_$state && return ret
 	_arguments \
-                   '1:name:_files -W /var/lib/dpkg/alternatives' \
+                   '1:name:_files -W $alterdir' \
                    '2:path:_files' && return 0
         return 1
 	;;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-29 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-29 15:44 update-alternatives on mandrake Chmouel Boudjnah
2001-05-29 15:06 ` Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).