svn commit: samba r15642 - in branches/SAMBA_4_0/source/script: .

metze at samba.org metze at samba.org
Tue May 16 16:57:56 GMT 2006


Author: metze
Date: 2006-05-16 16:57:56 +0000 (Tue, 16 May 2006)
New Revision: 15642

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15642

Log:
add an '--always-create' option to mkproto.pl
with this the proto headers will be always regenerated,
even if the content hasn't changed

you can use currently by
#>make MK_PROTO_ALWAYS_CREATE=yes'
or 
#>export MK_PROTO_ALWAYS_CREATE=yes
#>make

metze
Modified:
   branches/SAMBA_4_0/source/script/mkproto.pl


Changeset:
Modified: branches/SAMBA_4_0/source/script/mkproto.pl
===================================================================
--- branches/SAMBA_4_0/source/script/mkproto.pl	2006-05-16 16:51:34 UTC (rev 15641)
+++ branches/SAMBA_4_0/source/script/mkproto.pl	2006-05-16 16:57:56 UTC (rev 15642)
@@ -25,6 +25,7 @@
 my $private_data = \$_private;
 my $builddir = undef;
 my $srcdir = undef;
+my $always_create = $ENV{MK_PROTO_ALWAYS_CREATE};
 
 sub public($)
 {
@@ -47,6 +48,9 @@
 	print "  --define=DEF           Use DEF to check whether header was already included\n";
 	print "  --public-define=DEF    Same as --define, but just for public header\n";
 	print "  --private-define=DEF   Same as --define, but just for private header\n";
+	print "  --srcdir=path          Read files relative to this directory\n";
+	print "  --builddir=path        Write file relative to this directory\n";
+	print "  --always-create        Always create new proto headers, even if the content hasn't changed\n";
 	print "  --help                 Print this help message\n\n";
 	exit 0;
 }
@@ -61,9 +65,10 @@
 	},
 	'public-define=s' => \$public_define,
 	'private-define=s' => \$private_define,
-	'help' => \&usage,
+	'srcdir=s' => sub { my ($f,$v) = @_; $srcdir = $v; },
 	'builddir=s' => sub { my ($f,$v) = @_; $builddir = $v; },
-	'srcdir=s' => sub { my ($f,$v) = @_; $srcdir = $v; }
+	'always-create' => \$always_create,
+	'help' => \&usage
 ) or exit(1);
 
 if (not defined($public_define) and defined($public_file)) {
@@ -239,7 +244,7 @@
 my $old_public_data = file_load($public_file);
 my $old_private_data = file_load($private_file);
 
-if (not defined($old_public_data) or ($old_public_data ne $$public_data))
+if (defined($always_create) or not defined($old_public_data) or ($old_public_data ne $$public_data))
 {
 	mkpath(dirname($public_file), 0, 0755);
 	open(PUBLIC, ">$public_file") or die("Can't open `$public_file': $!"); 
@@ -247,7 +252,7 @@
 	close(PUBLIC);
 } 
 
-if (($public_file ne $private_file) and (
+if (($public_file ne $private_file) and (defined($always_create) or 
 	not defined($old_private_data) or ($old_private_data ne $$private_data))) {
 
 	mkpath(dirname($private_file), 0, 0755);



More information about the samba-cvs mailing list