Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions var/spack/repos/builtin/packages/crtm-fix/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down