cvsuser 04/11/30 03:15:44
Modified: build_tools ops2pm.pl
Log:
ensure oplib dir exists
[PATCH] ensure include/parrot/oplib/ directory exists
This patch ensures that the directory exists before trying to write to it.
Courtesy of Andy Dougherty <[EMAIL PROTECTED]>
Revision Changes Path
1.20 +5 -1 parrot/build_tools/ops2pm.pl
Index: ops2pm.pl
===================================================================
RCS file: /cvs/public/parrot/build_tools/ops2pm.pl,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ops2pm.pl 27 Nov 2004 14:00:40 -0000 1.19
+++ ops2pm.pl 30 Nov 2004 11:15:44 -0000 1.20
@@ -1,6 +1,6 @@
#! perl -w
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: ops2pm.pl,v 1.19 2004/11/27 14:00:40 leo Exp $
+# $Id: ops2pm.pl,v 1.20 2004/11/30 11:15:44 leo Exp $
=head1 NAME
@@ -225,6 +225,10 @@
# finally create an include file with opcode number
my $inc_f = "include/parrot/oplib/ops.h";
+my $inc_dir = "include/parrot/oplib";
+if (! -d $inc_dir) {
+ mkdir($inc_dir, 0755) or die "ops2pm.pl: Could not mkdir $inc_dir: $!\n";
+}
open OUT, ">$inc_f" or die "Can't write $inc_f: $!";
print OUT <<END_C;