diff options
author | Seth Alves <alves@src.gnome.org> | 2000-04-19 02:17:07 +0800 |
---|---|---|
committer | Seth Alves <alves@src.gnome.org> | 2000-04-19 02:17:07 +0800 |
commit | 25e1b34aafe43ba6cf1040340a38dd38a90aad33 (patch) | |
tree | 0b4e666e45bf457edcc0095634f0ae6f429b8b5a /libical/scripts/mkderivedcomponents.pl | |
parent | bc17057ec598cd5f755fd66244c429ecc51cff01 (diff) | |
download | gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.tar gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.tar.gz gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.tar.bz2 gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.tar.lz gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.tar.xz gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.tar.zst gsoc2013-evolution-25e1b34aafe43ba6cf1040340a38dd38a90aad33.zip |
import of libical-0.16
svn path=/trunk/; revision=2484
Diffstat (limited to 'libical/scripts/mkderivedcomponents.pl')
-rwxr-xr-x | libical/scripts/mkderivedcomponents.pl | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/libical/scripts/mkderivedcomponents.pl b/libical/scripts/mkderivedcomponents.pl index 3599a8d465..ac4e472250 100755 --- a/libical/scripts/mkderivedcomponents.pl +++ b/libical/scripts/mkderivedcomponents.pl @@ -1,7 +1,7 @@ #!/usr/local/bin/perl use Getopt::Std; -getopts('chsp'); +getopts('chspi:'); # ARG 0 is components.txt @@ -11,6 +11,8 @@ my @components; while (<PV>){ + s/#.*//; + chop; push(@components,$_); @@ -19,7 +21,32 @@ while (<PV>){ close PV; -if ($opt_c or $opt_h){ +# Write the file inline by copying everything before a demarcation +# line, and putting the generated data after the demarcation + +if ($opt_i) { + + open(IN,$opt_i) || die "Can't open input file \"$opt_i\""; + + while(<IN>){ + + if (/Do not edit/){ + last; + } + + print; + + } + + if($opt_i){ + print "# Everything below this line is machine generated. Do not edit. \n"; + } else { + print "/* Everything below this line is machine generated. Do not edit. */\n"; + } + +} + +if ($opt_c or $opt_h and !$opt_i){ print <<EOM; /* -*- Mode: C -*- @@ -55,7 +82,7 @@ EOM } -if ($opt_p){ +if ($opt_p and !$opt_i){ print <<EOM; @@ -127,7 +154,7 @@ sub new my \$self = Net::ICal::Component::new_from_ref(\$c); Net::ICal::Component::_add_elements(\$self,\\\@_); - bless \$self, \$package; + # Self is blessed in new_from_ref return \$self; |