[Bps-public-commit] Prophet branch, master, updated. 5e4663109c9588ea3b3d5da9345a73bf917d69b5

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Aug 14 07:51:14 EDT 2009


The branch, master has been updated
       via  5e4663109c9588ea3b3d5da9345a73bf917d69b5 (commit)
      from  0c71f46516e052813085c706b393cb1dfaabc9c8 (commit)

Summary of changes:
 lib/Prophet/CLI/Command.pm       |    6 ++++--
 lib/Prophet/CLI/Command/Clone.pm |    6 ++++--
 lib/Prophet/CLI/Command/Init.pm  |    4 +++-
 3 files changed, 11 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 5e4663109c9588ea3b3d5da9345a73bf917d69b5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Aug 14 19:51:05 2009 +0800

    tweak a bit: subsection can *not* contain unescaped \

diff --git a/lib/Prophet/CLI/Command.pm b/lib/Prophet/CLI/Command.pm
index 22274e2..40a6f9f 100644
--- a/lib/Prophet/CLI/Command.pm
+++ b/lib/Prophet/CLI/Command.pm
@@ -258,15 +258,17 @@ sub record_replica_in_config {
 
     if ( !$found_prev_replica ) {
         # replica section doesn't exist at all; create a new one
+	    my $url = $replica_url;
+	    $url =~ s!\\!\\\\!g; # subsection can't contain unescaped \
         $self->app_handle->config->group_set(
             $self->app_handle->config->replica_config_file,
             [
             {
-                key => "replica.$replica_url.$url_variable",
+                key => "replica.$url.$url_variable",
                 value => $replica_url,
             },
             {
-                key => "replica.$replica_url.uuid",
+                key => "replica.$url.uuid",
                 value => $replica_uuid,
             },
             ],
diff --git a/lib/Prophet/CLI/Command/Clone.pm b/lib/Prophet/CLI/Command/Clone.pm
index 9e27331..b6fe84a 100644
--- a/lib/Prophet/CLI/Command/Clone.pm
+++ b/lib/Prophet/CLI/Command/Clone.pm
@@ -54,13 +54,15 @@ sub run {
     $target->initialize(%init_args);
 
     # create new config section for this replica
+    my $from = $self->arg('from');
+	$from =~ s!\\!\\\\!g; # subsection can't contain unescaped \
     $self->app_handle->config->group_set(
         $self->app_handle->config->replica_config_file,
         [ {
-            key => 'replica.'.$self->arg('from').'.url',
+            key => 'replica.'.$from.'.url',
             value => $self->arg('from'),
         },
-        {   key => 'replica.'.$self->arg('from').'.uuid',
+        {   key => 'replica.'.$from.'.uuid',
             value => $target->uuid,
         },
         ]
diff --git a/lib/Prophet/CLI/Command/Init.pm b/lib/Prophet/CLI/Command/Init.pm
index e03247b..32b7229 100644
--- a/lib/Prophet/CLI/Command/Init.pm
+++ b/lib/Prophet/CLI/Command/Init.pm
@@ -28,8 +28,10 @@ sub run {
     print "Initialized your new Prophet database.\n";
 
     # create new config section for this replica
+    my $url = $self->app_handle->handle->url;
+	$url =~ s!\\!\\\\!g; # subsection can't contain unescaped \
     $self->app_handle->config->set(
-        key => 'replica.'.$self->app_handle->handle->url.'.uuid',
+        key => 'replica.'.$url.'.uuid',
         value => $self->app_handle->handle->uuid,
         filename => $self->app_handle->config->replica_config_file,
     );

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



More information about the Bps-public-commit mailing list