diff --git a/cvmanager b/cvmanager index c9d01f3..69c5a09 100755 --- a/cvmanager +++ b/cvmanager @@ -293,9 +293,12 @@ def update() puts_verbose " Found #{desired_version} as the 'latest' version" end - # if the version of the component does not match the one the user requested update it - if component['version'].to_s != desired_version.to_s - puts " Updating from #{component['version']} to #{desired_version}" + # if the component version in the most recently published composite version does not match the one the user requested update it + ccv_latest_version = ccv['versions'].select { |obj| obj['version'] == ccv['latest_version'] }.first + component_cvv = @api.resource(:content_view_versions).call(:index, {:composite_version_id => ccv_latest_version['id'], :organization_id => @options[:org], :content_view_id => component['content_view']['id'] }) + component_cvv_version = component_cvv['results'].first['version'] + if component_cvv_version != desired_version.to_s + puts " Updating from #{component_cvv_version} to #{desired_version}" oldids = ids.dup ids.delete(component['id']) cvversions = @api.resource(:content_view_versions).call(:index, {:content_view_id => component['content_view']['id'], :version => desired_version})