← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad-buildd/snap-default-branch into lp:launchpad-buildd

 

Colin Watson has proposed merging lp:~cjwatson/launchpad-buildd/snap-default-branch into lp:launchpad-buildd.

Commit message:
buildsnap: If --git-repository is passed but --git-path is not, build the default branch of the repository (LP: #1688224).

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1688224 in launchpad-buildd: "Allow building snap from current default branch of repository"
  https://bugs.launchpad.net/launchpad-buildd/+bug/1688224

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/snap-default-branch/+merge/323604
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad-buildd/snap-default-branch into lp:launchpad-buildd.
=== modified file 'buildsnap'
--- buildsnap	2017-02-10 14:53:12 +0000
+++ buildsnap	2017-05-04 10:31:32 +0000
@@ -114,11 +114,10 @@
                 cmd.insert(1, "-Ossl.cert_reqs=none")
         else:
             assert self.options.git_repository is not None
-            assert self.options.git_path is not None
-            cmd = [
-                "git", "clone", "-b", self.options.git_path,
-                self.options.git_repository, self.name,
-                ]
+            cmd = ["git", "clone"]
+            if self.options.git_path is not None:
+                cmd.extend(["-b", self.options.git_path])
+            cmd.extend([self.options.git_repository, self.name])
             if not self.ssl_verify:
                 env["GIT_SSL_NO_VERIFY"] = "1"
         self.run_build_command(cmd, env=env)
@@ -181,9 +180,8 @@
     parser.add_option("--revocation-endpoint",
                       help="builder proxy token revocation endpoint")
     options, args = parser.parse_args()
-    if (options.git_repository is None) != (options.git_path is None):
-        parser.error(
-            "must provide both --git-repository and --git-path or neither")
+    if options.git_repository is None and options.git_path is not None:
+        parser.error("--git-path requires --git-repository")
     if (options.branch is None) == (options.git_repository is None):
         parser.error(
             "must provide exactly one of --branch and --git-repository")

=== modified file 'debian/changelog'
--- debian/changelog	2017-02-10 14:55:42 +0000
+++ debian/changelog	2017-05-04 10:31:32 +0000
@@ -1,3 +1,10 @@
+launchpad-buildd (143) UNRELEASED; urgency=medium
+
+  * buildsnap: If --git-repository is passed but --git-path is not, build
+    the default branch of the repository (LP: #1688224).
+
+ -- Colin Watson <cjwatson@xxxxxxxxxx>  Thu, 04 May 2017 00:29:40 +0100
+
 launchpad-buildd (142) trusty; urgency=medium
 
   * lpbuildd.binarypackage: Pass DEB_BUILD_OPTIONS=noautodbgsym if we have