Skip to content

Commit

Permalink
Fix gawk-ism in Makefile
Browse files Browse the repository at this point in the history
The awk script used to extract htscodec's version string (if
git describe fails or returns a hash) used a three-argument
form of "match", which is a GNU extension.  Rewrite for
better compatibility with other awk implementations,
notably "mawk", which supplies awk in some Cirrus-CI images.

Also fix the cirrus-ci badge, which linked to the wrong location.
  • Loading branch information
daviesrob committed Sep 5, 2024
1 parent ac0ee54 commit 5ce31e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ htscodecs/htscodecs/version.h: force
vers=`cd $(srcdir)/htscodecs && git describe --always --dirty --match 'v[0-9]\.[0-9]*'` && \
case "$$vers" in \
v*) vers=$${vers#v} ;; \
*) iv=`awk '/^AC_INIT/ { match($$0, /^AC_INIT\(htscodecs, *([0-9](\.[0-9])*)\)/, m); print substr($$0, m[1, "start"], m[1, "length"]) }' $(srcdir)/htscodecs/configure.ac` ; vers="$$iv$${vers:+-g$$vers}" ;; \
*) iv=`awk '/^AC_INIT\(htscodecs,/ { match($$0, /[0-9](\.[0-9])*/); print substr($$0, RSTART, RLENGTH) }' $(srcdir)/htscodecs/configure.ac` ; vers="$$iv$${vers:+-g$$vers}" ;; \
esac ; \
if ! grep -s -q '"'"$$vers"'"' $@ ; then \
echo 'Updating $@ : #define HTSCODECS_VERSION_TEXT "'"$$vers"'"' ; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://api.cirrus-ci.com/github/samtools/htslib.svg?branch=develop)](https://api.cirrus-ci.com/github/samtools/htslib)
[![Build Status](https://api.cirrus-ci.com/github/samtools/htslib.svg?branch=develop)](https://cirrus-ci.com/github/samtools/htslib)
[![Build status](https://github.com/samtools/htslib/actions/workflows/windows-build.yml/badge.svg)](https://github.com/samtools/htslib/actions/workflows/windows-build.yml?query=branch%3Adevelop)
[![Github All Releases](https://img.shields.io/github/downloads/samtools/htslib/total.svg)](https://github.com/samtools/htslib)

Expand Down

0 comments on commit 5ce31e8

Please sign in to comment.