Ticket #4397: win32-packager.17.patch

File win32-packager.17.patch, 22.4 KB (added by David Bussenschutt <davidbuzz@…>, 12 years ago)

latest, superceeded all previous. patch against current file at: http://svn.mythtv.org/svn/trunk/mythtv/contrib/Win32/win32-packager.pl

  • win32-packager.

    old new  
    2020#use Cwd ();
    2121use LWP::UserAgent;
    2222use IO::File;
    23 use Data::Dumper qw(Dumper);
     23use Data::Dumper;
    2424use File::Copy qw(cp);
    2525
    2626my $NOISY = 1; # set to 0 for less output to the screen
    2727
    2828$| = 1; # autoflush stdout;
    2929
    30 my $SVNRELEASE = '15433' ;# this scipt was last tested to work with this version, on other versions YMMV.
     30my $SVNRELEASE = '15433' ;# this scipt was last tested to work with this
     31                          # developer version, on other versions YMMV.
     32#my $SVNRELEASE = 'HEAD' ;# if you are game, go forth and test the latest release!
    3133
    3234# We allow SourceForge to tell us which server to download from,
    3335# rather than assuming specific server/s
     
    3537                                                   # mirror of SF's choosing,
    3638                                                   # hopefully close to you
    3739# alternatively you can choose your own mirror:
    38 #my $sourceforge = 'optusnet.dl.sourceforge.net';  # australia  <- the author
    39 #                                                  #            uses this one!
     40#my $sourceforge = 'optusnet.dl.sourceforge.net';  # australia
    4041#my $sourceforge = 'internap.dl.sourceforge.net';  # USA,California
    4142#my $sourceforge = 'easynews.dl.sourceforge.net';  # USA,Arizona,Phoenix,
    4243#my $sourceforge = 'jaist.dl.sourceforge.net';     # Japan
     
    5051my $proxy = '';
    5152#my $proxy = 'http://enter.your.proxy.here:8080';
    5253
    53 # TODO -  use this list to define the components to build -
     54# TODO -  use this list to define the components to build - only the first of these currently works well.
    5455my @components = ( 'mythtv', 'myththemes', 'mythplugins' );
    5556
    5657
     
    6061#      unless $ENV{SOURCES};
    6162#  my $sources = $ENV{SOURCES};
    6263# TODO - although theoretically possible to change these paths,
    63 #        it has NOT been tested, and will with HIGH PROBABILITY fail somewhere
     64#        it has NOT been tested much, and will with HIGH PROBABILITY fail somewhere.
     65# TODO - Only $mingw is tested and most likely is safe to change.
    6466
    6567# perl compatible paths (single forward slashes in DOS style):
    6668my $msys = 'C:/MSys/1.0/'; # must end in slash, and use forward slashes /
     
    119121#  copy a new version of a file, set mtime to the original           [copy]
    120122
    121123#TODO:
    122 #  copy a file or set of files (path/filespec,  destination)         not-yet-impl.  use exec => 'copy /Y xxx yyy'
     124#  copy a set of files (path/filespec,  destination)                 not-yet-impl.  use exec => 'copy /Y xxx.* yyy'
    123125#  apply a diff                                                      not-yet-impl   use shell => 'patch -p0 < blah.patch'
    124126#  search-replace text in a file                                     not-yet-impl   use grep => ['pattern',subject], exec => shell 'patch < etc to replace it'
    125127
     
    195197[ dir => $sources.'svn-win32-1.4.6', extract => $sources.'svn-win32-1.4.6.zip' ],
    196198
    197199
    198 [ file => $msys.'bin/svn.exe', shell => ["cp -R $unixsources/svn-win32-1.4.6/* ".$unixmsys],comment => 'put the svn.exe executable into the path, so we can use it later!' ],
     200[ file => $msys.'bin/svn.exe', shell => ["cp -R $unixsources/svn-win32-1.4.6/* ".$unixmsys],comment => 'put the svn.exe executable into the path, so we can use it easily later!' ],
    199201
    200202# :
    201203[ dir => $sources."zlib" ,  mkdirs => $sources.'zlib',comment => 'the zlib download is a bit messed-up, and needs some TLC to put everything in the right place' ],
     
    203205# install to /usr:
    204206[ file => $msys.'lib/libz.a',      exec => ["copy /Y ".$dossources.'zlib\usr\lib\* '.$dosmsys."lib"] ],
    205207[ file => $msys.'bin/msys-z.dll',  exec => ["copy /Y ".$dossources.'zlib\usr\bin\* '.$dosmsys."bin"] ],
    206 [ file => $msys.'include/zlib.h',  exec => ["copy /Y ".$dossources.'zlib\usr\include\*', $dosmsys."include"] ],
     208[ file => $msys.'include/zlib.h',  exec => ["copy /Y ".$dossources.'zlib\usr\include\* '.$dosmsys."include"] ],
    207209# taglib also requires zlib in /mingw , so we'll put it there too, why not!
    208210[ file => $msys.'lib/libz.a',      exec => ["copy /Y ".$dossources.'zlib\usr\lib\* '.$dosmingw."lib"] ],
    209 [ file => $msys.'bin/msys-z.dll',  exec => ["copy /Y ".$dossources.'zlib\usr\bin\*', $dosmingw."bin"] ],
     211[ file => $msys.'bin/msys-z.dll',  exec => ["copy /Y ".$dossources.'zlib\usr\bin\* '. $dosmingw."bin"] ],
    210212[ file => $msys.'include/zlib.h',  exec => ["copy /Y ".$dossources.'zlib\usr\include\* '.$dosmingw."include"] ],
    211213
    212214
     
    452454export PATH=$QTDIR/bin:$PATH
    453455' ],comment => 'write a script that we can source later when inside msys to setup the environment variables'],
    454456
    455 ##
    456 #[ file => $mythtv.'make_run.sh', write => [$mythtv.'make_run.sh',
    457 #'#!/bin/bash
    458 #source '.$unixmythtv.'qt_env.sh
    459 #cd '.$unixmythtv.'/mythtv
    460 ## keep around just one earlier verion in run_old:
    461 #rm -rf run_old
    462 #mv run run_old
    463 #mkdir run
    464 ## copy exes and dlls to the run folder:
    465 #find . -name \\*.exe  | grep -v run | xargs -n1 -i__ cp __ ./run/
    466 #find . -name \\*.dll  | grep -v run | xargs -n1 -i__ cp __ ./run/ 
    467 ## mythtv needs the qt dlls at runtime:
    468 #cp '.$unixmsys.'qt-3.3.x-p8/lib/*.dll '.$unixmythtv.'mythtv/run
    469 ## qt mysql connection dll has to exist in a subfolder called sqldrivers:
    470 #mkdir '.$unixmythtv.'mythtv/run/sqldrivers
    471 #cp '.$unixmsys.'qt-3.3.x-p8/plugins/sqldrivers/libqsqlmysql.dll '.$unixmythtv.'mythtv/run/sqldrivers
    472 ## pthread dlls and mingwm10.dll are copied from here:
    473 #cp /mingw/bin/*.dll '.$unixmythtv.'mythtv/run
    474 #' ],comment => 'script that will copy all the files necessary for running mythtv out of the build folder into the ./run folder'],
    475 
    476 #
    477 [ file => $mythtv.'build_plugins.sh', write => [$mythtv.'build_plugins.sh',
    478 '#!/bin/bash
    479 cd '.$unixmythtv.'mythplugins
    480 ./configure --prefix=/usr --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type=debug && make && make install
    481 #make
    482 #make install
    483 #cd ..
    484 ' ],comment => 'write a script to build mythtv plugins'],
    485457
    486458# chmod the shell scripts, everytime
    487459[ file => $mythtv.'_' , shell => ["cd $mythtv","chmod 755 *.sh",'nocheck'] ],
     
    493465# SVN update every time, before patches, unless we are using a proxy
    494466foreach my $comp( @components ) {
    495467push @{$expect},
    496 [ file => $mythtv.'using_proxy_cannot_do_SVN.txt', exec => ['cd '.$dosmythtv."$comp && ".$dosmsys.'bin\svn.exe update','nocheck'],comment => 'getting SVN updates for:'.$comp ],
     468[ file => $mythtv.'using_proxy_cannot_do_SVN.txt', exec => ['cd '.$dosmythtv."$comp && ".$dosmsys.'bin\svn.exe -r '.$SVNRELEASE.' update','nocheck'],comment => 'getting SVN updates for:'.$comp ],
    497469}
    498470push @{$expect},
    499471
     472# always get svn num
     473[ file => $mythtv.'_', exec => ['cd '.$dosmythtv.'mythtv && '.$dosmsys.'bin\svn.exe info > '.$dosmythtv.'mythtv\svn_info.new','nocheck'], comment => 'fetching the SVN number to a text file, if we can'],
     474[ filesame => [$mythtv.'mythtv\svn_info.txt',$mythtv.'mythtv\svn_info.new'], shell => ['touch -r '.$unixmythtv.'mythtv/svn_info.txt '.$unixmythtv.'mythtv/svn_info.new'], comment => 'match the datetime of these files, so that the contents only can be compared next' ],
     475
     476# is svn num (ie file contents) changed since last run, if so, do a 'make clean' (overkill, I know, but safer)!
     477[ filesame => [$mythtv.'mythtv\svn_info.txt',$mythtv.'mythtv\svn_info.new'], shell => ['touch '.$unixmythtv.'mythtv/Makefile','cat '.$unixmythtv.'mythtv/svn_info.new >'.$unixmythtv.'mythtv/svn_info.txt','touch -r '.$unixmythtv.'mythtv/svn_info.txt '.$unixmythtv.'mythtv/svn_info.new'], comment => 'if the SVN number is changed, then remember that, AND arrange for a full re-make of mythtv. (overkill, I know, but safer)' ],
    500478
    501479# apply any outstanding win32 patches - this section will be hard to keep upwith HEAD/SVN:
    502480
     
    525503# config
    526504[ file => $mythtv.'mythtv/Makefile', shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun --disable-dvb --disable-ivtv --disable-iptv --disable-joystick-menu --disable-xvmc-vld --disable-x11 --disable-xvmc --enable-directx --enable-memalign-hack --cpu=k8 --compile-type=debug'], comment => 'do we already have a Makefile for mythtv?' ],
    527505# make
    528 [ newer => [$mythtv.'mythtv/libs/libmyth/libmyth-0.20.dll',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'libs/libmyth/libmyth-0.20.dll - redo make unless all these files exist, and are newer than the Makefile' ],
    529 [ newer => [$mythtv.'mythtv/libs/libmythtv/libmythtv-0.20.dll',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'libs/libmythtv/libmythtv-0.20.dll - redo make unless all these files exist, and are newer than the Makefile' ],
    530 [ newer => [$mythtv.'mythtv/programs/mythfrontend/mythfrontend.exe',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'programs/mythfrontend/mythfrontend.exe - redo make unless all these files exist, and are newer than the Makefile' ],
    531 [ newer => [$mythtv.'mythtv/programs/mythbackend/mythbackend.exe',$mythtv.'mythtv/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'programs/mythbackend/mythbackend.exe - redo make unless all these files exist, and are newer than the Makefile' ],
     506[ newer => [$mythtv.'mythtv/libs/libmyth/libmyth-0.20.dll',$mythtv.'mythtv/Makefile'], shell => ['rm '.$unixmythtv.'mythtv/libs/libmyth/libmyth-0.20.dll','source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'libs/libmyth/libmyth-0.20.dll - redo make unless all these files exist, and are newer than the Makefile' ],
     507[ newer => [$mythtv.'mythtv/libs/libmythtv/libmythtv-0.20.dll',$mythtv.'mythtv/Makefile'], shell => ['rm '.$unixmythtv.'mythtv/libs/libmythtv/libmythtv-0.20.dll','source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'libs/libmythtv/libmythtv-0.20.dll - redo make unless all these files exist, and are newer than the Makefile' ],
     508[ newer => [$mythtv.'mythtv/programs/mythfrontend/mythfrontend.exe',$mythtv.'mythtv/Makefile'], shell => ['rm '.$unixmythtv.'mythtv/programs/mythfrontend/mythfrontend.exe','source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'programs/mythfrontend/mythfrontend.exe - redo make unless all these files exist, and are newer than the Makefile' ],
     509[ newer => [$mythtv.'mythtv/programs/mythbackend/mythbackend.exe',$mythtv.'mythtv/Makefile'], shell => ['rm '.$unixmythtv.'mythtv/programs/mythbackend/mythbackend.exe','source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make'], comment => 'programs/mythbackend/mythbackend.exe - redo make unless all these files exist, and are newer than the Makefile' ],
    532510
    533511# re-install to msys /usr/bin folders etc, if we have a newer mythtv build ready:
    534512[ newer => [$msys.'bin/mythfrontend.exe',$mythtv.'mythtv/programs/mythfrontend/mythfrontend.exe'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythtv','make install'], comment => 'was the last configure successful? then install mythtv ' ],
    535513
     514# it seems that mythverbose.h isn't installed as it should be.... (needed by the plugins compile)
     515[ filesame => [$msys.'include/mythtv/mythverbose.h',$mythtv.'mythtv/libs/libmyth/mythverbose.h'], copy => [''=>''], comment => 'mythverbose.h ist installed properly yet...' ],
     516
     517
    536518# install some themes? does a 'make install' do that adequately (no, not if running outside msys)?
    537519
    538520
     
    639621# this has the 'nocheck' flag because the creation of the DB doesn't instantly reflect in the .txt file we are looking at:
    640622[ grep => ['mythconverg',$mythtv.'_mysqlshow_err.txt'], exec => [ 'echo create database mythconverg; | "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe" -u mythtv --password=mythtv','nocheck'], comment => ' does the mythconverg database exist? (and can this user see it?) '],
    641623
     624#----------------------------------------
     625
     626#  build the mythplugins now:
     627#
     628#[ file => $mythtv.'build_plugins.sh', write => [$mythtv.'build_plugins.sh',
     629#'#!/bin/bash
     630#source '.$unixmythtv.'qt_env.sh
     631#cd '.$unixmythtv.'mythplugins
     632#./configure --prefix=/usr --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type=debug && make && make install
     633##make
     634##make install
     635##cd ..
     636#' ],comment => 'write a script to build mythtv plugins'],
     637
     638# get mythtv sources, if we don't already have them
     639# download all the files from the web, and save them here:
     640[ dir => $mythtv.'mythplugins', mkdirs => $mythtv.'mythplugins' ],
     641
     642# config:
     643[ file => $mythtv.'mythplugins/Makefile', shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythplugins','--prefix=/usr --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type=debug'], comment => 'do we already have a Makefile for myth plugins?' ],
     644# make
     645#[ newer => [$mythtv.'mythplugins/mythmovies/mythmovies/XXXXX',$mythtv.'mythplugins/Makefile'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythplugins','make'], comment => 'plugins - redo make unless all these files exist, and are newer than the Makefile' ],
     646
     647# re-install to msys /usr/bin folders etc, if we have a newer mythtv build ready:
     648#[ newer => [$msys.'bin/mythfrontend.exeXXXXX',$mythtv.'mythplugins/mythmovies/mythmovies/XXXXX'], shell => ['source '.$unixmythtv.'qt_env.sh','cd '.$unixmythtv.'mythplugins','make install'], comment => 'plugins - was the last configure successful? then install mythtv ' ],
    642649
    643650
    644 # then we Can't connect to MySQL server is the message we get if the server is not even running!
    645 #[ grep => ["Access denied for user",$mythtv.'_mysqlshow_err.txt'], exec => 'C:\Program Files\MySQL\MySQL Server 5.0\bin\MySQLInstanceConfig.exe', comment => 'We couldnt connect to server, please re-configure the MySQL server to start as a service.'],
    646651
    647652#----------------------------------------
    648653
     
    657662print << "END";   
    658663#
    659664# SCRIPT TODO/NOTES:  - further notes on this scripts direction....
    660 # if the build was successful then try running the 'mythfrontend.exe' and 'mythbackend.exe' from the 'C:\mythtv\mythtv\run' folder.
    661 # ok, how about the test-run process? 
    662 # create a vanilla mysql.txt file
    663 # check that the local mysql server is running, and configure it:
    664 # we should run: 'C:\\Program Files\\MySQL\\MySQL Server 5.0\\bin\\MySQLInstanceConfig.exe'
    665 # check that mythtv/mythtv/mythconverg will access the mysql database.
    666 #
     665# * if the build was successful then try running the 'mythfrontend.exe' and 'mythbackend.exe' from the 'C:\mythtv\mythtv\run' folder.
     666# * ok, how about the test-run process? 
     667# * check that mythtv/mythtv/mythconverg will access the mysql database
     668# * mythplugins build isn't currently working, so disabled.
     669# * myththemes build isn't tried at all
    667670END
    668671}
    669672
     
    718721        # a single array on passing to effect();
    719722        effect($effecttype,$cause[0],@nocheckeffectparams);
    720723        if ( ! -f $cause[0] && $nocheck == 0) {
    721             die "archive -> EFFECT FAILED: $causetype,$cause[0],$effecttype\n";
     724            die "EFFECT FAILED ($causetype -> $effecttype): unable to locate expected file ($cause[0]) that was to be fetched from $nocheckeffectparams[0]\n";
    722725        }
    723726
    724727    }   elsif ( $causetype eq 'dir' ) {
     
    727730        }
    728731        effect($effecttype,@nocheckeffectparams);
    729732        if ( ! -d $cause[0] && $nocheck == 0) {
    730             die "dir -> EFFECT FAILED: $causetype,$cause[0],$effecttype\n";
     733            die "EFFECT FAILED ($causetype -> $effecttype): unable to locate expected directory ($cause[0]).\n";
    731734        }
    732735
    733736    } elsif ( $causetype eq 'file' ) {
    734737        if ( -f $cause[0] ) {print "file exists: $cause[0]\n"; next;}
    735738        effect($effecttype,@nocheckeffectparams);
    736739        if ( ! -f $cause[0] && $nocheck == 0) {
    737             die "file -> EFFECT FAILED: $causetype,$cause[0],$effecttype\n";
     740            die "EFFECT FAILED ($causetype -> $effecttype): unable to locate expected file ($cause[0]).\n";
    738741        }
    739742    } elsif ( $causetype eq 'filesame' ) {
    740743        # TODO - currently we check file mtime, and byte size, but not MD5/CRC32 or contents,  this is "good enough" for most circumstances.
     
    743746          $size = (stat($cause[0]))[7];
    744747          $mtime  = (stat($cause[0]))[9];
    745748        }
    746         if (! (-f $cause[1] ) ) {  die "cause: $causetype requires its SECOND filename to exist for comparison: $cause[1] \n"; }
     749        if (! (-f $cause[1] ) ) {  die "cause: $causetype requires its SECOND filename to exist for comparison: ($cause[1]).\n"; }
    747750        my $size2 = (stat($cause[1]))[7];
    748751        my $mtime2  = (stat($cause[1]))[9];
    749752        if ( $mtime != $mtime2 || $size != $size2) {
     
    755758            effect($effecttype,@nocheckeffectparams); # do something else if the files are not 100% identical?
    756759          } 
    757760        }else {
    758            print "effect not requiredm files already up-to-date/identical: ($cause[0] => $cause[1]) \n";
     761           print "effect not required files already up-to-date/identical: ($cause[0] => $cause[1]).\n";
    759762        }
    760763        undef $size; undef $mtime;
    761764        undef $size2; undef $mtime2;
     
    765768        if ( -f $cause[0] ) {
    766769          $mtime   = (stat($cause[0]))[9];
    767770        }
    768         if (! ( -f $cause[1]) ) {  die "cause: $causetype requires it's SECOND filename to exist for comparison: $cause[1]\n"; }
     771        if (! ( -f $cause[1]) ) {  die "cause: $causetype requires it's SECOND filename to exist for comparison: $cause[1].\n"; }
    769772        my $mtime2  = (stat($cause[1]))[9];
    770773        if ( $mtime < $mtime2 ) {
    771774          effect($effecttype,@nocheckeffectparams);
     
    774777            my $mtime3   = (stat($cause[0]))[9];
    775778            my $mtime4  = (stat($cause[1]))[9];
    776779            if ( $mtime3 < $mtime4  ) {
    777                 die "file -> EFFECT FAILED: $causetype,$cause[0],$cause[1],$effecttype\n";
     780                die "EFFECT FAILED ($causetype -> $effecttype): mtime of file ($cause[0]) should be greater than file ($cause[1]).\n";
    778781            }
    779782          }
    780783        } else {
     
    790793            print "grep - already matched source file($cause[1]), with pattern ($cause[0]) - no action reqd\n";
    791794        }
    792795        if ( (! _grep($cause[0],$cause[1])) && $nocheck == 0 ) {
    793            die "grep -> EFFECT FAILED: $causetype,$effecttype,$cause[0],$cause[1]\n";
     796           die "EFFECT FAILED ($causetype -> $effecttype): unable to locate regex pattern ($cause[0]) in file ($cause[1])\n";
    794797        }
    795798
    796799    } else {
    797         print Dumper(\@dep);
    798         die " unknown causetype '$causetype' \n";
     800        die " unknown causetype $causetype \n";
    799801    }
    800802}
    801803
     
    809811sub effect {
    810812    my ( $effecttype, @effectparams ) = @_;
    811813
    812         if ( $effecttype =~ /\s*fetch\s*/i ) {
     814        if ( $effecttype eq 'fetch') {
    813815            # passing two parameters that came in via the array
    814816            _fetch(@effectparams);
    815817
    816         } elsif ( $effecttype =~ /\s*extract\s*/i ) {
     818        } elsif ( $effecttype eq 'extract') {
    817819            my $tarfile = $effectparams[0];
    818820            my $destdir = $effectparams[1] || '';
    819821            if ($destdir eq '') {
     
    826828        print "extracttar($t,$destdir);\n";
    827829        extracttar($t,$destdir);
    828830
    829         } elsif ($effecttype =~ /\s*exec\s*/i ) { # execute a DOS command
     831        } elsif ($effecttype eq 'exec') { # execute a DOS command
    830832            my $cmd = shift @effectparams;
    831833            #print `$cmd`;
    832834            print "exec:$cmd\n";
     
    835837                print;
    836838            }   
    837839
    838         } elsif ($effecttype =~ /\s*shell\s*/i ) {
     840        } elsif ($effecttype eq 'shell') {
    839841            shell(@effectparams);
    840842           
    841         } elsif ($effecttype =~ /\s*copy\s*/i ) {
     843        } elsif ($effecttype eq 'copy') {
    842844            die "Can not copy non-existant file ($effectparams[0])\n" unless -f $effectparams[0];
    843845            print "copying file ($effectparams[0] => $effectparams[1]) \n";
    844846            cp($effectparams[0],$effectparams[1]);
    845847            # make destn mtime the same as the original for ease of comparison:
    846848            shell("touch --reference=".perl2unix($effectparams[0])." ".perl2unix($effectparams[1]));
    847849
    848         } elsif ($effecttype =~ /\s*mkdirs\s*/i ) {
     850        } elsif ($effecttype eq 'mkdirs') {
    849851            mkdirs(shift @effectparams);
    850852
    851         } elsif ($effecttype =~ /\s*write\s*/i ) {
     853        } elsif ($effecttype eq 'write') {
    852854            # just dump the requested content from the array to the file.
    853855            my $filename = shift @effectparams;
    854856            my $fh = new IO::File ("> $filename")
     
    858860            $fh->close();
    859861
    860862        } else {
    861             print Dumper(\@effectparams);
    862             die " unknown effecttype '$effecttype'\n";
     863            die " unknown effecttype $effecttype from cause 'dir'\n";
    863864        }
    864865}
    865866#------------------------------------------------------------------------------
     
    976977# (cause we are in the process of installing them)
    977978sub shell {
    978979    my @cmds = @_;
    979     my $cmd = $dosmsys.'bin\bash.exe -c "( export PATH=/bin:/mingw/bin:$PATH;'.join(';',@cmds).')"';
     980    my $cmd = $dosmsys.'bin\bash.exe -c "( export PATH=/bin:/mingw/bin:$PATH;'.join(';',@cmds).') 2>&1 "';
    980981    print "shell:$cmd\n";
    981982    # execute the cmd, and capture the output!  this is a glorified version
    982983    # of "print `$cmd`;" except it doesn't buffer the output if $|=1; is set.
    983984    open F, "$cmd |"  || die "err: $!";
    984985    while (<F>) {
     986        if (! $NOISY )  {
     987          # skip known spurious messages from going to the screen unnecessarily
     988          next if /redeclared without dllimport attribute after being referenced with dllimpo/;
     989          next if /warning: overriding commands for target `\.\'/;
     990          next if /warning: ignoring old commands for target `\.\'/;
     991          next if /Nothing to be done for `all\'/;
     992          next if /^cd .* \&\& \\/;
     993          next if /^make -f Makefile/;
     994        }
    985995        print;
    986996    }
    987997}