Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 368514 Details for
Bug 498988
eutils.eclass: optfeature function
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
eutils_add_optfeature_v3.patch
eutils_add_optfeature_v3.patch (text/plain), 1.80 KB, created by
Andrew Hamilton
on 2014-01-23 04:43:39 UTC
(
hide
)
Description:
eutils_add_optfeature_v3.patch
Filename:
MIME Type:
Creator:
Andrew Hamilton
Created:
2014-01-23 04:43:39 UTC
Size:
1.80 KB
patch
obsolete
>--- eutils.eclass 2014-01-22 23:36:35.819000000 -0500 >+++ eutils.eclass.patched 2014-01-22 23:38:15.538000000 -0500 >@@ -1729,4 +1729,71 @@ > > check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; } > >+# @FUNCTION: optfeature >+# @USAGE: <short description> <package atom to match> [other atoms] >+# @DESCRIPTION: >+# Print out a message suggesting an optional package (or packages) which >+# provide the described functionality >+# >+# The following snippet would suggest app-misc/foo for optional foo support, >+# app-misc/bar or app-misc/baz[bar] for optional bar support >+# and either both app-misc/a and app-misc/b or app-misc/c for alphabet support. >+# @CODE: >+# optfeature "foo support" app-misc/foo >+# optfeature "bar support" app-misc/bar app-misc/baz[bar] >+# optfeature "alphabet support" \( app-misc/a app-misc/b \) app-misc/c >+# >+optfeature() { >+ debug-print-function ${FUNCNAME} "$@" >+ local i >+ local desc=$1 >+ local flag=0 >+ local innercount=0 >+ local innerflag=0 >+ shift >+ for i; do >+ if [[ "$i" == "(" ]]; then >+ innercount=0 >+ innerflag=0 >+ flag=2 >+ elif [[ $flag -eq 2 ]]; then >+ if [[ "$i" == ")" ]]; then >+ if [[ $innercount -eq $innerflag ]]; then >+ flag=1 >+ break >+ else >+ flag=0 >+ fi >+ else >+ innercount=$((innercount+1)) >+ if has_version $i; then >+ innerflag=$((innerflag+1)) >+ fi >+ fi >+ elif has_version "$i"; then >+ flag=1 >+ break >+ >+ fi >+ done >+ if [[ $flag -eq 0 ]]; then >+ local andflag=0 >+ local msg="" >+ for i in "$@"; do >+ if [[ "$i" == "(" ]]; then >+ andflag=1 >+ msg=" " >+ elif [[ "$i" == ")" ]]; then >+ andflag=0 >+ msg="${msg:0: -4} for ${desc}" >+ elog "${msg}" >+ elif [[ $andflag -eq 1 ]]; then >+ msg="${msg} ${i} and" >+ else >+ elog " $i for ${desc}" >+ fi >+ done >+ fi >+} >+ > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 498988
:
368498
|
368506
|
368508
|
368510
|
368514
|
368516
|
368518