summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-01-14 23:08:01 +0100
committerAmy Liffey <amynka@gentoo.org>2017-01-14 23:25:12 +0100
commit5f2ad6a2254b5789debdb4f110e6fb8f728de97b (patch)
tree315b63ccf5efb9d3a29438e2fb424aaf8dae7e97
parentebuild-quiz: reorder numbers (diff)
downloadcomrel-5f2ad6a2254b5789debdb4f110e6fb8f728de97b.tar.gz
comrel-5f2ad6a2254b5789debdb4f110e6fb8f728de97b.tar.bz2
comrel-5f2ad6a2254b5789debdb4f110e6fb8f728de97b.zip
end-quiz: Add questions about valid USE flag cases, #465848
-rw-r--r--recruiters/quizzes/end-quiz.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/recruiters/quizzes/end-quiz.txt b/recruiters/quizzes/end-quiz.txt
index 96bff5b..eedb3ba 100644
--- a/recruiters/quizzes/end-quiz.txt
+++ b/recruiters/quizzes/end-quiz.txt
@@ -171,3 +171,47 @@ docs: devmanual
package? Under which circumstances should you avoid this check and how?
docs: devmanual
+
+21. When should USE flags be used? What are the cases where they should be
+ avoided? Consider the following examples. Explain what is wrong in them
+ and how would you improve them.
+
+docs: devmanual, common sense
+
+21.a. A large C++ application with long build time has:
+
+ # libcxx can be optionally used at run time via -stdlib=libc++
+ IUSE="libcxx"
+ DEPEND=""
+ RDEPEND="libcxx? ( dev-libs/libcxx )"
+
+21.b. A large package with long build time has:
+
+ inherit bash-completion-r1
+ IUSE="bash-completion"
+
+ src_install() {
+ default
+ use bash-completion && dobashcomp contrib/bash-completion/foo
+ }
+
+21.c. A package unconditionally installs 'foobar' executable which links
+ to libbar. The ebuild maintainer wanted to make it optional.
+ He used the following code:
+
+ IUSE="foobar"
+ RDEPEND="foobar? ( dev-libs/libbar )"
+ DEPEND="${RDEPEND}"
+
+ src_install() {
+ default
+ if ! use foobar; then
+ rm "${ED}"/usr/bin/foobar || die
+ fi
+ }
+
+21.d. A package has numerous configure switches which control a number
+ of optional features. All of them are enabled by default. They do
+ not have any external dependencies, and do not affect the package
+ size significantly. The ebuild author has added over 20 local USE
+ flags to control all of them.