Browse Source

build_binaries.py: tidy file copying loop

notably, don't make fwinfo file more than once
master
Peter Barker 3 years ago committed by Andrew Tridgell
parent
commit
46234e85f9
  1. 15
      Tools/scripts/build_binaries.py

15
Tools/scripts/build_binaries.py

@ -501,16 +501,19 @@ is bob we will attempt to checkout bob-AVR'''
tdir = os.path.join(os.path.dirname(os.path.dirname( tdir = os.path.join(os.path.dirname(os.path.dirname(
os.path.dirname(ddir))), tag, bname) os.path.dirname(ddir))), tag, bname)
if tag == "latest": if tag == "latest":
# we keep a permanent archive of all "latest" builds, # we keep a permanent archive of all
# their path including a build timestamp: # "latest" builds, their path including a
self.mkpath(ddir) # build timestamp:
if not os.path.exists(ddir):
self.mkpath(ddir)
self.addfwversion(ddir, vehicle)
self.progress("Copying %s to %s" % (path, ddir,)) self.progress("Copying %s to %s" % (path, ddir,))
shutil.copy(path, ddir) shutil.copy(path, ddir)
self.addfwversion(ddir, vehicle)
# the most recent build of every tag is kept around: # the most recent build of every tag is kept around:
self.progress("Copying %s to %s" % (path, tdir)) self.progress("Copying %s to %s" % (path, tdir))
self.mkpath(tdir) if not os.path.exists(tdir):
self.addfwversion(tdir, vehicle) self.mkpath(tdir)
self.addfwversion(tdir, vehicle)
shutil.copy(path, tdir) shutil.copy(path, tdir)
except Exception as e: except Exception as e:
self.print_exception_caught(e) self.print_exception_caught(e)

Loading…
Cancel
Save