[Buildd-tools-devel] Removing strict distribution check

Michael Banck mbanck@debian.org
Wed, 8 Dec 2004 00:36:24 +0100


On Mon, Dec 06, 2004 at 07:07:27PM +0100, Andreas Barth wrote:
> One of the reasons why I heavily disagree is that you could quite easily
> install (or purge) some packages in your normal file tree by a little
> spelling error. 

Well, at least here, sbuild bombs out if it does not find
/var/lib/sbuild/source-dependencies-$chroot or
/var/lib/sbuild/source-dependencies. I do not have the latter, so sbuild
does not try to build in the file system root. However, this is probably
not a well enough measure, the following patch should take care of it
though:

--- sbuild.orig 2004-12-06 18:39:41.000000000 +0100
+++ sbuild      2004-12-08 00:32:12.000000000 +0100
@@ -135,8 +135,6 @@
                $main::distribution = "stable"   if $main::distribution eq "s";
                $main::distribution = "testing"  if $main::distribution eq "t";
                $main::distribution = "unstable" if $main::distribution eq "u";
-               die "Bad distribution\n"
-                       if !isin($main::distribution, keys(%main::dist_order));
        }
        elsif (/^-p/ || /^--purge/) {
                if (/^-p(.)/ || /^--purge=(.)/) {
@@ -266,6 +264,8 @@
                "-o DPkg::Options::=--root=$absroot ".
                "-o DPkg::Run-Directory=$absroot";
        $main::chroot_apt_op = '$CHROOT_OPTIONS';
+} else {
+       die "chroot-$main::distribution does not exist\n";
 }
 write_jobs_file();

Another issue here is that the erro message only goes to the log file,
so the user is left in the dark what went wrong if he runs sbuild
interactively. This is of course fine for buildd mode, but the when run
interactively, STDERR probably should not be redirected. What do you
think?


Michael