You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2001/09/06 07:26:52 UTC

cvs commit: modperl-2.0/lib/Apache ParseSource.pm

stas        01/09/05 22:26:52

  Modified:    lib/Apache ParseSource.pm
  Log:
  reverting bad commit
  
  Revision  Changes    Path
  1.25      +6 -33     modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ParseSource.pm	2001/09/06 05:05:46	1.24
  +++ ParseSource.pm	2001/09/06 05:26:52	1.25
  @@ -2,7 +2,6 @@
   
   use strict;
   use Apache::Build ();
  -use Apache::TestTrace;
   use Config ();
   
   our $VERSION = '0.02';
  @@ -411,41 +410,19 @@
           $file = "$tdir/$subdir/$file";
       }
   
  -    my $old_dump = '';
  -    if (-e $file) {
  -        my @old_file = ();
  -        open my $old, '<', $file or die "open $file: $!";
  -        my $skip = 1;
  -        while (<$old>) {
  +    open my $pm, '>', $file or die "open $file: $!";
   
  -            if ($skip){
  -                $skip = 0 if /^\$Apache/;
  -            }
  -            else {
  -                $skip = 1 if /^\s*\n/;
  -            }
  -            push @old_file, $_ unless $skip;
  -        }
  -        close $old;
  -        $old_dump = join '', @old_file;
  -    }
  -
       # sort the hashes (including nested ones) for a consistent dump
       canonsort(\$data);
   
       my $dump = Data::Dumper->new([$data],
                                    [$name])->Dump;
   
  -    # write the file only if it has been changed
  -    if ($dump ne $old_dump) {
  +    my $package = ref($self) || $self;
  +    my $version = $self->VERSION;
  +    my $date = scalar localtime;
   
  -        my $package = ref($self) || $self;
  -        my $version = $self->VERSION;
  -        my $date = scalar localtime;
  -
  -        open my $pm, '>', $file or die "open $file: $!";
  -
  -        print $pm <<EOF;
  +    print $pm <<EOF;
   package $name;
   
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  @@ -458,11 +435,7 @@
   
   1;
   EOF
  -        close $pm;
  -    }
  -    else {
  -        warning "$file didn't change, skipping creating of the file";
  -    }
  +    close $pm;
   }
   
   # canonsort(\$data);