contrib/rpm: Count all predecessors in revision number

The revision number of the RPM (as build by contrib/rpm) should
be increasing so that newer packages can be installed using
`yum install` and older packages can be downgraded using
`yum downgrade`.
By counting only --first-parent, the following example turns
out wrong. Note the duplicate revision numbers.

  -- A(100)----------------------------F(101)----G(102)
      \                               /
       B(101)----C(102)----D(103)----E(104)

Just count *all* parent commits
This commit is contained in:
Lubomir Rintel 2014-10-13 22:34:41 +02:00 committed by Thomas Haller
parent 5d763a8375
commit 479dd171ae

View file

@ -62,7 +62,7 @@ exec > >(tee "$BUILDLOG")
exec 2>&1
UUID=`uuidgen`
RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list --first-parent HEAD | wc -l)}"
RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}"
VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}"
COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading HEAD revision")}"
COMMIT="${COMMIT:-$(git rev-parse --verify HEAD | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}"