[Bps-public-commit] Prophet branch, master, updated. 0.73-4-ge3645fd

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


The branch, master has been updated
       via  e3645fd6d5dba382fc328aef2ba39dc9cc6b952f (commit)
       via  f089ef5977233e3f2e3de568c9386389a635c8a8 (commit)
      from  e121be59fd6397f0892f169ca02de5e973f84ddd (commit)

Summary of changes:

- Log -----------------------------------------------------------------
commit f089ef5977233e3f2e3de568c9386389a635c8a8
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 99a9dd0..663b521 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',

commit e3645fd6d5dba382fc328aef2ba39dc9cc6b952f
Merge: e121be5 f089ef5
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Sep 16 01:10:42 2009 +0900

    Merge commit 'melo/exp-friendly-bonjour-names'
    
    * commit 'melo/exp-friendly-bonjour-names':
      Annouce project_name via Bonjour


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



More information about the Bps-public-commit mailing list