This file is indexed.

/usr/sbin/remove-default-ispell is in dictionaries-common 1.23.17.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
#!/usr/bin/perl -w

use strict;
use Debian::DictionariesCommon q(dico_checkroot);
use Debconf::Client::ConfModule q(:all);

dico_checkroot ();

die "Usage: $0 package-name\n" if (scalar @ARGV != 1);

version ('2.0');

my $class    = "ispell";
my $question = "dictionaries-common/default-$class";
my $script   = "/usr/share/dictionaries-common/dc-debconf-select.pl";
my $program  = "remove-default-$class";
my $debug    = 1 if exists $ENV{'DICT_COMMON_DEBUG'};
my $newflag  = "/var/cache/dictionaries-common/flag-$class-new";
my %title    = ('ispell'   => "Dictionaries-common: Ispell dictionary",
		'wordlist' => "Dictionaries-common: Wordlist dictionary"
		);

my ($errorcode, $value) = get $question;

if ($errorcode == 0) {
  require $script;

  my $pkg          = $ARGV[0];
  my $languages    = &dico_parse_languages($class,"languages");
  my @newchoices   = ();
  my %langsinpkg   = ();

  # Get list of languages provided by package being removed. Check
  # first if package is already removed, some packages using cdbs
  # call this script twice, the second with package already removed
  if ( exists $languages->{$pkg} ){
    foreach ( split (/\s*,\s*/, $languages->{$pkg}) ){
      $langsinpkg{$_}++;
    }
    # Update $languages removing $pkg entry
    delete $languages->{$pkg};

    # Update question variables with new values
    my ($choices, $echoices ) = &dico_get_all_choices($class,$languages);
    subst ($question, "choices", $choices);
    subst ($question, "echoices", $echoices);

    # Ask with new values if current value is being removed and langs are left
    if ( %$languages && exists $langsinpkg{$value} ) {
      fset  ($question, "seen", "false");
      input ("critical", $question);
      title ($title{$class});
      go ();
    }
  }
}

# If $newflag exists, we are removing an IDWP in the same run another IDWP of the same
# class is to be installed. If the to-be-installed IDWP is the new selection update-default-
# -$class will fail because the new IDWP is not yet unpacked. Since in this case update-
# -default-$class will be run in new IDWP postinst, we do not it here and so avoid problems.
if ( -f $newflag ) {
  print STDERR "$program: $newflag exists, defer update-default-$class run\n" if $debug;
} else {
  system "update-default-$class";
}

# Local Variables:
#  perl-indent-level: 2
# End:

__END__

=head1 NAME

remove-default-ispell - remove default ispell dictionary

=head1 SYNOPSIS

 remove-default-ispell <package>

=head1 DESCRIPTION

WARNING: Not to be used from the command line unless you know very well what you are doing.

When called from package postrm, this program will take care of removing the entries
associated to a ispell package from the dictionaries-common database
and call for the new selection if it was the default one.

=head1 SEE ALSO

The dictionaries-common policy document

=head1 AUTHORS

Rafael Laboissiere

=cut

#  LocalWords:  ispell wordlist