[Bps-public-commit] Shipwright branch, master, updated. 1200a777dbde64cc86b62ccd685b8ec5f445d26c

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jul 20 03:56:18 EDT 2009


The branch, master has been updated
       via  1200a777dbde64cc86b62ccd685b8ec5f445d26c (commit)
       via  a6c576c4f8514b39a941aed17dcdcf9f87e83a49 (commit)
      from  65c21d505e3eb3cdf953154c1364a4718c1593ed (commit)

Summary of changes:
 Changes                             |   10 ++++
 META.yml                            |    2 +-
 lib/Shipwright.pm                   |    2 +-
 share/bin/shipwright-builder        |   78 +++++++++++++++++------------------
 share/etc/shipwright-perl-wrapper   |   30 +++++++++++---
 share/etc/shipwright-script-wrapper |   26 +++++++++--
 share/etc/shipwright-utility        |   26 +++--------
 7 files changed, 102 insertions(+), 72 deletions(-)

- Log -----------------------------------------------------------------
commit a6c576c4f8514b39a941aed17dcdcf9f87e83a49
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 15:39:34 2009 +0800

    no bin-wrapped any more, we can use bin dir in as/.../ directly

diff --git a/share/bin/shipwright-builder b/share/bin/shipwright-builder
index 3e83b16..c82ceb2 100755
--- a/share/bin/shipwright-builder
+++ b/share/bin/shipwright-builder
@@ -244,7 +244,12 @@ else {
         print "seems it has been built before, need to clean first\n";
         clean();
     }
-    install();
+    if ( @$order ) {
+        install();
+    }
+    else {
+        print "all dists are intalled already\n";
+    }
 }
 
 sub install {
@@ -349,14 +354,8 @@ sub install {
     chmod oct 755,
       catfile( $args{'install-base'}, 'tools', 'shipwright-utility' );
 
-    # remove (usr/)?bin-wrapped, (usr/)?sbin-wrapped and lib if 
-    # they are symbolic links
-    for my $r (
-        'bin-wrapped', 'sbin-wrapped', 'lib',
-        catdir( 'usr', 'bin-wrapped' ),
-        catdir( 'usr', 'sbin-wrapped' ),
-      )
-    {
+    # remove lib it's symbolic link
+    for my $r ( 'lib' ) {
         my $dir = catdir( $args{'install-base'}, $r );
         unlink $dir if -l $dir;
     }
@@ -380,7 +379,7 @@ sub install {
         chdir $build_base;
     }
 
-    mkdir catdir( $args{'install-base'},       'bin' )
+    mkdir catdir( $args{'install-base'}, 'bin' )
       unless -e catdir( $args{'install-base'}, 'bin' );
 
     # in case wrappers are overwritten by accident
@@ -389,38 +388,36 @@ sub install {
             catfile( $args{'install-base'}, 'etc', $_ ) );
     }
 
-    if ( $args{as} ) {
-        my $cwd = getcwd;
-        chdir $args{'install-base'};
-        mkdir 'as';
-        my $as_dir = catdir( 'as', $args{as} );
-        mkdir $as_dir;
+    my $cwd = getcwd;
+    chdir $args{'install-base'};
+    open my $tmp_fh, '>', '__as',
+      or confess "can't wriite to $args{'install-base'}/__as: $!";
+    print $tmp_fh $args{as};
+    close $tmp_fh;
 
-        for my $r ( 'lib', 'bin', 'sbin' ) {
-            next unless -e $r;
-            my $dir = catdir( $as_dir, $r );
-            system( "mv $r $as_dir" );
+    mkdir 'as';
+    my $as_dir = catdir( 'as', $args{as} );
+    mkdir $as_dir;
 
-            if ( $r =~ /bin/ ) {
-                symlink $dir, "$r-wrapped";
-            }
-            else {
-                symlink $dir, $r;
-            }
-        }
+    for my $r ( 'lib', 'bin', 'sbin' ) {
+        next unless -e $r;
+        my $dir = catdir( $as_dir, $r );
+        system("mv $r $as_dir");
 
-        # in usr dir
-        my $usr_dir = catdir( $as_dir, 'usr' );
-        mkdir $usr_dir;
-        for my $r ( 'bin', 'sbin' ) {
-            next unless -e catdir( 'usr', $r );
-            system( "mv " . catdir( 'usr', $r ) . ' ' . $usr_dir ); 
-            my $dir = catdir( '..', $as_dir, 'usr', $r );
-            symlink $dir, catdir( 'usr', "$r-wrapped" );
+        if ( $r !~ /bin/ ) {
+            symlink $dir, $r;
         }
-        chdir $cwd;
     }
 
+    # in usr dir
+    my $usr_dir = catdir( $as_dir, 'usr' );
+    mkdir $usr_dir;
+    for my $r ( 'bin', 'sbin' ) {
+        next unless -e catdir( 'usr', $r );
+        system( "mv " . catdir( 'usr', $r ) . ' ' . $usr_dir );
+    }
+    chdir $cwd;
+
     wrap_bin($log) unless $^O =~ /MSWin/;
 
     print "install finished, the dists are at $args{'install-base'}\n";
@@ -543,14 +540,14 @@ sub wrap_bin {
         return unless -f $file;
 
         my $wrap_dir = $File::Find::dir;
-        $wrap_dir =~ s/-wrapped$//;
+        $wrap_dir =~ s!as/$args{as}/!!;
 
         my $wrap_file = catfile( $wrap_dir, $file );
         my $tmp = $File::Find::dir;
         $tmp =~ s/$args{'install-base'}//g;
         my $wrapped_depth =
           scalar( splitdir($File::Find::dir) ) -
-          scalar( splitdir( $args{'install-base'} ) );
+          scalar( splitdir( $args{'install-base'} ) ) - 2;
 
         mkdir $wrap_dir unless -d $wrap_dir;
 
@@ -600,8 +597,9 @@ sub wrap_bin {
 
     my @dirs =
       grep { -e $_ }
-      map { catdir( $args{'install-base'}, $_ ) } 'bin-wrapped', 'sbin-wrapped',
-      catdir( 'usr', 'bin-wrapped' ), catdir( 'usr', 'sbin-wrapped' );
+      map { catdir( $args{'install-base'}, 'as', $args{as}, $_ ) } 'bin',
+      'sbin',
+      catdir( 'usr', 'bin' ), catdir( 'usr', 'sbin' );
     find( { wanted => $sub, follow => 1 }, @dirs ) if @dirs;
 
 }
diff --git a/share/etc/shipwright-perl-wrapper b/share/etc/shipwright-perl-wrapper
index b5da954..856c716 100755
--- a/share/etc/shipwright-perl-wrapper
+++ b/share/etc/shipwright-perl-wrapper
@@ -6,18 +6,36 @@ else
     LINK=`readlink $0`
 fi
 
+AS=`cat $0/../../__as`;
+if [ "$AS" = '' ]; then
+    AS=`cat $0/../../../__as`;
+fi
+
 if [ "$LINK" = '' ] || [ $LINK = '../etc/shipwright-perl-wrapper' ] || [ $LINK = '../../etc/shipwright-perl-wrapper' ]; then
     BASE=$0
     BASE_DIR=`dirname "$BASE"`
     BASE_DIR=` (cd "$BASE_DIR"; pwd) `
     FILENAME=`basename "$BASE"`
     WRAPPED_DIR=`basename "$BASE_DIR"`
-    PATH=${BASE_DIR}/../sbin:${BASE_DIR}/../bin:${BASE_DIR}/../usr/sbin:${BASE_DIR}/../usr/bin:$PATH \
-    SHIPWRIGHT_PERL=$BASE_DIR/perl \
-    PERL5LIB=${BASE_DIR}/../lib/perl5/site_perl:${BASE_DIR}/../lib/perl5:${PERL5LIB}\
-        LD_LIBRARY_PATH=${BASE_DIR}/../lib:${LD_LIBRARY_PATH}\
-        DYLD_LIBRARY_PATH=${BASE_DIR}/../lib:${DYLD_LIBRARY_PATH}\
-        exec ${BASE_DIR}/../bin-wrapped/perl ${BASE_DIR}/../${WRAPPED_DIR}-wrapped/${FILENAME}  "$@"
+
+    if [ "$LINK" = '../../etc/shipwright-script-wrapper' ]; then
+        PARENT_BASE_DIR=` (cd "$BASE_DIR/.."; pwd) `
+        PARENT_WRAPPED_DIR=`basename "$PARENT_BASE_DIR"`
+        WRAPPED_DIR="$PARENT_WRAPPED_DIR/$WRAPPED_DIR"
+        PATH=${BASE_DIR}/../../sbin:${BASE_DIR}/../../bin:${BASE_DIR}/../sbin:${BASE_DIR}/../bin:$PATH \
+        SHIPWRIGHT_PERL=$BASE_DIR/../../bin/perl \
+        PERL5LIB=${BASE_DIR}/../../lib/perl5/site_perl:${BASE_DIR}/../../lib/perl5:${PERL5LIB}\
+            LD_LIBRARY_PATH=${BASE_DIR}/../../lib:${LD_LIBRARY_PATH}\
+            DYLD_LIBRARY_PATH=${BASE_DIR}/../../lib:${DYLD_LIBRARY_PATH}\
+            exec ${BASE_DIR}/../../as/$AS/bin/perl ${BASE_DIR}/../../as/$AS/${WRAPPED_DIR}/${FILENAME}  "$@"
+    else
+        PATH=${BASE_DIR}/../sbin:${BASE_DIR}/../bin:${BASE_DIR}/../usr/sbin:${BASE_DIR}/../usr/bin:$PATH \
+        SHIPWRIGHT_PERL=$BASE_DIR/../bin/perl \
+        PERL5LIB=${BASE_DIR}/../lib/perl5/site_perl:${BASE_DIR}/../lib/perl5:${PERL5LIB}\
+            LD_LIBRARY_PATH=${BASE_DIR}/../lib:${LD_LIBRARY_PATH}\
+            DYLD_LIBRARY_PATH=${BASE_DIR}/../lib:${DYLD_LIBRARY_PATH}\
+            exec ${BASE_DIR}/../as/$AS/bin/perl ${BASE_DIR}/../as/$AS/${WRAPPED_DIR}/${FILENAME}  "$@"
+    fi
 else
     exec $LINK "$@"
 fi
diff --git a/share/etc/shipwright-script-wrapper b/share/etc/shipwright-script-wrapper
index d529d9c..a0fa5a9 100755
--- a/share/etc/shipwright-script-wrapper
+++ b/share/etc/shipwright-script-wrapper
@@ -6,17 +6,33 @@ else
     LINK=`readlink $0`
 fi
 
+AS=`cat $0/../../__as`;
+if [ "$AS" = '' ]; then
+    AS=`cat $0/../../../__as`;
+fi
+
 if [ "$LINK" = '' ] || [ $LINK = '../etc/shipwright-script-wrapper' ] || [ $LINK = '../../etc/shipwright-script-wrapper' ]; then
     BASE=$0
     BASE_DIR=`dirname "$BASE"`
     BASE_DIR=` (cd "$BASE_DIR"; pwd) `
     FILENAME=`basename "$BASE"`
     WRAPPED_DIR=`basename "$BASE_DIR"`
-    PATH=${BASE_DIR}/../sbin:${BASE_DIR}/../bin:${BASE_DIR}/../usr/sbin:${BASE_DIR}/../usr/bin:$PATH \
-    PERL5LIB=${BASE_DIR}/../lib/perl5/site_perl:${BASE_DIR}/../lib/perl5:${PERL5LIB}\
-        LD_LIBRARY_PATH=${BASE_DIR}/../lib:${LD_LIBRARY_PATH}\
-        DYLD_LIBRARY_PATH=${BASE_DIR}/../lib:${DYLD_LIBRARY_PATH}\
-        exec ${BASE_DIR}/../${WRAPPED_DIR}-wrapped/${FILENAME}  "$@"
+    if [ "$LINK" = '../../etc/shipwright-script-wrapper' ]; then
+        PARENT_BASE_DIR=` (cd "$BASE_DIR/.."; pwd) `
+        PARENT_WRAPPED_DIR=`basename "$PARENT_BASE_DIR"`
+        WRAPPED_DIR="$PARENT_WRAPPED_DIR/$WRAPPED_DIR"
+        PATH=${BASE_DIR}/../../sbin:${BASE_DIR}/../../bin:${BASE_DIR}/../sbin:${BASE_DIR}/../bin:$PATH \
+        PERL5LIB=${BASE_DIR}/../../lib/perl5/site_perl:${BASE_DIR}/../../lib/perl5:${PERL5LIB}\
+            LD_LIBRARY_PATH=${BASE_DIR}/../../lib:${LD_LIBRARY_PATH}\
+            DYLD_LIBRARY_PATH=${BASE_DIR}/../../lib:${DYLD_LIBRARY_PATH}\
+            exec ${BASE_DIR}/../../as/$AS/${WRAPPED_DIR}/${FILENAME}  "$@"
+    else
+        PATH=${BASE_DIR}/../sbin:${BASE_DIR}/../bin:${BASE_DIR}/../usr/sbin:${BASE_DIR}/../usr/bin:$PATH \
+        PERL5LIB=${BASE_DIR}/../lib/perl5/site_perl:${BASE_DIR}/../lib/perl5:${PERL5LIB}\
+            LD_LIBRARY_PATH=${BASE_DIR}/../lib:${LD_LIBRARY_PATH}\
+            DYLD_LIBRARY_PATH=${BASE_DIR}/../lib:${DYLD_LIBRARY_PATH}\
+            exec ${BASE_DIR}/../as/$AS/${WRAPPED_DIR}/${FILENAME}  "$@"
+    fi
 else
     exec $LINK "$@"
 fi
diff --git a/share/etc/shipwright-utility b/share/etc/shipwright-utility
index f555fb4..f7dbeea 100755
--- a/share/etc/shipwright-utility
+++ b/share/etc/shipwright-utility
@@ -53,28 +53,16 @@ elsif ( $args{'switch'} ) {
     my $name = $args{'switch'};
     my $as_dir = catdir( 'as', $name );
     if ( -e $as_dir ) {
-        for my $r ( qw/bin sbin lib/ ) {
+        for my $r ( qw/lib/ ) {
             my $dir = catdir( $as_dir, $r );
             next unless -e $dir;
 
-            if ( $r =~ /bin/ ) {
-                unlink "$r-wrapped";
-                symlink $dir, "$r-wrapped";
-            }
-            else {
+            if ( $r !~ /bin/ ) {
                 unlink $r;
                 symlink $dir, $r;
             }
         }
 
-        # in usr dir
-        for my $r ( qw/bin sbin/ ) {
-            my $dir = catdir( $as_dir, 'usr', $r );
-            next unless -e $dir;
-            unlink catfile( 'usr', "$r-wrapped" );
-            symlink catdir( '..', $dir ), catfile( 'usr', "$r-wrapped" );
-        }
-
         # remove old ones
         for my $dir ( 'bin', 'sbin', catdir( 'usr', 'bin' ),
             catdir( 'usr', 'sbin' ) )
@@ -100,12 +88,12 @@ sub wrap_bin {
         return unless -f $file;
 
         my $wrap_dir = $File::Find::dir;
-        $wrap_dir =~ s/-wrapped$//;
+        $wrap_dir =~ s!as/$args{switch}/!!;
 
         my $wrap_file = catfile( $wrap_dir, $file );
         my $wrapped_depth =
           scalar( splitdir($File::Find::dir) ) -
-          scalar( splitdir($install_base) );
+          scalar( splitdir($install_base) ) - 2;
         mkdir $wrap_dir unless -d $wrap_dir;
 
         # return if it's been wrapped already
@@ -153,8 +141,8 @@ sub wrap_bin {
     };
 
     my @dirs =
-      grep { -e $_ } map { catdir( $install_base, $_ ) } 'bin-wrapped',
-      'sbin-wrapped',
-      catdir( 'usr', 'bin-wrapped' ), catdir( 'usr', 'sbin-wrapped' );
+      grep { -e $_ } map { catdir( $install_base, 'as', $args{switch}, $_ ) } 'bin',
+      'sbin', catdir( 'usr', 'bin' ), catdir( 'usr', 'sbin' );
     find( { wanted => $sub, follow => 1 }, @dirs ) if @dirs;
 }
+

commit 1200a777dbde64cc86b62ccd685b8ec5f445d26c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 20 15:51:02 2009 +0800

    update version to 2.3.0

diff --git a/Changes b/Changes
index 13da8dd..768ab44 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,15 @@
 Revision history for Shipwright
 
+2.3.0 Mon Jul 20 15:40:50 CST 2009
+
+* add multi-arch dists support
+* add --switch option to tools/shipwright-utility in installed dir
+* add shipwright-filter script to trim the installed dist
+    ( currently it's just --remove-pod )
+* update bin wrapper stuff( not back compatible )
+* support requires_from and test_requires_from of Module::Install
+* tweak git backend stuff, e.g. don't ignore things list in .gitignore 
+
 2.2.2 Wed Jul  8 19:11:21 CST 2009
 
 * expand ~ in path
diff --git a/META.yml b/META.yml
index 98f087d..8b3f354 100644
--- a/META.yml
+++ b/META.yml
@@ -50,4 +50,4 @@ requires:
   version: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 2.002002
+version: 2.003000
diff --git a/lib/Shipwright.pm b/lib/Shipwright.pm
index b909b14..3fb327e 100644
--- a/lib/Shipwright.pm
+++ b/lib/Shipwright.pm
@@ -2,7 +2,7 @@ package Shipwright;
 
 use warnings;
 use strict;
-use version; our $VERSION = qv('2.2.2');
+use version; our $VERSION = qv('2.3.0');
 
 use base qw/Class::Accessor::Fast/;
 

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



More information about the Bps-public-commit mailing list