summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-03-16 01:26:03 +0000
committerMike Frysinger <vapier@gentoo.org>2006-03-16 01:26:03 +0000
commit603611d6cab414acf879be36a09bee8fbddda991 (patch)
treec7c664062937214009bcf99e1962cdb70073033d /bin/ebuild.sh
parent56e26e3c64f2afb7701f6c0c0562b885951bfab2 (diff)
downloadportage-603611d6cab414acf879be36a09bee8fbddda991.tar.gz
portage-603611d6cab414acf879be36a09bee8fbddda991.tar.bz2
portage-603611d6cab414acf879be36a09bee8fbddda991.zip
- dont allow people to call `install` with -s via insopts/diropts/exeopts/libopts and simplify them in general
- fix "nostrip" usage and DEBUGBUILD svn path=/main/trunk/; revision=2898
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh67
1 files changed, 28 insertions, 39 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index be68b84ac..c0e7f0199 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -819,50 +819,28 @@ docinto() {
}
insopts() {
- INSOPTIONS=""
- for x in $*; do
- #if we have a debug build, let's not strip anything
- if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
- continue
- else
- INSOPTIONS="$INSOPTIONS $x"
- fi
- done
- export INSOPTIONS
+ export INSOPTIONS="$@"
+
+ # `install` should never be called with '-s' ...
+ [[ " ${INSOPTIONS} " == *" -s "* ]] && die "Never call insopts() with -s"
}
diropts() {
- DIROPTIONS=""
- for x in $*; do
- DIROPTIONS="${DIROPTIONS} $x"
- done
- export DIROPTIONS
+ export DIROPTIONS="$@"
}
exeopts() {
- EXEOPTIONS=""
- for x in $*; do
- #if we have a debug build, let's not strip anything
- if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
- continue
- else
- EXEOPTIONS="$EXEOPTIONS $x"
- fi
- done
- export EXEOPTIONS
+ export EXEOPTIONS="$@"
+
+ # `install` should never be called with '-s' ...
+ [[ " ${EXEOPTIONS} " == *" -s "* ]] && die "Never call exeopts() with -s"
}
libopts() {
- LIBOPTIONS=""
- for x in $*; do
- #if we have a debug build, let's not strip anything
- if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
- continue
- else
- LIBOPTIONS="$LIBOPTIONS $x"
- fi
- done
- export LIBOPTIONS
+ export LIBOPTIONS="$@"
+
+ # `install` should never be called with '-s' ...
+ [[ " ${LIBOPTIONS} " == *" -s "* ]] && die "Never call libopts() with -s"
}
abort_handler() {
@@ -984,7 +962,10 @@ dyn_compile() {
bzip2 -9 environment
cp "${EBUILD}" "${PF}.ebuild"
- if hasq nostrip $FEATURES $RESTRICT; then
+ if [[ " ${FEATURES} " == *" nostrip "* ]] || \
+ [[ " ${RESTRICT} " == *" nostrip "* ]] || \
+ [[ " ${RESTRICT} " == *" strip "* ]]
+ then
touch DEBUGBUILD
fi
@@ -1103,7 +1084,10 @@ dyn_help() {
echo " c++ flags : ${CXXFLAGS}"
echo " make flags : ${MAKEOPTS}"
echo -n " build mode : "
- if hasq nostrip $FEATURES $RESTRICT; then
+ if [[ " ${FEATURES} " == *" nostrip "* ]] || \
+ [[ " ${RESTRICT} " == *" nostrip "* ]] || \
+ [[ " ${RESTRICT} " == *" strip "* ]]
+ then
echo "debug (large)"
else
echo "production (stripped)"
@@ -1475,10 +1459,15 @@ fi
# We need to turn off pathname expansion for -* in KEYWORDS and
# we need to escape ~ to avoid tilde expansion
set -f
-KEYWORDS="`eval echo ${KEYWORDS//~/\\~}`"
+KEYWORDS=$(eval echo ${KEYWORDS//~/\\~})
set +f
-hasq nostrip ${RESTRICT} && export DEBUGBUILD=1
+if [[ " ${FEATURES} " == *" nostrip "* ]] || \
+ [[ " ${RESTRICT} " == *" nostrip "* ]] || \
+ [[ " ${RESTRICT} " == *" strip "* ]]
+then
+ export DEBUGBUILD=1
+fi
#a reasonable default for $S
if [ "$S" = "" ]; then