Return-Path: virtio-comment-return-1164-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 27 Mar 2020 10:38:02 +0000 Message-Id: <20200327103803.10460-8-alex.bennee@linaro.org> In-Reply-To: <20200327103803.10460-1-alex.bennee@linaro.org> References: <20200327103803.10460-1-alex.bennee@linaro.org> MIME-Version: 1.0 Subject: [virtio-comment] [RFC PATCH 7/8] make*: remove reliance on REVISION-DATE and use git Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To: virtio-dev@lists.oasis-open.org Cc: virtio-comment@lists.oasis-open.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= List-ID: Rather than manually tweaking REVISION-DATE and loading it into DATESTR move all the logic into make-setup-generated.sh. While we are at it we can query git directly for the state of tree and use that to fill in the meta-data. Signed-off-by: Alex Benn=C3=A9e --- REVISION-DATE | 1 - make-setup-generated.sh | 54 +++++++++++++++++++++++++++++------------ makeall.sh | 1 - makediff.sh | 1 - makediffall.sh | 1 - makediffwithbase.sh | 1 - maketex.sh | 1 - makezip.sh | 2 -- 8 files changed, 38 insertions(+), 24 deletions(-) delete mode 100644 REVISION-DATE diff --git a/REVISION-DATE b/REVISION-DATE deleted file mode 100644 index 59c9d17..0000000 --- a/REVISION-DATE +++ /dev/null @@ -1 +0,0 @@ -11 April 2019 diff --git a/make-setup-generated.sh b/make-setup-generated.sh index f15d148..2faea0b 100755 --- a/make-setup-generated.sh +++ b/make-setup-generated.sh @@ -1,39 +1,61 @@ #! /bin/sh +# +# Generate version and metadata preamble for the document +# =20 -VERSION=3D1.1 -DATESTR=3D${DATESTR:-`cat REVISION-DATE 2>/dev/null`} -if [ x"$DATESTR" =3D x ]; then - ISODATE=3D`git show --format=3Dformat:'%cd' --date=3Diso | head -n 1` - DATESTR=3D`date -d "$DATE" +'%d %B %Y'` +# Currently this works of the closest lightweight tag but we can +# update this when we start using proper signed and annotated tags. +TAG=3D$(git describe 2> /dev/null) +if [ x"$TAG" =3D x ]; then + # no tag on head + TAG=3D$(git describe --dirty --tags) + # base date on now + DATESTR=3D$(date +'%d %B %Y') + COMMIT=3D$(git rev-parse --short HEAD) +else + # base date on tag + DATESTR=3D$(git log HEAD^..HEAD --format=3Dformat:"%cd" --date=3Dforma= t:"%d %B %Y") + COMMIT=3D"" +fi + +VERSION=3D$(cut -d'-' -f2 <&2 @@ -54,7 +76,7 @@ cat > setup-generated.tex < tmpfilesforzip/tex/REVISION -echo "$DATESTR" > tmpfilesforzip/tex/REVISION-DATE cd tmpfilesforzip zip ../$SPECDOC.zip tex/* --=20 2.20.1 This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: virtio-comment-subscribe@lists.oasis-open.org Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org List help: virtio-comment-help@lists.oasis-open.org List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lis= ts Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/