Unverified Commit 2f83e9cb authored by Doron Behar's avatar Doron Behar Committed by GitHub
Browse files

tsm-client: 8.1.25.0 -> 8.1.27.0, drop old migration code (#387363)

parents bd0cf0c3 f9cc9bf9
Loading
Loading
Loading
Loading
+3 −60
Original line number Diff line number Diff line
{
  config,
  lib,
  options,
  pkgs,
  ...
}: # XXX migration code for freeform settings: `options` can be removed in 2025
let
  optionsGlobal = options;
in
}:

let

@@ -75,7 +71,7 @@ let
    {
      freeformType = attrsOf (either scalarType (listOf scalarType));
      # Client system-options file directives are explained here:
      # https://www.ibm.com/docs/en/storage-protect/8.1.25?topic=commands-processing-options
      # https://www.ibm.com/docs/en/storage-protect/8.1.27?topic=commands-processing-options
      options.servername = mkOption {
        type = servernameType;
        default = name;
@@ -150,27 +146,6 @@ let
      };
      config.commmethod = mkDefault "v6tcpip"; # uses v4 or v6, based on dns lookup result
      config.passwordaccess = if config.genPasswd then "generate" else "prompt";
      # XXX migration code for freeform settings, these can be removed in 2025:
      options.warnings = optionsGlobal.warnings;
      options.assertions = optionsGlobal.assertions;
      imports =
        let
          inherit (lib.modules) mkRemovedOptionModule mkRenamedOptionModule;
        in
        [
          (mkRemovedOptionModule [ "extraConfig" ]
            "Please just add options directly to the server attribute set, cf. the description of `programs.tsmClient.servers`."
          )
          (mkRemovedOptionModule [ "text" ]
            "Please just add options directly to the server attribute set, cf. the description of `programs.tsmClient.servers`."
          )
          (mkRenamedOptionModule [ "name" ] [ "servername" ])
          (mkRenamedOptionModule [ "server" ] [ "tcpserveraddress" ])
          (mkRenamedOptionModule [ "port" ] [ "tcpport" ])
          (mkRenamedOptionModule [ "node" ] [ "nodename" ])
          (mkRenamedOptionModule [ "passwdDir" ] [ "passworddir" ])
          (mkRenamedOptionModule [ "includeExclude" ] [ "inclexcl" ])
        ];
    };

  options.programs.tsmClient = {
@@ -291,16 +266,7 @@ let
        contain duplicate names
        (note that setting names are case insensitive).
      '';
    }) cfg.servers)
    # XXX migration code for freeform settings, this can be removed in 2025:
    ++ (enrichMigrationInfos "assertions" (
      addText:
      { assertion, message }:
      {
        inherit assertion;
        message = addText message;
      }
    ));
    }) cfg.servers);

  makeDsmSysLines =
    key: value:
@@ -340,17 +306,6 @@ let
      attrs = removeAttrs serverCfg [
        "servername"
        "genPasswd"
        # XXX migration code for freeform settings, these can be removed in 2025:
        "assertions"
        "warnings"
        "extraConfig"
        "text"
        "name"
        "server"
        "port"
        "node"
        "passwdDir"
        "includeExclude"
      ];
    in
    ''
@@ -369,16 +324,6 @@ let
    ${concatLines (map makeDsmSysStanza (attrValues cfg.servers))}
  '';

  # XXX migration code for freeform settings, this can be removed in 2025:
  enrichMigrationInfos =
    what: how:
    concatLists (
      mapAttrsToList (
        name: serverCfg:
        map (how (text: "In `programs.tsmClient.servers.${name}`: ${text}")) serverCfg."${what}"
      ) cfg.servers
    );

in

{
@@ -393,8 +338,6 @@ in
      dsmSysApi = dsmSysCli;
    };
    environment.systemPackages = [ cfg.wrappedPackage ];
    # XXX migration code for freeform settings, this can be removed in 2025:
    warnings = enrichMigrationInfos "warnings" (addText: addText);
  };

  meta.maintainers = [ lib.maintainers.yarny ];
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ in
      environment.HOME = "/var/lib/tsm-backup";
      serviceConfig = {
        # for exit status description see
        # https://www.ibm.com/docs/en/storage-protect/8.1.25?topic=clients-client-return-codes
        # https://www.ibm.com/docs/en/storage-protect/8.1.27?topic=clients-client-return-codes
        SuccessExitStatus = "4 8";
        # The `-se` option must come after the command.
        # The `-optfile` option suppresses a `dsm.opt`-not-found warning.
+3 −3
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
# point to this derivations `/dsmi_dir` directory symlink.
# Other environment variables might be necessary,
# depending on local configuration or usage; see:
# https://www.ibm.com/docs/en/storage-protect/8.1.25?topic=solaris-set-api-environment-variables
# https://www.ibm.com/docs/en/storage-protect/8.1.27?topic=solaris-set-api-environment-variables

let

@@ -91,10 +91,10 @@ let

  unwrapped = stdenv.mkDerivation (finalAttrs: {
    name = "tsm-client-${finalAttrs.version}-unwrapped";
    version = "8.1.25.0";
    version = "8.1.27.0";
    src = fetchurl {
      url = mkSrcUrl finalAttrs.version;
      hash = "sha512-OPNjSMnWJ/8Ogy9O0wG0H4cEbYiOwyCVzkWhpG00v/Vm0LDxLzPteMnMOyH8L1egIDhy7lmQYSzI/EC4WWUDDA==";
      hash = "sha512-nbQHoD7fUp4qBTgRJ6nHXF4PsZRTin7FGPi340jKc73O/9DCNb1JQG/gY+B2xzPM2g6agqWu/MX5J+Wt0nOEkA==";
    };
    inherit meta passthru;