public
Description: Easy OS package generation
Homepage: http://dpkg-tools.rubyforge.org/
Clone URL: git://github.com/fidothe/dpkg-tools.git
Improved the intelligence of arch-specific package creation for gems [#12 
state:resolved]
fidothe (author)
Thu Jul 03 07:54:06 -0700 2008
commit  06e8d4537f41e946c04c730c3dd8fc0b08c2b320
tree    c7387870cdf7ceb47b02f0bf1e34dc6b1ccb17a1
parent  570e8510a8ef4c14b0de8e4537af69a543c3ffd5
...
94
95
96
 
 
 
 
97
98
99
...
94
95
96
97
98
99
100
101
102
103
0
@@ -94,6 +94,10 @@ module DpkgTools
0
         "all"
0
       end
0
       
0
+ def build_system_architecture
0
+ IO.popen('dpkg-architecture -qDEB_BUILD_ARCH').gets.chomp
0
+ end
0
+
0
       def architecture_independent?
0
         debian_arch == 'all'
0
       end
...
67
68
69
70
 
71
72
73
...
67
68
69
 
70
71
72
73
0
@@ -67,7 +67,7 @@ module DpkgTools
0
         
0
         def debian_arch
0
           return 'all' if @spec.extensions.empty?
0
- 'i386'
0
+ build_system_architecture
0
         end
0
         
0
         def build_dependencies
...
1
 
2
3
4
...
30
31
32
 
 
 
 
 
 
 
33
34
35
...
1
2
3
4
5
...
31
32
33
34
35
36
37
38
39
40
41
42
43
0
@@ -1,4 +1,5 @@
0
 require File.dirname(__FILE__) + '/../../spec_helper'
0
+require 'stringio'
0
 
0
 describe DpkgTools::Package::Data, "instances" do
0
   before(:each) do
0
@@ -30,6 +31,13 @@ describe DpkgTools::Package::Data, "instances" do
0
     @data.stubs(:debian_arch).returns('i386')
0
     @data.architecture_independent?.should be_false
0
   end
0
+
0
+ it "should be able to return the underlying build arch" do
0
+ io = StringIO.new("amd64\n")
0
+ IO.expects(:popen).with('dpkg-architecture -qDEB_BUILD_ARCH').returns(io)
0
+
0
+ @data.build_system_architecture.should == "amd64"
0
+ end
0
 end
0
 
0
 describe DpkgTools::Package::Data::YamlConfigHelpers do
...
143
144
145
146
147
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
150
151
...
143
144
145
 
 
 
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
0
@@ -143,9 +143,20 @@ describe DpkgTools::Package::Gem::Data, "instances" do
0
     @data.debian_arch.should == "all"
0
   end
0
   
0
- it "should provide report the debian architecture name as i386 if spec.extensions is not empty" do
0
- @spec.stubs(:extensions).returns(['extconf.rb'])
0
- @data.debian_arch.should == "i386"
0
+ describe "reporting debian archtecture when spec.extensions is not empty" do
0
+ before(:each) do
0
+ @spec.stubs(:extensions).returns(['extconf.rb'])
0
+ end
0
+
0
+ it "should report the debian architecture name as i386 when the underlying system is too" do
0
+ @data.stubs(:build_system_architecture).returns("i386")
0
+ @data.debian_arch.should == "i386"
0
+ end
0
+
0
+ it "should report the debian architecture name as amd64 when the underlying system is too" do
0
+ @data.stubs(:build_system_architecture).returns("amd64")
0
+ @data.debian_arch.should == "amd64"
0
+ end
0
   end
0
   
0
   it "should be able to generate a sensible list of deps" do

Comments

    No one has commented yet.