Skip to content

Commit

Permalink
build: Fix rpmbuild for beta revision
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Oct 22, 2021
1 parent ee72839 commit ccaf155
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions contrib/unix/glpi-agent-rpm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ if [ -n "${GITHUB_REF%refs/tags/*}" -o -z "$VER" ]; then
VER=$(perl -Ilib -MGLPI::Agent::Version -e '$v = $GLPI::Agent::Version::VERSION; $v =~ s/-.*//; print $v')
fi
if [ -z "$REV" ]; then
REV=$([ -n "$GITHUB_SHA" ] && echo $GITHUB_SHA| cut -c 1-8 || git log --pretty=format:%h -n 1)
[ -n "$REV" ] && REV="git$REV" || REV=1
if [ -z "${VER%%*-*}" ]; then
REV="${VER#*-}"
VER="${VER%%-*}"
elif [ -n "$GITHUB_REF" ]; then
REV=1
else
REV=$([ -n "$GITHUB_SHA" ] && echo $GITHUB_SHA| cut -c 1-8 || git log --pretty=format:%h -n 1)
[ -n "$REV" ] && REV="git$REV" || REV=1
fi
fi

[ -z "$DIST" ] && unset DISTRO || DISTRO=".$DIST"
Expand Down

0 comments on commit ccaf155

Please sign in to comment.