[Title] pkg client caching just only one latest package
authorjiil.hyoun <jiil.hyoun@samsung.com>
Fri, 8 Mar 2013 06:20:37 +0000 (15:20 +0900)
committerjiil.hyoun <jiil.hyoun@samsung.com>
Fri, 8 Mar 2013 06:20:37 +0000 (15:20 +0900)
[Type] Enhancement
[Module] Toolchain /
[Priority] Minor
[Jira#]
[Redmine#] 7956
[Problem] waist cache space. it caused dist full
[Cause]
[Solution]
[TestCase]

Change-Id: I81fcf3ab8a558d0f4d635cd93c1273063377456a

src/pkg_server/client.rb

index fe53b2bec9b2c184cee0e628e964409bdaef5d25..0a36176db7a4421c8d85218879ee76a8cdd49f20 100644 (file)
@@ -287,10 +287,10 @@ class Client
                pkg_file_prefix = "#{@download_path}/#{pkg_name}_*_#{os}.zip"
                pkg_files = Dir[pkg_file_prefix].sort_by { |f| File.mtime(f) }.reverse
 
-               if not pkg_files.nil? and pkg_files.length >= 4 then
-                       Utils.execute_shell("rm -rf #{pkg_files[3..-1].join(" ")}")
+               if not pkg_files.nil? and pkg_files.length >= 2 then
+                       Utils.execute_shell("rm -rf #{pkg_files[1..-1].join(" ")}")
                        @log.info "Removed old package files.."
-                       @log.info "  * #{pkg_files[3..-1].join(", ")}"
+                       @log.info "  * #{pkg_files[1..-1].join(", ")}"
                end
        end