[Bps-public-commit] r15402 - Shipwright/branches/1.10/lib/Shipwright/Source

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Aug 22 23:29:48 EDT 2008


Author: sunnavy
Date: Fri Aug 22 23:29:47 2008
New Revision: 15402

Modified:
   Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm

Log:
merged 15401 to 1.1

Modified: Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Source/Base.pm	Fri Aug 22 23:29:47 2008
@@ -117,13 +117,21 @@
                 my $shipwright_makefile = <<'EOF';
 my $shipwright_req = {};
 
+sub _shipwright_requires {
+    my $type = shift;
+    my %req  = @_;
+    for my $name ( keys %req ) {
+        $shipwright_req->{$type}{$name} = $req{$name};
+    }
+}
+
 sub shipwright_requires {
-    $shipwright_req->{requires}{$_[0]} = $_[1] || 0;
+    _shipwright_requires( 'requires', @_ == 1 ? ( @_, 0 ) : @_ );
     goto &requires;
 }
 
 sub shipwright_build_requires {
-    $shipwright_req->{build_requires}{$_[0]} = $_[1] || 0;
+    _shipwright_requires( 'build_requires', @_ == 1 ? ( @_, 0 ) : @_ );
     goto &build_requires;
 }
 



More information about the Bps-public-commit mailing list