summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2022-04-23 08:47:28 +0200
committerVladimír Čunát <v@cunat.cz>2022-04-23 08:47:28 +0200
commit487624c151950796f8fe29e5408507aa7f1ea589 (patch)
treed977b4ffaf220f99973c35a43fa2c3f95ee9c0cf
parent9c1b29e66294b69a84c1cc1c6ff6d606c23d327b (diff)
parent3326297c8e93c895f7bac7a84729216515383a84 (diff)
downloadnixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.tar
nixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.tar.gz
nixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.tar.bz2
nixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.tar.lz
nixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.tar.xz
nixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.tar.zst
nixpkgs-487624c151950796f8fe29e5408507aa7f1ea589.zip
Merge #167432: ethtool: 5.16 -> 5.17
-rw-r--r--pkgs/tools/misc/ethtool/default.nix21
1 files changed, 19 insertions, 2 deletions
diff --git a/pkgs/tools/misc/ethtool/default.nix b/pkgs/tools/misc/ethtool/default.nix
index d46815e8bf2..f80de50ea55 100644
--- a/pkgs/tools/misc/ethtool/default.nix
+++ b/pkgs/tools/misc/ethtool/default.nix
@@ -3,15 +3,16 @@
 , fetchurl
 , libmnl
 , pkg-config
+, writeScript
 }:
 
 stdenv.mkDerivation rec {
   pname = "ethtool";
-  version = "5.16";
+  version = "5.17";
 
   src = fetchurl {
     url = "mirror://kernel/software/network/${pname}/${pname}-${version}.tar.xz";
-    sha256 = "sha256-qi/vGTbdShF1XfoL25Pw7FvqRSCNJ8l1S8Or4apCwcs=";
+    sha256 = "sha256-ZKuRS5xrRQRyRdkfQLh2CycomSqeWvInF8ZEI46IkTM=";
   };
 
   nativeBuildInputs = [
@@ -22,6 +23,22 @@ stdenv.mkDerivation rec {
     libmnl
   ];
 
+  passthru = {
+    updateScript = writeScript "update-ethtool" ''
+      #!/usr/bin/env nix-shell
+      #!nix-shell -i bash -p curl pcre common-updater-scripts
+
+      set -eu -o pipefail
+
+      # Expect the text in format of '<a href="ethtool-VER.tar.xz">...</a>'
+      # The page always lists versions newest to oldest. Pick the first one.
+      new_version="$(curl -s https://mirrors.edge.kernel.org/pub/software/network/ethtool/ |
+          pcregrep -o1 '<a href="ethtool-([0-9.]+)[.]tar[.]xz">' |
+          head -n1)"
+      update-source-version ${pname} "$new_version"
+    '';
+  };
+
   meta = with lib; {
     description = "Utility for controlling network drivers and hardware";
     homepage = "https://www.kernel.org/pub/software/network/ethtool/";