From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12115 invoked from network); 19 Apr 2002 08:37:41 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Apr 2002 08:37:41 -0000 Received: (qmail 25508 invoked by alias); 19 Apr 2002 08:37:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17016 Received: (qmail 25496 invoked from network); 19 Apr 2002 08:37:33 -0000 From: Borsenkow Andrej To: "'Bart Schaefer'" , zsh-workers@sunsite.dk Subject: RE: _values does not quote inserted matches Date: Fri, 19 Apr 2002 12:37:22 +0400 Message-ID: <001501c1e77d$6e0a94c0$1fc1f2a3@mow.siemens.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0016_01C1E79E.F51C34C0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: <1020416160723.ZM10203@candle.brasslantern.com> x-mimeole: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal This is a multi-part message in MIME format. ------=_NextPart_000_0016_01C1E79E.F51C34C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > It turned out to be an extraneous `local expl' in the version of _urpmi > that I do have: > > @@ -92,7 +92,7 @@ > done < /etc/urpmi/urpmi.cfg > ;; > urpmi_rpms ) > - local pkg foo expl > + local pkg foo > local -a pkgs > local -a synthesis > synthesis=(/var/lib/urpmi/synthesis.*(N)) > > Andrej, please fix that when you're committing your other changes. > Here is updated version. It relies on recent _values fixes. The completion is correct for Mandrake 8.2. If you say O.K it will go in both head and 4.0. I'd like to use common with _rpm cache and functions to get list of installed RPMs, but _rpm is one large function and I am reluctant to split it (I remember somebody was against it, but forgot reasons). -andrej ------=_NextPart_000_0016_01C1E79E.F51C34C0 Content-Type: application/octet-stream; name="_urpmi" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="_urpmi" #compdef urpme urpmi urpmi.addmedia urpmi.removemedia urpmi.update = urpmq=0A= =0A= _urpmi_cache_policy() {=0A= local -a synthesis=0A= local i=0A= synthesis=3D(/var/lib/urpmi/synthesis.*)=0A= for i in $synthesis; do=0A= [[ -e "$1" && -e "$i" && "$1" -nt "$i" ]] && return 1=0A= done=0A= return 0=0A= }=0A= =0A= _urpmi_media() {=0A= local source media brace expl=0A= local -a all_sources=0A= =0A= while read source media brace; do=0A= [[ "$brace" !=3D "{" ]] && continue=0A= all_sources=3D("$all_sources[@]" $source)=0A= done < /etc/urpmi/urpmi.cfg=0A= =0A= _values -s , 'urpmi media' "$all_sources[@]"=0A= =0A= }=0A= =0A= _urpmi_rpms() {=0A= local pkg ret=3D1 expl=0A= local -a pkgs=0A= local -a synthesis=0A= =0A= synthesis=3D(/var/lib/urpmi/synthesis.*(N))=0A= (( $#synthesis > 0 )) && {=0A= if _cache_invalid _urpmi_rpms || ! _retrieve_cache _urpmi_rpms; = then=0A= pkgs=3D($(zcat $synthesis | \=0A= grep @info@ | cut -d @ -f 3 | sed -e 's/\.[^.]*$//'))=0A= _store_cache _urpmi_rpms pkgs=0A= fi=0A= }=0A= (( $#pkgs > 0 )) && \=0A= _wanted urpmi_rpms expl 'urpmi RPMs to install' \=0A= compadd "$@" -a pkgs && ret=3D0=0A= =0A= _wanted urpmi_files expl 'RPM files to install' \=0A= _files "$@" -g '*.(#i)rpm' && ret=3D0=0A= =0A= _wanted urpmi_source_files expl 'source RPM files to install' \=0A= _files "$@" -g '*.(#i)src.rpm' && ret=3D0=0A= =0A= return $ret=0A= }=0A= =0A= _urpmi_media_url() {=0A= local expl ret=3D1=0A= =0A= if compset -P file:// || compset -P removable://; then=0A= _files "$@" -W / -/ && ret=3D0=0A= elif [[ -prefix '(ftp|http)://' ]]; then=0A= _urls "$@" && ret=3D0=0A= else=0A= _wanted urpmi_media_type expl 'type of media' \=0A= compadd "$@" -- file:// http:// ftp:// removable:// && ret=3D0=0A= fi=0A= =0A= return $ret=0A= }=0A= =0A= _urpme_package() {=0A= local -a _rpms=0A= _rpms=3D( $(_call_program packages rpm -qa 2>/dev/null) )=0A= compadd "$@" -a -- _rpms=0A= }=0A= =0A= _urpmi() {=0A= local state context line ret=3D1=0A= typeset -A opt_args=0A= =0A= case "$service" in=0A= urpme )=0A= _arguments -A '-*' \=0A= "--auto[do not ask any question]" \=0A= "-a[find all matches]" \=0A= ": :_urpme_package"=0A= ;;=0A= urpmi.addmedia )=0A= _arguments -A '-*' \=0A= "(--wget)--curl[use curl to retrieve distant files]" \=0A= "(:)--distrib[automatically create all media from an installation = medium]:media URL:_urpmi_media_url" \=0A= "--update[mark as update media]" \=0A= "(--curl)--wget[use wget to retrieve distant files]" \=0A= "-c[clean headers cache directory]" \=0A= "-f[force generation of hdlist files]" \=0A= "-h[try to find and use synthesis or hdlist file]" \=0A= "(--distrib):name of media: " \=0A= "(--distrib):media URL:_urpmi_media_url" \=0A= "(--distrib): :(with)" \=0A= "(--distrib):relative path to hdlist file: " \=0A= && ret=3D0=0A= ;;=0A= urpmi.removemedia )=0A= _arguments -A '-*' \=0A= "(:)-a[select all media]" \=0A= "(-a)"{,\*}": :_urpmi_media" \=0A= && ret=3D0=0A= ;;=0A= urpmi.update )=0A= _arguments -A '-*' \=0A= "(--wget)--curl[use curl to retrieve distant files]" \=0A= "(--curl)--wget[use wget to retrieve distant files]" \=0A= "(:)-a[select all non-removable media]" \=0A= "-c[clean /var/cache/urpmi/headers on exit]" \=0A= "-d[force complete computation of depslist.ordered file]" \=0A= "*-f[force generation of hdlist files]" \=0A= "(-a)"{,\*}": :_urpmi_media" \=0A= && ret=3D0=0A= ;;=0A= urpmi )=0A= _arguments -A '-*' \=0A= "(: -)--help[print usage information]" \=0A= "(--help)--allow-medium-change[allow change of removable media]" \=0A= "(--help)--auto[do not ask any questions]" \=0A= "(--help)--auto-select[select the packages to update]" \=0A= "(--help -X)--best-output[automatically select text or X interface]" = \=0A= "(--help)--complete[use parsehdlist server to complete selection]" = \=0A= "(--help --wget)--curl[use curl to retrieve distant files]" \=0A= "(--help)--force[proceed even when some packages do not exist]" \=0A= "(--help --fuzzy -z)"{--fuzzy,-y}"[return all matches even if exact = match exists]" \=0A= "(--help)--media[use only the media listed by comma]: :_urpmi_media" = \=0A= "(--help)--noclean[do not clean RPM cache]" \=0A= "(--help --src -s)"{--src,-s}"[next package is source package]" \=0A= "(--help)--update[use only update media]" \=0A= "(--help --curl)--wget[use wget to retrieve distant files]" \=0A= "(--help)-a[select all packages matching command line]" \=0A= "(--help -m -M)-m[choose minimum closure of requires (default)]" \=0A= "(--help -m -M)-M[choose maximum closure of requires]" \=0A= "(--help)-P[do not search in provides]" \=0A= "(--help -q -v)-q[be quiet]" \=0A= "(--help -q -v)-v[verbose mode]" \=0A= "(--help --best-output)-X[use X interface]" \=0A= "(--help)"{,\*}": :_urpmi_rpms" \=0A= && ret=3D0=0A= ;;=0A= urpmq )=0A= _arguments -A '-*' \=0A= "(--help -h)--auto-select[automatically select packages for upgrading = the system]" \=0A= "(--help -h)--force[ignore non-existent packages]" \=0A= "(--help -h --fuzzy -z)"{--fuzzy,-y}"[return all matches even if = exact match exists]" \=0A= "(--help -h)--headers[extract headers for package listed from urpmi = db to stdout]" \=0A= "(--help -h)--media[use only the media listed by comma]: = :_urpmi_media" \=0A= "(--help -h)--sources[show full path to package file]" \=0A= "(--help -h --src -s)"{--src,-s}"[next package is source package]" = \=0A= "(--help -h)--update[use only update media]" \=0A= "(--help -h -c -p -P)-c[choose complete method for resolving requires = closure]" \=0A= "(--help -h)-d[show package depndencies]" \=0A= "(--help -h)-f[print version, release and arch with name]" \=0A= "(--help -h)-g[print groups too with name]" \=0A= "(--help -h -c -p -P)-p[allow search in provides to find package]" = \=0A= "(--help -h -c -p -P)-P[do not search in provides to find package]" = \=0A= "(--help -h)-r[print version and release too with name]" \=0A= "(--help -h)-u[remove package if a better version is already = installed]" \=0A= "(--help -h)-v[verbose mode]" \=0A= "(--help -h)*:urpmi package name: " \=0A= && ret=3D0=0A= ;;=0A= esac=0A= =0A= return $ret=0A= }=0A= =0A= local update_policy=0A= =0A= zstyle -s ":completion:*:*:urpmi:*" cache-policy update_policy=0A= if [[ -z "$update_policy" ]]; then=0A= zstyle ":completion:*:*:urpmi:*" cache-policy = _urpmi_cache_policy=0A= fi=0A= =0A= _urpmi "$@"=0A= ------=_NextPart_000_0016_01C1E79E.F51C34C0--