diff --git a/bin/genreceiver b/bin/genreceiver index 51aabecb7..aed8cade1 100755 --- a/bin/genreceiver +++ b/bin/genreceiver @@ -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 () { + if (/(\$[I][d]: .*\$)/) { + $idstr = $1; + last; + } + } + close(IN); + } + return $idstr; +} diff --git a/bin/genservice b/bin/genservice index 738bace91..4160b7491 100755 --- a/bin/genservice +++ b/bin/genservice @@ -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 () { + if (/(\$[I][d]: .*\$)/) { + $idstr = $1; + last; + } + } + close(IN); + } + return $idstr; +}