@@ -39,6 +39,7 @@ def inject_prerelease_information(
3939 custom_root_projection : str | None = None ,
4040 keep_root_spec_intact : bool = False ,
4141 spack_packages_path : str | None = None ,
42+ spack_packages_version_sha : str | None = None ,
4243) -> str :
4344 # In comparison to the projections script, this returns a string rather than a dict because we need to
4445 # add spack-specific, non-standard 'repo::' sections, which the yaml dumper does not support.
@@ -69,7 +70,7 @@ def inject_prerelease_information(
6970 if spack_packages_path :
7071 # Add the 'repo:' section for prerelease spack packages if provided
7172 updated_manifest = add_prerelease_repos_section (
72- updated_manifest , spack_packages_path
73+ updated_manifest , spack_packages_path , spack_packages_version_sha
7374 )
7475
7576 # Dump the current dict, and add the non-standard 'repo::' section
@@ -151,7 +152,7 @@ def update_root_spec_projection_version(
151152
152153
153154def add_prerelease_repos_section (
154- manifest : dict [str , Any ], spack_packages_path : str
155+ manifest : dict [str , Any ], spack_packages_path : str , spack_packages_version_sha : str | None = None
155156) -> dict [str , Any ]:
156157
157158 manifest .setdefault ("spack" , {}).setdefault ("repos" , {})
@@ -162,6 +163,9 @@ def add_prerelease_repos_section(
162163 }
163164 }
164165
166+ if spack_packages_version_sha :
167+ manifest ["spack" ]["repos" ]["access_spack_packages" ]["commit" ] = spack_packages_version_sha
168+
165169 return manifest
166170
167171
@@ -208,6 +212,13 @@ def parse_args(args: list[str]) -> argparse.Namespace:
208212 help = "Local path to a spack-packages repository that is added to the manifests repos section" ,
209213 )
210214
215+ parser .add_argument (
216+ "--spack-packages-version-sha" ,
217+ type = str ,
218+ required = False ,
219+ help = "Git SHA of the spack-packages repository that is added to the manifests repos section" ,
220+ )
221+
211222 # Args dealing with outputs
212223 parser .add_argument (
213224 "--output" ,
@@ -228,6 +239,7 @@ def main():
228239 args .custom_root_projection ,
229240 args .keep_root_spec_intact ,
230241 args .spack_packages_path ,
242+ args .spack_packages_version_sha ,
231243 )
232244
233245 print (injected_manifest )
0 commit comments