]> git.ipfire.org Git - pakfire.git/commitdiff
Add --mode switch for "pakfire-build build ..." command.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Jul 2011 11:13:21 +0000 (13:13 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Jul 2011 11:16:28 +0000 (13:16 +0200)
--mode=release will only build with official repositories and
disable the build repository which is also enabled when running
with --mode=development.

--mode=development is the default for pakfire-build.
--mode=release is the default for pakfire-server.

pakfire/builder.py
pakfire/cli.py
po/pakfire.pot

index a0d69162cc8fb9c27a6eea3e18997555bcc24e03..b530364d0933b3bed47e096264ac69ac63c7817a 100644 (file)
@@ -42,7 +42,18 @@ class Builder(object):
        kernel_version = os.uname()[2]
 
        def __init__(self, pkg=None, distro_config=None, build_id=None, logfile=None,
-                       **pakfire_args):
+                       builder_mode="release", **pakfire_args):
+               # Set mode.
+               assert builder_mode in ("development", "release",)
+               self.mode = builder_mode
+
+               # Disable the build repository in release mode.
+               if self.mode == "release":
+                       if pakfire_args.has_key("disable_repos") and pakfire_args["disable_repos"]:
+                               pakfire_args["disable_repos"] += ["build",]
+                       else:
+                               pakfire_args["disable_repos"] = ["build",]
+
                # Save the build id and generate one if no build id was provided.
                if not build_id:
                        build_id = "%s" % uuid.uuid4()
index 49c60701a1dce9a49936b33e972ff5802c7452e1..a70d8747e41b3e5aa44102432c5c54adbd1c9e56 100644 (file)
@@ -316,6 +316,8 @@ class CliBuilder(Cli):
                        help=_("Build the package for the given architecture."))
                sub_build.add_argument("--resultdir", nargs="?",
                        help=_("Path were the output files should be copied to."))
+               sub_build.add_argument("-m", "--mode", nargs="?", default="development",
+                       help=_("Mode to run in. Is either 'release' or 'development' (default)."))
 
        def parse_command_shell(self):
                # Implement the "shell" command.
@@ -358,8 +360,8 @@ class CliBuilder(Cli):
                        "arch" : self.args.arch,
                }
 
-               pakfire.build(pkg, distro_config=distro_config, resultdirs=[self.args.resultdir,],
-                       shell=True, **self.pakfire_args)
+               pakfire.build(pkg, builder_mode=self.args.mode, distro_config=distro_config,
+                       resultdirs=[self.args.resultdir,], shell=True, **self.pakfire_args)
 
        def handle_shell(self):
                pkg = None
index bea417d2e3230665a4bdf86aa58c5196be716575..958dee78db179a772848191f1c6cf9671d11b17b 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-07-21 16:26+0200\n"
+"POT-Creation-Date: 2011-07-22 17:04+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -34,7 +34,7 @@ msgstr ""
 msgid "Downgrading"
 msgstr ""
 
-#: ../pakfire/builder.py:246
+#: ../pakfire/builder.py:259
 #, python-format
 msgid "Extracting: %s (source)"
 msgstr ""
@@ -187,67 +187,71 @@ msgstr ""
 msgid "Build the package for the given architecture."
 msgstr ""
 
-#: ../pakfire/cli.py:318 ../pakfire/cli.py:340
+#: ../pakfire/cli.py:318 ../pakfire/cli.py:342
 msgid "Path were the output files should be copied to."
 msgstr ""
 
-#: ../pakfire/cli.py:323
-msgid "Go into a shell."
+#: ../pakfire/cli.py:320
+msgid "Mode to run in. Is either 'release' or 'development' (default)."
 msgstr ""
 
 #: ../pakfire/cli.py:325
+msgid "Go into a shell."
+msgstr ""
+
+#: ../pakfire/cli.py:327
 msgid "Give name of a package."
 msgstr ""
 
-#: ../pakfire/cli.py:329
+#: ../pakfire/cli.py:331
 msgid "Emulated architecture in the shell."
 msgstr ""
 
-#: ../pakfire/cli.py:334
+#: ../pakfire/cli.py:336
 msgid "Generate a source package."
 msgstr ""
 
-#: ../pakfire/cli.py:336
+#: ../pakfire/cli.py:338
 msgid "Give name(s) of a package(s)."
 msgstr ""
 
-#: ../pakfire/cli.py:411
+#: ../pakfire/cli.py:413
 msgid "Pakfire repo command line interface."
 msgstr ""
 
-#: ../pakfire/cli.py:436
+#: ../pakfire/cli.py:438
 msgid "Repository management commands."
 msgstr ""
 
-#: ../pakfire/cli.py:444
+#: ../pakfire/cli.py:446
 msgid "Create a new repository index."
 msgstr ""
 
-#: ../pakfire/cli.py:445
+#: ../pakfire/cli.py:447
 msgid "Path to the packages."
 msgstr ""
 
-#: ../pakfire/cli.py:446
+#: ../pakfire/cli.py:448
 msgid "Path to input packages."
 msgstr ""
 
-#: ../pakfire/cli.py:458
+#: ../pakfire/cli.py:460
 msgid "Pakfire master command line interface."
 msgstr ""
 
-#: ../pakfire/cli.py:486
+#: ../pakfire/cli.py:488
 msgid "Update the sources."
 msgstr ""
 
-#: ../pakfire/cli.py:496
+#: ../pakfire/cli.py:498
 msgid "Pakfire server command line interface."
 msgstr ""
 
-#: ../pakfire/cli.py:526
+#: ../pakfire/cli.py:528
 msgid "Request a build job from the server."
 msgstr ""
 
-#: ../pakfire/cli.py:532
+#: ../pakfire/cli.py:534
 msgid "Send a keepalive to the server."
 msgstr ""