Skip to content

Commit

Permalink
boards generator: new option --allgen (#4614)
Browse files Browse the repository at this point in the history
useful when changing and pushing updates
  • Loading branch information
d-a-v authored Apr 7, 2018
1 parent 3a110aa commit 149af76
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,11 @@ def package ():
if packagegen:
pkgfname_read = pkgfname + '.orig'
# check if backup already exists
if not os.path.isfile(pkgfname_read):
os.rename(pkgfname, pkgfname_read)
if os.path.isfile(pkgfname_read):
print "package file is in the way, please move it"
print " %s" % pkgfname_read
sys.exit(1)
os.rename(pkgfname, pkgfname_read)

# read package file
with open (pkgfname_read, "r") as package_file:
Expand Down Expand Up @@ -1302,6 +1305,8 @@ def usage (name,ret):
print " --packagegen - replace board:[] in package"
print " --doc - shows doc/boards.rst"
print " --docgen - replace doc/boards.rst"
print " --allgen - generate and replace everything"
print " (useful for pushing on github)"
print ""

out = ""
Expand Down Expand Up @@ -1347,7 +1352,8 @@ def usage (name,ret):
try:
opts, args = getopt.getopt(sys.argv[1:], "h",
[ "help", "lwip=", "led=", "speed=", "board=", "customspeed=", "nofloat",
"ld", "ldgen", "boards", "boardsgen", "package", "packagegen", "doc", "docgen" ])
"ld", "ldgen", "boards", "boardsgen", "package", "packagegen", "doc", "docgen",
"allgen"] )
except getopt.GetoptError as err:
print str(err) # will print something like "option -a not recognized"
usage(sys.argv[0], 1)
Expand Down Expand Up @@ -1417,6 +1423,16 @@ def usage (name,ret):
docshow = True
docgen = True

elif o in ("--allgen"):
ldshow = True
ldgen = True
boardsshow = True
boardsgen = True
packageshow = True
packagegen = True
docshow = True
docgen = True

else:
assert False, "unhandled option"

Expand Down

0 comments on commit 149af76

Please sign in to comment.