3 # tcl.req - a simple makedepends like script for tcl.
5 # I plan to rewrite this in C so that perl is not required by RPM at
8 # by Ken Estes Mail.com kestes@staff.mail.com
18 # notice we are passed a list of filenames NOT as common in unix the
19 # contents of the file.
27 foreach $module (sort keys %require) {
28 print "tcl($module)\n";
40 open(FILE, "<$file")||
41 die("$0: Could not open file: '$file' : $!\n");
45 # Each keyword can appear multiple times. Don't
46 # bother with datastructures to store these strings,
47 # if we need to print it print it now.
49 if ( m/^\s*\$RPM_Requires\s*=\s*["'](.*)['"]/i) {
50 foreach $_ (spit(/\s+/, $1)) {
57 # Each keyword can appear multiple times. Don't
58 # bother with datastructures to store these strings,
59 # if we need to print it print it now.
61 if ( m/^\s*\$RPM_Requires\s*=\s*["'](.*)['"]/i) {
62 foreach $_ (spit(/\s+/, $1))
67 # we wish to capture these source statements:
69 # source "$PATH/lib/util.tcl"
70 # source "comconf.tcl"
71 # if {[catch {source $env(CONTROL_PANEL_LIB_DIR)/bindings.tcl}] != 0} {
73 # quick check to see if the complex regexps could possibly match.
74 # This should speed things up.
78 # note we include parethesis and '$' and '\' in the pattern
81 (m!source\s+([\'\"])?([0-9A-Za-z/._\-\\\(\)\$]+)!)
86 # If there is some interpolation of variables,
87 # see if taking the basename will give us the filename.
90 ($module = basename($module));
93 ($require{$module}=1);
98 die("$0: Could not close file: '$file' : $!\n");