Skip to content

Commit

Permalink
Merge remote-tracking branch 'tobi-github/bee-install-destdir'
Browse files Browse the repository at this point in the history
* tobi-github/bee-install-destdir:
  bee-install: extract files into BEE_BEEDESTDIR, if it is set
  bee: prepend BEE_BEEDESTDIR to BEE_METADIR and BEE_CACHEDIR
  bee: added new option --destdir
  • Loading branch information
mariux committed Mar 21, 2012
2 parents 11ea1ac + 4ae4163 commit ec2346e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bee-install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,12 @@ function do_install_file() {
vv="vv"
fi

if [ -n "${BEE_BEEDESTDIR}" ] ; then
changedir="--transform=s,^/,${BEE_BEEDESTDIR}/,"
fi

start_cmd tar -x --dereference -${vv}Pf ${file} \
${changedir} \
--transform="s,^FILES$,${BEE_METADIR}/${pkg}/FILES," \
--transform="s,^BUILD$,${BEE_METADIR}/${pkg}/${beefile}," \
--transform="s,^META$,${BEE_METADIR}/${pkg}/META," \
Expand Down
21 changes: 21 additions & 0 deletions src/bee.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function print_usage() {
bee --print-config
bee --help
bee --version
bee --destdir=/path/to/destdir
EOF
}

Expand All @@ -83,6 +84,23 @@ function search_tool_cmd {
done
}

options=$(${BEE_BINDIR}/beegetopt --name=bee \
--option=destdir/d= \
-- "${@}")

eval set -- ${options}

while true ; do
case "${1}" in
--destdir)
BEE_BEEDESTDIR=${2}
shift 2
;;
--)
shift
break;
esac
done

options=$(${BEE_BINDIR}/beegetopt --name=bee \
--stop-on-no-option \
Expand Down Expand Up @@ -136,6 +154,9 @@ if [ "${TOOL}" = "init" ] ; then
config_export_prefix_variables
fi

BEE_METADIR=${BEE_BEEDESTDIR}${BEE_METADIR}
BEE_CACHEDIR=${BEE_BEEDESTDIR}${BEE_CACHEDIR}

if [ "${OPT_PRINTCONFIG}" = "1" ] ; then
config_print
exit 0
Expand Down
2 changes: 2 additions & 0 deletions src/beelib.config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ function config_export() {
export BEE_DATADIR
export BEE_LIBEXECDIR

export BEE_BEEDESTDIR

export BEE_VERSION

export XDG_CONFIG_HOME
Expand Down

0 comments on commit ec2346e

Please sign in to comment.