Added code to preserve RCS Id strings.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1658 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-08-20 19:36:43 +00:00
parent 2302b5f0e9
commit d7b2c3de87
2 changed files with 48 additions and 6 deletions
+24 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# $Id: genreceiver,v 1.2 2002/08/14 19:07:48 mdb Exp $
# $Id: genreceiver,v 1.3 2002/08/20 19:36:43 mdb Exp $
#
# This script is used to generate invocation receiver marshaller and
# unmarshaller classes based on receiver interface definitions.
@@ -179,7 +179,8 @@ while ($srcfile = shift) {
$mimports{"com.threerings.presents.server.InvocationSender"} = 1;
$mimports{"$dcdrpkg.${svcname}Decoder"} = 1;
my @mimportsl = sort keys %mimports;
my %mdata = ( "imports" => \@mimportsl,
my %mdata = ( "idstr" => slurp_idstr($sendpath),
"imports" => \@mimportsl,
"name" => $svcname,
"package" => $sendpkg,
"methods" => \@methods,
@@ -207,7 +208,8 @@ while ($srcfile = shift) {
my %dimports = %imports;
$dimports{"com.threerings.presents.client.InvocationDecoder"} = 1;
my @dimportsl = sort keys %dimports;
my %ddata = ( "imports" => \@dimportsl,
my %ddata = ( "idstr" => slurp_idstr($dcdrpath),
"imports" => \@dimportsl,
"name" => $svcname,
"receiver_code" => MD5->hexhash($ifcname),
"package" => $dcdrpkg,
@@ -352,3 +354,22 @@ sub unwrap_arglist {
}
return $argvals;
}
#
# If the specified file exists, it is opened and its RCS Id string is read
# and returned.
#
sub slurp_idstr {
my ($path) = @_;
my $idstr = "\$Id\$";
if (-f $path && open(IN, "$path")) {
while (<IN>) {
if (/(\$[I][d]: .*\$)/) {
$idstr = $1;
last;
}
}
close(IN);
}
return $idstr;
}
+24 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# $Id: genservice,v 1.4 2002/08/20 19:26:23 mdb Exp $
# $Id: genservice,v 1.5 2002/08/20 19:36:43 mdb Exp $
#
# This script is used to generate invocation service marshaller and
# unmarshaller classes based on invocation service interface definitions.
@@ -225,7 +225,8 @@ while ($srcfile = shift) {
$mimports{"com.threerings.presents.data.InvocationMarshaller"} = 1;
$mimports{"com.threerings.presents.dobj.InvocationResponseEvent"} = 1;
my @mimportsl = sort keys %mimports;
my %mdata = ( "imports" => \@mimportsl,
my %mdata = ( "idstr" => slurp_idstr($marshpath),
"imports" => \@mimportsl,
"name" => $svcname,
"package" => $marshpkg,
"listeners" => \@listeners,
@@ -258,7 +259,8 @@ while ($srcfile = shift) {
$dimports{"com.threerings.presents.server.InvocationException"} = 1;
$dimports{"$marshpkg.${svcname}Marshaller"} = 1;
my @dimportsl = sort keys %dimports;
my %ddata = ( "imports" => \@dimportsl,
my %ddata = ( "idstr" => slurp_idstr($disppath),
"imports" => \@dimportsl,
"name" => $svcname,
"package" => $disppkg,
"listeners" => \@listeners,
@@ -444,3 +446,22 @@ sub gen_listener_args {
}
return \@listener_args;
}
#
# If the specified file exists, it is opened and its RCS Id string is read
# and returned.
#
sub slurp_idstr {
my ($path) = @_;
my $idstr = "\$Id\$";
if (-f $path && open(IN, "$path")) {
while (<IN>) {
if (/(\$[I][d]: .*\$)/) {
$idstr = $1;
last;
}
}
close(IN);
}
return $idstr;
}