Commit 729225e3 authored by Robert Hensing's avatar Robert Hensing
Browse files

treewide: lib.isInOldestRelease -> lib.oldestSupportedReleaseIsAtLeast

parent c2b411e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@

let
  inherit (builtins) head length;
  inherit (lib.trivial) isInOldestRelease mergeAttrs warn warnIf;
  inherit (lib.trivial) oldestSupportedReleaseIsAtLeast mergeAttrs warn warnIf;
  inherit (lib.strings) concatStringsSep concatMapStringsSep escapeNixIdentifier sanitizeDerivationName;
  inherit (lib.lists) foldr foldl' concatMap elemAt all partition groupBy take foldl;
in
@@ -2137,6 +2137,6 @@ rec {
    "lib.zip is a deprecated alias of lib.zipAttrsWith." zipAttrsWith;

  # DEPRECATED
  cartesianProductOfSets = warnIf (isInOldestRelease 2405)
  cartesianProductOfSets = warnIf (oldestSupportedReleaseIsAtLeast 2405)
    "lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct." cartesianProduct;
}
+4 −4
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ let
    isAttrs
    isBool
    isFunction
    isInOldestRelease
    oldestSupportedReleaseIsAtLeast
    isList
    isString
    length
@@ -1030,7 +1030,7 @@ let
  mkForce = mkOverride 50;
  mkVMOverride = mkOverride 10; # used by ‘nixos-rebuild build-vm’

  defaultPriority = warnIf (isInOldestRelease 2305) "lib.modules.defaultPriority is deprecated, please use lib.modules.defaultOverridePriority instead." defaultOverridePriority;
  defaultPriority = warnIf (oldestSupportedReleaseIsAtLeast 2305) "lib.modules.defaultPriority is deprecated, please use lib.modules.defaultOverridePriority instead." defaultOverridePriority;

  mkFixStrictness = warn "lib.mkFixStrictness has no effect and will be removed. It returns its argument unmodified, so you can just remove any calls." id;

@@ -1146,8 +1146,8 @@ let
  }: doRename {
    inherit from to;
    visible = false;
    warn = isInOldestRelease sinceRelease;
    use = warnIf (isInOldestRelease sinceRelease)
    warn = oldestSupportedReleaseIsAtLeast sinceRelease;
    use = warnIf (oldestSupportedReleaseIsAtLeast sinceRelease)
      "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'.";
  };

+3 −3
Original line number Diff line number Diff line
@@ -256,15 +256,15 @@ let

in {

  pathType = lib.warnIf (lib.isInOldestRelease 2305)
  pathType = lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2305)
    "lib.sources.pathType has been moved to lib.filesystem.pathType."
    lib.filesystem.pathType;

  pathIsDirectory = lib.warnIf (lib.isInOldestRelease 2305)
  pathIsDirectory = lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2305)
    "lib.sources.pathIsDirectory has been moved to lib.filesystem.pathIsDirectory."
    lib.filesystem.pathIsDirectory;

  pathIsRegularFile = lib.warnIf (lib.isInOldestRelease 2305)
  pathIsRegularFile = lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2305)
    "lib.sources.pathIsRegularFile has been moved to lib.filesystem.pathIsRegularFile."
    lib.filesystem.pathIsRegularFile;

+1 −1
Original line number Diff line number Diff line
@@ -2272,7 +2272,7 @@ rec {
    isCoercibleToString :: a -> bool
    ```
  */
  isCoercibleToString = lib.warnIf (lib.isInOldestRelease 2305)
  isCoercibleToString = lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2305)
    "lib.strings.isCoercibleToString is deprecated in favor of either isStringLike or isConvertibleWithToString. Only use the latter if it needs to return true for null, numbers, booleans and list of similarly coercibles."
    isConvertibleWithToString;

+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ in
    nodesCompat =
      mapAttrs
        (name: config: config // {
          config = lib.warnIf (lib.isInOldestRelease 2211)
          config = lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2211)
            "Module argument `nodes.${name}.config` is deprecated. Use `nodes.${name}` instead."
            config;
        })
Loading