]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
github: fetch git tags before testing
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 28 Feb 2020 17:07:12 +0000 (18:07 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 28 Feb 2020 19:39:35 +0000 (20:39 +0100)
GitHub workflows fetch a clone of the dracut repository which doesn't
contain git tags, thus "breaking" the RPM build in certain situations
i.e.:
DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
which in full git clone returns a tag with a numeric version. However,
without tags it returns SHA of the last commit, which later propagates into
`Provides:` attribute of the built RPM and can break dependency tree when
installed

fedora-test-github.sh

index acd6f67ca4680df898d2bcdac68d333fc784e5ef..283e895629c967f3ffdae2c21ed3834af1b42314 100755 (executable)
@@ -7,6 +7,16 @@ set -ex
 RUN_ID="$1"
 TESTS=$2
 
+# GitHub workflows fetch a clone of the dracut repository which doesn't
+# contain git tags, thus "breaking" the RPM build in certain situations
+# i.e.:
+# DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
+# which in full git clone returns a tag with a numeric version. However,
+# without tags it returns SHA of the last commit, which later propagates into
+# `Provides:` attribute of the built RPM and can break dependency tree when
+# installed
+[[ -d .git ]] && git fetch --tags && git describe --tags
+
 ./configure
 
 NCPU=$(getconf _NPROCESSORS_ONLN)