fix beta version marker handling

This commit is contained in:
Sebastien Bourdeauducq 2019-11-14 17:44:36 +08:00
parent 961dcac63d
commit 303bc7b162
2 changed files with 7 additions and 0 deletions

View File

@ -2,10 +2,16 @@ let
pkgs = import <nixpkgs> {}; pkgs = import <nixpkgs> {};
artiqSrc = <artiqSrc>; artiqSrc = <artiqSrc>;
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; } generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
# keep in sync with artiq-fast/pkgs/artiq-version.nix
'' ''
cp --no-preserve=mode,ownership -R ${./artiq-fast} $out cp --no-preserve=mode,ownership -R ${./artiq-fast} $out
REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD` REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD`
MAJOR_VERSION=`cat ${artiqSrc}/MAJOR_VERSION` MAJOR_VERSION=`cat ${artiqSrc}/MAJOR_VERSION`
if [ -e BETA ]; then
SUFFIX=".beta"
else
SUFFIX=""
fi
COMMIT_COUNT=`git --git-dir ${artiqSrc}/.git rev-list --count HEAD` COMMIT_COUNT=`git --git-dir ${artiqSrc}/.git rev-list --count HEAD`
TIMESTAMP=`git --git-dir ${artiqSrc}/.git log -1 --format=%ct` TIMESTAMP=`git --git-dir ${artiqSrc}/.git log -1 --format=%ct`
ARTIQ_SRC_CLEAN=`mktemp -d` ARTIQ_SRC_CLEAN=`mktemp -d`

View File

@ -3,6 +3,7 @@ let
artiq-version = stdenv.mkDerivation { artiq-version = stdenv.mkDerivation {
name = "artiq-version"; name = "artiq-version";
src = import ./artiq-src.nix { inherit fetchgit; }; src = import ./artiq-src.nix { inherit fetchgit; };
# keep in sync with ../../artiq-fast.nix
buildPhase = '' buildPhase = ''
REV=`${git}/bin/git rev-parse HEAD` REV=`${git}/bin/git rev-parse HEAD`
MAJOR_VERSION=`cat MAJOR_VERSION` MAJOR_VERSION=`cat MAJOR_VERSION`