summary refs log tree commit diff
path: root/pkgs/common-updater/scripts.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-12-31 14:31:56 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2017-02-19 16:51:17 +0200
commitb53c53b1b4dd30d4c28ed86ec4f6c49079de4f66 (patch)
treeb24b7a727febc108b13973a964c2645806f2d5c6 /pkgs/common-updater/scripts.nix
parent6dbe55ca689cacebc31fa8d38b8660a819e14d81 (diff)
downloadnixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.tar
nixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.tar.gz
nixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.tar.bz2
nixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.tar.lz
nixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.tar.xz
nixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.tar.zst
nixpkgs-b53c53b1b4dd30d4c28ed86ec4f6c49079de4f66.zip
maintainers: Add script to patch version/sha256 in .nix files
Adds a script to help automatically upgrading packages: this one can
patch name/version attributes like:
    version = "50.1.0";
    name = "bc-1.06";
... to the given version, and updates the sha256 hash to match.

Usage is:

update-source-version <attr> <new-version> [<new-source-hash>]

where:
    - attr is the attribute path of the package
    - new-version is the version string to be patched in
    - new-source-hash is the optional sha256/etc. hash of the source.
      If not given, the script will automatically calculate it.

This is added to a subdirectory where other useful scripts can be added
in the future, like figuring out the newest version from a git repo or
GitHub releases etc.
Diffstat (limited to 'pkgs/common-updater/scripts.nix')
-rw-r--r--pkgs/common-updater/scripts.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/common-updater/scripts.nix b/pkgs/common-updater/scripts.nix
new file mode 100644
index 00000000000..cb7f23f7480
--- /dev/null
+++ b/pkgs/common-updater/scripts.nix
@@ -0,0 +1,18 @@
+{ stdenv, makeWrapper, coreutils, gawk, gnused, nix }:
+
+stdenv.mkDerivation {
+  name = "common-updater-scripts";
+
+  buildInputs = [ makeWrapper ];
+
+  unpackPhase = "true";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ${./scripts}/* $out/bin
+
+    for f in $out/bin/*; do
+      wrapProgram $f --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils gawk gnused nix ]}
+    done
+  '';
+}