I have attached a text file of how to use the command interface that I
have suggested.
Thanks
Rob
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Hudson
Sent: 18 January 2007 15:45
To: [email protected]
Subject: [scmbug-users] Generic Run Command for the Daemon
Hi Kristis,
I have been messing about with some Subversion hook code to
convert documents to PDF when they are committed to the repository. I
had a problem where I could not get a remote user to get the spawned PDF
converter to run (It just hung). [Running directly on the machine worked
successfully].
I found a solution with the help of the Scmbug Daemon. I added
an extra interface to the Scmbug Daemon that simply ran a command that
was passed to it. It worked a treat. The additional code for Scmbug
was only a few lines and I think it means that the Daemon can be re-used
for other simple tasks.
In my case it saves me having to run two daemons on the same
machine (And obviously I get to re-use all the code that you have
already written).
Would you be willing to integrate this change to scmbug for me?
(It would mike my life a hell of a lot easier!)
I know it isn't strictly source control related, but it is a
very generic interface that I think could be useful to a lot of people.
Thanks
Rob
How to Use the Run Command Interface
====================================
The run command interface on the Scmbug Daemon enables you to utilise
an existing scmbug Daemon in order to run a given command. You will
need to have already installed the Daemon and the Glue in order for
this to work. The following is an example snippet of Perl to
illustrate what will be required in your file
Example Perl File
=================
use Scmbug::Common qw (
$ACTIVITY_RUN_CMD
);
use Scmbug::Connection;
sub new {
my $type = shift;
my $self = {};
bless $self, $type;
$config_info = shift;
my $conn = Scmbug::Connection->new() ;
# Set the port and location for the Daemon
$conn->port( 3333 );
$conn->location( "localhost" );
$self->connection( $conn );
return $self;
}
sub connection {
my $self = shift;
my $data = shift;
if ( $data ) {
$self->{ connection } = $data;
} else {
return $self->{ connection };
}
}
sub make_cmd_line_call {
my $self = shift;
my $the_cmd = "PUT COMMAND HERE";
my $new_activity = Scmbug::Activity->new();
$new_activity->name( $ACTIVITY_RUN_CMD );
$new_activity->user( "the_user" );
$new_activity->product_name( "" );
$new_activity->repository( "" );
$new_activity->{ run_cmd } = $pdfconverter;
# Process this tagging activity as well
$self->connection()->process_activity( $new_activity );
}
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users