Skip to content

Commit

Permalink
bee-init: Add options --pkgextraname and --pkgprefix
Browse files Browse the repository at this point in the history
Add options --pkgextraname and --pkgprefix to influence naming of bee-files.
  • Loading branch information
mariux committed Feb 14, 2013
1 parent 2126e6f commit 698d0e7
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/bee-init.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function usage() {
-e --execute execute bee-file after creation
-i --install execute bee-file and install software
Naming bee-files:
--pkgextraname=NAME add pkgextraname '_NAME' to bee-file-name
--pkgprefix=NAME prefix bee-file with 'NAME-'
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[${PREFIX}]
Expand Down Expand Up @@ -236,7 +240,9 @@ function initialize() {
fi
fi

beefile="${pname%.bee}.bee"
eval $(${BEE_BINDIR}/beeversion ${pname})

beefile="${OPT_pkgprefix}${PKGFULLNAME}${OPT_pkgextraname}-${PKGFULLVERSION:=0}-${PKGREVISION:=0}.bee"

if [ -e "${beefile}" ] && [ "$OPT_FORCE" != "yes" ] ; then
echo "${beefile} already exists .. use option -f to overwrite .."
Expand Down Expand Up @@ -336,6 +342,8 @@ options=$(${BEE_BINDIR}/beegetopt --name bee-init \
--option docdir= \
--option localedir= \
--option buildtype= \
--option pkgextraname= \
--option pkgprefix= \
-- "$@")

if [ $? != 0 ] ; then
Expand All @@ -347,6 +355,8 @@ OPT_VERSIONIFY="yes"
OPT_OUTPUT=
OPT_EXEC="no"
OPT_INSTALL=
OPT_pkgextraname=""
OPT_pkgprefix=""

eval set -- "${options}"

Expand Down Expand Up @@ -409,6 +419,16 @@ while true ; do
shift 2
;;

--pkgextraname)
eval OPT_${1:2}="_${2}"
shift 2
;;

--pkgprefix)
eval OPT_${1:2}="${2}-"
shift 2
;;

--output)
OPT_OUTPUT=${2}
shift 2
Expand Down

0 comments on commit 698d0e7

Please sign in to comment.