Skip to content

Commit

Permalink
bee-init: add --define option to pre-define ENV variables in the bee-…
Browse files Browse the repository at this point in the history
…file

new @BEE_DFINES@ must be added to templates if you want to support this.

--define A="B C" is problematik due to some unknown quoting bug in bash->beegetopt
tranfsormation. this needs to be fixed. 8)

but --define ROOT_DIR=/usr/whatever works just fine 8)
  • Loading branch information
mariux committed Mar 23, 2012
1 parent 6c40ac5 commit a635790
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conf/templates/fallback
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ PATCHURL[0]=""

@DEFAULT_PREFIX_VARS@

@BEE_DEFINES@

#mee_extract() {
# bee_extract ${@}
#}
Expand Down
11 changes: 11 additions & 0 deletions src/bee-init.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function usage() {
-f --force force overwrite of bee-file.
-h --help this little help.
-V --version print version number.
-D --define=A=B define ENV variables with the bee-file.
(extra (over)quoting may be needed if B contains spaces.)
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
Expand Down Expand Up @@ -240,6 +242,9 @@ function initialize() {
sed -e "s,@DEFAULT_PREFIX_VARS@,${DEFAULT_PREFIX_VARS}," \
-i ${beefile}

sed -e "s,@BEE_DEFINES@,${OPT_DEFINE}," \
-i ${beefile}

if [ "${CONFIGURE_BEEHAVIOR}" ] ; then
sed -e "s,@BEE_CONFIGURE@,BEE_CONFIGURE=${CONFIGURE_BEEHAVIOR}," \
-i ${beefile}
Expand All @@ -265,6 +270,7 @@ options=$(${BEE_BINDIR}/beegetopt --name bee-init \
--option disable-versionify \
--option help/h \
--option version/V \
--option define/D= \
--option template/t= \
--option force/f \
--option configure= \
Expand Down Expand Up @@ -356,6 +362,11 @@ while true ; do
shift 2
;;

--define)
OPT_DEFINE="${OPT_DEFINE}\n${2}"
shift 2
;;

--buildtype)
OPT_BUILDTYPE="${2}"
shift 2
Expand Down

0 comments on commit a635790

Please sign in to comment.