forked from linuxmint/nemo-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bump-versions
executable file
·32 lines (25 loc) · 1.14 KB
/
bump-versions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/python3
import argparse
import os
import subprocess
import sys
parser = argparse.ArgumentParser(description='Bumps versions for a new Cinnamon release.')
parser.add_argument('-c', '--codename', required=True, help='a Mint codename')
parser.add_argument('-v', '--version', required=True, help='a version number')
args = parser.parse_args()
with open('build-order') as build_order_file:
projects = [line.strip() for line in build_order_file if not '#' in line]
for project in projects:
os.chdir(project)
print("")
print(" ", project)
print("----------------")
for filename in ["setup.py", "meson.build"]:
if os.path.exists(filename):
subprocess.call("sed -i '/version/ {/dependency/! s/[0-9].[0-9].[0-9]/%s/}' %s" % (args.version, filename), shell=True)
for filename in ["PKG-INFO"]:
if os.path.exists(filename):
subprocess.call(["sed", "-i", "/Version:/s/[0-9].[0-9].[0-9]/%s/" % args.version, filename])
subprocess.call(["dch", "--distribution", args.codename, "-v", args.version, args.version], stdout=None, stderr=None)
os.chdir("..")
print("----------------")