[buildd-tools-devel] Bug#705968: schroot: --session-name should work with automatic sessions

Daniel Shahaf danielsh at apache.org
Mon Dec 28 15:19:12 UTC 2015


Control: tags -1 + patch

How about the following patch?

(against 1.6.10-1)
[[[
--- bin/schroot/schroot-options-base.cc
+++ bin/schroot/schroot-options-base.cc
@@ -261,7 +261,8 @@ options_base::check_actions ()
       throw error(_("Unknown action specified"));
     }
 
-  if (!this->session_name.empty() && this->action != ACTION_SESSION_BEGIN)
+  if (!this->session_name.empty() && this->action != ACTION_SESSION_BEGIN &&
+      this->action != ACTION_SESSION_AUTO)
     throw error
       (_("--session-name is not permitted for the specified action"));
]]]

(against 1.7.2-3)
[[[
diff --git a/lib/schroot-common/options.cc b/lib/schroot-common/options.cc
index b0af5ae..02996af 100644
--- a/lib/schroot-common/options.cc
+++ b/lib/schroot-common/options.cc
@@ -263,6 +263,7 @@ namespace schroot_common
         throw error(_("Unknown action specified"));
       }
 
-    if (!this->session_name.empty() && this->action != ACTION_SESSION_BEGIN)
+    if (!this->session_name.empty() && this->action != ACTION_SESSION_BEGIN &&
+        this->action != ACTION_SESSION_AUTO)
       throw error
         (_("--session-name is not permitted for the specified action"));
]]]

In a quick test, it functions as expected:

[[[
% sudo usr/bin/schroot -c unstable-amd64-sbuild -n foo
(unstable-amd64-sbuild)root at host:~# env | grep -i schroot
⋮
SCHROOT_SESSION_ID=foo
]]]

I tested the 1.6.10-1 patch.  Where would I find an upstream tarball of
1.7.2, to test the 1.7.2-3 patch with?  It wasn't clear to me from
the existing docs (HACKING, d/README.source, d/control, d/watch).

Cheers,

Daniel



More information about the Buildd-tools-devel mailing list