Skip to content

Commit f41fda4

Browse files
daviesrobjkbonfield
authored andcommitted
Fix gawk-ism in Makefile
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.
1 parent 2f3379d commit f41fda4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ htscodecs/htscodecs/version.h: force
573573
vers=`cd $(srcdir)/htscodecs && git describe --always --dirty --match 'v[0-9]\.[0-9]*'` && \
574574
case "$$vers" in \
575575
v*) vers=$${vers#v} ;; \
576-
*) 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}" ;; \
576+
*) 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}" ;; \
577577
esac ; \
578578
if ! grep -s -q '"'"$$vers"'"' $@ ; then \
579579
echo 'Updating $@ : #define HTSCODECS_VERSION_TEXT "'"$$vers"'"' ; \

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://api.cirrus-ci.com/github/samtools/htslib.svg?branch=develop)](https://api.cirrus-ci.com/github/samtools/htslib)
1+
[![Build Status](https://api.cirrus-ci.com/github/samtools/htslib.svg?branch=develop)](https://cirrus-ci.com/github/samtools/htslib)
22
[![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)
33
[![Github All Releases](https://img.shields.io/github/downloads/samtools/htslib/total.svg)](https://github.com/samtools/htslib)
44

0 commit comments

Comments
 (0)