[buildd-tools-devel] Bug#619288: Bug#619288: sbuild: FTBFS when HOME isn't set

Roger Leigh rleigh at codelibre.net
Wed Mar 23 12:53:39 UTC 2011


tags 619288 patch fixed-upstream pending
thanks

On Tue, Mar 22, 2011 at 06:26:19PM +0100, Philipp Kern wrote:
> Source: sbuild
> Version: 0.62.1-1
> Severity: serious
> 
> > PERL5LIB=/build/buildd-sbuild_0.62.1-1-s390-qtXMSd/sbuild-0.62.1/debian/build/../../lib:/build/buildd-sbuild_0.62.1-1-s390-qtXMSd/sbuild-0.62.1/debian/build/lib \
> > 	  /build/buildd-sbuild_0.62.1-1-s390-qtXMSd/sbuild-0.62.1/debian/build/../../tools/sbuild-dumpconfig buildd config > buildd.conf
> > HOME not defined in environment!
> > make[3]: *** [buildd.conf] Error 255

Fixed using the following patch:

diff --git a/debian/changelog b/debian/changelog
index ab1407b..33f010a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,8 +7,9 @@ sbuild (0.62.2-1) unstable; urgency=low
       disabled even when set as the default in the configuration.
     - root is not required to be a member of the sbuild group in order
       to run schroot via the sbuild-schroot wrapper (Closes: #619128).
+    - Don't require HOME to be set in the environment (Closes: #619288).
 
- -- Roger Leigh <rleigh at debian.org>  Mon, 21 Mar 2011 14:52:40 +0000
+ -- Roger Leigh <rleigh at debian.org>  Wed, 23 Mar 2011 10:38:03 +0000
 
 sbuild (0.62.1-1) unstable; urgency=high
 
diff --git a/lib/Sbuild/ConfBase.pm b/lib/Sbuild/ConfBase.pm
index bdd26db..0578795 100644
--- a/lib/Sbuild/ConfBase.pm
+++ b/lib/Sbuild/ConfBase.pm
@@ -74,10 +74,14 @@ sub init_allowed_keys {
            if !-d $directory;
     };
 
-    my $home = $ENV{'HOME'}
-        or die "HOME not defined in environment!\n";
     my @pwinfo = getpwuid($<);
-    my $username = $pwinfo[0] || $ENV{'LOGNAME'} || $ENV{'USER'};
+    die "Can't get passwd entry for uid $<: $!" if (!@pwinfo);
+    my $home = $ENV{'HOME'};
+    if (!$home) {
+       print STDERR "W: HOME not set in environment; falling back to $pwinfo[7]
+       $home = $pwinfo[7];
+    }
+    my $username = $pwinfo[0];
     my $fullname = $pwinfo[6];
     $fullname =~ s/,.*$//;


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20110323/0687bae6/attachment.pgp>


More information about the Buildd-tools-devel mailing list