Debugging why index.html was not removed.
Dev

Dev commited on 2018-06-17 09:33:22
Showing 2 changed files, with 9 additions and 3 deletions.

... ...
@@ -77,6 +77,7 @@ module RCM
77 77
         f.mode = f_stat.mode.to_s(8)[-4, 4]
78 78
         f.state = ::RCM::File::PRESENT
79 79
         got[path] = f
80
+        @logger.debug(f)
80 81
       end
81 82
 
82 83
       got
... ...
@@ -143,6 +143,9 @@ module RCM
143 143
   end
144 144
 
145 145
   def self.converge_packages
146
+    # We'll install them in one go (minor optimization)
147
+    missing_packages = []
148
+
146 149
     @wanted[PACKAGES].each do |pkg_name, pkg_obj|
147 150
       current_pkg = @got[PACKAGES][pkg_name]
148 151
 
... ...
@@ -151,18 +154,20 @@ module RCM
151 154
         next
152 155
       end
153 156
 
154
-      @logger.debug('Missing package:' + pkg_name)
155 157
       if current_pkg.version != pkg_obj.version && current_pkg.state == ::RCM::Package::INSTALLED
156 158
         # Wrong version is installed. Remove current version and install the correct one.
157 159
         # Not the best way to go about it... but we are not implementing a legit solution.
158 160
         @logger.debug("#{current_pkg.name}=#{current_pkg.version} is installed. Uninstalling first.")
159 161
         @pkg_mgr.remove(pkg_obj)
160
-        @pkg_mgr.install(pkg_obj)
162
+        missing_packages.push(pkg_obj)
161 163
       elsif current_pkg.state == ::RCM::Package::REMOVED
162
-        @pkg_mgr.install(pkg_obj)
164
+        missing_packages.push(pkg_obj)
163 165
       end
164 166
     end
165 167
 
168
+    @logger.debug("Missing packages: #{missing_packages.join(', ')}")
169
+    @pkg_mgr.install(missing_packages)
170
+
166 171
   end
167 172
 
168 173
   def self.converge_files
169 174