Merge pull request #152947 from trofi/update-script-for-mc

mc: add trivial updater script
This commit is contained in:
Jörg Thalheim 2021-12-31 15:50:41 +00:00 committed by GitHub
commit 2a2ffb1351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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/";