lsb-release: rewrite with replaceVars, and use @runtimeShell@ (#360576)

This commit is contained in:
Aleksana
2024-12-07 19:58:52 +08:00
committed by GitHub
2 changed files with 25 additions and 21 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#! @shell@
#! @runtimeShell@
set -o errexit
set -o nounset
+24 -20
View File
@@ -1,22 +1,26 @@
{ substituteAll, lib
, coreutils, getopt
{
replaceVars,
runCommand,
lib,
runtimeShell,
coreutils,
getopt,
}:
substituteAll {
name = "lsb_release";
src = ./lsb_release.sh;
dir = "bin";
isExecutable = true;
inherit coreutils getopt;
meta = with lib; {
description = "Prints certain LSB (Linux Standard Base) and Distribution information";
mainProgram = "lsb_release";
license = [ licenses.mit ];
maintainers = with maintainers; [ primeos ];
platforms = platforms.linux;
};
}
runCommand "lsb_release"
{
meta = with lib; {
description = "Prints certain LSB (Linux Standard Base) and Distribution information";
mainProgram = "lsb_release";
license = [ licenses.mit ];
maintainers = with maintainers; [ primeos ];
platforms = platforms.linux;
};
}
''
install -Dm 555 ${
replaceVars ./lsb_release.sh {
inherit runtimeShell coreutils getopt;
}
} $out/bin/lsb_release
''