Changeset 86018813 in rtems for contrib/crossrpms/specstrip


Ignore:
Timestamp:
Mar 20, 2010, 6:57:46 AM (10 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 5, master
Children:
64c228c4
Parents:
01846b3
Message:

Filter constant conditionals.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/crossrpms/specstrip

    r01846b3 r86018813  
    77
    88
    9 # Copyright (C) 2005,2006       Ralf Corsépius, Ulm, Germany,
     9# Copyright (C) 2005,2006,2010  Ralf Corsépius, Ulm, Germany,
    1010#
    1111# This program is free software; you can redistribute it and/or
     
    167167foreach my $i ( @buffer2 )
    168168{
    169 #  print STDERR $i->{state}, $i->{line}, "\n";
     169  print STDERR $i->{state}, $i->{line}, "\n" if $verbose > 1;
    170170  if ( $i->{state} =~ m/($ppat)/ ) {
     171  } elsif ( $i->{state} =~ m/.*<"([a-zA-Z_0-9\.\-]+)" (!=|==) "([a-zA-Z_0-9\.\-]+)">.*/ ) {
     172  # Filter out constant conditionals
     173    if ( "$2" eq "==" ) {
     174      if ( "$1" eq "$3" ) {
     175        if ( $i->{line} =~ m/^%(if|else|endif).*$/ ) {
     176        } else {
     177          push @buffer3, $i->{line}, "\n";
     178        }
     179      }
     180    } elsif ( "$2" eq "!=" ){
     181      if ( "$1" ne "$3" ) {
     182        if ( $i->{line} =~ m/^%(if|else|endif).*$/ ) {
     183        } else {
     184          push @buffer3, $i->{line}, "\n";
     185        }
     186      }
     187    } else {
     188      die "invalid condition: $i->{state}";
     189    }
    171190  } else {
    172191    push @buffer3, $i->{line}, "\n"
Note: See TracChangeset for help on using the changeset viewer.