[mythtv] [mythtv-commits] Ticket #4397: win32 dependancy resolver and build script
buzz
davidbuzz at gmail.com
Fri Jan 4 00:54:31 UTC 2008
>
> Command Extensions are enabled by default on Vista, WindowsXP and
> Windows 2000 so mkdid with full path should work (and did on my XP and
> Vista test machines) and as the [mkdirs] did not work on either my XP
> or Vista machines I changed it to the following which does work (when
> passed a dos path ie $dossources):
>
> sub mkdirs {
> my $path = shift;
> print `mkdir $path`;
> }
>
That's like what I had initially (in all versions of the script upto 6 I
think), because I tested it in a cmd.exe with multiple subfolders (ie 'mkdir
c:/x/y/z') and it worked..... but doing the equivalent from within perl
backticks didn't seem to work. I've now re-tested it , and I agree we
should go back to the way it was (as you suggested), because it clearly DOES
work if the pathslashes are formatted correctly for DOS (ie double
backslashed):
#!c:/perl/bin/perl.exe -w
# works:
print `mkdir c:\\x\\y\\z`;
#it's just that this doesn't:
print `mkdir c:\x\y\z`;
#and neither does this:
print `mkdir c:/x/y/z`;
>
> another issue I've had with the script is that the [extract] function
> doesn't work as it is trying to call an msys command (tar.exe) in a
> regular command shell. the child process (gzip or bzip2) does not
> work, I modified the function to be as follows
>
That's a bug then... although it's clearly working for me, I'm happy to
improve/fix it.
I guess it's reasonable to do all the [extract]ions in msys, given that we
don't [extract] anything till after the basic msys is installed.
ASIDE: Is it "against the rules" to call a msys command in a regular dos
shell? I thought they were just normal windows binaries that fiddle with
the paths that you give them to make the unix<->windows magic work.
All three of these tar commands work fine on my system... but I just
realised it's from the fact that I have some gnuwin32 utilities, including
gzip.exe and bunzip2.exe in my path. bugger!
Your fix will be in the next version, coming within the hour or so, as I
guess it works :-) Clearly we can't use bash at that time, as we have a
chicken-egg-chicken problem if we do.
>
>
> sub extracttar {
> my ( $t, $d) = @_;
>
> unless ( $t =~ m/zip/ ) { # the unzip tool need the full DOS path,
> the msys commands need that stripped off.
> $t =~ s#^$msys#/#i;
> }
> my $d2 = $d;
> #$d2 =~ s#/#\\\\#g; # the chdir command MUST have paths with
> backslashes, not forward slashes.
>
> print "extracting to: $d\n";
> my $cmd = $msys.'bin/sh2.exe -c "( export
> PATH=/bin:/mingw/bin:$PATH;';
> #my $cmd = '';
> if ( $t =~ /\.gz$/ ) {
> $cmd = $cmd."cd $d2;tar.exe -zxvpf $t";
> } elsif ( $t =~ /\.bz2$/ ) {
> $cmd = $cmd."cd $d2;tar.exe -jxvpf $t";
> }elsif ( $t =~ /\.zip$/ ) {
> $cmd = $cmd."cd $d2 && $sources/unzip/unzip.exe -o $t";
> #die "unzippng not implemented yet \n";
> }elsif ( $t =~ /\.tar$/ ) {
> $cmd = $cmd."cd $d2;tar.exe -xvpf $t";
> } else {
> die "extract tar failed on ($t,$d)\n";
> }
> $cmd = $cmd.')"';
> # execute the cmd, and capture the output!
> # this is a glorified version of "print `$cmd`;" except it doesn't
> buffer the output, if $|=1; is set.
> # $t should be a msys compatible path ie /sources/etc
> print "extracttar:$cmd\n";
> open F, "$cmd |" || die "err: $!";
> while (<F>) {
> print;
> }
> }
>
> You'll notice the use of sh2.exe instead of sh.exe. I copy sh.exe to
> sh2 in the install process as otherwise it can't be replaced when bash
> is installed.
>
> As for the dsound.h ddraw.h and dinput.h files, those can be
> downloaded from the Allegro project in the following file:
> http://alleg.sourceforge.net/files/dx80_mgw.zip
>
( I will compare these, and if identical, use them instead)
>
>
> I'm a bit mystified as to how you're getting this bootstrap script to
> run as-is with the problems I'm seeing with it
>
(gnuwin32 utilities accidentially in the path would do it!)
ASIDE: how do the other Win32 developers/builders feel about the quality of
the code in the build script otherwise? Is it easy-enough to follow hte
logic of what's going on? I find it easy, but I wrote it. :-)
Buzz.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20080104/858e0618/attachment.htm
More information about the mythtv-dev
mailing list