Re: How can we quote # in a value passed to debconf-set-selections?
Hi,
Since debconf-set/get-selections have no mechanism for quoting,
introducing one could break applications that already expect to set
values with chars such as: ' " \
So instead, perhaps change the behaviour of debconf-get-selections to
treat # to denote a comment, only if it appears on the start of a line.
According to the debconf-set-selections(1) man page, that was the
expected behaviour anyway:
> Lines beginning with a # character are
> comments. Blank lines are ignored. All other lines set the value...
So I propose the attached patch.
Thanks!
Regards,
--
Steven Chamberlain
steven@pyro.eu.org
Index: debconf-1.5.36.1/debconf-set-selections
===================================================================
--- debconf-1.5.36.1.orig/debconf-set-selections 2012-03-25 18:09:10.000000000 +0100
+++ debconf-1.5.36.1/debconf-set-selections 2012-03-25 18:09:39.000000000 +0100
@@ -176,7 +176,7 @@
sub mungeline ($) {
my $line=shift;
chomp $line;
- $line=~s/\#.*$//;
+ $line=~s/^\#.*$//;
$line=~s/\r$//;
return $line;
}
Reply to: