Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion chb/app/CHVersion.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
chbversion: str = "0.3.0-20260122"
chbversion: str = "0.3.0-20260125"

minimum_required_chb_version = "0.6.0_20260122"
17 changes: 14 additions & 3 deletions chb/cmdline/commandutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@

from chb.app.Callgraph import CallgraphNode

from chb.app.CHVersion import minimum_required_chb_version

from chb.arm.ARMAccess import ARMAccess
from chb.arm.ARMAssembly import ARMAssembly

Expand Down Expand Up @@ -458,9 +460,18 @@ def analyzecmd(args: argparse.Namespace) -> NoReturn:
exit(0)

if skip_if_metrics and UF.has_analysis_results(path, xfile):
# we have what we need
print_status_update("Skip analysis of " + xname)
exit(0)
chbversion = UF.get_resultmetrics_chb_version(path, xfile)
if chbversion >= minimum_required_chb_version:
# we have what we need
print_status_update("Skip analysis of " + xname + " (version: " + chbversion + ")")
exit(0)
else:
print_status_update(
"Analysis results found are out of date with current version. "
+ "Minimum required version: "
+ minimum_required_chb_version
+ ". Version found: "
+ chbversion)

try:
userhints = prepare_executable(
Expand Down
8 changes: 8 additions & 0 deletions chb/util/fileutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,14 @@ def get_resultmetrics_xheader(path: str, xfile: str) -> ET.Element:
return get_chb_xheader(filename)


def get_resultmetrics_chb_version(path: str, xfile: str) -> str:
xheader = get_resultmetrics_xheader(path, xfile)
xversion = xheader.get("chb-version")
if xversion is None:
raise CHBError("chb-version attribute missing from metrics header")
return xversion


def get_resultdata_filename(path: str, xfile: str) -> str:
fdir = get_results_dir(path, xfile)
return get_chb_filename(fdir, xfile, "data.xml")
Expand Down