[Bps-public-commit] r11119 - in Shipwright/trunk: lib/Shipwright/Script
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Wed Mar 19 10:56:44 EDT 2008
Author: sunnavy
Date: Wed Mar 19 10:56:39 2008
New Revision: 11119
Modified:
Shipwright/trunk/lib/Shipwright/Script/Build.pm
Shipwright/trunk/share/bin/shipwright-builder
Log:
set the name as foo-1.0 if the repository or build_base ends with foo/1.0
Modified: Shipwright/trunk/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Build.pm (original)
+++ Shipwright/trunk/lib/Shipwright/Script/Build.pm Wed Mar 19 10:56:39 2008
@@ -41,8 +41,13 @@
die "need repository arg" unless $self->repository;
- if ( ! $self->name && $self->repository =~ /([-.\w]+)$/ ) {
- $self->name( $1 );
+ unless ( $self->name ) {
+ if ( $self->repository =~ m{([-.\w]+)/([.\d]+)$} ) {
+ $self->name( "$1-$2" );
+ }
+ elsif ( $self->repository =~ /([-.\w]+)$/ ) {
+ $self->name( $1 );
+ }
}
$self->skip( { map { $_ => 1 } split /\s*,\s*/, $self->skip || '' } );
Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder (original)
+++ Shipwright/trunk/share/bin/shipwright-builder Wed Mar 19 10:56:39 2008
@@ -116,12 +116,18 @@
$CPAN::Config->{prerequisites_policy} = 'ignore';
}
- my $name = $args{'name'};
- ($name) = $build_base =~ /([-.\w]+)$/ unless $name;
+ unless ( $args{name} ) {
+ if ( $build_base =~ m{([-.\w]+)[\\/]([.\d]+)$} ) {
+ $args{name} = "$1-$2";
+ }
+ elsif ( $build_base =~ m{([-.\w]+)$} ) {
+ $args{name} = $1;
+ }
+ }
unless ( $args{'install-base'} ) {
- my $dir = tempdir( $name . '-XXXXXX', DIR => File::Spec->tmpdir );
- $args{'install-base'} = File::Spec->catfile( $dir, $name );
+ my $dir = tempdir( $args{name} . '-XXXXXX', DIR => File::Spec->tmpdir );
+ $args{'install-base'} = File::Spec->catfile( $dir, $args{name} );
print $log
"no default install-base, will set it to $args{'install-base'}\n";
More information about the Bps-public-commit
mailing list