[Bps-public-commit] Shipwright branch, master, updated. 1f7c96ab21ca56c76cec97be43773d1fbe6f029c

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Jul 16 01:05:03 EDT 2009


The branch, master has been updated
       via  1f7c96ab21ca56c76cec97be43773d1fbe6f029c (commit)
       via  6d04e37a3d7d7818e55a443cb86ec701a4b993d2 (commit)
       via  9873d4f558423df29e230403b969b932c72f95ee (commit)
       via  7f9d2a2106d770a46363f1a655586619d22c651b (commit)
      from  3fca7b89a55fe2cf9f4e7fffd56e84550297b665 (commit)

Summary of changes:
 share/bin/shipwright-builder |   43 +++++++++++++++++++++++++++++++++--------
 share/bin/shipwright-filter  |    2 +-
 share/etc/shipwright-utility |   21 +++++++++++++++++--
 3 files changed, 53 insertions(+), 13 deletions(-)

- Log -----------------------------------------------------------------
commit 7f9d2a2106d770a46363f1a655586619d22c651b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 16 12:26:00 2009 +0800

    added as arg to build multiple arch libs

diff --git a/share/bin/shipwright-builder b/share/bin/shipwright-builder
index 5be1f66..6398948 100755
--- a/share/bin/shipwright-builder
+++ b/share/bin/shipwright-builder
@@ -25,19 +25,19 @@ my %args;
 
 use Getopt::Long;
 confess "unknown option"
-  unless GetOptions(
+unless GetOptions(
     \%args,                   'install-base=s',
     'perl=s',                 'skip=s',
     'flags=s',                'skip-test',
     'skip-test-except-final', 'only-test',
-    'skip-man-pages',
-    'force',                  'clean',
-    'name=s',                 'help', 'advanced-help',
+    'skip-man-pages',         'force',
+    'clean',                  'name=s',
+    'help',                   'advanced-help',
     'noclean',                'only=s',
     'with=s',                 'noclean-after-install',
     'make=s',                 'branches=s',
-    'verbose',
-  );
+    'verbose',                'as=s',
+);
 
 my $USAGE = <<'END';
 run: ./bin/shipwright-builder
@@ -123,6 +123,7 @@ $args{flags} = {
 $args{with} = { map { split /=/ } split /\s*,\s*/, $args{with} || '' };
 $args{branches} = { map { split /=/ } split /\s*,\s*/, $args{branches} || '' };
 $args{make} ||= 'make';
+$args{as} ||= '';
 
 if ( $args{only} ) {
     $args{only} = { map { $_ => 1 } split /\s*,\s*/, $args{only} };
@@ -152,10 +153,10 @@ unless ( $args{'install-base'} ) {
 
 my $installed;
 my $installed_hash = {};
-my $installed_file = catfile( $args{'install-base'}, 'installed.yml' );
+my $installed_file = catfile( $args{'install-base'}, "$args{as}_installed.yml" );
 if ( -e $installed_file ) {
     $installed =
-      YAML::Tiny->read( catfile( $args{'install-base'}, 'installed.yml' ) );
+      YAML::Tiny->read( catfile( $args{'install-base'}, '$args{as}installed.yml' ) );
     $installed_hash = { map { $_ => 1 } @{ $installed->[0] } };
 }
 else {
@@ -348,6 +349,13 @@ sub install {
     chmod oct 755,
       catfile( $args{'install-base'}, 'tools', 'shipwright-utility' );
 
+    my $lib_dir = catfile( $args{'install-base'}, 'lib' );
+
+    if ( $args{as} ) {
+        # remove lib/ if it's symbolic link
+        unlink $lib_dir if -l $lib_dir;
+    }
+
     mkdir 'dists' unless -e 'dists';
     for my $dist (@$order) {
         _install( $dist, $log );
@@ -365,6 +373,23 @@ sub install {
     }
 
     wrap_bin($log) unless $^O =~ /MSWin/;
+
+    if ( $args{as} ) {
+        my $cwd = getcwd;
+        chdir $args{'install-base'};
+        mkdir 'as';
+        my $as_dir = catdir( 'as', $args{as} );
+        if ( -e $as_dir ) {
+            warn "$as_dir already exists, won't overwrite";
+        }
+        else {
+            my $cwd = getcwd;
+            system("mv lib $as_dir");
+            symlink $as_dir, 'lib';
+        }
+        chdir $cwd;
+    }
+
     print "install finished, the dists are at $args{'install-base'}\n";
     print $log "install finished, the dists are at $args{'install-base'}\n";
 }

commit 9873d4f558423df29e230403b969b932c72f95ee
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 16 12:50:11 2009 +0800

    add --switch arg in share/etc/shipwright-utility

diff --git a/share/etc/shipwright-utility b/share/etc/shipwright-utility
index 42d854b..d08914a 100755
--- a/share/etc/shipwright-utility
+++ b/share/etc/shipwright-utility
@@ -8,10 +8,11 @@ use Cwd;
 use Carp;
 
 my %args;
-GetOptions( \%args, 'install-links=s', 'help' );
+GetOptions( \%args, 'install-links=s', 'switch=s', 'help' );
 
 my $USAGE = <<'END'
-run: ./tools/shipwright-utility --install-links
+run: ./tools/shipwright-utility --install-links /usr/local
+run: ./tools/shipwright-utility --switch ubuntu
 
 options: 
 
@@ -20,6 +21,9 @@ help: print this usage
 install-links: link files in bin, sbin, or libexec to other places
     e.g. --install-links /usr/local
 
+switch: switch to the lib below as/$name
+    e.g. --switch ubuntu
+
 END
   ;
 
@@ -45,4 +49,15 @@ elsif ( $args{'install-links'} ) {
         }
     }
 }
-
+elsif ( $args{'switch'} ) {
+    my $name = $args{'switch'};
+    my $as_dir = catdir( 'as', $name );
+    if ( -e $as_dir ) {
+        unlink 'lib';
+        symlink $as_dir, 'lib';
+        print "switched to $name with success.\n";
+    }
+    else {
+        print "no switch name $name exists\n";
+    }
+}

commit 6d04e37a3d7d7818e55a443cb86ec701a4b993d2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 16 12:51:35 2009 +0800

    tiny fix

diff --git a/share/bin/shipwright-builder b/share/bin/shipwright-builder
index 6398948..cd4e7ba 100755
--- a/share/bin/shipwright-builder
+++ b/share/bin/shipwright-builder
@@ -155,8 +155,8 @@ my $installed;
 my $installed_hash = {};
 my $installed_file = catfile( $args{'install-base'}, "$args{as}_installed.yml" );
 if ( -e $installed_file ) {
-    $installed =
-      YAML::Tiny->read( catfile( $args{'install-base'}, '$args{as}installed.yml' ) );
+    $installed = YAML::Tiny->read(
+        catfile( $args{'install-base'}, '$args{as}_installed.yml' ) );
     $installed_hash = { map { $_ => 1 } @{ $installed->[0] } };
 }
 else {

commit 1f7c96ab21ca56c76cec97be43773d1fbe6f029c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 16 12:52:03 2009 +0800

    pod fix

diff --git a/share/bin/shipwright-filter b/share/bin/shipwright-filter
index 1df1c5f..ec11c4f 100755
--- a/share/bin/shipwright-filter
+++ b/share/bin/shipwright-filter
@@ -12,7 +12,7 @@ confess "unknown option"
   unless GetOptions( \%args, 'remove-pod', 'help' );
 
 my $USAGE = <<'END'
-run: ./bin/shipwright-utility --remove-pod
+run: ./bin/shipwright-filter --remove-pod
 
 options: 
 

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



More information about the Bps-public-commit mailing list