create orig tarball before generating debian changelog (#12640)
This commit is contained in:
parent
9d7d1fafb0
commit
bba065d34a
|
@ -170,12 +170,36 @@ def prepare_build(dist, project, cmd_options, new):
|
|||
call("git submodule init")
|
||||
call("git submodule update")
|
||||
|
||||
# get package source name
|
||||
control_file = os.path.join(debian_folder, 'control')
|
||||
package['names'] = re.findall(r"Package\s*:\s*(.*?)\n", cat(control_file))
|
||||
package['source_name'] = re.search(r"^Source\s*:\s*(.*?)\n",
|
||||
cat(control_file),
|
||||
re.MULTILINE
|
||||
).group(1)
|
||||
|
||||
# build tarball
|
||||
origin_archive = os.path.join(settings.ORIGIN_PATH,
|
||||
"%s_%s.orig.tar.bz2" % (package['source_name'], project['version']))
|
||||
if not os.path.exists(origin_archive):
|
||||
print "+ Generating origin tarball ..."
|
||||
os.chdir(project['git_path'])
|
||||
call("git checkout --quiet %s" % build_branch)
|
||||
if os.path.exists('setup.py'):
|
||||
call("python setup.py clean --all")
|
||||
call("python setup.py sdist --formats=bztar")
|
||||
shutil.move("dist/%s.tar.bz2" % project['fullname'], origin_archive)
|
||||
elif os.path.exists('./configure.ac'):
|
||||
call("make dist-bzip2")
|
||||
shutil.move("%s-%s.tar.bz2" % \
|
||||
(project['name'], project['ac_version']),
|
||||
origin_archive)
|
||||
elif os.path.exists('Makefile'):
|
||||
call("make dist-bzip2")
|
||||
shutil.move("sdist/%s.tar.bz2" % project['fullname'], origin_archive)
|
||||
else:
|
||||
error('Unsupported project type', project['build_dir'], exit_code=2)
|
||||
|
||||
last_version_file = os.path.join(project['lock_path'],
|
||||
"%s_%s_%s.last_version" % (project['name'],
|
||||
package['repository'],
|
||||
|
@ -242,27 +266,6 @@ def prepare_build(dist, project, cmd_options, new):
|
|||
print "+ Already built for %s !" % dist
|
||||
return package
|
||||
|
||||
origin_archive = os.path.join(settings.ORIGIN_PATH,
|
||||
"%s_%s.orig.tar.bz2" % (package['source_name'], project['version']))
|
||||
if not os.path.exists(origin_archive):
|
||||
print "+ Generating origin tarball ..."
|
||||
os.chdir(project['git_path'])
|
||||
call("git checkout --quiet %s" % build_branch)
|
||||
if os.path.exists('setup.py'):
|
||||
call("python setup.py clean --all")
|
||||
call("python setup.py sdist --formats=bztar")
|
||||
shutil.move("dist/%s.tar.bz2" % project['fullname'], origin_archive)
|
||||
elif os.path.exists('./configure.ac'):
|
||||
call("make dist-bzip2")
|
||||
shutil.move("%s-%s.tar.bz2" % \
|
||||
(project['name'], project['ac_version']),
|
||||
origin_archive)
|
||||
elif os.path.exists('Makefile'):
|
||||
call("make dist-bzip2")
|
||||
shutil.move("sdist/%s.tar.bz2" % project['fullname'], origin_archive)
|
||||
else:
|
||||
error('Unsupported project type', project['build_dir'], exit_code=2)
|
||||
|
||||
print "+ Preparing Debian build (%s %s) ..." % (package['source_name'], package['version'])
|
||||
if debian_branch:
|
||||
call("git checkout --quiet %s" % debian_branch)
|
||||
|
|
Loading…
Reference in New Issue