autoproj 1.13.1 → 1.13.2.b1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8c0eb43db5cb20d6097d40687891ce39ea963a2
4
- data.tar.gz: 739b2709c825b0b726c87efbece61f644535f910
3
+ metadata.gz: 21b0b71092d73116445ddc3b3d6e3d9f88334e6e
4
+ data.tar.gz: 6e80ccfdc1c89fc078ee2f769c8975a3ee20902f
5
5
  SHA512:
6
- metadata.gz: a4028b0a7ec006dc9553c6e1ba84e5ebd978bf5f20772163b527c223a4fd61757907f79d7f34e1232ed41a33cbb3a5a2324ec25e30e87ebe4a674379e36e72df
7
- data.tar.gz: 6c0599dc5381ecab814f22672113f96e712aca049a04b0c79b7d0e8b9c7e13eb764ef0e9776da878babb4cbbe2326a21554297f031b0283050a70586bab29adc
6
+ metadata.gz: 3cf05bee34dbb299d93acccfaf9c727d3406d3866f823abab726be19d07d84f704d2a5a84827a77b2c239723c8ebe0f8d612270a108cb6b460ded8518c30594a
7
+ data.tar.gz: 8a232a9d04fe59d6408ef10669e2bf8b30c9091436ef7119b3b35ad11c419a2ba1f4808f552b9bb6e01d9ed3f0b22969eaec50bcc10f079e2a7c42e46721dfbe
data/Rakefile CHANGED
@@ -18,8 +18,8 @@ Utilrb::Rake.hoe do
18
18
  license 'BSD'
19
19
 
20
20
  extra_deps <<
21
- ['autobuild', '>= 1.9.0.b1', '< 2.0.0'] <<
22
- ['utilrb', '>= 1.6.0'] <<
21
+ ['autobuild', '>= 1.9.0', '< 1.10.0'] <<
22
+ ['utilrb', '>= 2.0.0', '< 3.0.0'] <<
23
23
  ['highline', '>= 1.5.0']
24
24
  end
25
25
  end
@@ -358,6 +358,14 @@ module Autoproj
358
358
  end
359
359
  end
360
360
 
361
+ def import_log_enabled?
362
+ get('import_log_enabled', true)
363
+ end
364
+
365
+ def import_log_enabled=(value)
366
+ set('import_log_enabled', !!value)
367
+ end
368
+
361
369
  def ruby_executable
362
370
  @ruby_executable ||= OSDependencies.autodetect_ruby_program
363
371
  end
@@ -870,6 +878,15 @@ fi
870
878
  "emerge --noreplace '%s'")
871
879
  end
872
880
  end
881
+ # Package manager interface for systems that use pkg (i.e. FreeBSD) as
882
+ # their package manager
883
+ class PkgManager < ShellScriptManager
884
+ def initialize
885
+ super(['pkg'], true,
886
+ "pkg install -y '%s'",
887
+ "pkg install -y '%s'")
888
+ end
889
+ end
873
890
 
874
891
  #Package manger for OpenSuse and Suse (untested)
875
892
  class ZypperManager < ShellScriptManager
@@ -1483,7 +1500,8 @@ fi
1483
1500
  PackageManagers::YumManager,
1484
1501
  PackageManagers::PortManager,
1485
1502
  PackageManagers::ZypperManager,
1486
- PackageManagers::PipManager]
1503
+ PackageManagers::PipManager ,
1504
+ PackageManagers::PkgManager]
1487
1505
 
1488
1506
  # Mapping from OS name to package manager name
1489
1507
  #
@@ -1503,7 +1521,8 @@ fi
1503
1521
  'fedora' => 'yum',
1504
1522
  'macos-port' => 'macports',
1505
1523
  'macos-brew' => 'brew',
1506
- 'opensuse' => 'zypper'
1524
+ 'opensuse' => 'zypper',
1525
+ 'freebsd' => 'pkg'
1507
1526
  }
1508
1527
 
1509
1528
  # The information contained in the OSdeps files, as a hash
@@ -1710,6 +1729,9 @@ fi
1710
1729
  version =~/.*VERSION\s+=\s+([^\s]+)/
1711
1730
  version = $1
1712
1731
  [['opensuse'], [version.strip]]
1732
+ elsif Autobuild.freebsd?
1733
+ version = `uname -r`.strip.split("-")[0]
1734
+ [['freebsd'],[version]]
1713
1735
  end
1714
1736
  end
1715
1737
 
@@ -1858,6 +1880,20 @@ fi
1858
1880
 
1859
1881
  class InvalidRecursiveStatement < Autobuild::Exception; end
1860
1882
 
1883
+ # Return the path to the osdeps name for a given package name while
1884
+ # accounting for package aliases
1885
+ #
1886
+ # returns an array contain the path starting with name and
1887
+ # ending at the resolved name
1888
+ def self.resolve_name(name)
1889
+ path = [ name ]
1890
+ while OSDependencies.aliases.has_key?(name)
1891
+ name = OSDependencies.aliases[name]
1892
+ path << name
1893
+ end
1894
+ path
1895
+ end
1896
+
1861
1897
  # Return the list of packages that should be installed for +name+
1862
1898
  #
1863
1899
  # The following two simple return values are possible:
@@ -1876,9 +1912,8 @@ fi
1876
1912
  # name and version. The package list might be empty even if status ==
1877
1913
  # FOUND_PACKAGES, for instance if the ignore keyword is used.
1878
1914
  def resolve_package(name)
1879
- while OSDependencies.aliases.has_key?(name)
1880
- name = OSDependencies.aliases[name]
1881
- end
1915
+ path = OSDependencies.resolve_name(name)
1916
+ name = path.last
1882
1917
 
1883
1918
  os_names, os_versions = OSDependencies.operating_system
1884
1919
  os_names = os_names.dup
@@ -2099,7 +2134,8 @@ fi
2099
2134
  dependencies.each do |name|
2100
2135
  result = resolve_package(name)
2101
2136
  if !result
2102
- raise MissingOSDep.new, "there is no osdeps definition for #{name}"
2137
+ path = OSDependencies.resolve_name(name)
2138
+ raise MissingOSDep.new, "there is no osdeps definition for #{path.last} (search tree: #{path.join("->")})"
2103
2139
  end
2104
2140
 
2105
2141
  if result.empty?
@@ -2929,11 +2965,12 @@ build-essential:
2929
2965
  opensuse:
2930
2966
  - "@devel_C_C++"
2931
2967
  - gcc-c++
2968
+ default: clang
2932
2969
  autobuild:
2933
- - gem: autobuild
2970
+ - gem: autobuild<1.10
2934
2971
  - osdep: readline
2935
2972
  autoproj:
2936
- - gem: autoproj
2973
+ - gem: autoproj<2.0
2937
2974
  - osdep: readline
2938
2975
  readline:
2939
2976
  debian,ubuntu: libreadline-dev
@@ -2950,9 +2987,10 @@ git:
2950
2987
  gentoo: dev-vcs/git
2951
2988
  arch: git
2952
2989
  fedora: git
2953
- macos-port: git-core
2990
+ macos-port: git
2954
2991
  macos-brew: git
2955
2992
  opensuse: git
2993
+ freebsd: git
2956
2994
  hg:
2957
2995
  debian,ubuntu: mercurial
2958
2996
  gentoo: dev-vcs/mercurial
@@ -2960,6 +2998,7 @@ hg:
2960
2998
  fedora: mercurial
2961
2999
  darwin: mercurial
2962
3000
  opensuse: mercurial
3001
+ freebsd: mercurial
2963
3002
  svn:
2964
3003
  debian,ubuntu: subversion
2965
3004
  gentoo: dev-util/subversion
@@ -2967,6 +3006,7 @@ svn:
2967
3006
  fedora: subversion
2968
3007
  darwin: subversion
2969
3008
  opensuse: subversion
3009
+ freebsd: subversion
2970
3010
  cmake:
2971
3011
  debian,ubuntu: cmake
2972
3012
  gentoo: dev-util/cmake
@@ -2974,6 +3014,7 @@ cmake:
2974
3014
  fedora: cmake
2975
3015
  darwin: cmake
2976
3016
  opensuse: cmake
3017
+ freebsd: cmake
2977
3018
  autotools:
2978
3019
  debian,ubuntu:
2979
3020
  - automake
@@ -2993,6 +3034,9 @@ autotools:
2993
3034
  opensuse:
2994
3035
  - automake
2995
3036
  - autoconf
3037
+ freebsd:
3038
+ - automake
3039
+ - autoconf
2996
3040
  archive:
2997
3041
  debian,ubuntu:
2998
3042
  - tar
@@ -3014,18 +3058,22 @@ archive:
3014
3058
  opensuse:
3015
3059
  - tar
3016
3060
  - unzip
3061
+ default: ignore
3017
3062
  cvs:
3018
3063
  debian,ubuntu: cvs
3019
3064
  fedora: cvs
3020
3065
  darwin: cvs
3021
3066
  arch: cvs
3022
3067
  opensuse: cvs
3068
+ freebsd: cvs
3023
3069
  pip:
3024
3070
  debian,ubuntu: python-pip
3025
3071
  arch: python2-pip
3026
3072
  opensuse: python-pip
3027
3073
  fedora: python-pip
3074
+ freebsd: pip
3028
3075
  sudo:
3076
+ macos-brew: ignore
3029
3077
  default: sudo
3030
3078
 
3031
3079
  EODEFS
@@ -537,6 +537,16 @@ module Autoproj
537
537
  # Returns the set of packages that are actually selected based on what
538
538
  # the user gave on the command line
539
539
  def self.resolve_user_selection(selected_packages, options = Hash.new)
540
+ if all_known_package?
541
+ result = PackageSelection.new
542
+ names = manifest.all_packages
543
+ names.delete_if { |pkg_name| manifest.excluded?(pkg_name) || manifest.ignored?(pkg_name) }
544
+ names.each do |pkg_name|
545
+ result.select(pkg_name, pkg_name)
546
+ end
547
+ return result
548
+ #return manifest.metapackages#.collect {|m| m[0] }
549
+ end
540
550
  if selected_packages.empty?
541
551
  return manifest.default_packages
542
552
  end
@@ -773,13 +783,12 @@ module Autoproj
773
783
  return all_enabled_packages
774
784
 
775
785
  ensure
776
- if !updated_packages.empty?
786
+ if Autoproj.config.import_log_enabled? && !updated_packages.empty? && Autoproj::Ops::Snapshot.update_log_available?(manifest)
777
787
  failure_message =
778
788
  if $!
779
789
  " (#{$!.message.split("\n").first})"
780
790
  end
781
791
  ops = Ops::Snapshot.new(manifest, keep_going: true)
782
-
783
792
  ops.update_package_import_state(
784
793
  "#{$0} #{argv.join(" ")}#{failure_message}",
785
794
  updated_packages)
@@ -831,6 +840,7 @@ module Autoproj
831
840
  def self.manifest; Autoproj.manifest end
832
841
  def self.only_status?; !!@only_status end
833
842
  def self.only_local?; !!@only_local end
843
+ def self.all_known_package?; !!@all_known_package end
834
844
  def self.reset?; !!@reset end
835
845
  def self.check?; !!@check end
836
846
  def self.manifest_update?; !!@manifest_update end
@@ -887,6 +897,7 @@ module Autoproj
887
897
  def self.parse_arguments(args, with_mode = true, &additional_options)
888
898
  @only_status = false
889
899
  @only_local = false
900
+ @all_known_package = false
890
901
  @show_osdeps = false
891
902
  @status_exit_code = false
892
903
  @revshow_osdeps = false
@@ -1054,6 +1065,9 @@ where 'mode' is one of:
1054
1065
  opts.on("--local", "in status and update modes, do not access the network") do
1055
1066
  @only_local = true
1056
1067
  end
1068
+ opts.on("--all-known-packages", "handle all known packages that are defined by package-sets") do
1069
+ @all_known_package = true
1070
+ end
1057
1071
  opts.on("--reset", "in update mode, reset the repositories to the state requested by the VCS configuration") do
1058
1072
  @reset = true
1059
1073
  end
@@ -167,6 +167,14 @@ module Autoproj
167
167
  end
168
168
  end
169
169
 
170
+ def import_log_enabled?
171
+ get('import_log_enabled', true)
172
+ end
173
+
174
+ def import_log_enabled=(value)
175
+ set('import_log_enabled', !!value)
176
+ end
177
+
170
178
  def ruby_executable
171
179
  @ruby_executable ||= OSDependencies.autodetect_ruby_program
172
180
  end
@@ -87,12 +87,13 @@ build-essential:
87
87
  fedora: ["gcc-c++", make, glibc-devel]
88
88
  darwin: ignore
89
89
  opensuse: ["@devel_C_C++", "gcc-c++"]
90
+ default: clang
90
91
 
91
92
  autobuild:
92
- - gem: autobuild
93
+ - gem: autobuild<1.10
93
94
  - osdep: readline
94
95
  autoproj:
95
- - gem: autoproj
96
+ - gem: autoproj<2.0
96
97
  - osdep: readline
97
98
 
98
99
  readline:
@@ -112,9 +113,10 @@ git:
112
113
  gentoo: dev-vcs/git
113
114
  arch: git
114
115
  fedora: git
115
- macos-port: git-core
116
+ macos-port: git
116
117
  macos-brew: git
117
118
  opensuse: git
119
+ freebsd: git
118
120
 
119
121
  hg:
120
122
  debian,ubuntu: mercurial
@@ -123,6 +125,7 @@ hg:
123
125
  fedora: mercurial
124
126
  darwin: mercurial
125
127
  opensuse: mercurial
128
+ freebsd: mercurial
126
129
 
127
130
  svn:
128
131
  debian,ubuntu: subversion
@@ -131,6 +134,7 @@ svn:
131
134
  fedora: subversion
132
135
  darwin: subversion
133
136
  opensuse: subversion
137
+ freebsd: subversion
134
138
 
135
139
  cmake:
136
140
  debian,ubuntu: cmake
@@ -139,6 +143,7 @@ cmake:
139
143
  fedora: cmake
140
144
  darwin: cmake
141
145
  opensuse: cmake
146
+ freebsd: cmake
142
147
 
143
148
  autotools:
144
149
  debian,ubuntu:
@@ -159,6 +164,9 @@ autotools:
159
164
  opensuse:
160
165
  - automake
161
166
  - autoconf
167
+ freebsd:
168
+ - automake
169
+ - autoconf
162
170
 
163
171
  archive:
164
172
  debian,ubuntu:
@@ -181,6 +189,7 @@ archive:
181
189
  opensuse:
182
190
  - tar
183
191
  - unzip
192
+ default: ignore
184
193
 
185
194
  cvs:
186
195
  debian,ubuntu: cvs
@@ -188,15 +197,17 @@ cvs:
188
197
  darwin: cvs
189
198
  arch: cvs
190
199
  opensuse: cvs
200
+ freebsd: cvs
191
201
 
192
202
  pip:
193
203
  debian,ubuntu: python-pip
194
204
  arch: python2-pip
195
205
  opensuse: python-pip
196
206
  fedora: python-pip
207
+ freebsd: pip
197
208
 
198
209
  sudo:
210
+ macos-brew: ignore
199
211
  default: sudo
200
212
 
201
213
  # vim: expandtab
202
-
@@ -52,7 +52,7 @@ module Autoproj
52
52
  elsif !access_methods.has_key?(value)
53
53
  raise Autoproj::InputError, "#{value} is not a known access method"
54
54
  elsif disabled_methods.include?(value)
55
- raise Autoproj::InputError, "#{method} is disabled on #{base_url}"
55
+ raise Autoproj::InputError, "#{value} is disabled on #{base_url}"
56
56
  end
57
57
 
58
58
  value
@@ -113,7 +113,7 @@ module Autoproj
113
113
  attr_reader :metapackages
114
114
 
115
115
  # The VCS object for the main configuration itself
116
- attr_reader :vcs
116
+ attr_accessor :vcs
117
117
 
118
118
  # The definition of all OS packages available on this installation
119
119
  attr_reader :osdeps
@@ -141,6 +141,7 @@ module Autoproj
141
141
  if Autoproj.has_config_key?('manifest_source')
142
142
  @vcs = VCSDefinition.from_raw(Autoproj.user_config('manifest_source'))
143
143
  end
144
+ @package_sets << LocalPackageSet.new(self, vcs)
144
145
  end
145
146
 
146
147
 
@@ -209,6 +209,9 @@ module Autoproj
209
209
  by_repository_id = Hash.new
210
210
  by_name = Hash.new
211
211
 
212
+ required_remotes_dirs = Array.new
213
+ required_user_dirs = Array.new
214
+
212
215
  queue = queue_auto_imports_if_needed(Array.new, root_pkg_set, root_pkg_set)
213
216
  while !queue.empty?
214
217
  vcs, options, imported_from = queue.shift
@@ -227,17 +230,28 @@ module Autoproj
227
230
  end
228
231
  by_repository_id[repository_id] = [vcs, imported_from]
229
232
 
233
+ # Make sure the package set has been already checked out to
234
+ # retrieve the actual name of the package set
230
235
  if !vcs.local?
231
236
  update_remote_package_set(vcs, only_local)
232
- create_remote_set_user_dir(vcs)
237
+ raw_local_dir = PackageSet.raw_local_dir_of(vcs)
238
+ required_remotes_dirs << raw_local_dir
233
239
  end
234
-
235
240
  name = PackageSet.name_of(manifest, vcs)
241
+
242
+ required_user_dirs = by_name.collect { |k,v| k }
243
+ Autoproj.debug "Trying to load package_set: #{name} from definition #{repository_id}"
244
+ Autoproj.debug "Already loaded package_sets are: #{required_user_dirs}"
245
+
236
246
  if already_loaded = by_name[name]
237
247
  already_loaded_pkg_set, already_loaded_vcs = *already_loaded
238
248
  if already_loaded_vcs != vcs
239
249
  if imported_from
240
- Autoproj.warn "#{imported_from.name} auto-imports a package set from #{vcs}, but a package set with the same name (#{name}) has already been imported from #{already_loaded_vcs}, I am skipping this one"
250
+ Autoproj.warn "redundant auto-import by #{imported_from.name} for package set '#{name}'."
251
+ Autoproj.warn " A package set with the same name (#{name}) has already been imported from"
252
+ Autoproj.warn " #{already_loaded_vcs}"
253
+ Autoproj.warn " Skipping the following one: "
254
+ Autoproj.warn " #{vcs}"
241
255
  else
242
256
  Autoproj.warn "the manifest refers to a package set from #{vcs}, but a package set with the same name (#{name}) has already been imported from #{already_loaded_vcs}, I am skipping this one"
243
257
  end
@@ -248,6 +262,8 @@ module Autoproj
248
262
  imported_from.imports << already_loaded_pkg_set
249
263
  end
250
264
  next
265
+ else
266
+ create_remote_set_user_dir(vcs)
251
267
  end
252
268
 
253
269
  pkg_set = load_package_set(vcs, options, imported_from)
@@ -260,18 +276,20 @@ module Autoproj
260
276
  queue_auto_imports_if_needed(queue, pkg_set, root_pkg_set)
261
277
  end
262
278
 
263
- cleanup_remotes_dir(package_sets)
264
- cleanup_remotes_user_dir(package_sets)
279
+ cleanup_remotes_dir(package_sets, required_remotes_dirs)
280
+ cleanup_remotes_user_dir(package_sets, required_user_dirs)
265
281
  package_sets
266
282
  end
267
283
 
268
284
  # Removes from {remotes_dir} the directories that do not match a package
269
285
  # set
270
- def cleanup_remotes_dir(package_sets = manifest.package_sets)
286
+ def cleanup_remotes_dir(package_sets = manifest.package_sets, required_remotes_dirs = Array.new)
271
287
  # Cleanup the .remotes and remotes_symlinks_dir directories
272
288
  Dir.glob(File.join(remotes_dir, '*')).each do |dir|
273
289
  dir = File.expand_path(dir)
274
- if File.directory?(dir) && !package_sets.find { |pkg| pkg.raw_local_dir == dir }
290
+ # Once a package set has been checked out during the process,
291
+ # keep it -- so that it won't be checked out again
292
+ if File.directory?(dir) && !required_remotes_dirs.include?(dir)
275
293
  FileUtils.rm_rf dir
276
294
  end
277
295
  end
@@ -279,10 +297,11 @@ module Autoproj
279
297
 
280
298
  # Removes from {remotes_user_dir} the directories that do not match a
281
299
  # package set
282
- def cleanup_remotes_user_dir(package_sets = manifest.package_sets)
300
+ def cleanup_remotes_user_dir(package_sets = manifest.package_sets, required_user_dirs = Array.new)
283
301
  Dir.glob(File.join(remotes_user_dir, '*')).each do |file|
284
302
  file = File.expand_path(file)
285
- if File.symlink?(file) && !package_sets.find { |pkg_set| pkg_set.user_local_dir == file }
303
+ user_dir = File.basename(file)
304
+ if File.symlink?(file) && !required_user_dirs.include?(user_dir)
286
305
  FileUtils.rm_f file
287
306
  end
288
307
  end
@@ -340,7 +359,7 @@ module Autoproj
340
359
  Tools.load_main_initrb(manifest)
341
360
  manifest.load(manifest_path)
342
361
 
343
- root_pkg_set = LocalPackageSet.new(manifest)
362
+ root_pkg_set = manifest.local_package_set
344
363
  root_pkg_set.load_description_file
345
364
  root_pkg_set.explicit = true
346
365
  package_sets = load_and_update_package_sets(root_pkg_set, only_local)
@@ -88,6 +88,8 @@ module Autoproj
88
88
  return args, reuse
89
89
  end
90
90
 
91
+ MAIN_CONFIGURATION_TEMPLATE = File.expand_path(File.join("..", "..", "..", "samples", 'autoproj'), File.dirname(__FILE__))
92
+
91
93
  def bootstrap(*args)
92
94
  check_root_dir_empty
93
95
  args, reuse = handle_bootstrap_options(args)
@@ -113,8 +115,7 @@ module Autoproj
113
115
  # If we are not getting the installation setup from a VCS, copy the template
114
116
  # files
115
117
  if args.empty? || args.size == 1
116
- sample_dir = File.expand_path(File.join("..", "..", "..", "samples"), File.dirname(__FILE__))
117
- FileUtils.cp_r File.join(sample_dir, "autoproj"), "autoproj"
118
+ FileUtils.cp_r MAIN_CONFIGURATION_TEMPLATE, "autoproj"
118
119
  end
119
120
 
120
121
  if args.size == 1 # the user asks us to download a manifest
@@ -30,6 +30,13 @@ module Autoproj
30
30
  result
31
31
  end
32
32
 
33
+ def self.update_log_available?(manifest)
34
+ new(manifest).import_state_log_package
35
+ true
36
+ rescue ArgumentError
37
+ false
38
+ end
39
+
33
40
  def sort_versions(versions)
34
41
  pkg_sets, pkgs = versions.partition { |vcs| vcs.keys.first =~ /^pkg_set:/ }
35
42
  pkg_sets.sort_by { |vcs| vcs.keys.first } +
@@ -145,7 +152,17 @@ module Autoproj
145
152
  # @return [Autobuild::Package] a package whose importer is
146
153
  # {Autobuild::Git}
147
154
  def import_state_log_package
148
- manifest.main_package_set.create_autobuild_package
155
+ pkg = manifest.main_package_set.create_autobuild_package
156
+ if !pkg.importer
157
+ if Autobuild::Git.can_handle?(pkg.srcdir)
158
+ pkg.importer = Autobuild.git(pkg.srcdir)
159
+ end
160
+ end
161
+
162
+ if !pkg.importer.kind_of?(Autobuild::Git)
163
+ raise ArgumentError, "cannot use autoproj auto-import feature if the main configuration is not managed under git"
164
+ end
165
+ pkg
149
166
  end
150
167
 
151
168
  def import_state_log_ref
@@ -355,6 +355,15 @@ fi
355
355
  "emerge --noreplace '%s'")
356
356
  end
357
357
  end
358
+ # Package manager interface for systems that use pkg (i.e. FreeBSD) as
359
+ # their package manager
360
+ class PkgManager < ShellScriptManager
361
+ def initialize
362
+ super(['pkg'], true,
363
+ "pkg install -y '%s'",
364
+ "pkg install -y '%s'")
365
+ end
366
+ end
358
367
 
359
368
  #Package manger for OpenSuse and Suse (untested)
360
369
  class ZypperManager < ShellScriptManager
@@ -968,7 +977,8 @@ fi
968
977
  PackageManagers::YumManager,
969
978
  PackageManagers::PortManager,
970
979
  PackageManagers::ZypperManager,
971
- PackageManagers::PipManager]
980
+ PackageManagers::PipManager ,
981
+ PackageManagers::PkgManager]
972
982
 
973
983
  # Mapping from OS name to package manager name
974
984
  #
@@ -988,7 +998,8 @@ fi
988
998
  'fedora' => 'yum',
989
999
  'macos-port' => 'macports',
990
1000
  'macos-brew' => 'brew',
991
- 'opensuse' => 'zypper'
1001
+ 'opensuse' => 'zypper',
1002
+ 'freebsd' => 'pkg'
992
1003
  }
993
1004
 
994
1005
  # The information contained in the OSdeps files, as a hash
@@ -1195,6 +1206,9 @@ fi
1195
1206
  version =~/.*VERSION\s+=\s+([^\s]+)/
1196
1207
  version = $1
1197
1208
  [['opensuse'], [version.strip]]
1209
+ elsif Autobuild.freebsd?
1210
+ version = `uname -r`.strip.split("-")[0]
1211
+ [['freebsd'],[version]]
1198
1212
  end
1199
1213
  end
1200
1214
 
@@ -1343,6 +1357,20 @@ fi
1343
1357
 
1344
1358
  class InvalidRecursiveStatement < Autobuild::Exception; end
1345
1359
 
1360
+ # Return the path to the osdeps name for a given package name while
1361
+ # accounting for package aliases
1362
+ #
1363
+ # returns an array contain the path starting with name and
1364
+ # ending at the resolved name
1365
+ def self.resolve_name(name)
1366
+ path = [ name ]
1367
+ while OSDependencies.aliases.has_key?(name)
1368
+ name = OSDependencies.aliases[name]
1369
+ path << name
1370
+ end
1371
+ path
1372
+ end
1373
+
1346
1374
  # Return the list of packages that should be installed for +name+
1347
1375
  #
1348
1376
  # The following two simple return values are possible:
@@ -1361,9 +1389,8 @@ fi
1361
1389
  # name and version. The package list might be empty even if status ==
1362
1390
  # FOUND_PACKAGES, for instance if the ignore keyword is used.
1363
1391
  def resolve_package(name)
1364
- while OSDependencies.aliases.has_key?(name)
1365
- name = OSDependencies.aliases[name]
1366
- end
1392
+ path = OSDependencies.resolve_name(name)
1393
+ name = path.last
1367
1394
 
1368
1395
  os_names, os_versions = OSDependencies.operating_system
1369
1396
  os_names = os_names.dup
@@ -1584,7 +1611,8 @@ fi
1584
1611
  dependencies.each do |name|
1585
1612
  result = resolve_package(name)
1586
1613
  if !result
1587
- raise MissingOSDep.new, "there is no osdeps definition for #{name}"
1614
+ path = OSDependencies.resolve_name(name)
1615
+ raise MissingOSDep.new, "there is no osdeps definition for #{path.last} (search tree: #{path.join("->")})"
1588
1616
  end
1589
1617
 
1590
1618
  if result.empty?
data/lib/autoproj/test.rb CHANGED
@@ -44,7 +44,17 @@ module Autoproj
44
44
  end
45
45
 
46
46
  def setup
47
- # Setup code for all the tests
47
+ @tmpdir = Array.new
48
+ super
49
+ end
50
+
51
+ def create_bootstrap
52
+ dir = Dir.mktmpdir
53
+ @tmpdir << dir
54
+ require 'autoproj/ops/main_config_switcher'
55
+ FileUtils.cp_r Ops::MainConfigSwitcher::MAIN_CONFIGURATION_TEMPLATE, File.join(dir, 'autoproj')
56
+ Autoproj.root_dir = dir
57
+ Autoproj.manifest = Manifest.load(File.join(dir, 'autoproj', 'manifest'))
48
58
  end
49
59
 
50
60
  def teardown
@@ -52,6 +62,9 @@ module Autoproj
52
62
  flexmock_teardown
53
63
  end
54
64
  super
65
+ @tmpdir.each do |dir|
66
+ FileUtils.remove_entry_secure dir
67
+ end
55
68
  Autobuild::Package.clear
56
69
  end
57
70
  end
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.13.1"
2
+ VERSION = "1.13.2.b1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.1
4
+ version: 1.13.2.b1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rock Core Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autobuild
@@ -16,34 +16,40 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.9.0.b1
19
+ version: 1.9.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 2.0.0
22
+ version: 1.10.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.9.0.b1
29
+ version: 1.9.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 2.0.0
32
+ version: 1.10.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: utilrb
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 1.6.0
39
+ version: 2.0.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: 3.0.0
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
47
  - - ">="
45
48
  - !ruby/object:Gem::Version
46
- version: 1.6.0
49
+ version: 2.0.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: 3.0.0
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: highline
49
55
  requirement: !ruby/object:Gem::Requirement
@@ -241,9 +247,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
241
247
  version: 1.9.2
242
248
  required_rubygems_version: !ruby/object:Gem::Requirement
243
249
  requirements:
244
- - - ">="
250
+ - - ">"
245
251
  - !ruby/object:Gem::Version
246
- version: '0'
252
+ version: 1.3.1
247
253
  requirements: []
248
254
  rubyforge_project:
249
255
  rubygems_version: 2.2.2