Lines 5-14
Link Here
|
5 |
# ZSH completion function for Portage |
5 |
# ZSH completion function for Portage |
6 |
# Author: baptux <bapt@ifrance.com> |
6 |
# Author: baptux <bapt@ifrance.com> |
7 |
# Author: Mamoru KOMACHI <usata@gentoo.org> |
7 |
# Author: Mamoru KOMACHI <usata@gentoo.org> |
|
|
8 |
# Author: oberyno <oberyno@gmail.com> |
8 |
|
9 |
|
9 |
# Already done: |
10 |
# Already done: |
10 |
# |
11 |
# |
11 |
# emerge (fully done) |
12 |
# emerge (fully done) |
12 |
# rc-update (fully done) |
13 |
# rc-update (fully done) |
13 |
# rc-status (fully done) |
14 |
# rc-status (fully done) |
14 |
# ebuild (fully done) |
15 |
# ebuild (fully done) |
Lines 57-63
Link Here
|
57 |
'package[This command is a lot like the merge command, but create a .tbz2 package]' \ |
58 |
'package[This command is a lot like the merge command, but create a .tbz2 package]' \ |
58 |
'rpm[Builds a RedHat RPM package]' |
59 |
'rpm[Builds a RedHat RPM package]' |
59 |
fi |
60 |
fi |
60 |
|
61 |
|
61 |
} |
62 |
} |
62 |
|
63 |
|
63 |
# Stuff for rc-status |
64 |
# Stuff for rc-status |
Lines 77-82
Link Here
|
77 |
# Stuff for rc-update |
78 |
# Stuff for rc-update |
78 |
|
79 |
|
79 |
_rc-update () { |
80 |
_rc-update () { |
|
|
81 |
local used_init |
82 |
used_init=(${=${(M)${(f)"$(rc-update show 2>/dev/null)"}:#*|*[a-z]*}% |*}) |
80 |
if (( CURRENT == 2 ));then |
83 |
if (( CURRENT == 2 ));then |
81 |
_values "rc-update actions" \ |
84 |
_values "rc-update actions" \ |
82 |
'add[Add script to a runlevel]' \ |
85 |
'add[Add script to a runlevel]' \ |
Lines 87-95
Link Here
|
87 |
'-s[Show scripts lanched at a runlevel]' |
90 |
'-s[Show scripts lanched at a runlevel]' |
88 |
elif (( CURRENT == 3 ));then |
91 |
elif (( CURRENT == 3 ));then |
89 |
case "$words[2]" in |
92 |
case "$words[2]" in |
90 |
add|-a|del|-d) |
93 |
add|-a) |
91 |
_arguments -s \ |
94 |
_values "scripts" /etc/init.d/*~*.sh(:t) |
92 |
'*:scripts:_files -W /etc/init.d/' |
95 |
;; |
|
|
96 |
del|-d) |
97 |
_values "scripts" $used_init |
93 |
;; |
98 |
;; |
94 |
show|-s) |
99 |
show|-s) |
95 |
_values "runlevels" $gentoo_runlevels |
100 |
_values "runlevels" $gentoo_runlevels |
Lines 107-361
Link Here
|
107 |
# Stuff for quickpkg |
112 |
# Stuff for quickpkg |
108 |
|
113 |
|
109 |
_quickpkg () { |
114 |
_quickpkg () { |
110 |
if compset -P '(\\|)[><][=]'; then |
115 |
if compset -P '(\\|)(>=|<=|<|>|=)'; then |
111 |
_arguments -s \ |
116 |
_arguments -s \ |
112 |
'*:installed pkgname with versions:_portage_unmerge_vers' && return 0 |
117 |
'*:installed package:_gentoo_packages installed_versions' |
113 |
elif compset -P '(\\|)[<=>]'; then |
|
|
114 |
_arguments -s \ |
115 |
'*:installed pkgname with versions:_portage_unmerge_vers' && return 0 |
116 |
elif compset -P '(\\|)[/]'; then |
118 |
elif compset -P '(\\|)[/]'; then |
117 |
_files -W / -/ && return 0 |
119 |
_path_files -W / -/ |
118 |
else |
120 |
else |
119 |
_arguments -s \ |
121 |
_arguments \ |
120 |
'*:installed pkgname:_portage_quickpkg' && return 0 |
122 |
'*:installed package:_gentoo_packages installed' |
121 |
fi |
123 |
fi |
122 |
} |
124 |
} |
123 |
|
125 |
|
124 |
# Stuff for emerge |
126 |
# Stuff for emerge |
125 |
|
127 |
|
126 |
_emerge () { |
128 |
_emerge () { |
127 |
local state |
129 |
local nopkg_opts all noask_opts bopts install_args common_args profiles |
128 |
if (( CURRENT == 2 ));then |
|
|
129 |
_arguments -s \ |
130 |
'*:*:->actions' \ |
131 |
"$common_args[@]" "$install_args[@]" && return 0 |
132 |
elif (( CURRENT > 2 ));then |
133 |
case "$words[2]" in |
134 |
unmerge|-C) |
135 |
if compset -P '(\\|)[><][=]'; then |
136 |
_arguments -s \ |
137 |
'*:installed pkgname with versions:_portage_unmerge_vers' "$common_args[@]" && return 0 |
138 |
elif compset -P '(\\|)[<=>]'; then |
139 |
_arguments -s \ |
140 |
'*:installed pkgname with versions:_portage_unmerge_vers' "$common_args[@]" && return 0 |
141 |
else |
142 |
_arguments -s \ |
143 |
'*:installed pkgname:_portage_unmerge' "$common_args[@]" && return 0 |
144 |
fi |
145 |
;; |
146 |
clean|-c) |
147 |
_arguments -s \ |
148 |
'*:installed pkgname:_portage_clean' "$common_args[@]" && return 0 |
149 |
;; |
150 |
--usepkgonly|-K) |
151 |
_arguments -s \ |
152 |
'*:use package only:_portage_tbz2list' "$common_args[@]" && return 0 |
153 |
;; |
154 |
depclean|help|-h|info|regen|sync|rsync|--searchdesc|-S|search|-s|prune|-P) |
155 |
;; |
156 |
--resume|--skipfirst) |
157 |
_arguments -s \ |
158 |
'--skipfirst[Removes the first package in the resume list]' \ |
159 |
"$common_args[@]" && return 0 |
160 |
;; |
161 |
*) |
162 |
_arguments -s \ |
163 |
'*:*:->install_portage' \ |
164 |
"$common_args[@]" \ |
165 |
"$install_args[@]" && return 0 |
166 |
;; |
167 |
esac |
168 |
fi |
169 |
while [[ -n "$state" ]]; do |
170 |
lstate=$state |
171 |
state='' |
172 |
case "$lstate" in |
173 |
actions) |
174 |
if compset -P '(\\|)[><][=]'; then |
175 |
_alternative \ |
176 |
'*:portage:_ebuild_cache' |
177 |
|
178 |
elif compset -P '(\\|)[<=>]'; then |
179 |
_alternative \ |
180 |
'*:portage:_ebuild_cache' |
181 |
|
182 |
else |
183 |
_alternative \ |
184 |
':emerge actions:_actions' \ |
185 |
'*:portage:_portage_pkglist' |
186 |
fi |
187 |
|
188 |
;; |
189 |
install_portage) |
190 |
if compset -P '(\\|)[><][=]'; then |
191 |
_alternative \ |
192 |
'*:portage:_ebuild_cache' |
193 |
elif compset -P '(\\|)[<=>]'; then |
194 |
_alternative \ |
195 |
'*:portage:_ebuild_cache' |
196 |
else |
197 |
_alternative \ |
198 |
'*:portage:_portage_pkglist' |
199 |
fi |
200 |
;; |
201 |
esac |
202 |
done |
203 |
} |
204 |
|
205 |
#Function to show only installed packages -- pkgname (no category or version #) |
206 |
_portage_unmerge(){ |
207 |
installed_portage=(/var/db/pkg/*-*/*) |
208 |
installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}} |
209 |
_tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} } |
210 |
_path_files -/ -W "/var/db/pkg/" |
211 |
} |
212 |
|
130 |
|
213 |
#Function to show only installed packages -- no _path_files |
131 |
noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \ |
214 |
_portage_quickpkg(){ |
132 |
-S --version -V --help -h --metadata) |
215 |
installed_portage=(/var/db/pkg/*-*/*) |
|
|
216 |
installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}} |
217 |
_tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} } |
218 |
} |
219 |
|
220 |
#Function to show only installed packages -- cat/name-ver |
221 |
_portage_unmerge_vers(){ |
222 |
installed_portage=(/var/db/pkg/*-*/*) |
223 |
installed_pkgname=${(M)${${installed_portage##*/}}} |
224 |
_tags -s installed_pkgname && { compadd "$@" ${(kv)=installed_pkgname} } |
225 |
_path_files -/ -W "/var/db/pkg/" |
226 |
} |
227 |
|
133 |
|
228 |
#Functions to show "cat/name", classes and dependencies |
134 |
nopkg_opts=(--resume --skipfirst -c --clean -h --help --depclean --info \ |
229 |
_portage_clean() { |
135 |
--metadata -P --prune --regen -s --search -S --searchdesc --sync -C \ |
230 |
installed_portage=(/var/db/pkg/*-*/*) |
136 |
--unmerge -V --version -i --inject) |
231 |
installed_dir=/var/db/pkg/ |
137 |
|
232 |
installed_pkg=${installed_portage//$installed_dir/} |
138 |
bopts=($nopkg_opts -b --buildpkg -B --buildpkgonly -G --getbinpkgonly -g \ |
233 |
installed_pkgname=${(M)${${installed_portage##*/}%%-[0-9]*}} |
139 |
--getbinpkg -k --usepkg -K --usepkgonly --fetch-all-uri -f -F --fetchonly) |
234 |
_tags -s installed_pkg && { compadd "$@" -k installed_pkg || compadd "$@" ${(kv)=installed_pkg} } |
140 |
|
235 |
_tags -s installed_pkgname && { compadd "$@" -k installed_pkgname || compadd "$@" ${(kv)=installed_pkgname} } |
141 |
all=($bopts -l --changelog --columns --deep -D --emptytree -e --newuse \ |
236 |
} |
142 |
--noconfmem --nodeps -O --noreplace -n --oneshot -1 -o --onlydeps --tree -t \ |
237 |
|
143 |
-u --update -U --upgradeonly) |
238 |
#Function to show tbz2 files available |
144 |
|
239 |
_portage_tbz2list() { |
145 |
common_args=( |
240 |
# this doesn't take care of ${PORTAGE_BINHOST}. If Gentoo official |
146 |
"($noask_opts --sync)"{-p,--pretend}"[Simply display what would be done]" |
241 |
# binary mirror will be available we should rewrite it accordingly. |
147 |
"($noask_opts)"{-a,--ask}"[Ask what would be done]" |
242 |
_path_files -g \*.tbz2 -W "${pkgdir}/All" |
148 |
'(-d --debug --help -h --version -V)'{-d,--debug}'[Tells emerge to run the emerge command in debug mode]' |
243 |
} |
149 |
'(--quiet -q --verbose -v)'{-q,--quiet}'[General outcome is a reduced or condensed output]' |
|
|
150 |
'(--verbose -v --quiet -q)'{-v,--verbose}'[Tell emerge to run in verbose mode]' |
151 |
'--nospinner[Disables the spinner for the session]' |
152 |
) |
153 |
install_args=( |
154 |
"($bopts)"{-b,--buildpkg}"[Tells emerge to build binary packages]" |
155 |
"($bopts)"{-B,--buildpkgonly}"[Tells emerge to only build binary packages]" |
156 |
"($nopkg_opts --emptytree -e -l --changelog --usepkgonly -K)"{-l,--changelog}"[This will show the ChangeLog]" |
157 |
"($nopkg_opts -t --tree)--columns[Displays versions in aligned format]" |
158 |
"($nopkg_opts -D --deep)"{-D,--deep}"[Consider the entire dependency tree of packages]" |
159 |
"($nopkg_opts -e -l --changelog --emptytree)"{-e,--emptytree}"[Only consider glibc as installed packages]" |
160 |
"($all --nospinner --pretend -p)"{-i,--inject}"[Portage thinks that this package is installed]" |
161 |
"($nopkg_opts $bopts)"{-f,--fetchonly}"[Just perform fetches for all packages]" |
162 |
"($nopkg_opts $bopts)"{-F,--fetch-all-uri}"[As -f, but prints all mirrors when used with -p]" |
163 |
"($bopts)"{-g,--getbinpkg}"[Tells emerge to download binary package]" |
164 |
"($bopts)"{-G,--getbinpkgonly}"[As --getbinpkg, but does not use local info]" |
165 |
"($nopkg_opts)--noconfmem[Causes portage to disregard merge records]" |
166 |
"($nopkg_opts -O --nodeps)"{-O,--nodeps}"[Merges specified packages without merging dependencies]" |
167 |
"($nopkg_opts -n --noreplace)"{-n,--noreplace}"[Skip packages already installed]" |
168 |
"($nopkg_opts)"{-1,--oneshot}"[Do not add package to the world profile]" |
169 |
"($nopkg_opts --onlydeps -o)"{-o,--onlydeps}"[Only merge (or pretend to merge) the dependencies]" |
170 |
"($nopkg_opts --columns -t --tree)"{-t,--tree}"[Show dependency tree]" |
171 |
"($nopkg_opts --update -u)"{-u,--update}"[Updates packages to the most recent version available]" |
172 |
"($nopkg_opts --upgradeonly -U)"{-U,--upgradeonly}"[Do not update packages to a lower version]" |
173 |
"($bopts)"{-k,--usepkg}"[Tells emerge to use binary packages if available]" |
174 |
"($bopts --changelog -l)"{-K,--usepkgonly}"[Tells emerge to use binary packages only]" |
175 |
"($all)"{-c,--clean}"[Cleans the system by removing packages]" |
176 |
'(: -)'{-h,--help}'[Displays help]:subject:(sync config system)' |
177 |
"(: $all)--depclean[Clean all packages that have no reason for being installed]" |
178 |
"(: $all $noask_opts --nospinner --quiet -q)--info[This is a list of information to include in bug reports]" |
179 |
"(: -)--metadata[Generate metadata]" |
180 |
"($nopkg_opts --usepkgonly -K)--newuse[Include installed packages which have changed USE flags]" |
181 |
"($all)"{-P,--prune}"[Removes all but the latest versions of matching packages]" |
182 |
"(: $all $noask_opts --verbose -v)--regen[Causes portage to check and update the dependency cache]" |
183 |
"(: $all $noask_opts --verbose -v)"{-s,--search}"[Searches for matches]" |
184 |
"(: $all $noask_opts --verbose -v)"{-S,--searchdesc}"[Matches the seachdesc string against the description field]" |
185 |
"(: $all --pretend -p)--sync[Initiates a portage tree update]" |
186 |
"($all)"{-C,--unmerge}"[Removes all matching packages]" |
187 |
'(: -)'{-V,--version}'[Display version info]' |
188 |
"(: $all[3,-1])--resume[Resumes the last merge operation]" |
189 |
"(: $all[3,-1])--skipfirst[Removes the first package in the resume list]" |
190 |
) |
191 |
profiles=( |
192 |
'world[All packages in the world profile]' |
193 |
'system[All packages in the system profile]' |
194 |
) |
195 |
|
196 |
|
197 |
# Dispatch |
198 |
if (( $words[(I)(--(unmerge|clean|prune)|-[[:alpha:]]#(C|c|P)[[:alpha:]]#)] )) ; then |
199 |
if compset -P '(\\|)(>=|<=|<|>|=)'; then |
200 |
_arguments -s \ |
201 |
'*:installed package:_gentoo_packages installed_versions' && return 0 |
202 |
else |
203 |
_arguments -s \ |
204 |
"$common_args[@]" "$install_args[@]" \ |
205 |
"*:installed package:_gentoo_packages installed" && return 0 |
206 |
fi |
244 |
|
207 |
|
245 |
#Function to show all available portage names |
208 |
elif (( $words[(I)(world|system)] )) ; then |
246 |
_portage_pkglist(){ |
209 |
_arguments -s \ |
247 |
portage_classlist="world system" |
210 |
"$common_args[@]" "$install_args[@]" \ |
248 |
portage_pkglist="$portage_pkglist ${portage_classlist}" |
211 |
"($nopkg_opts[1,-2] --inject -i --oneshot -1):" && return 0 |
249 |
_tags -s portage_pkglist && { compadd "$@" -k portage_pkglist || compadd "$@" ${(kv)=portage_pkglist} } |
212 |
|
250 |
_path_files -/ -W "${portdir}" |
213 |
elif (( $words[(I)(--usepkgonly|-[[:alnum:]]#K[[:alnum:]]#)] )) ; then |
251 |
# XXX: If I add ${portdir_overlay} category completion won't work properly |
214 |
_arguments -s \ |
252 |
#[[ -n "${portdir_overlay}" ]] && _path_files -/ -W "${portdir_overlay}" |
215 |
"$common_args[@]" "$install_args[@]" \ |
253 |
_path_files -g \*.ebuild |
216 |
'*:binary package:_gentoo_packages binary' && return 0 |
|
|
217 |
|
218 |
elif [[ $words[-3] == (--help|-h) ]] ; then |
219 |
_message "No more arguments" && return 0 |
220 |
|
221 |
else |
222 |
if compset -P '(\\|)(>=|<=|<|>|=)'; then |
223 |
_arguments \ |
224 |
"*:portage:_gentoo_packages available_versions" && return 0 |
225 |
|
226 |
elif (( $words[(I)(--inject|-i)] )) ; then |
227 |
_arguments -s \ |
228 |
"$common_args[@]" "$install_args[@]" \ |
229 |
"*:portage:_gentoo_packages available_versions" && return 0 |
230 |
else |
231 |
_arguments -s \ |
232 |
"$common_args[@]" "$install_args[@]" \ |
233 |
"($nopkg_opts)::portage: _values 'profile' \$profiles[@] " \ |
234 |
"($nopkg_opts)*:portage:_gentoo_packages available" && return 0 |
235 |
fi |
236 |
fi |
254 |
} |
237 |
} |
255 |
#Function for matching all ebuilds pkg-ver (slow if asking for all packages) |
|
|
256 |
_ebuild_cache(){ |
257 |
if _cache_invalid portage_ebuilds || ! _retrieve_cache portage_ebuilds; then |
258 |
|
259 |
overlay_ebuilds=($portdir_overlay/*-*/*/*) |
260 |
overlay_list=${${(M)${overlay_ebuilds##*/}#*ebuild}%%.ebuild} |
261 |
metadata_ebuilds=($portdir/metadata/cache/*-*/*) |
262 |
metadata_list=${(M)${${metadata_ebuilds##*/}}} |
263 |
|
238 |
|
264 |
_store_cache portage_ebuilds metadata_list overlay_list |
|
|
265 |
fi |
266 |
_tags -s metadata_list && {compadd "$@" ${(kv)=metadata_list} } |
267 |
_tags -s overlay_list && {compadd "$@" ${(kv)=overlay_list} } |
268 |
} |
269 |
|
239 |
|
270 |
local update_policy |
|
|
271 |
zstyle -s ":completion:*:*:emerge:*" cache-policy update_policy |
272 |
if [[ -z "$update_policy" ]]; then |
273 |
zstyle ":completion:*:*:emerge:*" cache-policy _ebuilds_caching_policy |
274 |
fi |
275 |
|
276 |
_ebuilds_caching_policy () { |
277 |
# rebuild if cache is more than a week old |
278 |
oldp=( "$1"(mw+1) ) |
279 |
(( $#oldp )) && return 0 |
280 |
} |
281 |
|
240 |
|
282 |
common_args=( |
241 |
local gentoo_runlevels |
283 |
{'(-p -a --ask)--pretend','(--pretend -a --ask)-p'}'[simply display what would be done]' |
242 |
gentoo_runlevels=(/etc/runlevels/*(:t)) |
284 |
{'(-p -a --pretend)--ask','(--pretend -p --ask)-a'}'[ask what would be done]' |
|
|
285 |
{'(-d)--debug','(--debug)-d'}'[Tells emerge to run the emerge command in debug mode]' |
286 |
) |
287 |
install_args=( |
288 |
{'(--upgradeonly -U --update -u --quiet -q --onlydeps -o --oneshot --nospinner --noreplace -n --nodeps -O --noconfmem -D --deep --changelog --buildpkg -B -b --buildpkgonly --emptytree -e -f --fetchonly)-l','(--upgradeonly -U --update -u --quiet -q --onlydeps -o --nospinner --noreplace -n --nodeps -O --noconfmem -D --deep --emptytree -e -f --fetchonly -l --buildpkg -b -B --buildpkgonly )--changelog'}'[This will show the ChangeLog]' |
289 |
{'(-b --buildpkgonly -B --changelog -l)--buildpkg','(--changelog -l --buildpkg --buildpkgonly -B)-b'}'[Tells emerge to build binary packages]' |
290 |
{'(-B -b --buildpkg --changelog -l)--buildpkgonly','(--changelog -l --buildpkgonly --buildpkg -b)-B'}'[Tells emerge to only build binary packages]' |
291 |
{'(-D --changelog -l)--deep','(-l --changelog --deep)-D'}'[Consider the entire dependency tree of packages]' |
292 |
{'(-e -l --changelog)--emptytree','(--emptytree -l --changelog)-e'}'[Only consider glibc as installed packages]' |
293 |
{'(-f -l --changelog)--fetchonly','(-l --changelog --fetchonly)-f'}'[Just perform fetches for all packages]' |
294 |
'(-l --changelog)--noconfmem[Causes portage to disregard merge records]' |
295 |
{'(--changelog -l -O)--nodeps','(--nodeps --changelog -l)-O'}'[Merges specified packages without merging dependencies]' |
296 |
{'(-l --changelog -n)--noreplace','(-l --changelog --noreplace)-n'}'[Skip packages already installed]' |
297 |
'(-l --changelog)--nospiner[Disables the spinner for the session]' |
298 |
'(-l --changelog)--oneshot[Do not add package to the world profile]' |
299 |
{'(--onlydeps --changelog -l)-o','(--changelog -o -l)--onlydeps'}'[Only merge (or pretend to merge) the dependencies]' |
300 |
{'(--quiet --changelog -l)-q','(-q --changelog -l)--quiet'}'[General outcome is a reduced or condensed output]' |
301 |
{'(-l --changelog -t)--tree','(-l --changelog --tree)-t'}'[Show dependency tree]' |
302 |
{'(--update --changelog -l)-u','(-u --changelog -l)--update'}'[Updates packages to the most recent version available]' |
303 |
{'(--upgradeonly --changelog -l)-U','(-U --changelog -l)--upgradeonly'}'[Do not update packages to a lower version]' |
304 |
{'(--usepkg --changelog -l)-k','(-k --changelog -l)--usepkg'}'[Tells emerge to use binary packages if available]' |
305 |
{'(--usepkgonly --changelog -l)-K','(-K --changelog -l)--usepkgonly'}'[Tells emerge to use binary packages only]' |
306 |
{'(--verbose)-v','(-v)--verbose'}'[Tell emerge to run in verbose mode]' |
307 |
'(-p --pretend -a --ask)--columns[Displays versions in aligned format]' |
308 |
'--resume[Resumes the last merge operation]' |
309 |
) |
310 |
|
311 |
_actions() { |
312 |
_values "emerge actions" \ |
313 |
'sync[Initiates a portage tree update]' \ |
314 |
'rsync[Initiates a portage tree update]' \ |
315 |
'unmerge[Removes all matching packages]' \ |
316 |
'search[Searches for matches]' \ |
317 |
'regen[Causes portage to check and update the dependency cache]' \ |
318 |
'prune[Removes all but the latest versions of matching packages]' \ |
319 |
'inject[Portage thinks that this package is installed]' \ |
320 |
'info[This is a list of information to include in bug reports]' \ |
321 |
'help[Displays help]' \ |
322 |
'depclean[Clean all packages that have no reason for being installed]'\ |
323 |
'clean[Cleans the system by removing packages]' \ |
324 |
'-c[Cleans the system by removing packages]' \ |
325 |
'-h[Displays help]' \ |
326 |
'-i[Portage thinks that this package is installed]' \ |
327 |
'-P[Removes all but the latest versions of matching packages]' \ |
328 |
'-s[Searches for matches]' \ |
329 |
'-S[Matches the search string against the description field]' \ |
330 |
'--searchdesc[Matches the search string against the description field]' \ |
331 |
'-C[Removes all matching packages]' \ |
332 |
'world[Represent all packages in the world profiles]' \ |
333 |
'system[Represent all the system packages]' |
334 |
} |
335 |
local portage_pkglist gentoo_runlevels portdir pkgdir portdir_overlay overlay |
336 |
#Reading informations from make.conf |
337 |
[[ -n "${PORTDIR}" ]] && portdir="${PORTDIR}" |
338 |
[[ -n "${PKGDIR}" ]] && pkgdir="${PKGDIR}" |
339 |
if [[ -n "${PORTDIR_OVERLAY}" ]] ; then |
340 |
for overlay in ${=PORTDIR_OVERLAY} ; do |
341 |
portdir_overlay=(${overlay} ${portdir_overlay}) |
342 |
done |
343 |
fi |
344 |
[[ -r /etc/make.globals ]] && source /etc/make.globals |
345 |
[[ -r /etc/make.conf ]] && source /etc/make.conf |
346 |
|
347 |
[[ -z "${portdir}" ]] && portdir="${PORTDIR}" |
348 |
[[ -z "${pkgdir}" ]] && pkgdir="${PKGDIR}" |
349 |
if [[ -z "${portdir_overlay}" ]] ; then |
350 |
for overlay in ${=PORTDIR_OVERLAY} ; do |
351 |
portdir_overlay=(${overlay} ${portdir_overlay}) |
352 |
done |
353 |
fi |
354 |
|
355 |
portage_pkglist=(${portdir}/*-*/* ${portdir_overlay}/*-*/*) |
356 |
portage_pkglist=(${portage_pkglist##*/}) |
357 |
gentoo_runlevels=(/etc/runlevels/*) |
358 |
gentoo_runlevels=(${${gentoo_runlevels/\/etc\/runlevels\//}%/}) |
359 |
|
243 |
|
360 |
case "$service" in |
244 |
case "$service" in |
361 |
emerge) |
245 |
emerge) |