[Bug 902624] [NEW] process_command does not properly skip blank input lines

Bob Vincent bobvin at pillars.net
Sat Dec 10 20:30:18 UTC 2011


Public bug reported:

Upstream bug report filed at http://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=651642

This is related to Debian bug reports #630772 and #637737

When purging old kernels from the command line, multiple "Use of
uninitialized value $command" errors are displayed.  These errors are
caused by the following code line:

      return 1 unless defined && ! /^\s*#/; # Skip blank lines,
comments.

The code skips undefined input and comments, but the associated inline
comment claims that the intent was to skip blank lines and comments.  I
resolved the problem locally by making the following change:

diff --git a/Debconf/ConfModule.pm b/Debconf/ConfModule.pm
index 8017202..20c084e 100644
--- a/Debconf/ConfModule.pm
+++ b/Debconf/ConfModule.pm
@@ -228,7 +228,9 @@ sub process_command {
 	my $this=shift;
 	
 	debug developer => "<-- $_";
-	return 1 unless defined && ! /^\s*#/; # Skip blank lines, comments.
+	return 1 unless defined; # Skip empty input.
+	return 1 if /^\s*$/ # Skip blank lines.
+	return 1 if /^\s*#/ # Skip comments.
 	chomp;
 	my ($command, @params);
 	if (defined $this->client_capb and grep { $_ eq 'escape' } @{$this->client_capb}) {

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: debconf 1.5.40ubuntu1 [modified: usr/share/perl5/Debconf/ConfModule.pm]
Uname: Linux 3.2.0-rc5+ i686
ApportVersion: 1.23-0ubuntu4
Architecture: i386
Date: Sat Dec 10 15:18:59 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100712)
ProcEnviron:
 LANGUAGE=en_US.UTF-8
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: debconf
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: debconf (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 oneiric

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to debconf in Ubuntu.
https://bugs.launchpad.net/bugs/902624

Title:
  process_command does not properly skip blank input lines

Status in “debconf” package in Ubuntu:
  New

Bug description:
  Upstream bug report filed at http://bugs.debian.org/cgi-
  bin/bugreport.cgi?bug=651642

  This is related to Debian bug reports #630772 and #637737

  When purging old kernels from the command line, multiple "Use of
  uninitialized value $command" errors are displayed.  These errors are
  caused by the following code line:

        return 1 unless defined && ! /^\s*#/; # Skip blank lines,
  comments.

  The code skips undefined input and comments, but the associated inline
  comment claims that the intent was to skip blank lines and comments.
  I resolved the problem locally by making the following change:

  diff --git a/Debconf/ConfModule.pm b/Debconf/ConfModule.pm
  index 8017202..20c084e 100644
  --- a/Debconf/ConfModule.pm
  +++ b/Debconf/ConfModule.pm
  @@ -228,7 +228,9 @@ sub process_command {
   	my $this=shift;
   	
   	debug developer => "<-- $_";
  -	return 1 unless defined && ! /^\s*#/; # Skip blank lines, comments.
  +	return 1 unless defined; # Skip empty input.
  +	return 1 if /^\s*$/ # Skip blank lines.
  +	return 1 if /^\s*#/ # Skip comments.
   	chomp;
   	my ($command, @params);
   	if (defined $this->client_capb and grep { $_ eq 'escape' } @{$this->client_capb}) {

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: debconf 1.5.40ubuntu1 [modified: usr/share/perl5/Debconf/ConfModule.pm]
  Uname: Linux 3.2.0-rc5+ i686
  ApportVersion: 1.23-0ubuntu4
  Architecture: i386
  Date: Sat Dec 10 15:18:59 2011
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Alpha i386 (20100712)
  ProcEnviron:
   LANGUAGE=en_US.UTF-8
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: debconf
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debconf/+bug/902624/+subscriptions




More information about the foundations-bugs mailing list