~cjwatson/debconf/dbus

« back to all changes in this revision

Viewing changes to debconf-set-selections

  • Committer: joeyh
  • Date: 2005-08-16 13:14:49 UTC
  • Revision ID: vcs-imports@canonical.com-20050816131449-8acd0884e69f0a34
* debconf-set-selections: support wrapping of long lines with "\".

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
seen, so to override the default value without marking a question seen, you
54
54
need two lines.
55
55
 
 
56
Lines can be continued to the next line by ending them with a "\"
 
57
character.
 
58
 
56
59
=head1 EXAMPLES
57
60
 
58
61
 # Force debconf priority to critical.
170
173
        }
171
174
}
172
175
 
 
176
sub mungeline ($) {
 
177
        my $line=shift;
 
178
        chomp $line;
 
179
        $line=~s/\#.*$//;
 
180
        $line=~s/\r$//;
 
181
        return $line;
 
182
}
 
183
 
 
184
 
173
185
GetOptions(
174
186
        "verbose|v" => \$debug,
175
187
        "checkonly|c" => \$checkonly,
181
193
$error = 0;
182
194
 
183
195
while (<>) {
184
 
        chomp;
185
 
        s/\#.*$//;
186
 
        s/\r$//;
 
196
        $_=mungeline($_);
 
197
        while (/\\$/ && ! eof) {
 
198
                s/\\$//;
 
199
                $_.=mungeline(<>);
 
200
        }
187
201
        next if /^\s*$/;
188
202
        # Allow multiple spaces between all values except the last one.
189
203
        # Extra whitespace in the content is significant.