changeset 245:21da92cea416

Add --save-after-login option to bin/treepkgbuilder.py and corresponding keyword argument to PBuilder.login
author Bernhard Herzog <bh@intevation.de>
date Tue, 24 Feb 2009 18:28:25 +0000
parents a05cbf80dec9
children 59e2d8e26635
files bin/treepkgbuilder.py treepkg/builder.py
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bin/treepkgbuilder.py	Wed Jan 21 14:02:01 2009 +0000
+++ b/bin/treepkgbuilder.py	Tue Feb 24 18:28:25 2009 +0000
@@ -130,11 +130,14 @@
         parser.add_option("--bind-mount", action="append",
                           help=("Directories to bind-mount in the chroot"
                                 " environment."))
+        parser.add_option("--save-after-login", action="store_true",
+                          help="Copy changes back to the tarball.")
         return parser
 
 
     def run(self):
-        self.get_builder().login(bindmounts=self.opts.bind_mount)
+        self.get_builder().login(bindmounts=self.opts.bind_mount,
+                                 save_after_login=self.opts.save_after_login)
 
 
 class BuildCommand(Command):
--- a/treepkg/builder.py	Wed Jan 21 14:02:01 2009 +0000
+++ b/treepkg/builder.py	Tue Feb 24 18:28:25 2009 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 by Intevation GmbH
+# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
 #
@@ -246,11 +246,13 @@
                            args=args, script=script),
                  suppress_output=False)
 
-    def login(self, bindmounts=()):
+    def login(self, bindmounts=(), save_after_login=False):
         """Start an interactive shell in the pbuilder environment"""
         args = []
         for mount in bindmounts:
             args.extend(["--bindmounts", mount])
+        if save_after_login:
+            args.extend(["--save-after-login"])
         run.call(cmdexpand("@rootcmd /usr/sbin/pbuilder login"
                            " --configfile $pbuilderrc @args",
                            rootcmd=self.root_cmd, pbuilderrc=self.pbuilderrc,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)