|
20 | 20 |
|
21 | 21 | def bookkeeping_for_fhicl_documents_artdaq_v3_base(self): |
22 | 22 |
|
23 | | - # Determine that the artdaq package used is new enough to be |
24 | | - # compatible with the assumptions made by DAQInterface about the |
25 | | - # interface artdaq offers |
26 | | - |
27 | | - # JCF, Nov-20-2018: update this when ready to require subsystem-compatible |
28 | | - # artdaq |
29 | | - |
30 | | - if os.path.exists(self.daq_dir + "/srcs/artdaq"): |
31 | | - commit_check_throws_if_failure( |
32 | | - self.daq_dir + "/srcs/artdaq", |
33 | | - "b434f3b71dd5c87da68d6b13f040701ff610fee1", |
34 | | - "July 15, 2018", |
35 | | - True, |
36 | | - ) |
37 | | - else: |
38 | | - |
39 | | - # JCF, Sep-20-2018: not yet logic for requiring an artdaq |
40 | | - # version with a letter at the end of it (e.g., v3_02_01a as |
41 | | - # opposed to v3_02_01) |
42 | | - |
43 | | - min_majorver = "3" |
44 | | - min_minorver = "03" |
45 | | - min_minorerver = "00" |
46 | | - |
47 | | - # ...so we'll also have a list of versions where if the artdaq |
48 | | - # version matches one of them, we'll be considered OK |
49 | | - |
50 | | - other_allowed_versions = ["v3_02_01a"] |
51 | | - |
52 | | - self.fill_package_versions(["artdaq"]) |
53 | | - version = self.package_versions["artdaq"] |
54 | | - |
55 | | - res = re.search(r"v([0-9]+)_([0-9]+)_([0-9]+)(.*)", version) |
56 | | - |
57 | | - if not res: |
58 | | - raise Exception( |
59 | | - "Problem parsing the calculated version of artdaq, %s" % (version) |
60 | | - ) |
61 | | - |
62 | | - majorver = res.group(1) |
63 | | - minorver = res.group(2) |
64 | | - minorerver = res.group(3) |
65 | | - extension = res.group(4) |
66 | | - |
67 | | - passes_requirement = False |
68 | | - |
69 | | - if int(majorver) > int(min_majorver): |
70 | | - passes_requirement = True |
71 | | - elif int(majorver) == int(min_majorver): |
72 | | - if int(minorver) > int(min_minorver): |
73 | | - passes_requirement = True |
74 | | - elif int(minorver) == int(min_minorver): |
75 | | - if int(minorerver) >= int(min_minorerver): |
76 | | - passes_requirement = True |
77 | | - |
78 | | - if not passes_requirement: |
79 | | - for an_allowed_version in other_allowed_versions: |
80 | | - if version == an_allowed_version: |
81 | | - passes_requirement = True |
82 | | - |
83 | | - if not passes_requirement: |
84 | | - raise Exception( |
85 | | - make_paragraph( |
86 | | - 'Version of artdaq set up by setup script "%s" is v%s_%s_%s%s; need a version at least as recent as v%s_%s_%s' |
87 | | - % ( |
88 | | - self.daq_setup_script, |
89 | | - majorver, |
90 | | - minorver, |
91 | | - minorerver, |
92 | | - extension, |
93 | | - min_majorver, |
94 | | - min_minorver, |
95 | | - min_minorerver, |
96 | | - ) |
97 | | - ) |
98 | | - ) |
99 | | - |
100 | 23 | # Start calculating values (fragment counts, memory sizes, etc.) |
101 | 24 | # which will need to appear in the FHiCL |
102 | 25 |
|
|
0 commit comments