xtensa-build-zephyr.py: -p ristine deletes STAGING_DIR

Make the new -p pristine build option also delete the staging_dir. This
solves a problem where the following sequence was leaving a stale
platform1 build in staging:

xtensa-build-zephyr.py -p platform1
   < code >
xtensa-build-zephyr.py -p platform2

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2022-08-05 03:08:28 -07:00 committed by Liam Girdwood
parent 5fb1d45562
commit b29242a2ad
1 changed files with 4 additions and 0 deletions

View File

@ -410,6 +410,10 @@ def build_platforms():
global STAGING_DIR
STAGING_DIR = pathlib.Path(west_top, "build-sof-staging")
if args.pristine:
if os.path.exists(STAGING_DIR):
shutil.rmtree(STAGING_DIR)
# smex does not use 'install -D'
sof_output_dir = pathlib.Path(STAGING_DIR, "sof")
sof_output_dir.mkdir(mode=511, parents=True, exist_ok=True)