Bug#363351: [Buildd-tools-devel] Bug#363351: checkchroot gives "uninitialized value" warning

Roger Leigh rleigh at whinlatter.ukfsn.org
Thu Apr 27 10:15:46 UTC 2006


tags 363351 + patch fixed-upstream pending
thanks

Martin Michlmayr <tbm at cyrius.com> writes:

> /usr/share/sbuild/checkchroot unstable gives me the following:
>
> Use of uninitialized value in string comparison (cmp) at /usr/share/sbuild/checkchroot line 80.
> Use of uninitialized value in concatenation (.) or string at /usr/share/sbuild/checkchroot line 87.
>
> The problem is that this is repeated very often (probably
> infinitely) and it has just filled my log file, causing my disk
> space to run out...

Sorry about that.  I've applied the following patch to SVN to fix
this:

Index: bin/checkchroot
===================================================================
--- bin/checkchroot	(revision 553)
+++ bin/checkchroot	(working copy)
@@ -21,7 +21,7 @@
 use warnings;
 use locale;
 use POSIX qw(locale_h);
-use Sbuild::Utility qw(setup cleanup);
+use Sbuild::Utility qw(setup cleanup shutdown);
 
 package main;
 
@@ -41,7 +41,7 @@
 
 if (! open STATUS, "grep-status -F Status -s Package ' installed' '$chroot_dir/var/lib/dpkg/status' | awk '{print \$2}' |" ) {
 	print STDERR "Can't read dpkg status file in chroot: $!\n";
-	main::shutdown();
+	shutdown();
 }
 while (<STATUS>) {
 	chomp;
@@ -49,14 +49,14 @@
 }
 if (! close STATUS) {
 	print STDERR "Error reading dpkg status file in chroot: $!\n";
-	main::shutdown();
+	shutdown();
 }
 
 my $dist = Sbuild::Utility::get_dist($ARGV[0]);
 
 if (! open REF, "< $chroot_dir/../ref-$dist") {
 	print STDERR "Can't read reference status file $chroot_dir/../ref-$dist: $!\n";
-	main::shutdown();
+	shutdown();
 }
 while (<REF>) {
 	chomp;
@@ -64,12 +64,21 @@
 }
 if (! close REF) {
 	print STDERR "Error reading reference status file: $!\n";
-	main::shutdown();
+	shutdown();
 }
 
 @status = sort @status;
 @ref = sort @ref;
 
+if (!@status) {
+    print STDERR "dpkg status file is empty\n";
+    shutdown();
+}
+if (!@ref) {
+    print STDERR "Reference status file is empty\n";
+    shutdown();
+}
+
 print "DELETE             ADD\n";
 print "======================================\n";
 my $i = 0;


-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20060427/99021fdc/attachment.pgp


More information about the Buildd-tools-devel mailing list