View | Details | Raw Unified
Collapse All | Expand All

(-) site-functions-old/_gcc-config (-2 / +2 lines)
 Lines 19-26    Link Here 
_gcc_profile(){
_gcc_profile(){
    local profile
    local profile
    profile=$(_call_program tag gcc-config --list-profiles)
    profile=(${(f)"$(_call_program gcc-installed gcc-config --list-profiles)"})
    profile=${profile/\[([^]]*)\]/}
    profile=${${profile/\[([^]]*)\]/}/\*}
    _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
    _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} }
}
}
(-) site-functions-old/_genlop (-36 / +1 lines)
 Lines 61-67    Link Here 
		"($single --time -t)"{--time,-t}"[display merge time]" \
		"($single --time -t)"{--time,-t}"[display merge time]" \
		"($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
		"($single --rsync -r --unmerge -u)"{--unmerge,-u}"[display when packages have been unmerged]" \
		"($single $arg *)"{--version,-v}"[display version information]" \
		"($single $arg *)"{--version,-v}"[display version information]" \
		"($single)*:package:_portage_pkglist"
		"($single)*:package:_gentoo_packages available"
	;;
	;;
    esac
    esac
	
	
 Lines 79-91    Link Here 
    done   
    done   
}
}
#Function to show all available portage names
_portage_pkglist(){
    portage_pkglist="$portage_pkglist"
    _tags -s portage_pkglist && { compadd "$@" ${(kv)=portage_pkglist} }
    _path_files -/ -F "*CVSROOT" -F "*eclass" -F "*distfiles" -F "*licences" -F "*files" -W "${portdir}"
}
_days() {
_days() {
	local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"	
	local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"	
	local day=$(date +%u)
	local day=$(date +%u)
 Lines 115-145    Link Here 
	elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
	elif [[ ${month} == 12 ]] then compadd $j $f $m $a $M $ju $J $A $s $o $n $d
	fi
	fi
}
}
#Reading informations from make.conf
#
# Using portageq is the right way to get PORTDIR, but it is very slow :-(
#
#portdir="$(portageq portdir)"
#pkgdir="$(portageq pkgdir)"
#portdir_overlay="$(portageq portdir_overlay)"
[[ -n "${PORTDIR}" ]] && portdir="${PORTDIR}"
[[ -n "${PKGDIR}" ]] && pkgdir="${PKGDIR}"
if [[ -n "${PORTDIR_OVERLAY}" ]] ; then
    for overlay in ${=PORTDIR_OVERLAY} ; do
	portdir_overlay=(${overlay} ${portdir_overlay})
    done
fi
[[ -r /etc/make.globals ]] && source /etc/make.globals
[[ -r /etc/make.conf ]] && source /etc/make.conf
[[ -z "${portdir}" ]] && portdir="${PORTDIR}"
[[ -z "${pkgdir}" ]] && pkgdir="${PKGDIR}"
if [[ -z "${portdir_overlay}" ]] ; then
    for overlay in ${=PORTDIR_OVERLAY} ; do
	portdir_overlay=(${overlay} ${portdir_overlay})
    done
fi
portage_pkglist=(${portdir}/*-*/* ${=portdir_overlay}/*-*/*)
portage_pkglist=(${portage_pkglist##*/})
(-) site-functions-old/_gentoolkit (-24 / +11 lines)
 Lines 19-30    Link Here 
_tags -s category && { compadd "$@" ${(kv)=category} }
_tags -s category && { compadd "$@" ${(kv)=category} }
}
}
#Function to show only installed packages   -- pkgname (no category or version #)
_portage_installed(){
    installed_portage=(/var/db/pkg/*-*/*)
    installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
    _tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
}
#moved out of equery 
#moved out of equery 
_equery_val(){
_equery_val(){
    _values  "equery actions" \
    _values  "equery actions" \
 Lines 38-50    Link Here 
	'size[print size of files contained in package]' 
	'size[print size of files contained in package]' 
	}
	}
#Function to show all available portage names
_portage_pkglist(){
    portage_pkglist="$portage_pkglist"
    _tags -s portage_pkglist && { compadd "$@" ${(kv)=portage_pkglist} }
    _path_files -/ -F "*CVSROOT" -F "*eclass" -F "*distfiles" -F "*licences" -W "${portdir}"
}
#Reading informations from Portage
#Reading informations from Portage
#
#
# Using portageq is the right way to get PORTDIR, but it is very slow :-(
# Using portageq is the right way to get PORTDIR, but it is very slow :-(
 Lines 70-77    Link Here 
    done
    done
fi
fi
portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
#portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
portage_pkglist=(${portage_pkglist##*/})
#portage_pkglist=(${portage_pkglist##*/})
case $service in
case $service in
 Lines 101-118    Link Here 
	"($excl --uninstalled -U --installed -I $dups -d)"{--installed,-I}"[include only installed packages]" \
	"($excl --uninstalled -U --installed -I $dups -d)"{--installed,-I}"[include only installed packages]" \
	"($excl --group -g $dups -d)"{--group,-g}"[find by group]:group:_category" \
	"($excl --group -g $dups -d)"{--group,-g}"[find by group]:group:_category" \
	"($check $excl --list -l $dups -d)"{--list,-l}"[list package contents]" \
	"($check $excl --list -l $dups -d)"{--list,-l}"[list package contents]" \
	"($excl --info -i $dups -d 1)"{--info,-i}"[get package description and home page]:package:_portage_pkglist" \
	"($excl --info -i $dups -d 1)"{--info,-i}"[get package description and home page]:package:_gentoo_packages available" \
	"($excl $check $find $dups --uninstalled -U)"{--check-time,-ct}"[verify package file timestamps]" \
	"($excl $check $find $dups --uninstalled -U)"{--check-time,-ct}"[verify package file timestamps]" \
	"($excl $check $find $dups --uninstalled -U)"{--check-md5,-cm}"[verify package files md5]" \
	"($excl $check $find $dups --uninstalled -U)"{--check-md5,-cm}"[verify package files md5]" \
	"($excl $check $find $dups --uninstalled -U)"{--check,-c}"[verify mtimes and md5]" \
	"($excl $check $find $dups --uninstalled -U)"{--check,-c}"[verify mtimes and md5]" \
	"($excl $find --query-deps -q $dups -d 1)"{--query-deps,-q}"[display all installed packages depending on selected packages]:package:_portage_pkglist" \
	"($excl $find --query-deps -q $dups -d 1)"{--query-deps,-q}"[display all installed packages depending on selected packages]:package:_gentoo_packages available" \
	"()"{--no-color,-nc}"[dont use colors]" \
	"()"{--no-color,-nc}"[dont use colors]" \
	"*--verbose[be more verbose (2 levels)]" \
	"*--verbose[be more verbose (2 levels)]" \
	"*-v[be more verbose (2 levels)]" \
	"*-v[be more verbose (2 levels)]" \
	"($excl --non-masked -n --masked -m $dups)"{--masked,-m}"[include only masked packages]" \
	"($excl --non-masked -n --masked -m $dups)"{--masked,-m}"[include only masked packages]" \
	"($excl --non-masked -n --masked -m $dups)"{--non-masked,-n}"[include only non-masked packages]" \
	"($excl --non-masked -n --masked -m $dups)"{--non-masked,-n}"[include only non-masked packages]" \
	"(- :)"{--help,-h}"[show help]" \
	"(- :)"{--help,-h}"[show help]" \
	"(--info -i --query-deps -q --slot -s)1:package:_portage_installed"
	"(--info -i --query-deps -q --slot -s)1:package:_gentoo_packages installed"
;;
;;
 
 
equery)
equery)
 Lines 130-136    Link Here 
		 '--timestamp[append timestamp]' \
		 '--timestamp[append timestamp]' \
		 '--md5sum[append md5sum]' \
		 '--md5sum[append md5sum]' \
		 '--type[prepend file type]' \
		 '--type[prepend file type]' \
		 '*:installed pkgname:_portage_installed' && return 0
		 '*:installed pkgname:_gentoo_packages installed' && return 0
		;;
		;;
	    belongs|--earlyout)
	    belongs|--earlyout)
		  _arguments -s \
		  _arguments -s \
 Lines 148-176    Link Here 
		 '(-I --exclude-installed -i --installed)'{-I,--exclude-installed}'[do not search installed packages]' \
		 '(-I --exclude-installed -i --installed)'{-I,--exclude-installed}'[do not search installed packages]' \
		 '(-p --portage)'{-p,--portage-tree}'[also search in portage tree]' \
		 '(-p --portage)'{-p,--portage-tree}'[also search in portage tree]' \
		 '(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]' \
		 '(-o --overlay-tree)'{-o,--overlay-tree}'[also search in overlay tree]' \
		 '*:package:_portage_installed' && return 0
		 '*:package:_gentoo_packages installed' && return 0
		;;
		;;
	    uses|which)
	    uses|which)
	    	_arguments \
	    	_arguments \
		'*:package:_portage_pkglist' \
		'*:package:_gentoo_packages available' \
		     && return 0
		     && return 0
		;;
		;;
	    depgraph|-U|--no-useflags|-l|--linear)
	    depgraph|-U|--no-useflags|-l|--linear)
	    	_arguments -s \
	    	_arguments -s \
		'(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
		'(-U --no-useflags)'{-U,--no-useflags}'[do not show USE flags]' \
		'(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
		'(-l --linear)'{-l,--linear}'[do not use fancy formatting]' \
		 '*:package:_portage_installed' \
		 '*:package:_gentoo_packages installed' \
		   && return 0
		   && return 0
		;;
		;;
	    size|-b|--bytes)
	    size|-b|--bytes)
	    	_arguments -s \
	    	_arguments -s \
		'(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
		'(-b --bytes)'{-b,--bytes}'[report size in bytes]' \
		'*:package:_portage_installed' \
		'*:package:_gentoo_packages installed' \
		    && return 0
		    && return 0
		;;
		;;
	    check)
	    check)
		_arguments -s \
		_arguments -s \
		'*:package:_portage_installed' \
		'*:package:_gentoo_packages installed' \
		    && return 0
		    && return 0
	        ;;
	        ;;
	    --nocolor|-C|--quiet|-q)
	    --nocolor|-C|--quiet|-q)
(-) site-functions-old/_gentoo_packages (+92 lines)
Line 0    Link Here 
#autoload
#Author: baptux <bapt@ifrance.com>
#Description: 
# functions for gentoo packages
# inspired by _deb_packages
#Usage: _gentoo_packages installed|available
local gentoo_pkglist installed_pkg
_gentoo_installed_list(){
	local installed_portage installed_dir installed_pkgname
	installed_portage=(/var/db/pkg/*-*/*)
	installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
	installed_dir=/var/db/pkg/
	installed_pkg=${installed_portage//$installed_dir/}
	installed_pkg="${installed_pkgname} ${installed_pkg}"	
}
_gentoo_pkglist(){
	local portage_pkglist portdir pkgdir portdir_overlay overlay
	#Reading informations from make.conf
	[[ -n "${PORTDIR}" ]] && portdir="${PORTDIR}"
	[[ -n "${PKGDIR}" ]] && pkgdir="${PKGDIR}"
	if [[ -n "${PORTDIR_OVERLAY}" ]] ; then
		for overlay in ${=PORTDIR_OVERLAY} ; do
			portdir_overlay=(${overlay} ${portdir_overlay})
		done
	fi
	[[ -r /etc/make.globals ]] && source /etc/make.globals
	[[ -r /etc/make.conf ]] && source /etc/make.conf
	[[ -z "${portdir}" ]] && portdir="${PORTDIR}"
	[[ -z "${pkgdir}" ]] && pkgdir="${PKGDIR}"
	if [[ -z "${portdir_overlay}" ]] ; then
		for overlay in ${=PORTDIR_OVERLAY} ; do
			portdir_overlay=(${overlay} ${portdir_overlay})
		done
	fi
	portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
	portage_pkglist=(${portage_pkglist##*/})
	gentoo_classlist="world system"
	gentoo_pkglist=(${(kv)=portage_pkglist} ${(kv)=gentoo_classlist})
}
_gentoo_packages_update_installed(){
	if ( [[ ${+_gentoo_packages_cache_installed} -eq 0 ]] ||
	      _cache_invalid GENTOO_installed ) && ! _retrieve_cache GENTOO_installed;
	then
		_gentoo_installed_list
	    _gentoo_packages_cache_installed=(
	      	${(kv)=installed_pkg}
	      )
         _store_cache GENTOO_installed _gentoo_packages_cache_installed
    fi
      cachevar=_gentoo_packages_cache_installed
}
_gentoo_packages_update_available(){
	if ( [[ ${+_gentoo_packages_cache_available} -eq 0 ]] ||
		_cache_invalid GENTOO_available ) && ! _retrieve_cache GENTOO_available;
	then
		_gentoo_pkglist
		_gentoo_packages_cache_available=(
			${gentoo_pkglist}
		)
		_store_cache GENTOO_available _gentoo_packages_cache_available
	fi
	cachevar=_gentoo_packages_cache_available
}
_gentoo_packages () {
	local command="$argv[$#]" expl cachevar pkgset update_policy
	zstyle -s ":completion:*:*:$service:*" cache-policy update_policy
	if [[ -z "$update_policy" ]]; then
		zstyle ":completion:*:*:$service:*" cache-policy _gentoo_cache_policy
	fi
	[[ "$command" = (installed|available) ]] || {
		_message "unknown command: $command"
		return
	}
	[[ "$pkgset" = (installed|available) ]] || {
		pkgset="$command"
	}
	expl=("${(@)argv[1,-2]}")
	_gentoo_packages_update_$pkgset
	_tags packages && compadd "$expl[@]" - "${(@P)cachevar}"
}
_gentoo_cache_policy () {
  # rebuild if cache is more than a week old
    oldp=( "$1"(mw+1) )
      (( $#oldp )) && return 0
}
_gentoo_packages "$@"
(-) site-functions-old/_portage (-40 / +5 lines)
 Lines 6-20    Link Here 
# Author: baptux <bapt@ifrance.com>
# Author: baptux <bapt@ifrance.com>
# Author: Mamoru KOMACHI <usata@gentoo.org>
# Author: Mamoru KOMACHI <usata@gentoo.org>
# Already done:
#
# emerge (fully done) 
# rc-update (fully done)
# rc-status (fully done)
# ebuild (fully done)
# opengl-update (fully done)
# rc (fully done)
# Stuff for rc
# Stuff for rc
_rc () {
_rc () {
	if (( CURRENT == 2 ));then
	if (( CURRENT == 2 ));then
 Lines 117-123    Link Here 
		_files -W / -/ && return 0
		_files -W / -/ && return 0
	  else 
	  else 
		_arguments -s \
		_arguments -s \
		    '*:installed pkgname:_portage_quickpkg' && return 0
		    '*:installed pkgname:_portage_unmerge' && return 0
	  fi
	  fi
}
}
 
 
 Lines 145-151    Link Here 
		;;
		;;
	    clean|-c)
	    clean|-c)
	    	_arguments -s \
	    	_arguments -s \
		    '*:installed pkgname:_portage_clean' "$common_args[@]" && return 0
		    '*:installed pkgname:_gentoo_packages installed' "$common_args[@]" && return 0
		;;
		;;
	    --usepkgonly|-K)
	    --usepkgonly|-K)
		_arguments -s \
		_arguments -s \
 Lines 204-222    Link Here 
#Function to show only installed packages   -- pkgname (no category or version #)
#Function to show only installed packages   -- pkgname (no category or version #)
_portage_unmerge(){
_portage_unmerge(){
    installed_portage=(/var/db/pkg/*-*/*)
    _gentoo_packages installed
    installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
    _tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
    _path_files -/ -W "/var/db/pkg/"
    _path_files -/ -W "/var/db/pkg/"
}
}
#Function to show only installed packages -- no _path_files 
_portage_quickpkg(){
    installed_portage=(/var/db/pkg/*-*/*)
    installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
    _tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} }
}
#Function to show only installed packages -- cat/name-ver
#Function to show only installed packages -- cat/name-ver
_portage_unmerge_vers(){
_portage_unmerge_vers(){
    installed_portage=(/var/db/pkg/*-*/*)
    installed_portage=(/var/db/pkg/*-*/*)
 Lines 225-240    Link Here 
    _path_files -/ -W "/var/db/pkg/"
    _path_files -/ -W "/var/db/pkg/"
}
}
#Functions to show "cat/name", classes and dependencies
_portage_clean() {
    installed_portage=(/var/db/pkg/*-*/*)
    installed_dir=/var/db/pkg/
    installed_pkg=${installed_portage//$installed_dir/}
    installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}}
    _tags -s installed_pkg && { compadd "$@" -k installed_pkg || compadd "$@" ${(kv)=installed_pkg} }
    _tags -s installed_pkgname && { compadd "$@" -k installed_pkgname || compadd "$@" ${(kv)=installed_pkgname} }
}
#Function to show tbz2 files available
#Function to show tbz2 files available
_portage_tbz2list() {
_portage_tbz2list() {
    # this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
    # this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official
 Lines 244-255    Link Here 
#Function to show all available portage names
#Function to show all available portage names
_portage_pkglist(){
_portage_pkglist(){
    portage_classlist="world system"
    _gentoo_packages available
    portage_pkglist="$portage_pkglist ${portage_classlist}"
    _tags -s portage_pkglist && { compadd "$@" -k portage_pkglist || compadd "$@" ${(kv)=portage_pkglist} }
    _path_files -/ -W "${portdir}"
    _path_files -/ -W "${portdir}"
    # XXX: If I add ${portdir_overlay} category completion won't work properly
    #[[ -n "${portdir_overlay}" ]] && _path_files -/ -W "${portdir_overlay}"
    _path_files -g \*.ebuild
    _path_files -g \*.ebuild
}
}
#Function for matching all ebuilds  pkg-ver (slow if asking for all packages)
#Function for matching all ebuilds  pkg-ver (slow if asking for all packages)
 Lines 332-338    Link Here 
	'world[Represent all packages in the world profiles]' \
	'world[Represent all packages in the world profiles]' \
	'system[Represent all the system packages]' 
	'system[Represent all the system packages]' 
}
}
local portage_pkglist gentoo_runlevels portdir pkgdir portdir_overlay overlay
local gentoo_runlevels portdir pkgdir portdir_overlay overlay
#Reading informations from make.conf
#Reading informations from make.conf
[[ -n "${PORTDIR}" ]] && portdir="${PORTDIR}"
[[ -n "${PORTDIR}" ]] && portdir="${PORTDIR}"
[[ -n "${PKGDIR}" ]] && pkgdir="${PKGDIR}"
[[ -n "${PKGDIR}" ]] && pkgdir="${PKGDIR}"
 Lines 351-359    Link Here 
	portdir_overlay=(${overlay} ${portdir_overlay})
	portdir_overlay=(${overlay} ${portdir_overlay})
    done
    done
fi
fi
portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*)
portage_pkglist=(${portage_pkglist##*/})
gentoo_runlevels=(/etc/runlevels/*)
gentoo_runlevels=(/etc/runlevels/*)
gentoo_runlevels=(${${gentoo_runlevels/\/etc\/runlevels\//}%/})
gentoo_runlevels=(${${gentoo_runlevels/\/etc\/runlevels\//}%/})