]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fedora-test-github.sh: only fetch tags, if building rpm
authorHarald Hoyer <harald@redhat.com>
Wed, 4 Mar 2020 10:01:52 +0000 (11:01 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 4 Mar 2020 10:06:04 +0000 (11:06 +0100)
fedora-test-github.sh

index 283e895629c967f3ffdae2c21ed3834af1b42314..2506215feddb260a073e7550b5bfe78f7a922a61 100755 (executable)
@@ -7,24 +7,29 @@ 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)
 
 if ! [[ $TESTS ]]; then
+    # 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
     make -j$NCPU all syncheck rpm logtee
 else
-    [[ $TESTS == "99" ]] && make_docs=yes || make_docs=no
+    if [[ $TESTS == "99" ]]; then
+        [[ -d .git ]] && git fetch --tags && git describe --tags
+        make_docs=yes
+    else
+        make_docs=no
+    fi
+
     make -j$NCPU enable_documentation=$make_docs all logtee
 
     cd test