summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-05-26 09:14:29 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-06-01 06:40:13 (GMT)
commitfbbeb6dfbde2105dac9d4f2ef708f100eb31ce47 (patch)
tree24bf8a9ce06e363993b76f22a7f9e469ef5dcca7
parente00aabb831b4300e60b8d2887fe60f155abf64b3 (diff)
downloadeobuilder-fbbeb6dfbde2105dac9d4f2ef708f100eb31ce47.zip
eobuilder-fbbeb6dfbde2105dac9d4f2ef708f100eb31ce47.tar.gz
eobuilder-fbbeb6dfbde2105dac9d4f2ef708f100eb31ce47.tar.bz2
add check for hotfix branch names (#43310)v19
-rwxr-xr-xeobuilder-ctl7
1 files changed, 7 insertions, 0 deletions
diff --git a/eobuilder-ctl b/eobuilder-ctl
index 2795859..caac453 100755
--- a/eobuilder-ctl
+++ b/eobuilder-ctl
@@ -146,6 +146,8 @@ def prepare_build(dist, project, cmd_options, new):
package['repository'] = settings.HOTFIX_REPOSITORIES[dist]
os.chdir(project['git_path'])
build_branch = cmd_options.branch
+ if cmd_options.hotfix and not build_branch.startswith('hotfix/'):
+ return error("Invalid name for hotfix branch (must start with hotfix/)", exit_code=2)
debian_folder = cmd_options.debian_folder
if os.path.isdir('debian-' + dist) and debian_folder == 'debian':
debian_folder = 'debian-' + dist
@@ -267,6 +269,11 @@ def prepare_build(dist, project, cmd_options, new):
debian_changelog))
good_changelog_contents = open(debian_changelog).read()
+ if cmd_options.hotfix:
+ version_part = build_branch.split('/', 1)[1].lstrip('v')
+ if not project['version'].startswith(version_part):
+ return error("Invalid name for hotfix branch (must start with version number)", exit_code=2)
+
build_file = os.path.join(project['lock_path'],
"%s_%s_%s_%s.build" % (project['name'],
package['version'],