Skip to content

Commit

Permalink
Merge pull request #19 from ackurth/add_suffix
Browse files Browse the repository at this point in the history
Add suffix handling to Builder
  • Loading branch information
ackurth authored Feb 24, 2021
2 parents d881a9c + aaf6933 commit 4faf641
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ default value.
To install a package replace `<package>` and `<version>` with an available
build plan:

build <package> [<version>] [<variant>]
build <package> [<version>] [<variant>] [<suffix>]

The parameter `<version>` is optional. It will default to installing the
highest version available.

If there are more variants available, you can optionally specify the
`<variant>` as third parameter.

If you want to add a suffix to the paths of certain `<variant>` of a `<version>`
of a `<package>`, you can optionally specify the `<suffix>` as a parameter.
This results in the files being copied to `<package>/<version>/<variant>_<suffix>.`

In any case, you can always get more details with

build --help
Expand Down
18 changes: 12 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ case "$PACKAGE" in
cat <<ENDHELP
Usage: build -h|--help
build configure
build <package> [<version>] [<variant>]
build <package> [<version>] [<variant>] [<suffix>]
Install software as given in a build plan identifed by <package>, <version>
and optional <variant>. If no <variant> is given, the "default" variant will
be built.
and optional <variant> and <suffix>. If no <variant> is given, the "default"
variant will be built. Note that you need to specify <variant> if you want to
pass <suffix>. If no <suffix> is given, the <variant> will be built.
Options:
Expand Down Expand Up @@ -155,11 +156,17 @@ if [ -z ${1+x} ]; then
log_warning ">>>"
VERSION="${guess}"
else
VERSION="${1}" # keep version as $1 in $@ to hand it to the build scrips!
VERSION="${1}" # keep version as $1 in $@ to hand it to the build scripts!
fi
VARIANT="${2:-default}" # optional variant
log_status ">>> set up build of ${PACKAGE} ${VERSION} (${VARIANT} variant)..."
PLAN="${PLANFILE_PATH}/${PACKAGE}/${VERSION}/${VARIANT}" # set plan path

if [ ! -z "$3" ]
then
VARIANT="${VARIANT}_${3}" # append suffix to variant if suffix not empty
fi

log_status ">>> set up build of ${PACKAGE} ${VERSION} (${VARIANT} variant)..."
if version_gt $BASH_VERSION 4.4; then
SOURCE="${SOURCE_PATH@P}/${PACKAGE}-${VERSION}"
TARGET="${TARGET_PATH@P}/${PACKAGE}/${VERSION}/${VARIANT}"
Expand All @@ -176,7 +183,6 @@ fi
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Load the build plan
log_status ">>> loading the build plan..."
PLAN="${PLANFILE_PATH}/${PACKAGE}/${VERSION}/${VARIANT}"
. "${PLAN}"

log_status ">>> build environment information"
Expand Down

0 comments on commit 4faf641

Please sign in to comment.