mc: add trivial updater script
This commit is contained in:
parent
59bfda7248
commit
1d8cb6dd7d
1 changed files with 14 additions and 0 deletions
|
@ -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/";
|
||||
|
|
Loading…
Reference in a new issue