From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19679 invoked from network); 29 May 2001 14:46:55 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2001 14:46:55 -0000 Received: (qmail 3525 invoked by alias); 29 May 2001 14:46:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14539 Received: (qmail 3510 invoked from network); 29 May 2001 14:46:46 -0000 To: zsh-workers@sunsite.dk Subject: update-alternatives on mandrake From: Chmouel Boudjnah Date: 29 May 2001 16:44:20 +0100 Message-ID: User-Agent: Gnus/5.090003 (Oort Gnus v0.03) Emacs/21.0.103 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 ;;