lsb-release: rewrite with replaceVars, and use @runtimeShell@ (#360576)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#! @shell@
|
||||
#! @runtimeShell@
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
@@ -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
|
||||
''
|
||||
|
||||
Reference in New Issue
Block a user