[Bps-public-commit] r10287 - bpsbuilder/BPB/lib/BPB/Backend

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Jan 11 09:25:44 EST 2008


Author: sunnavy
Date: Fri Jan 11 09:25:43 2008
New Revision: 10287

Modified:
   bpsbuilder/BPB/lib/BPB/Backend/SVK.pm
   bpsbuilder/BPB/lib/BPB/Backend/SVN.pm

Log:
added propset method, and bin/bpb-builder should have svn:executable prop

Modified: bpsbuilder/BPB/lib/BPB/Backend/SVK.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Backend/SVK.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Backend/SVK.pm	Fri Jan 11 09:25:43 2008
@@ -12,7 +12,7 @@
 # all the dependance packages will be in //local/test/deps
 # the bpb's stuff will be in //local/test/bpb
 
-our %REQUIRE_OPTIONS = ( import => [qw/source/], );
+our %REQUIRE_OPTIONS = ( import => [qw/source/] );
 
 use base qw/Class::Accessor::Fast/;
 __PACKAGE__->mk_accessors(qw/repository log/);
@@ -53,6 +53,11 @@
         _initialize => 1,
         comment     => 'created project',
     );
+    $self->propset(
+        path  => 'bin/bpb-builder',
+        type  => 'svn:executable',
+        value => '*'
+    );
 }
 
 =head2 import
@@ -177,6 +182,15 @@
     elsif ( $type eq 'info' ) {
         $cmd = [ 'svk', 'info', join '/', $self->repository, $args{path} ];
     }
+    elsif ( $type eq 'propset' ) {
+        $cmd = [
+            'svk',                                'propset',
+            $args{type},                          '-m',
+            q{'} . "set prop $args{type}" . q{'}, q{'} . $args{value} . q{'},
+            join '/',                             $self->repository,
+            $args{path}
+        ];
+    }
     else {
         croak "invalid command: $type";
     }
@@ -218,7 +232,7 @@
         s{/$}{};
         my ($string) = BPB::Util->run(
             [ 'svk', 'cat', $self->repository . "/scripts/$_/require.yml" ] );
-        my $req    = BPB::Config::Load($string);
+        my $req = BPB::Config::Load($string);
         $require->{$_} = [ keys %$req ];
     }
 
@@ -274,6 +288,13 @@
     return $info;
 }
 
+sub propset {
+    my $self = shift;
+    my %args = @_;
+    my ( $info, $err ) = BPB::Util->run( $self->_cmd( propset => %args ) );
+    $self->log->warn($err) if $err;
+}
+
 1;
 
 __END__

Modified: bpsbuilder/BPB/lib/BPB/Backend/SVN.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Backend/SVN.pm	(original)
+++ bpsbuilder/BPB/lib/BPB/Backend/SVN.pm	Fri Jan 11 09:25:43 2008
@@ -53,6 +53,11 @@
         comment     => 'create project',
         _initialize => 1,
     );
+    $self->propset(
+        path  => 'bin/bpb-builder',
+        type  => 'svn:executable',
+        value => '*'
+    );
 }
 
 =head2 import
@@ -173,6 +178,13 @@
     elsif ( $type eq 'info' ) {
         $cmd = [ 'svn', 'info', join '/', $self->repository, $args{path} ];
     }
+    elsif ( $type eq 'propset' ) {
+        $cmd = [
+            'svn',       'propset',
+            $args{type}, q{'} . $args{value} . q{'},
+            $args{path}
+        ];
+    }
     else {
         croak "invalid command: $type";
     }
@@ -213,7 +225,7 @@
         s{/$}{};
         my ($string) = BPB::Util->run(
             [ 'svn', 'cat', $self->repository . "/scripts/$_/require.yml" ] );
-        my $req    = BPB::Config::Load($string);
+        my $req = BPB::Config::Load($string);
         $require->{$_} = [ keys %$req ];
     }
 
@@ -272,6 +284,27 @@
     return $info;
 }
 
+sub propset {
+    my $self = shift;
+    my %args = @_;
+    my $dir  = tempdir( CLEANUP => 1 );
+
+    $self->checkout(
+        target => $dir,
+    );
+    BPB::Util->run(
+        $self->_cmd(
+            propset => %args,
+            path => File::Spec->catfile( $dir, $args{path} )
+        )
+    );
+
+    $self->commit(
+        path    => File::Spec->catfile( $dir, $args{path} ),
+        comment => "set prop $args{type}"
+    );
+}
+
 1;
 
 __END__



More information about the Bps-public-commit mailing list