mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Tools: support new stable release of 4.3.x
allows creation of the stable-4.3.x directories
This commit is contained in:
parent
7d23e14f85
commit
d10cebd649
@ -8,6 +8,8 @@ import shutil
|
|||||||
|
|
||||||
VEHICLES = ['AntennaTracker', 'Copter', 'Plane', 'Rover', 'Sub']
|
VEHICLES = ['AntennaTracker', 'Copter', 'Plane', 'Rover', 'Sub']
|
||||||
|
|
||||||
|
# beta directories that may contain stable builds
|
||||||
|
BETA_DIRS = ['beta-4.3']
|
||||||
|
|
||||||
def make_stable(basedir, vehicle):
|
def make_stable(basedir, vehicle):
|
||||||
'''make stable version for a vehicle'''
|
'''make stable version for a vehicle'''
|
||||||
@ -34,11 +36,45 @@ def make_stable(basedir, vehicle):
|
|||||||
old_dir = os.path.join(stable_dir, b)
|
old_dir = os.path.join(stable_dir, b)
|
||||||
shutil.copytree(old_dir, new_dir)
|
shutil.copytree(old_dir, new_dir)
|
||||||
|
|
||||||
|
def make_stable_from_beta(basedir, vehicle, beta_dir):
|
||||||
|
'''make stable version from a beta with OFFICAL tag'''
|
||||||
|
beta_dir = os.path.join(basedir, vehicle, beta_dir)
|
||||||
|
if not os.path.exists(beta_dir):
|
||||||
|
return
|
||||||
|
for b in sorted(os.listdir(beta_dir)):
|
||||||
|
if not os.path.isdir(os.path.join(beta_dir, b)):
|
||||||
|
continue
|
||||||
|
vfile = os.path.join(beta_dir, b, "firmware-version.txt")
|
||||||
|
if not os.path.exists(vfile):
|
||||||
|
print("Missing %s" % vfile)
|
||||||
|
continue
|
||||||
|
vstr = open(vfile).read().strip()
|
||||||
|
a = vstr.split('-')
|
||||||
|
if len(a) != 2:
|
||||||
|
continue
|
||||||
|
version = a[0]
|
||||||
|
vtype = a[1]
|
||||||
|
#print(vfile, b, version, vtype)
|
||||||
|
if vtype != 'FIRMWARE_VERSION_TYPE_OFFICIAL':
|
||||||
|
# not a new stable
|
||||||
|
continue
|
||||||
|
new_dir_parent = os.path.join(basedir, vehicle, 'stable-%s' % version)
|
||||||
|
new_dir = os.path.join(new_dir_parent, b)
|
||||||
|
if os.path.exists(new_dir):
|
||||||
|
continue
|
||||||
|
if not os.path.exists(new_dir_parent):
|
||||||
|
os.mkdir(new_dir_parent)
|
||||||
|
print('Creating %s' % new_dir)
|
||||||
|
old_dir = os.path.join(beta_dir, b)
|
||||||
|
shutil.copytree(old_dir, new_dir)
|
||||||
|
|
||||||
|
|
||||||
def make_all_stable(basedir):
|
def make_all_stable(basedir):
|
||||||
'''make stable directory for all vehicles'''
|
'''make stable directory for all vehicles'''
|
||||||
for v in VEHICLES:
|
for v in VEHICLES:
|
||||||
make_stable(basedir, v)
|
make_stable(basedir, v)
|
||||||
|
for b in BETA_DIRS:
|
||||||
|
make_stable_from_beta(basedir, v, b)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user