[Bps-public-commit] Prophet branch, master, updated. 0.73-2-ge121be5

jesse jesse at bestpractical.com
Tue Sep 15 12:07:07 EDT 2009


The branch, master has been updated
       via  e121be59fd6397f0892f169ca02de5e973f84ddd (commit)
      from  2b820fe1edc071da8cc72d1de7f90f37d00513dd (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Pull.pm |    3 ++-
 lib/Prophet/Server.pm           |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit e121be59fd6397f0892f169ca02de5e973f84ddd
Author: Pedro Melo <melo at simplicidade.org>
Date:   Fri Aug 28 18:14:11 2009 +0100

    Annouce project_name via Bonjour
    
    The previous Bonjour annoncement included only the UUID of the source.
    That is not very helpfull to decide which source to use.
    
    This change updates the Bonjour annoucement to include both the
    project_name and the UUID.
    
    The pull --local code was updated to deal with both new and old servers,
    but old clients will not see new servers.
    
    Signed-off-by: Pedro Melo <melo at simplicidade.org>

diff --git a/lib/Prophet/CLI/Command/Pull.pm b/lib/Prophet/CLI/Command/Pull.pm
index 8c2a0bd..b8b69af 100644
--- a/lib/Prophet/CLI/Command/Pull.pm
+++ b/lib/Prophet/CLI/Command/Pull.pm
@@ -101,7 +101,8 @@ sub find_bonjour_sources {
             my $res = Net::Bonjour->new('prophet');
             $res->discover;
             for my $entry ( $res->entries ) {
-                if ( $entry->name eq $db_uuid ) {
+                my $name = $entry->name;
+                if ( $name eq $db_uuid || $name =~ m/[(]$db_uuid[)]$/ ) {
                     print "Found a database replica on " . $entry->hostname."\n";
                     require URI;
                     my $uri = URI->new();
diff --git a/lib/Prophet/Server.pm b/lib/Prophet/Server.pm
index 8b0a6df..3c1d0e0 100644
--- a/lib/Prophet/Server.pm
+++ b/lib/Prophet/Server.pm
@@ -41,8 +41,10 @@ sub run {
     eval { require File::ShareDir }  || return "Without File::ShareDir installed, Prophet's Web UI won't work";
 
     if ($publisher) {
+        my $name = $self->app_handle->setting( label => 'project_name' )->get->[0];
+        my $uuid = $self->handle->db_uuid;
         $publisher->publish(
-            name   => $self->handle->db_uuid,
+            name   => "$name ($uuid)",
             type   => '_prophet._tcp',
             port   => $self->port,
             domain => 'local',

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list