Assorted winemaker fixes

Francois Gouget fgouget at free.fr
Thu Apr 19 19:09:11 CDT 2001


Changelog:

 * tools/winemaker
   Fix file lossage in subdirectories of an 'include' directory (closes #163)
   When case fixing #includes, take into account that the file may have
been renamed (closes #161)
   Better support of $(SRCDIR) in -I directives
   RTF was not recognised in rc files because it was in the wrong place
   Escape weird characters when putting the rc filename in the spec
file

--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                         "Utilisateur" (nom commun) :
        Mot utilisé par les informaticiens en lieu et place d'"idiot".

-------------- next part --------------
Index: tools/winemaker
===================================================================
RCS file: /home/wine/wine/tools/winemaker,v
retrieving revision 1.23
diff -u -r1.23 winemaker
--- tools/winemaker	2001/04/18 17:39:42	1.23
+++ tools/winemaker	2001/04/19 23:53:34
@@ -554,6 +554,7 @@
     push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_", at sources_cxx;
     push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_", at sources_rc;
     push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_", at sources_misc;
+    push @{@$parent_settings[$T_SOURCES_MISC]},map "$dirname$_",@{@$project_settings[$T_SOURCES_MISC]};
     return;
   }
 
@@ -1174,12 +1175,14 @@
     }
   } else {
     # Here's how we proceed:
+    # - compute the 'renamed' filename (see renaming phase)
     # - split the filename we look for into its components
     # - then for each directory in the include path
     #   - trace the directory components starting from that directory
     #   - if we fail to find a match at any point then continue with 
     #     the next directory in the include path
     #   - otherwise, rejoice, our quest is over.
+    $filename =~ s/[ \$]/_/g;
     my @file_components=split /[\/\\]+/, $filename;
     #print "  Searching for $filename from @$project[$P_PATH]\n";
 
@@ -1199,7 +1202,8 @@
       if (!is_absolute($dirname)) {
 	$dirname="@$project[$P_PATH]$dirname";
       } else {
-	$dirname=~ s+^\$\(TOPSRCDIR\)/++;
+        $dirname=~ s+^\$\(TOPSRCDIR\)/++;
+        $dirname=~ s+^\$\(SRCDIR\)/+@$project[$P_PATH]+;
       }
       #print "    in $dirname\n";
       $real_filename=search_from("$dirname",\@file_components);
@@ -1213,6 +1217,7 @@
       my $dirname=$include;
       $dirname=~ s+^-I++;
       $dirname=~ s+^\$\(TOPSRCDIR\)\/++;
+      $dirname=~ s+^\$\(SRCDIR\)\/+@$project[$P_PATH]+;
       #print "    in $dirname  (global setting)\n";
       $real_filename=search_from("$dirname",\@file_components);
       if (defined $real_filename) {
@@ -1352,7 +1358,7 @@
         # Issues a warning if the pack is of the form pack(push,label)
         print FILEO "$pack_indent/* winemaker: $pack_header$1 */\n";
         my $pack_comment=$';
-	$pack_comment =~ s/^\s*//;
+        $pack_comment =~ s/^\s*//;
         if ($pack_comment ne "") {
           print FILEO "$pack_indent$pack_comment";
         }
@@ -1381,7 +1387,7 @@
         my $label=$2;
         print FILEO "$pack_indent/* winemaker: $pack_header$1 */\n";
         my $pack_comment=$';
-	$pack_comment =~ s/^\s*//;
+        $pack_comment =~ s/^\s*//;
         if ($pack_comment ne "") {
           print FILEO "$pack_indent$pack_comment";
         }
@@ -1458,7 +1464,7 @@
       $modified=1;
 
     } elsif ($is_rc) {
-      if ($rc_block_depth == 0 and /^(\w+\s+(BITMAP|CURSOR|FONT|FONTDIR|ICON|MESSAGETABLE|TEXT)\s+((DISCARDABLE|FIXED|IMPURE|LOADONCALL|MOVEABLE|PRELOAD|PURE|RTF)\s+)*)([\"<]?)([^\">\r\n]+)([\">]?)/) {
+      if ($rc_block_depth == 0 and /^(\w+\s+(BITMAP|CURSOR|FONT|FONTDIR|ICON|MESSAGETABLE|TEXT|RTF)\s+((DISCARDABLE|FIXED|IMPURE|LOADONCALL|MOVEABLE|PRELOAD|PURE)\s+)*)([\"<]?)([^\">\r\n]+)([\">]?)/) {
 	my $from_file=($5 eq "<"?"":$dirname);
 	my $real_include_name=get_real_include_name($line,$6,$from_file,$project,$target);
 	print FILEO "$1$5$real_include_name$7$'";
@@ -1578,6 +1584,7 @@
     }
     my $rcname=@{@$target[$T_SOURCES_RC]}[0];
     $rcname =~ s+\.rc$++i;
+    $rcname =~ s+([^/\w])+\\\1+g;
     print FILEO "rsrc    $rcname.res\n";
   }
   print FILEO "\n";


More information about the wine-patches mailing list