~ubuntu-branches/ubuntu/dapper/swatch/dapper

« back to all changes in this revision

Viewing changes to swatch_oldrc2newrc

  • Committer: Bazaar Package Importer
  • Author(s): Nikolay Kokalichev
  • Date: 2004-08-02 00:00:23 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040802000023-p0rhldb331nacs2o
Tags: 3.1.1-1
 * New upstream release. (Fixes some bugs) 
   - This version is the newest version (Closes: #194052)
   - "Throttle does not work" is fixed (Closes: #254648)

 * For other fixed bugs see the upstream changelog (orig. CHANGES) file
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
 
3
 
=head1 NAME
4
 
 
5
 
oldrc2newrc - Swatch configuration file conversion tool
6
 
 
7
 
=head1 SYNOPSYS
8
 
 
9
 
B<swatch_oldrcrc2newrc> < I<old_config_file> > I<new_config_file>
10
 
 
11
 
=head1 DESCRIPTION
12
 
 
13
 
This program will convert an swatch version 2 configuration file
14
 
into a new style configuration file. I highly reccomend that you
15
 
examine the new file before using it.
16
 
 
17
 
=cut
18
 
 
19
 
#
20
 
#
21
 
#    oldrc2newrc - a swatch configuration file converter
22
 
#    Copyright (C) 1999 E. Todd Atkins
23
 
#
24
 
#    This program is free software; you can redistribute it and/or modify
25
 
#    it under the terms of the GNU General Public License as published by
26
 
#    the Free Software Foundation; either version 2 of the License, or
27
 
#    any later version.
28
 
#
29
 
#    This program is distributed in the hope that it will be useful,
30
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
31
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
 
#    GNU General Public License for more details.
33
 
#
34
 
#    You should have received a copy of the GNU General Public License
35
 
#    along with this program; if not, write to the Free Software
36
 
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37
 
#
38
 
#
39
 
#
40
 
 
41
 
use strict;
42
 
 
43
 
while (<>) {
44
 
  chomp;
45
 
  @_ = split(/\t+/);
46
 
 
47
 
  if (/^\s*$/ or /^\s*\#/) {
48
 
    print "$_\n";
49
 
  } elsif (/ignore/) {
50
 
    print "ignore = $_[0]\n";
51
 
  } else {
52
 
    print "watchfor = $_[0]\n";
53
 
    print "\tthrottle = $_[2]\n" if (defined $_[2] and $_[2] =~ /^[0-9]/);
54
 
    foreach my $action (split(/,/, $_[1])) {
55
 
      print "\t$action\n";
56
 
    }
57
 
  }
58
 
}