← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:bddeb-release-arg into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:bddeb-release-arg into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/304563
-- 
Your team cloud init development team is requested to review the proposed merge of ~smoser/cloud-init:bddeb-release-arg into cloud-init:master.
diff --git a/packages/bddeb b/packages/bddeb
index 94496c7..abb7b60 100755
--- a/packages/bddeb
+++ b/packages/bddeb
@@ -67,7 +67,7 @@ def run_helper(helper, args=None, strip=True):
     return stdout
 
 
-def write_debian_folder(root, version_data, pkgmap, pyver="3",
+def write_debian_folder(root, templ_data, pkgmap, pyver="3",
                         append_requires=[]):
     deb_dir = util.abs_join(root, 'debian')
 
@@ -79,7 +79,7 @@ def write_debian_folder(root, version_data, pkgmap, pyver="3",
     templater.render_to_file(util.abs_join(find_root(),
                              'packages', 'debian', 'changelog.in'),
                              util.abs_join(deb_dir, 'changelog'),
-                             params=version_data)
+                             params=templ_data)
 
     # Write out the control file template
     reqs = run_helper('read-dependencies').splitlines()
@@ -147,6 +147,10 @@ def main():
                         default=os.environ.get("INIT_SYSTEM",
                                                "upstart,systemd"))
 
+    parser.add_argument("--release", dest="release",
+                        help=("build with changelog referencing RELEASE"),
+                        default="UNRELEASED")
+
     for ent in DEBUILD_ARGS:
         parser.add_argument(ent, dest="debuild_args", action='append_const',
                             const=ent, default=[],
@@ -184,6 +188,7 @@ def main():
             pkgmap[p] = "python3-" + p
             pyver = "3"
 
+    templ_data = {'debian_release': args.release}
     with util.tempdir() as tdir:
 
         # output like 0.7.6-1022-g36e92d3
@@ -208,7 +213,9 @@ def main():
             append_requires = ['cloud-utils | cloud-guest-utils']
         else:
             append_requires = []
-        write_debian_folder(xdir, ver_data, pkgmap,
+
+        templ_data.update(ver_data)
+        write_debian_folder(xdir, templ_data, pkgmap,
                             pyver=pyver, append_requires=append_requires)
 
         print("Running 'debuild %s' in %r" % (' '.join(args.debuild_args),
diff --git a/packages/debian/changelog.in b/packages/debian/changelog.in
index f8e9825..bdf8d56 100644
--- a/packages/debian/changelog.in
+++ b/packages/debian/changelog.in
@@ -1,5 +1,5 @@
 ## template:basic
-cloud-init (${version_long}-1~bddeb) UNRELEASED; urgency=low
+cloud-init (${version_long}-1~bddeb) ${debian_release}; urgency=low
 
   * build