[Bps-public-commit] r10591 - in bpsbuilder/Shipwright/lib/Shipwright: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jan 30 13:48:59 EST 2008


Author: sunnavy
Date: Wed Jan 30 13:48:59 2008
New Revision: 10591

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

Log:
added etc/shipwright-utility

Modified: bpsbuilder/Shipwright/lib/Shipwright/Backend.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Backend.pm	Wed Jan 30 13:48:59 2008
@@ -332,12 +332,24 @@
 
     mkdir File::Spec->catfile( $args{'install-base'},       'etc' )
       unless -e File::Spec->catfile( $args{'install-base'}, 'etc' );
+    mkdir File::Spec->catfile( $args{'install-base'},       'tools' )
+      unless -e File::Spec->catfile( $args{'install-base'}, 'tools' );
 
     for ( 'shipwright-script-wrapper', 'shipwright-perl-wrapper' ) {
         copy( File::Spec->catfile( 'etc', $_ ),
             File::Spec->catfile( $args{'install-base'}, 'etc', $_ ) );
     }
 
+    copy(
+        File::Spec->catfile( 'etc', 'shipwright-utility' ),
+        File::Spec->catfile(
+            $args{'install-base'}, 'tools', 'shipwright-utility'
+        )
+    );
+    chmod 0755,
+      File::Spec->catfile( $args{'install-base'}, 'tools',
+        'shipwright-utility' );
+
     for my $dist (@$order) {
         unless ( grep { $dist eq $_ } @{ $args{skip} } ) {
             install($dist);
@@ -556,6 +568,56 @@
 }
 EOF
 , 
+installed_utility => <<'EOF'
+#!/usr/bin/env perl 
+use strict;
+use warnings;
+
+use Getopt::Long;
+use File::Spec;
+use Cwd;
+
+my %args;
+GetOptions( \%args, 'install-links=s', 'help' );
+
+my $USAGE = <<'END'
+run: ./tools/shipwright-utility --install-links
+
+options: 
+
+help: print this usage
+
+install-links: link files in bin, sbin, or libexec to other places
+    e.g. --install-links /usr/local
+
+END
+  ;
+
+if ( $args{'help'} ) {
+    print $USAGE;
+}
+elsif ( $args{'install-links'} ) {
+    my $cwd = getcwd();
+
+    for my $dir (qw/bin sbin libexec/) {
+        next unless -e $dir;
+        my $dh;
+        opendir $dh, $dir or die $!;
+
+        mkdir File::Spec->catfile( $args{'install-links'},       $dir )
+          unless -e File::Spec->catfile( $args{'install-links'}, $dir );
+        my @files = readdir $dh;
+        for (@files) {
+            next if $_ eq '.' || $_ eq '..';
+            symlink File::Spec->catfile( $cwd, $dir, $_ ),
+              File::Spec->catfile( $args{'install-links'}, $dir, $_ ) or die
+                  $!;
+        }
+    }
+}
+
+EOF
+,
 null => '',    
 );
 

Modified: bpsbuilder/Shipwright/lib/Shipwright/Backend/SVK.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Backend/SVK.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Backend/SVK.pm	Wed Jan 30 13:48:59 2008
@@ -47,6 +47,8 @@
           'wrapper',
         File::Spec->catfile( $dir, 'etc', 'shipwright-perl-wrapper' ) =>
           'perl_wrapper',
+        File::Spec->catfile( $dir, 'etc', 'shipwright-utility' ) =>
+          'installed_utility',
         File::Spec->catfile( $dir, 'bin', 'shipwright-builder' ) => 'builder',
         File::Spec->catfile( $dir, 'bin', 'shipwright-utility' ) => 'utility',
         File::Spec->catfile( $dir, 't',          'test' )      => 'null',
@@ -69,7 +71,7 @@
     for (
         'bin/shipwright-builder',      'bin/shipwright-utility',
         'etc/shipwright-perl-wrapper', 'etc/shipwright-script-wrapper',
-        't/test'
+        't/test', 'etc/shipwright-utility',
       )
     {
         $self->propset(

Modified: bpsbuilder/Shipwright/lib/Shipwright/Backend/SVN.pm
==============================================================================
--- bpsbuilder/Shipwright/lib/Shipwright/Backend/SVN.pm	(original)
+++ bpsbuilder/Shipwright/lib/Shipwright/Backend/SVN.pm	Wed Jan 30 13:48:59 2008
@@ -47,6 +47,8 @@
           'wrapper',
         File::Spec->catfile( $dir, 'etc', 'shipwright-perl-wrapper' ) =>
           'perl_wrapper',
+        File::Spec->catfile( $dir, 'etc', 'shipwright-utility' ) =>
+          'installed_utility',
         File::Spec->catfile( $dir, 'bin', 'shipwright-builder' ) => 'builder',
         File::Spec->catfile( $dir, 'bin', 'shipwright-utility' ) => 'utility',
         File::Spec->catfile( $dir, 't',   'test' )               => 'null',
@@ -70,7 +72,7 @@
     for (
         'bin/shipwright-builder',      'bin/shipwright-utility',
         'etc/shipwright-perl-wrapper', 'etc/shipwright-script-wrapper',
-        't/test'
+        't/test', 'etc/shipwright-utility',
       )
     {
         $self->propset(



More information about the Bps-public-commit mailing list