add support for version epoch (#30840)
This commit is contained in:
parent
8a98a2a49f
commit
deae95af3f
|
@ -232,7 +232,8 @@ def prepare_build(dist, project, cmd_options, new):
|
||||||
settings.DEBIAN_VERSIONS[dist])
|
settings.DEBIAN_VERSIONS[dist])
|
||||||
call("git checkout --quiet %s" % build_branch)
|
call("git checkout --quiet %s" % build_branch)
|
||||||
changelog = '\n'.join(changelog_from_git(package['source_name'],
|
changelog = '\n'.join(changelog_from_git(package['source_name'],
|
||||||
version_suffix, project['git_path'], package['repository']))
|
version_suffix, project['git_path'], package['repository'],
|
||||||
|
epoch=cmd_options.epoch))
|
||||||
if changelog:
|
if changelog:
|
||||||
if not os.path.isdir(debian_folder):
|
if not os.path.isdir(debian_folder):
|
||||||
call("git checkout --quiet %s" % debian_branch)
|
call("git checkout --quiet %s" % debian_branch)
|
||||||
|
@ -252,7 +253,7 @@ def prepare_build(dist, project, cmd_options, new):
|
||||||
shutil.rmtree(project['build_dir'])
|
shutil.rmtree(project['build_dir'])
|
||||||
os.makedirs(project['build_dir'], 0755)
|
os.makedirs(project['build_dir'], 0755)
|
||||||
|
|
||||||
if package['version'].split('-')[0] == project['version']:
|
if package['version'].split('-')[0].split(':')[-1] == project['version']:
|
||||||
# the generated changelog has the right version number, use it.
|
# the generated changelog has the right version number, use it.
|
||||||
good_changelog_contents = changelog
|
good_changelog_contents = changelog
|
||||||
else:
|
else:
|
||||||
|
@ -261,7 +262,9 @@ def prepare_build(dist, project, cmd_options, new):
|
||||||
package['version'] = '%s%s' % (project['version'], version_suffix)
|
package['version'] = '%s%s' % (project['version'], version_suffix)
|
||||||
call('dch "Eobuilder version" -v %s --distribution %s \
|
call('dch "Eobuilder version" -v %s --distribution %s \
|
||||||
--force-bad-version --force-distribution --changelog %s' % \
|
--force-bad-version --force-distribution --changelog %s' % \
|
||||||
(package['version'], package["repository"], debian_changelog))
|
('%s:%s' % (cmd_options.epoch, package['version']) if cmd_options.epoch else package['version'],
|
||||||
|
package["repository"],
|
||||||
|
debian_changelog))
|
||||||
good_changelog_contents = open(debian_changelog).read()
|
good_changelog_contents = open(debian_changelog).read()
|
||||||
|
|
||||||
build_file = os.path.join(project['lock_path'],
|
build_file = os.path.join(project['lock_path'],
|
||||||
|
|
|
@ -35,7 +35,8 @@ def is_pep0440_project(path):
|
||||||
def changelog_from_git(project, version_suffix, path,
|
def changelog_from_git(project, version_suffix, path,
|
||||||
repository='eobuilder',
|
repository='eobuilder',
|
||||||
maintainer_name='eobuilder',
|
maintainer_name='eobuilder',
|
||||||
maintainer_email='eobuilder@entrouvert.com'):
|
maintainer_email='eobuilder@entrouvert.com',
|
||||||
|
epoch=''):
|
||||||
repo = git.repo.Repo(path)
|
repo = git.repo.Repo(path)
|
||||||
is_pep0440 = is_pep0440_project(path)
|
is_pep0440 = is_pep0440_project(path)
|
||||||
|
|
||||||
|
@ -73,6 +74,8 @@ def changelog_from_git(project, version_suffix, path,
|
||||||
version = version.replace('.g', '+g')
|
version = version.replace('.g', '+g')
|
||||||
if i == 0:
|
if i == 0:
|
||||||
version += version_suffix
|
version += version_suffix
|
||||||
|
if epoch:
|
||||||
|
version = '%s:%s' % (epoch, version)
|
||||||
yield '%s (%s) %s; urgency=low' % (project, str(version), repository)
|
yield '%s (%s) %s; urgency=low' % (project, str(version), repository)
|
||||||
yield ''
|
yield ''
|
||||||
for l in logs:
|
for l in logs:
|
||||||
|
|
|
@ -49,6 +49,11 @@ def parse_cmdline():
|
||||||
dest="branch", metavar='NAME',
|
dest="branch", metavar='NAME',
|
||||||
default="master",
|
default="master",
|
||||||
help="branch to build (Default: master)")
|
help="branch to build (Default: master)")
|
||||||
|
parser.add_option("--epoch",
|
||||||
|
action="store", type="string",
|
||||||
|
dest="epoch", metavar='EPOCH',
|
||||||
|
default="",
|
||||||
|
help="version number epoch (default: none)")
|
||||||
parser.add_option("-D", "--debian-folder",
|
parser.add_option("-D", "--debian-folder",
|
||||||
action="store", type="string",
|
action="store", type="string",
|
||||||
dest="debian_folder", metavar='NAME',
|
dest="debian_folder", metavar='NAME',
|
||||||
|
|
Loading…
Reference in New Issue