rpm 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/.travis.yml +10 -0
  2. data/ChangeLog +5 -0
  3. data/README.rdoc +11 -1
  4. data/lib/rpm/{ffi → c}/header.rb +1 -1
  5. data/lib/rpm/c/rpmcallback.rb +28 -0
  6. data/lib/rpm/c/rpmcli.rb +7 -0
  7. data/lib/rpm/{ffi → c}/rpmdb.rb +1 -1
  8. data/lib/rpm/{ffi → c}/rpmds.rb +1 -6
  9. data/lib/rpm/{ffi → c}/rpmfi.rb +1 -1
  10. data/lib/rpm/c/rpmio.rb +21 -0
  11. data/lib/rpm/{ffi → c}/rpmlib.rb +1 -1
  12. data/lib/rpm/{ffi → c}/rpmlog.rb +3 -1
  13. data/lib/rpm/{ffi → c}/rpmmacro.rb +1 -10
  14. data/lib/rpm/{ffi → c}/rpmprob.rb +17 -3
  15. data/lib/rpm/{ffi → c}/rpmps.rb +1 -1
  16. data/lib/rpm/{ffi → c}/rpmtag.rb +12 -4
  17. data/lib/rpm/{ffi → c}/rpmtd.rb +1 -1
  18. data/lib/rpm/{ffi → c}/rpmts.rb +6 -2
  19. data/lib/rpm/{ffi → c}/rpmtypes.rb +3 -1
  20. data/lib/rpm/c.rb +47 -0
  21. data/lib/rpm/db.rb +5 -5
  22. data/lib/rpm/dependency.rb +10 -10
  23. data/lib/rpm/gem_version.rb +1 -1
  24. data/lib/rpm/match_iterator.rb +5 -5
  25. data/lib/rpm/package.rb +55 -55
  26. data/lib/rpm/problem.rb +71 -0
  27. data/lib/rpm/transaction.rb +186 -35
  28. data/lib/rpm/version.rb +3 -4
  29. data/lib/rpm.rb +16 -24
  30. data/rpm.gemspec +1 -1
  31. data/test/data/simple-1.0-0.i586.rpm +0 -0
  32. data/test/data/simple.spec +0 -4
  33. data/test/data/simple_with_deps-1.0-0.i586.rpm +0 -0
  34. data/test/data/simple_with_deps.spec +41 -0
  35. data/test/helper.rb +1 -1
  36. data/test/test_dependency.rb +1 -1
  37. data/test/test_lib.rb +13 -13
  38. data/test/test_package.rb +24 -3
  39. data/test/test_problem.rb +20 -0
  40. data/test/test_transaction.rb +115 -14
  41. data/test/test_version.rb +2 -0
  42. metadata +80 -69
  43. data/lib/rpm/ffi/rpmcallback.rb +0 -26
  44. data/lib/rpm/ffi.rb +0 -44
data/test/test_version.rb CHANGED
@@ -27,12 +27,14 @@ class RPM_Version_Tests < Test::Unit::TestCase
27
27
  assert( @a.newer?(@b) )
28
28
  assert( @c.newer?(@a) )
29
29
  assert( @d.newer?(@a) )
30
+ assert( !@a.newer?(@a) )
30
31
  end
31
32
 
32
33
  def test_version_older?
33
34
  assert( @b.older?(@a) )
34
35
  assert( @a.older?(@c) )
35
36
  assert( @a.older?(@d) )
37
+ assert( !@a.older?(@a) )
36
38
  end
37
39
 
38
40
  def test_vre
metadata CHANGED
@@ -1,75 +1,89 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rpm
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Duncan Mac-Vicar P.
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-01-04 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: ffi
12
+ date: 2013-06-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
23
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: ffi
32
+ requirement: !ruby/object:Gem::Requirement
25
33
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
33
38
  type: :runtime
34
- version_requirements: *id001
35
- description: Ruby bindings for rpm. Almost a drop-in replacement for ruby-rpm. Uses FFI.
36
- email:
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Ruby bindings for rpm. Almost a drop-in replacement for ruby-rpm. Uses
47
+ FFI.
48
+ email:
37
49
  - dmacvicar@suse.de
38
50
  executables: []
39
-
40
51
  extensions: []
41
-
42
52
  extra_rdoc_files: []
43
-
44
- files:
53
+ files:
45
54
  - .gitignore
55
+ - .travis.yml
56
+ - ChangeLog
46
57
  - Gemfile
47
58
  - MIT-LICENSE
48
59
  - README.rdoc
49
60
  - Rakefile
50
61
  - lib/rpm.rb
62
+ - lib/rpm/c.rb
63
+ - lib/rpm/c/header.rb
64
+ - lib/rpm/c/rpmcallback.rb
65
+ - lib/rpm/c/rpmcli.rb
66
+ - lib/rpm/c/rpmdb.rb
67
+ - lib/rpm/c/rpmds.rb
68
+ - lib/rpm/c/rpmfi.rb
69
+ - lib/rpm/c/rpmio.rb
70
+ - lib/rpm/c/rpmlib.rb
71
+ - lib/rpm/c/rpmlog.rb
72
+ - lib/rpm/c/rpmmacro.rb
73
+ - lib/rpm/c/rpmprob.rb
74
+ - lib/rpm/c/rpmps.rb
75
+ - lib/rpm/c/rpmtag.rb
76
+ - lib/rpm/c/rpmtd.rb
77
+ - lib/rpm/c/rpmts.rb
78
+ - lib/rpm/c/rpmtypes.rb
51
79
  - lib/rpm/compat.rb
52
80
  - lib/rpm/db.rb
53
81
  - lib/rpm/dependency.rb
54
- - lib/rpm/ffi.rb
55
- - lib/rpm/ffi/header.rb
56
- - lib/rpm/ffi/rpmcallback.rb
57
- - lib/rpm/ffi/rpmdb.rb
58
- - lib/rpm/ffi/rpmds.rb
59
- - lib/rpm/ffi/rpmfi.rb
60
- - lib/rpm/ffi/rpmlib.rb
61
- - lib/rpm/ffi/rpmlog.rb
62
- - lib/rpm/ffi/rpmmacro.rb
63
- - lib/rpm/ffi/rpmprob.rb
64
- - lib/rpm/ffi/rpmps.rb
65
- - lib/rpm/ffi/rpmtag.rb
66
- - lib/rpm/ffi/rpmtd.rb
67
- - lib/rpm/ffi/rpmts.rb
68
- - lib/rpm/ffi/rpmtypes.rb
69
82
  - lib/rpm/file.rb
70
83
  - lib/rpm/gem_version.rb
71
84
  - lib/rpm/match_iterator.rb
72
85
  - lib/rpm/package.rb
86
+ - lib/rpm/problem.rb
73
87
  - lib/rpm/transaction.rb
74
88
  - lib/rpm/utils.rb
75
89
  - lib/rpm/version.rb
@@ -77,57 +91,54 @@ files:
77
91
  - test/data/a.spec
78
92
  - test/data/simple-1.0-0.i586.rpm
79
93
  - test/data/simple.spec
94
+ - test/data/simple_with_deps-1.0-0.i586.rpm
95
+ - test/data/simple_with_deps.spec
80
96
  - test/helper.rb
81
97
  - test/test_dependency.rb
82
98
  - test/test_file.rb
83
99
  - test/test_lib.rb
84
100
  - test/test_package.rb
101
+ - test/test_problem.rb
85
102
  - test/test_rpm.rb
86
103
  - test/test_transaction.rb
87
104
  - test/test_version.rb
88
- has_rdoc: true
89
- homepage: ""
105
+ homepage: ''
90
106
  licenses: []
91
-
92
107
  post_install_message:
93
108
  rdoc_options: []
94
-
95
- require_paths:
109
+ require_paths:
96
110
  - lib
97
- required_ruby_version: !ruby/object:Gem::Requirement
111
+ required_ruby_version: !ruby/object:Gem::Requirement
98
112
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
106
- required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
118
  none: false
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- hash: 3
112
- segments:
113
- - 0
114
- version: "0"
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
115
123
  requirements: []
116
-
117
124
  rubyforge_project: rpm
118
- rubygems_version: 1.6.2
125
+ rubygems_version: 1.8.23
119
126
  signing_key:
120
127
  specification_version: 3
121
128
  summary: Ruby bindings for rpm (package manager)
122
- test_files:
129
+ test_files:
123
130
  - test/data/a.spec
124
131
  - test/data/simple-1.0-0.i586.rpm
125
132
  - test/data/simple.spec
133
+ - test/data/simple_with_deps-1.0-0.i586.rpm
134
+ - test/data/simple_with_deps.spec
126
135
  - test/helper.rb
127
136
  - test/test_dependency.rb
128
137
  - test/test_file.rb
129
138
  - test/test_lib.rb
130
139
  - test/test_package.rb
140
+ - test/test_problem.rb
131
141
  - test/test_rpm.rb
132
142
  - test/test_transaction.rb
133
143
  - test/test_version.rb
144
+ has_rdoc:
@@ -1,26 +0,0 @@
1
- module RPM
2
- module FFI
3
-
4
- enum :rpmCallbackType, [
5
- :unknown, 0,
6
- :inst_progress, (1 << 0),
7
- :inst_start, (1 << 1),
8
- :inst_open_file, (1 << 2),
9
- :inst_close_file, (1 << 3),
10
- :trans_progress, (1 << 4),
11
- :trans_start, (1 << 5),
12
- :trans_stop, (1 << 6),
13
- :uninst_progress, (1 << 7),
14
- :uninst_start, (1 << 8),
15
- :uninst_stop, (1 << 9),
16
- :repackage_progress, (1 << 10),
17
- :repackage_start, (1 << 11),
18
- :repackage_stop, (1 << 12),
19
- :unpack_error, (1 << 13),
20
- :cpio_error, (1 << 14),
21
- :script_error, (1 << 15)]
22
-
23
- callback :rpmCallbackFunction, [:pointer, :rpmCallbackType, :rpm_loff_t, :rpm_loff_t, :fnpyKey, :rpmCallbackData], :void
24
-
25
- end
26
- end
data/lib/rpm/ffi.rb DELETED
@@ -1,44 +0,0 @@
1
- require 'rubygems'
2
- require 'ffi'
3
-
4
- module RPM
5
- module FFI
6
-
7
- extend ::FFI::Library
8
-
9
- begin
10
- ffi_lib('rpm')
11
- rescue LoadError => e
12
- raise(
13
- "Can't find rpm libs on your system: #{e.message}"
14
- )
15
- end
16
-
17
- end
18
- end
19
-
20
- require 'rpm/ffi/rpmtypes'
21
- require 'rpm/ffi/rpmcallback'
22
- require 'rpm/ffi/rpmtag'
23
- require 'rpm/ffi/rpmlib'
24
- require 'rpm/ffi/rpmlog'
25
- require 'rpm/ffi/rpmmacro'
26
- require 'rpm/ffi/header'
27
- require 'rpm/ffi/rpmprob'
28
- require 'rpm/ffi/rpmps'
29
- require 'rpm/ffi/rpmfi'
30
- require 'rpm/ffi/rpmdb'
31
- require 'rpm/ffi/rpmts'
32
- require 'rpm/ffi/rpmds'
33
- require 'rpm/ffi/rpmtd'
34
-
35
- module RPM
36
- module FFI
37
-
38
- def self.rpm_version_code
39
- ver = ::RPM::FFI.RPMVERSION.split('.', 3)
40
- return (ver[0].to_i<<16) + (ver[1].to_i<<8) + (ver[2].to_i<<0)
41
- end
42
-
43
- end
44
- end