Skip to content

Commit

Permalink
spack style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arezaii committed Dec 9, 2024
1 parent 6ddfc00 commit edfce90
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions var/spack/repos/builtin/packages/chapel/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,15 +774,25 @@ def get_main_version_from_cmakelists(self) -> str:
chpl_patch_version = None
for line in f:
if "set(CHPL_MAJOR_VERSION" in line:
chpl_major_version = line.split()[1].strip(')')
chpl_major_version = line.split()[1].strip(")")
if "set(CHPL_MINOR_VERSION" in line:
chpl_minor_version = line.split()[1].strip(')')
chpl_minor_version = line.split()[1].strip(")")
if "set(CHPL_PATCH_VERSION" in line:
chpl_patch_version = line.split()[1].strip(')')
if chpl_major_version is not None and chpl_minor_version is not None and chpl_patch_version is not None:
chpl_patch_version = line.split()[1].strip(")")
if (
chpl_major_version is not None
and chpl_minor_version is not None
and chpl_patch_version is not None
):
break
assert(chpl_major_version is not None and chpl_minor_version is not None and chpl_patch_version is not None)
chpl_version_string = "{}.{}.{}".format(chpl_major_version, chpl_minor_version, chpl_patch_version)
assert (
chpl_major_version is not None
and chpl_minor_version is not None
and chpl_patch_version is not None
)
chpl_version_string = "{}.{}.{}".format(
chpl_major_version, chpl_minor_version, chpl_patch_version
)
return chpl_version_string

@property
Expand Down

0 comments on commit edfce90

Please sign in to comment.