2018-03-03 14:07:00 +00:00
|
|
|
self: super: let
|
2022-08-02 11:19:32 +00:00
|
|
|
lib = super.lib;
|
2015-08-23 14:51:11 +00:00
|
|
|
|
2018-03-03 14:07:00 +00:00
|
|
|
# This callPackage will try to detect obsolete overrides.
|
|
|
|
callPackage = path: args: let
|
|
|
|
override = super.callPackage path args;
|
2022-08-02 11:19:32 +00:00
|
|
|
upstream = lib.optionalAttrs (override ? "name")
|
|
|
|
(super.${(builtins.parseDrvName override.name).name} or {});
|
2018-03-03 14:07:00 +00:00
|
|
|
in if upstream ? "name" &&
|
|
|
|
override ? "name" &&
|
2022-08-02 11:19:32 +00:00
|
|
|
lib.compareVersions upstream.name override.name != -1
|
2018-03-03 14:07:00 +00:00
|
|
|
then
|
2022-08-02 11:19:32 +00:00
|
|
|
builtins.trace
|
2018-03-03 14:07:00 +00:00
|
|
|
"Upstream `${upstream.name}' gets overridden by `${override.name}'."
|
|
|
|
override
|
|
|
|
else override;
|
2017-11-12 12:04:42 +00:00
|
|
|
|
2018-03-03 14:07:00 +00:00
|
|
|
subdirsOf = path:
|
2022-08-02 11:19:32 +00:00
|
|
|
lib.mapAttrs (name: _: path + "/${name}")
|
|
|
|
(lib.filterAttrs (_: x: x == "directory") (builtins.readDir path));
|
2018-03-03 14:07:00 +00:00
|
|
|
|
2022-08-02 11:19:32 +00:00
|
|
|
in lib.mapAttrs (_: lib.flip callPackage {})
|
|
|
|
(lib.filterAttrs (_: dir: lib.pathExists (dir + "/default.nix"))
|
2018-03-03 14:07:00 +00:00
|
|
|
(subdirsOf ./.))
|