Skip to content

Commit

Permalink
update config script
Browse files Browse the repository at this point in the history
  • Loading branch information
rinigus committed Dec 1, 2021
1 parent 39392ea commit a7c34c0
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions scripts/bump-config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/usr/bin/env python3
import sys, glob
import sys, glob, argparse
import lxml.etree as ET
from datetime import datetime

base = sys.argv[1]
if len(sys.argv) > 2 and sys.argv[2]=="--config-only":
parser = argparse.ArgumentParser(description='Bump configuration files')

parser.add_argument('base', help='OBS directory of the project')
parser.add_argument('--config-version', default=None, help='Version/tag of config project')
parser.add_argument('--config-only', action="store_true", help='Bump only config files')

args = parser.parse_args()

base = args.base
if args.config_only:
S = ['config', 'hal-version']
else:
S = ['config', 'hal-version', 'droid-hal-*-img-boot']
Expand All @@ -18,6 +26,11 @@
root.remove(c)
elif c.attrib['name'] == 'webhook':
root.remove(c)
if args.config_version and f.find('-img-boot') < 0:
for cc in c:
if cc.attrib["name"] == 'revision':
cc.text = args.config_version
print(f, 'Set version', args.config_version)
comment = ET.Comment(' Bump Config: ' + datetime.now().isoformat(sep=' ', timespec='seconds') + ' ')
root.append(comment)
tree.write(f)

0 comments on commit a7c34c0

Please sign in to comment.