Skip to content

Commit

Permalink
JCF: Issue #410: extend list_packages.py to be able to list primary e…
Browse files Browse the repository at this point in the history
…xternals for a given release
  • Loading branch information
Dune committed Nov 15, 2024
1 parent 26384b1 commit a909496
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
13 changes: 9 additions & 4 deletions scripts/list_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
from spack.dr_tools import get_packages

if len(sys.argv) < 3:
print("Usage: {} <name of release type (\"develop\", \"production_v4\", or frozen release version)> <name of build group (coredaq, fddaq, nddaq>".format(sys.argv[0].split("/")[-1]))
print("Usage: {} <name of release type (\"develop\", \"production_v4\", or frozen release version as vX.Y.Z)> <name of package group (coredaq, fddaq, nddaq, externals>".format(sys.argv[0].split("/")[-1]))
sys.exit(1)

reltype=sys.argv[1]
bg=sys.argv[2]
pg=sys.argv[2]

if pg != "externals":
subdir=pg
else:
subdir="coredaq"

thisdir=os.path.dirname( os.path.realpath(__file__) )
yaml_filename="{}/../configs/{}/{}-{}/release.yaml".format(thisdir, bg, bg, reltype)
yaml_filename="{}/../configs/{}/{}-{}/release.yaml".format(thisdir, subdir, subdir, reltype)

if not os.path.exists(yaml_filename):
print(f"Unable to find {yaml_filename}; perhaps directories in daq-release were rearranged since this script was written?")
sys.exit(2)

print(" ".join( get_packages(yaml_filename) ))
print(" ".join( get_packages(yaml_filename, pg) ))


9 changes: 2 additions & 7 deletions scripts/spack/dr_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ def parse_yaml_file(fname):
print(exc)
return fman

def get_packages(yaml_file):
def get_packages(yaml_file, package_group):
rdict = parse_yaml_file(yaml_file)

pkgs = rdict[ rdict["type"] ]
pkgs = rdict[package_group]

return [pkg["name"] for pkg in pkgs]

# for i in range(len(pkgs)):
# ipkg = pkgs[i]
# iname = ipkg["name"]
# print(f"{iname}")

0 comments on commit a909496

Please sign in to comment.