Removing uneeded variable and updating apt iff needed.
Dev

Dev commited on 2018-06-19 06:12:17
Showing 1 changed files, with 1 additions and 8 deletions.

... ...
@@ -14,12 +14,6 @@ require 'logger'
14 14
 module RCM
15 15
 
16 16
   @config_mgr = ::RCM::ConfigManager.new()
17
-  @got = {
18
-    ::RCM::ConfigManager::PACKAGES => {},
19
-    ::RCM::ConfigManager::FILES => {},
20
-    ::RCM::ConfigManager::SERVICES => {}
21
-  }
22
- 
23 17
   @logger = @config_mgr.logger
24 18
   @pkg_mgr = ::RCM::Apt.new(@logger)
25 19
   @file_mgr = ::RCM::FileManager.new(@logger)
... ...
@@ -29,8 +23,6 @@ module RCM
29 23
     # We'll install them in one go (minor optimization)
30 24
     missing_packages = []
31 25
 
32
-    @pkg_mgr.update unless @env == 'dev'
33
-
34 26
     @config_mgr.packages.each do |pkg_name, pkg_obj|
35 27
       current_pkg = current_state_of_packages[pkg_name]
36 28
 
... ...
@@ -50,6 +42,7 @@ module RCM
50 42
       end
51 43
     end
52 44
 
45
+    @pkg_mgr.update unless @env == 'dev' || missing_packages.empty?
53 46
     @pkg_mgr.install(missing_packages) unless missing_packages.empty?
54 47
   end
55 48
 
56 49