From fcab50cdc60886575b949d4582b21671a4c5c057 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 2 Jan 2023 14:36:40 +0100 Subject: [PATCH] Renaming spec file and fixing shellcheck errors. --- .gitlab-ci.yml | 5 ++++- get-rpm-release | 12 +++++++++--- get-rpm-version | 7 +++++-- pp-admintools.spec.template => template.spec | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) rename pp-admintools.spec.template => template.spec (98%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e53311f..299273a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,12 @@ --- +# ---------------------------- include: - project: 'python/packaging' - ref: develop + ref: main file: 'gitlab/create-all.yaml' +# ---------------------------- variables: EXPIRE_ARTIFACTS_IN: '1 week' PKG_NAME: 'pp-admintools' @@ -29,4 +31,5 @@ variables: YUM_REPO_GPG_KEY_PUB: 'nada' YUM_REPO_GPG_KEY_SEC: 'nada' + # vim: et tabstop=2 expandtab shiftwidth=2 softtabstop=2 list diff --git a/get-rpm-release b/get-rpm-release index 7681494..5f49ae0 100755 --- a/get-rpm-release +++ b/get-rpm-release @@ -2,7 +2,11 @@ cd "$( dirname "$0" )" || exit 6 -VERSION=$( head -n 1 debian/changelog | sed -e "s/^[^(]*(//" -e "s/).*//" ) +VERSION=$( grep -P '^\s*__version__\b' lib/pp_admintools/__init__.py | \ + grep -P '^\s*__version__\b' | \ + awk -F= '{print $2}' | \ + sed -e "s/^[ ]*'//" -e "s/'.*//" ) + REVISION=1 VERSION_FILE=".rpm-version" @@ -14,7 +18,9 @@ OLD_VERSION_FULL= OLD_VERSION= OLD_REVISION= if [[ -f "${VERSION_FILE}" ]] ; then - OLD_VERSION_FULL=$( grep -P -v '^\s*(#.*|$)' "${VERSION_FILE}" | head -n 1 | sed -e 's/[ ].*//' ) + OLD_VERSION_FULL=$( grep -P -v '^\s*(#.*|$)' "${VERSION_FILE}" | \ + head -n 1 | \ + sed -e 's/[ ].*//' ) fi if [[ -n "${OLD_VERSION_FULL}" ]] ; then @@ -43,4 +49,4 @@ fi echo "${REVISION}" -# vim: ts=4 et +# vim: ts=4 et list diff --git a/get-rpm-version b/get-rpm-version index 20f4726..b383883 100755 --- a/get-rpm-version +++ b/get-rpm-version @@ -2,8 +2,11 @@ cd "$( dirname "$0" )" || exit 6 -VERSION=$( head -n 1 debian/changelog | sed -e "s/^[^(]*(//" -e "s/).*//" ) +VERSION=$( grep -P '^\s*__version__\b' lib/pp_admintools/__init__.py | \ + grep -P '^\s*__version__\b' | \ + awk -F= '{print $2}' | \ + sed -e "s/^[ ]*'//" -e "s/'.*//" ) echo "${VERSION}" -# vim: ts=4 et +# vim: ts=4 et list diff --git a/pp-admintools.spec.template b/template.spec similarity index 98% rename from pp-admintools.spec.template rename to template.spec index adfdc37..d98ce04 100644 --- a/pp-admintools.spec.template +++ b/template.spec @@ -1,7 +1,7 @@ # vim: filetype=spec %define version @@@Version@@@ -%define builddir pp-admintools-%{version} +%define builddir python@@@py_version_nodot@@@_pp-admintools-%{version} Name: pp-admintools Version: %{version} -- 2.39.5