home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / perl5 / Debconf / Priority.pm < prev    next >
Encoding:
Perl POD Document  |  2006-07-24  |  642 b   |  41 lines

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Priority;
  6. use strict;
  7. use Debconf::Config;
  8. use base qw(Exporter);
  9. our @EXPORT_OK = qw(high_enough priority_valid priority_list);
  10.  
  11.  
  12. my %priorities=(
  13.     'low' => 0,
  14.     'medium' => 1,
  15.     'high' => 2,
  16.     'critical' => 3,
  17. );
  18.  
  19.  
  20. sub high_enough {
  21.     my $priority=shift;
  22.  
  23.     return 1 if ! exists $priorities{$priority};
  24.     return $priorities{$priority} >= $priorities{Debconf::Config->priority};
  25. }
  26.  
  27.  
  28. sub priority_valid {
  29.     my $priority=shift;
  30.  
  31.     return exists $priorities{$priority};
  32. }
  33.  
  34.  
  35. sub priority_list {
  36.     return sort { $priorities{$a} <=> $priorities{$b} } keys %priorities;
  37. }
  38.  
  39.  
  40. 1
  41.