bin/autoproj_bootstrap in autoproj-1.8.2.b16 vs bin/autoproj_bootstrap in autoproj-1.8.2.b17
- old
+ new
@@ -363,10 +363,18 @@
Autoproj.warn "#{package_name} is not a valid Debian package name"
false
end
end
+ def install(packages)
+ if super
+ # Invalidate caching of installed packages, as we just
+ # installed new packages !
+ @installed_packages = nil
+ end
+ end
+
def filter_uptodate_packages(packages)
packages.find_all do |package_name|
!installed?(package_name)
end
end
@@ -381,16 +389,20 @@
@with_prerelease = false
@with_doc = false
def initialize
super(['gem'])
+ @installed_gems = Set.new
end
# Used to override the Gem::SpecFetcher object used by this gem
# manager. Useful mainly for testing
attr_writer :gem_fetcher
+ # The set of gems installed during this autoproj session
+ attr_reader :installed_gems
+
def gem_fetcher
if !@gem_fetcher
Autoproj.message " looking for RubyGems updates"
@gem_fetcher = Gem::SpecFetcher.fetcher
end
@@ -435,19 +447,24 @@
Autoproj.message " installing/updating RubyGems dependencies: #{gems.map { |g| g.join(" ") }.sort.join(", ")}"
cmdlines.each do |c|
Autobuild::Subprocess.run 'autoproj', 'osdeps', *c
end
+ gems.each do |name, v|
+ installed_gems << name
+ end
did_something = true
end
end
# Returns the set of RubyGem packages in +packages+ that are not already
# installed, or that can be upgraded
def filter_uptodate_packages(gems)
# Don't install gems that are already there ...
gems = gems.dup
gems.delete_if do |name, version|
+ next(true) if installed_gems.include?(name)
+
version_requirements = Gem::Requirement.new(version || '>= 0')
installed =
if Gem::Specification.respond_to?(:find_by_name)
begin
[Gem::Specification.find_by_name(name, version_requirements)]