diff options
author | aszlig <aszlig@redmoonstudios.org> | 2016-08-09 14:11:29 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2016-08-09 14:15:06 +0200 |
commit | 55d881eea334049dbb6ac10623bb895363857fca (patch) | |
tree | 451fe519a10072585adb88c2d1086489a4f39d13 | |
parent | 199f5a2844cb31be96872599d8db7105b572f116 (diff) |
Revert adding .git-revision unconditionally
This reverts commit 1e534e234b0a92bf06361fa41b7ac8691fdbc769. We already should have a .git directory if it is managed via Git, otherwise there is no way to get the Git revision if neither .git-revision or .git is present. But having .git-revision _and_ .git present seems very much redundant to me. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @bennofs, @Profpatsch Issue: #17218
-rw-r--r-- | nixos/modules/installer/tools/get-version-suffix (renamed from nixos/modules/installer/tools/get-git-revision) | 2 | ||||
-rw-r--r-- | nixos/modules/installer/tools/nixos-rebuild.sh | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/nixos/modules/installer/tools/get-git-revision b/nixos/modules/installer/tools/get-version-suffix index b57d9cf9fa089..b8972cd57d22b 100644 --- a/nixos/modules/installer/tools/get-git-revision +++ b/nixos/modules/installer/tools/get-version-suffix @@ -17,6 +17,6 @@ getVersion() { if nixpkgs=$(nix-instantiate --find-file nixpkgs "$@"); then getVersion $nixpkgs if [ -n "$rev" ]; then - echo "$rev" + echo ".git.$rev" fi fi diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 80a4537375c4f..5ecdcdb3cdb52 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -311,10 +311,9 @@ fi # nixos-version shows something useful). if [ -n "$canRun" ]; then if nixpkgs=$(nix-instantiate --find-file nixpkgs "${extraBuildFlags[@]}"); then - revision=$($SHELL $nixpkgs/nixos/modules/installer/tools/get-git-revision "${extraBuildFlags[@]}" || true) - if [ -n "$revision" ]; then - echo -n ".git.$revision" > "$nixpkgs/.version-suffix" || true - echo -n "$revision" > "$nixpkgs/.git-revision" || true + suffix=$($SHELL $nixpkgs/nixos/modules/installer/tools/get-version-suffix "${extraBuildFlags[@]}" || true) + if [ -n "$suffix" ]; then + echo -n "$suffix" > "$nixpkgs/.version-suffix" || true fi fi fi |