summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorTim Steinbach <tim@nequissimus.com>2019-04-07 09:10:49 -0400
committerTim Steinbach <tim@nequissimus.com>2019-04-07 09:15:28 -0400
commitf53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57 (patch)
tree621fc0f5f88728918a47a0c5f9f276880a2d250e /pkgs/applications
parent8466ad785613c40f49c722669dfe488e4271dd35 (diff)
downloadnixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.tar
nixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.tar.gz
nixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.tar.bz2
nixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.tar.lz
nixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.tar.xz
nixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.tar.zst
nixpkgs-f53ffadbc5e9ffa6b1e8845ce61ebe0417d21c57.zip
git: Add update script
Diffstat (limited to 'pkgs/applications')
-rwxr-xr-xpkgs/applications/version-management/git-and-tools/git/update.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/git/update.sh b/pkgs/applications/version-management/git-and-tools/git/update.sh
new file mode 100755
index 00000000000..05944014743
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git/update.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl common-updater-scripts jq
+
+set -eu -o pipefail
+
+oldVersion="$(nix-instantiate --eval -E "with import ./. {}; git.version or (builtins.parseDrvName git.name).version" | tr -d '"')"
+latestTag="$(git ls-remote --tags --sort="v:refname" git://github.com/git/git.git | grep -v '\{\}' | grep -v '\-rc' | tail -1 | sed 's|^.*/v\(.*\)|\1|')"
+
+if [ ! "${oldVersion}" = "${latestTag}" ]; then
+  update-source-version git "${latestTag}"
+  nixpkgs="$(git rev-parse --show-toplevel)"
+  default_nix="$nixpkgs/pkgs/applications/version-management/git-and-tools/git/default.nix"
+  nix-build -A git
+  git add "${default_nix}"
+  git commit -m "git: ${oldVersion} -> ${latestTag}"
+else
+  echo "git is already up-to-date"
+fi