From 900242aa907d00a38e3543d64197a691c0451c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Tue, 8 Feb 2022 23:23:15 +0100 Subject: [PATCH] Removed version file --- Makefile | 27 +++++++++------------------ VERSION | 1 - 2 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 VERSION diff --git a/Makefile b/Makefile index af08ef7..11e2d2c 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,29 @@ #!/usr/bin/make -f SHELL := /bin/sh -.SHELLFLAGS := -eu -c +.SHELLFLAGS := -euc DOCKER := $(shell command -v docker 2>/dev/null) GIT := $(shell command -v git 2>/dev/null) M4 := $(shell command -v m4 2>/dev/null) DISTDIR := ./dist -VERSION_FILE = ./VERSION DOCKERFILE_TEMPLATE := ./Dockerfile.m4 IMAGE_REGISTRY := docker.io IMAGE_NAMESPACE := hectormolinero IMAGE_PROJECT := qemu-reactos IMAGE_NAME := $(IMAGE_REGISTRY)/$(IMAGE_NAMESPACE)/$(IMAGE_PROJECT) - -IMAGE_VERSION := v0 -ifneq ($(wildcard $(VERSION_FILE)),) - IMAGE_VERSION := $(shell cat '$(VERSION_FILE)') -endif +IMAGE_VERSION := $(shell '$(GIT)' describe --abbrev=0 2>/dev/null || printf 'v0') IMAGE_BUILD_OPTS := IMAGE_NATIVE_DOCKERFILE := $(DISTDIR)/Dockerfile IMAGE_NATIVE_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).tzst - IMAGE_AMD64_DOCKERFILE := $(DISTDIR)/Dockerfile.amd64 IMAGE_AMD64_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).amd64.tzst - IMAGE_ARM64V8_DOCKERFILE := $(DISTDIR)/Dockerfile.arm64v8 IMAGE_ARM64V8_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).arm64v8.tzst - IMAGE_ARM32V7_DOCKERFILE := $(DISTDIR)/Dockerfile.arm32v7 IMAGE_ARM32V7_TARBALL := $(DISTDIR)/$(IMAGE_PROJECT).arm32v7.tzst @@ -72,8 +64,8 @@ $(IMAGE_AMD64_DOCKERFILE): $(DOCKERFILE_TEMPLATE) mkdir -p '$(DISTDIR)' '$(M4)' \ --prefix-builtins \ - -D CROSS_ARCH=amd64 \ - -D CROSS_QEMU=/usr/bin/qemu-x86_64-static \ + --define=CROSS_ARCH=amd64 \ + --define=CROSS_QEMU=/usr/bin/qemu-x86_64-static \ '$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@' '$(DOCKER)' build $(IMAGE_BUILD_OPTS) \ --tag '$(IMAGE_NAME):$(IMAGE_VERSION)-amd64' \ @@ -87,8 +79,8 @@ $(IMAGE_ARM64V8_DOCKERFILE): $(DOCKERFILE_TEMPLATE) mkdir -p '$(DISTDIR)' '$(M4)' \ --prefix-builtins \ - -D CROSS_ARCH=arm64v8 \ - -D CROSS_QEMU=/usr/bin/qemu-aarch64-static \ + --define=CROSS_ARCH=arm64v8 \ + --define=CROSS_QEMU=/usr/bin/qemu-aarch64-static \ '$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@' '$(DOCKER)' build $(IMAGE_BUILD_OPTS) \ --tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm64v8' \ @@ -102,8 +94,8 @@ $(IMAGE_ARM32V7_DOCKERFILE): $(DOCKERFILE_TEMPLATE) mkdir -p '$(DISTDIR)' '$(M4)' \ --prefix-builtins \ - -D CROSS_ARCH=arm32v7 \ - -D CROSS_QEMU=/usr/bin/qemu-arm-static \ + --define=CROSS_ARCH=arm32v7 \ + --define=CROSS_QEMU=/usr/bin/qemu-arm-static \ '$(DOCKERFILE_TEMPLATE)' | cat --squeeze-blank > '$@' '$(DOCKER)' build $(IMAGE_BUILD_OPTS) \ --tag '$(IMAGE_NAME):$(IMAGE_VERSION)-arm32v7' \ @@ -238,8 +230,7 @@ binfmt-register: version: @if printf '%s' '$(IMAGE_VERSION)' | grep -q '^v[0-9]\{1,\}$$'; then \ NEW_IMAGE_VERSION=$$(awk -v 'v=$(IMAGE_VERSION)' 'BEGIN {printf "v%.0f", substr(v,2)+1}'); \ - printf '%s\n' "$${NEW_IMAGE_VERSION:?}" > '$(VERSION_FILE)'; \ - '$(GIT)' add '$(VERSION_FILE)'; '$(GIT)' commit -m "$${NEW_IMAGE_VERSION:?}"; \ + '$(GIT)' commit --allow-empty -m "$${NEW_IMAGE_VERSION:?}"; \ '$(GIT)' tag -a "$${NEW_IMAGE_VERSION:?}" -m "$${NEW_IMAGE_VERSION:?}"; \ else \ >&2 printf 'Malformed version string: %s\n' '$(IMAGE_VERSION)'; \ diff --git a/VERSION b/VERSION deleted file mode 100644 index f5dd48f..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -v39