diff --git a/var/spack/repos/builtin/packages/crtm-fix/package.py b/var/spack/repos/builtin/packages/crtm-fix/package.py index 7c30f6aebd34dd..2499c2e047fb2a 100644 --- a/var/spack/repos/builtin/packages/crtm-fix/package.py +++ b/var/spack/repos/builtin/packages/crtm-fix/package.py @@ -58,23 +58,27 @@ def install(self, spec, prefix): # Little_Endian amsua_metop-c_v2.SpcCoeff.bin is what it's supposed to be. # Remove the incorrect file, and install it as noACC,, then install # correct file under new name. - if "+big_endian" in spec and spec.version == Version("2.4.0_emc"): - remove_path = join_path( - os.getcwd(), "fix", "SpcCoeff", "Big_Endian", "amsua_metop-c.SpcCoeff.bin" + if "+big_endian" in spec and ( + spec.version in [Version("2.4.0_emc"), Version("2.4.0.1_emc")] + ): + amc_sc_path = join_path("SpcCoeff", "Big_Endian", "amsua_metop-c.SpcCoeff.bin") + amc_sc_v2_path = join_path( + "SpcCoeff", "Little_Endian", "amsua_metop-c_v2.SpcCoeff.bin" ) + # In 2.4.0_emc, the path is prefixed by 'fix/' + if spec.version == Version("2.4.0_emc"): + amc_sc_path = join_path("fix", amc_sc_path) + amc_sc_v2_path = join_path("fix", amc_sc_v2_path) + + remove_path = join_path(os.getcwd(), amc_sc_path) + fix_files.remove(remove_path) # This file is incorrect, install it as a different name. - install( - join_path("fix", "SpcCoeff", "Big_Endian", "amsua_metop-c.SpcCoeff.bin"), - join_path(self.prefix.fix, "amsua_metop-c.SpcCoeff.noACC.bin"), - ) + install(amc_sc_path, join_path(self.prefix.fix, "amsua_metop-c.SpcCoeff.noACC.bin")) # This "Little_Endian" file is actually the correct one. - install( - join_path("fix", "SpcCoeff", "Little_Endian", "amsua_metop-c_v2.SpcCoeff.bin"), - join_path(self.prefix.fix, "amsua_metop-c.SpcCoeff.bin"), - ) + install(amc_sc_v2_path, join_path(self.prefix.fix, "amsua_metop-c.SpcCoeff.bin")) for f in fix_files: install(f, self.prefix.fix)