Changeset 119 for trunk/debbuild


Ignore:
Timestamp:
07/27/07 16:56:59 (17 years ago)
Author:
kdeugau
Message:

/trunk

Added chunk to the .spec parser to choke and die Just Like rpmbuild if we
encounter a %[a-z]+ tag we don't understand.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r118 r119  
    481481    next if /^#/ && $stage eq 'preamble';       # Ignore comments...
    482482    next if /^\s*$/ && $stage eq 'preamble';    # ... and blank lines.
     483
     484# no sense in continuing if we find something we don't grok
     485    # Yes, this is really horribly fugly.  But it's a cheap crosscheck against invalid
     486    # %-tags which also make rpmbuild barf.  In theory.
     487# notes:  some of these are not *entirely* case-sensitive (%ifxxx), but most are.
     488    # Extracted from the Maximum RPM online doc via:
     489    # grep -h %[a-z] *|perl -e 'while (<>) { /\%([a-z0-9]+)\b/; print "$1|\n"; }'|sort -u
     490    if (/^%[a-z]/ &&
     491                $_ !~ /^%(?:attr|build|check|clean|config|configure|defattr|define|description|
     492                dir|doc|docdir|else|endif|files|ghost|if|ifarch|ifn|ifnarch|ifnos|ifnxxx|fos|ifxxx|
     493                install|package|patch|post|postun|pre|prep|preun|readme|setup|
     494                triggerin|triggerpostun|triggerun|verify|verifyscript)\b/x
     495        ) {
     496        my ($badtag) = (/^%([a-z]+)/i);
     497        die "Unknown tag \%$badtag at line $. of $specfile\n";
     498    }
    483499
    484500# preprocess %define's
Note: See TracChangeset for help on using the changeset viewer.