Skip to content

Commit

Permalink
Builder|Ubuntu: Create a separate source package for Saucy
Browse files Browse the repository at this point in the history
The package version contains a distribution-specific part so
that they may coexist in the PPA.
  • Loading branch information
skyjake committed Nov 25, 2013
1 parent 28980a0 commit ad621c3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions distrib/autobuild.py
Expand Up @@ -177,6 +177,7 @@ def update_debian_changelog():

def build_source_package():
"""Builds the source tarball and a Debian source package."""
git_pull()
ev = builder.Event(latestAvailable=True)
print "Creating source tarball for build %i." % ev.number()
os.chdir(os.path.join(builder.config.DISTRIB_DIR))
Expand All @@ -192,8 +193,12 @@ def build_source_package():
remote_copy(fn, ev.file_path(fn))
break

# Check distribution.
system_command("lsb_release -a | perl -n -e 'm/Codename:\s(.+)/ && print $1' > /tmp/distroname")
distro = file('/tmp/distroname', 'rt').read()

# Create a source Debian package and upload it to Launchpad.
pkgVer = '%s.%i' % (ev.version_base(), ev.number())
pkgVer = '%s.%i+%s' % (ev.version_base(), ev.number(), distro)
pkgDir = 'doomsday-%s' % pkgVer
system_command('tar xzf %s' % fn)
os.rename(fn[:-7], pkgDir)
Expand All @@ -209,7 +214,12 @@ def gen_changelog(src, dst, extraSub=''):
system_command("sed 's/%s-build%i/%s/;%s' %s > %s" % (
ev.version_base(), ev.number(), pkgVer, extraSub, src, dst))

gen_changelog('../../../debian/changelog', 'changelog')
# Figure out the name of the distribution.
dsub = ''
if distro:
dsub = 's/) precise;/) %s;/' % distro

gen_changelog('../../../debian/changelog', 'changelog', dsub)
system_command("sed 's/${Arch}/i386 amd64/' ../../../debian/control.template > control")
system_command("sed 's/`..\/build_number.py --print`/%i/;s/..\/..\/doomsday/..\/doomsday/' ../../../debian/rules > rules" % ev.number())
os.chdir('..')
Expand Down

0 comments on commit ad621c3

Please sign in to comment.