forked from synit/synit
Better git versioning
This commit is contained in:
parent
3db9835b85
commit
f91214d1b0
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
def x(cmd):
|
||||||
|
return subprocess.check_output(cmd, shell=True)
|
||||||
|
|
||||||
|
uncommitted = x('git status --porcelain=v1 -- .')
|
||||||
|
dirty = len(uncommitted) > 0
|
||||||
|
|
||||||
|
if dirty:
|
||||||
|
commithash = x('git --no-pager log -n 1 --pretty=tformat:"%h" -- .').strip()
|
||||||
|
timestamp = int(time.time())
|
||||||
|
else:
|
||||||
|
(commithash, timestamp) = x('git --no-pager log -n 1 --pretty=tformat:"%h %ct" -- .').strip().split()
|
||||||
|
timestamp = int(timestamp)
|
||||||
|
|
||||||
|
commithash = commithash.decode('utf-8')
|
||||||
|
timestamp = time.strftime("%Y%m%d%H%M%S", time.gmtime(timestamp))
|
||||||
|
print(f'_git{timestamp}')
|
|
@ -1,3 +1,4 @@
|
||||||
|
GITVERSION
|
||||||
VERSION
|
VERSION
|
||||||
buildlog.*
|
buildlog.*
|
||||||
preserves-tool.aarch64
|
preserves-tool.aarch64
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
pkgname=preserves-tools
|
pkgname=preserves-tools
|
||||||
pkgver=$(cat VERSION)
|
pkgver=$(cat VERSION)$(cat GITVERSION)
|
||||||
pkgrel=$(date '+%Y%m%d%H%M%S')
|
pkgrel=0
|
||||||
pkgdesc="Command-line tools for working with Preserves documents"
|
pkgdesc="Command-line tools for working with Preserves documents"
|
||||||
url="https://preserves.dev/"
|
url="https://preserves.dev/"
|
||||||
arch="all"
|
arch="all"
|
||||||
|
|
|
@ -9,6 +9,8 @@ prepare: preserves miniclean
|
||||||
| preserves-tool convert --output-format unquoted \
|
| preserves-tool convert --output-format unquoted \
|
||||||
--select '. "packages" / [. "name" = "preserves-tools"] . "version"' \
|
--select '. "packages" / [. "name" = "preserves-tools"] . "version"' \
|
||||||
> VERSION
|
> VERSION
|
||||||
|
rm -f preserves/implementations/rust/rust-toolchain
|
||||||
|
(cd preserves; ../../../gitversion) > GITVERSION
|
||||||
|
|
||||||
preserves:
|
preserves:
|
||||||
git clone https://gitlab.com/preserves/preserves
|
git clone https://gitlab.com/preserves/preserves
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
GITVERSION
|
||||||
VERSION
|
VERSION
|
||||||
buildlog.*
|
buildlog.*
|
||||||
protocols/
|
protocols/
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
pkgname=syndicate-server
|
pkgname=syndicate-server
|
||||||
pkgver=$(cat VERSION)
|
pkgver=$(cat VERSION)$(cat GITVERSION)
|
||||||
pkgrel=$(date '+%Y%m%d%H%M%S')
|
pkgrel=0
|
||||||
pkgdesc="Syndicate server"
|
pkgdesc="Syndicate server"
|
||||||
url="https://syndicate-lang.org/"
|
url="https://syndicate-lang.org/"
|
||||||
arch="all"
|
arch="all"
|
||||||
|
|
|
@ -8,6 +8,7 @@ prepare: syndicate-rs miniclean
|
||||||
--select '. "packages" / [. "name" = "syndicate-server"] . "version"' \
|
--select '. "packages" / [. "name" = "syndicate-server"] . "version"' \
|
||||||
> VERSION
|
> VERSION
|
||||||
rsync -a syndicate-rs/syndicate-server/protocols .
|
rsync -a syndicate-rs/syndicate-server/protocols .
|
||||||
|
(cd syndicate-rs; ../../../gitversion) > GITVERSION
|
||||||
|
|
||||||
syndicate-rs:
|
syndicate-rs:
|
||||||
git clone https://git.syndicate-lang.org/syndicate-lang/syndicate-rs
|
git clone https://git.syndicate-lang.org/syndicate-lang/syndicate-rs
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
|
GITVERSION
|
||||||
protocols/
|
protocols/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
pkgname=synit-config
|
pkgname=synit-config
|
||||||
pkgver=0.0.6
|
pkgver=0.0.6$(cat GITVERSION)
|
||||||
pkgrel=$(date '+%Y%m%d%H%M%S')
|
pkgrel=0
|
||||||
# pkgver=0.0.5
|
|
||||||
# pkgrel=1
|
|
||||||
pkgdesc="synit system layer configuration"
|
pkgdesc="synit system layer configuration"
|
||||||
url="https://synit.org/"
|
url="https://synit.org/"
|
||||||
arch="noarch"
|
arch="noarch"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
rsync -a ../../../protocols .
|
rsync -a ../../../protocols .
|
||||||
|
../../gitversion > GITVERSION
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf protocols
|
rm -rf protocols
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
GITVERSION
|
||||||
VERSION
|
VERSION
|
||||||
buildlog.*
|
buildlog.*
|
||||||
synit-pid1.aarch64
|
synit-pid1.aarch64
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
pkgname=synit-pid1
|
pkgname=synit-pid1
|
||||||
pkgver=$(cat VERSION)
|
pkgver=$(cat VERSION)$(cat GITVERSION)
|
||||||
pkgrel=$(date '+%Y%m%d%H%M%S')
|
pkgrel=0
|
||||||
pkgdesc="synit pid 1 program"
|
pkgdesc="synit pid 1 program"
|
||||||
url="https://synit.org/"
|
url="https://synit.org/"
|
||||||
arch="all"
|
arch="all"
|
||||||
|
|
|
@ -6,6 +6,7 @@ prepare: miniclean
|
||||||
(cd ../../../synit-pid1 && cargo metadata --format-version 1) | \
|
(cd ../../../synit-pid1 && cargo metadata --format-version 1) | \
|
||||||
preserves-tool convert --output-format unquoted \
|
preserves-tool convert --output-format unquoted \
|
||||||
--select '. "packages" / [. "name" = "synit-pid1"] . "version"' > VERSION
|
--select '. "packages" / [. "name" = "synit-pid1"] . "version"' > VERSION
|
||||||
|
(cd ../../../synit-pid1; ../packaging/gitversion) > GITVERSION
|
||||||
|
|
||||||
miniclean:
|
miniclean:
|
||||||
rm -f synit-pid1.$(ARCH)
|
rm -f synit-pid1.$(ARCH)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
GITVERSION
|
|
@ -1,8 +1,8 @@
|
||||||
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Contributor: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
# Maintainer: Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
pkgname=synit-splash
|
pkgname=synit-splash
|
||||||
pkgver=0.0.1
|
pkgver=0.0.2$(cat GITVERSION)
|
||||||
pkgrel=5
|
pkgrel=0
|
||||||
pkgdesc="synit loading splash screen"
|
pkgdesc="synit loading splash screen"
|
||||||
url="https://synit.org/"
|
url="https://synit.org/"
|
||||||
arch="noarch"
|
arch="noarch"
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# -*- makefile -*-
|
||||||
|
|
||||||
|
prepare:
|
||||||
|
../../gitversion > GITVERSION
|
||||||
|
|
||||||
|
clean:
|
Loading…
Reference in New Issue