mc: add trivial updater script

This commit is contained in:
Sergei Trofimovich 2021-12-31 14:42:25 +00:00
parent 59bfda7248
commit 1d8cb6dd7d

View file

@ -17,6 +17,9 @@
, coreutils
, autoreconfHook
, autoSignDarwinBinariesHook
# updater only
, writeScript
}:
stdenv.mkDerivation rec {
@ -69,6 +72,17 @@ stdenv.mkDerivation rec {
$out/bin/mc
'';
passthru.updateScript = writeScript "update-mc" ''
#!/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 "Current version is: 4.8.27; ...".
new_version="$(curl -s https://midnight-commander.org/ | pcregrep -o1 'Current version is: (([0-9]+\.?)+);')"
update-source-version mc "$new_version"
'';
meta = with lib; {
description = "File Manager and User Shell for the GNU Project";
downloadPage = "https://www.midnight-commander.org/downloads/";