<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl -w
# This file was preprocessed, do not edit!


package Debconf::Element::Teletype::Multiselect;
use strict;
use Debconf::Gettext;
use Debconf::Config;
use base qw(Debconf::Element::Multiselect Debconf::Element::Teletype::Select);


sub show {
	my $this=shift;

	my @selected;
	my $none_of_the_above=gettext("none of the above");

	my @choices=$this-&gt;question-&gt;choices_split;
	my %value = map { $_ =&gt; 1 } $this-&gt;translate_default;
	if ($this-&gt;frontend-&gt;promptdefault &amp;&amp; $this-&gt;question-&gt;value ne '') {
		push @choices, $none_of_the_above;
	}
	my @completions=@choices;
	my $i=1;
	my %choicenum=map { $_ =&gt; $i++ } @choices;
	
	$this-&gt;frontend-&gt;display($this-&gt;question-&gt;extended_description."\n");
	
	my $default;
	if (Debconf::Config-&gt;terse eq 'false') {
		$this-&gt;printlist(@choices);
		$this-&gt;frontend-&gt;display("\n(".gettext("Enter the items you want to select, separated by spaces.").")\n");
		push @completions, 1..@choices;
		$default=join(" ", map { $choicenum{$_} }
		                   grep { $value{$_} } @choices);
	}
	else {
		$default=join(" ", grep { $value{$_} } @choices);
	}

	while (1) {
		$_=$this-&gt;frontend-&gt;prompt(
			prompt =&gt; $this-&gt;question-&gt;description,
		 	default =&gt; $default,
			completions =&gt; [@completions],
			completion_append_character =&gt; " ",
			question =&gt; $this-&gt;question,
		);
		return unless defined $_;

		@selected=split(/[	 ,]+/, $_);

		@selected=map { $this-&gt;expandabbrev($_, @choices) } @selected;

		next if grep { $_ eq '' } @selected;

		if ($#selected &gt; 0) {
			map { next if $_ eq $none_of_the_above } @selected;
		}
		
		last;
	}

	$this-&gt;frontend-&gt;display("\n");

	if (defined $selected[0] &amp;&amp; $selected[0] eq $none_of_the_above) {
		$this-&gt;value('');
	}
	else {
		my %selected=map { $_ =&gt; 1 } @selected;

		$this-&gt;value(join(', ', $this-&gt;order_values(
				map { $this-&gt;translate_to_C($_) }
		                keys %selected)));
	}
}

1
</pre></body></html>