home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / sbin / select-default-ispell < prev    next >
Encoding:
Text File  |  2006-12-19  |  1.3 KB  |  77 lines

  1. #!/usr/bin/perl -w
  2.  
  3. use Debian::DictionariesCommon q(:all);
  4. use Debconf::Client::ConfModule q(:all);
  5. use Getopt::Long;
  6.  
  7. die "$0: Sorry, you must be root to run this.\n"
  8.   if ($< != 0);
  9.  
  10. my $rebuild  = '';
  11.  
  12. GetOptions ('rebuild' => \$rebuild);
  13.  
  14. version ('2.0');
  15.  
  16. my $question = "dictionaries-common/default-ispell";
  17. my $class    = "ispell";
  18. my $options  = "";
  19.  
  20. $options = "--rebuild" if $rebuild;
  21.  
  22. updatedb ($class);
  23. my $dictionaries = loaddb ($class);
  24.  
  25. unless ( scalar (keys %{$dictionaries}) == 0 ) {
  26.   if (get $question) {
  27.     fset ($question, "seen", "false");
  28.     input ("critical", "$question");
  29.     title ("Dictionaries-common: Ispell dictionary");
  30.     go ();
  31.   }
  32. }
  33.  
  34. system "update-default-$class $options";
  35.  
  36. #Local Variables:
  37. #perl-indent-level: 2
  38. #End:
  39.  
  40. __END__
  41.  
  42. =head1 NAME
  43.  
  44.     select-default-ispell - select default ispell dictionary
  45.  
  46. =head1 SYNOPSIS
  47.  
  48.  select-default-ispell [--rebuild]
  49.  
  50. =head1 DESCRIPTION
  51.  
  52. This program will make debconf always ask the shared question about 
  53. the default ispell dictionary to be used in your 
  54. system according to the installed ones, and will do the appropriate 
  55. settings.
  56.  
  57. Calls internally B<update-default-ispell>.
  58.  
  59.  
  60. =head1 OPTIONS
  61.  
  62.   --rebuild    Rebuild emacsen and jed stuff
  63.  
  64. =head1 SEE ALSO
  65.  
  66. The dictionaries-common policy document
  67.  
  68. =head1 AUTHORS
  69.  
  70. Rafael Laboissiere
  71.  
  72. =cut
  73.  
  74.  
  75.  
  76. #  LocalWords:  ispell wordlist
  77.