Eliminate a step in the string construction
This commit is contained in:
parent
1315e8fab8
commit
0670b65fff
|
@ -30,6 +30,7 @@
|
||||||
hasAttr "meta" drv &&
|
hasAttr "meta" drv &&
|
||||||
hasAttr "maintainers" drv.meta &&
|
hasAttr "maintainers" drv.meta &&
|
||||||
(length drv.meta.maintainers) == 0;
|
(length drv.meta.maintainers) == 0;
|
||||||
|
stringJoin = objToString: objs: writeText "txt" (concatLines (map objToString objs));
|
||||||
maintainerToString = m: "${m.name} (${m.email})";
|
maintainerToString = m: "${m.name} (${m.email})";
|
||||||
drvToString = drv: "${drv.name}";
|
drvToString = drv: "${drv.name}";
|
||||||
};
|
};
|
||||||
|
@ -38,8 +39,7 @@
|
||||||
maintainers = drv: let
|
maintainers = drv: let
|
||||||
drvs = buildtimeDerivations drv;
|
drvs = buildtimeDerivations drv;
|
||||||
maintainers = concatMap drvMaintainers drvs;
|
maintainers = concatMap drvMaintainers drvs;
|
||||||
maintainerNames = map maintainerToString maintainers;
|
maintainerNamesList = stringJoin (m: "${m.name} (${m.email})") maintainers;
|
||||||
maintainerNamesList = writeText "maintainers" (concatLines maintainerNames);
|
|
||||||
uniqNames = runCommandLocal "uniq-maintainers.txt" {} ''
|
uniqNames = runCommandLocal "uniq-maintainers.txt" {} ''
|
||||||
<${maintainerNamesList} sort | uniq -c > $out
|
<${maintainerNamesList} sort | uniq -c > $out
|
||||||
'';
|
'';
|
||||||
|
@ -47,8 +47,7 @@
|
||||||
adopt = drv: let
|
adopt = drv: let
|
||||||
drvs = buildtimeDerivations drv;
|
drvs = buildtimeDerivations drv;
|
||||||
drvsNoMain = filter nobodyMaintains drvs;
|
drvsNoMain = filter nobodyMaintains drvs;
|
||||||
drvNames = map drvToString drvsNoMain;
|
drvNamesList = stringJoin (drv: "${drv.name} ${drv.meta.position}") drvsNoMain;
|
||||||
drvNamesList = writeText "no-maintainers" (concatLines drvNames);
|
|
||||||
uniqNames = runCommandLocal "no-maintainers.txt" {} ''
|
uniqNames = runCommandLocal "no-maintainers.txt" {} ''
|
||||||
<${drvNamesList} sort -u > $out
|
<${drvNamesList} sort -u > $out
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue