„deb/control-build.sh“ ändern

This commit is contained in:
BlubbFish 2022-01-19 21:34:13 +01:00
parent ce2797154e
commit debbafa171

View File

@ -5,56 +5,56 @@ usage() {
echo "usage: " \ echo "usage: " \
"NAME=app " \ "NAME=app " \
"PLATFORM=amd64 " \ "PLATFORM=amd64 " \
"DEPENDENCIES=\"libc-bin (>= 2.19)\" " \
"MAINAINER=\"Test <email@example>\" " \ "MAINAINER=\"Test <email@example>\" " \
"DESCRIPTION=Testapp " \ "DESCRIPTION=Testapp " \
"VERSION=1.0-0 " \ "VERSION=1.0-0 " \
"[DEPENDENCIES=\"libc-bin (>= 2.19)\"] " \
"sh control-build.sh" "sh control-build.sh"
exit 1 exit 1
} }
echo "DEB Builder control-file: https://github.com/linksmart/ci-scripts/blob/master/deb/control-build.sh" echo "DEB Builder control-file: https://git.blubbfish.net/vs_utils/CI-Scripts/src/branch/master/deb/control-build.sh"
if [[ -z "$NAME" ]]; then if [[ -z "${NAME}" ]]; then
usage usage
fi fi
if [[ -z "$PLATFORM" ]]; then if [[ -z "${PLATFORM}" ]]; then
usage usage
fi fi
if [[ -z "$MAINAINER" ]]; then if [[ -z "${MAINAINER}" ]]; then
usage usage
fi fi
if [[ -z "$DESCRIPTION" ]]; then if [[ -z "${DESCRIPTION}" ]]; then
usage usage
fi fi
if [[ -z "$VERSION" ]]; then if [[ -z "${VERSION}" ]]; then
usage usage
fi fi
re='^[^0-9]*([0-9]+.*)$' re='^[^0-9]*([0-9]+.*)$'
if [[ $VERSION =~ $re ]]; then if [[ ${VERSION} =~ $re ]]; then
VERSION=${BASH_REMATCH[1]} VERSION=${BASH_REMATCH[1]}
else else
echo "could not found a number in string"; echo "could not found a number in string";
VERSION="0.0.0+"$BUILDNUMBER VERSION="0.0.0+"${BUILDNUMBER}
if [[ -z "$BUILDNUMBER" ]]; then if [[ -z "${BUILDNUMBER}" ]]; then
echo "you also not provide a valid buildnumner BUILDNUMBER=123" echo "you also not provide a valid buildnumner BUILDNUMBER=123"
usage usage
fi fi
fi fi
echo "Package: $NAME" > control echo "Package: ${NAME}" > control
echo "Version: $VERSION" >> control echo "Version: ${VERSION}" >> control
echo "Section: base" >> control echo "Section: base" >> control
echo "Priority: optional" >> control echo "Priority: optional" >> control
echo "Architecture: $PLATFORM" >> control echo "Architecture: ${PLATFORM}" >> control
if [[ -n "$DEPENDENCIES" ]]; then if [[ -n "${DEPENDENCIES}" ]]; then
echo "Depends: $DEPENDENCIES" >> control echo "Depends: ${DEPENDENCIES}" >> control
fi fi
echo "Maintainer: $MAINAINER" >> control echo "Maintainer: ${MAINAINER}" >> control
echo "Description: $DESCRIPTION" >> control echo "Description: ${DESCRIPTION}" >> control