Fix pkg-svr clean/remove-snapshot bug 09/26009/1
authorHyoun Jiil <jiil.hyoun@samsung.com>
Thu, 14 Aug 2014 06:02:03 +0000 (15:02 +0900)
committerHyoun Jiil <jiil.hyoun@samsung.com>
Thu, 14 Aug 2014 06:02:03 +0000 (15:02 +0900)
Now changes folder snapshot log also remove

Change-Id: I47adec84463e7716a0781f9c134753a8a8e1d33c

package/changelog
package/pkginfo.manifest
src/pkg_server/distribution.rb

index 762113f76dbd3452487bd85456258ea16156710c..d9a7cde295b86cc797eb8ad0005995b433dc9219 100644 (file)
@@ -1,3 +1,7 @@
+* 2.2.2
+- Fix pkg-svr clean/remove-snapshot bug 
+--  Now changes folder snapshot log also remove
+== hyoun jiil <jiil.hyoun@samsung.com> 2014-08-14
 * 2.1.65
 - fix windows package bug caused by nasca
 -- package has nasca encript file 
index 685bc5d1c398c38af5500cf28c9c97833aa32af4..0366a45bd35f815898c1dd060a55463f84ba9f87 100644 (file)
@@ -1,5 +1,5 @@
 Source : dibs
-Version :2.1.65
+Version :2.2.2
 Maintainer : taejun ha<taejun.ha@samsung.com>, jiil hyoun <jiil.hyoun@samsung.com>, donghyuk yang <donghyouk.yang@samsung.com>, donghee yang <donghee.yang@samsung.com>, sungmin kim <dev.sungmin.kim@samsung.com, jonghwan park <jonghwan2.park@samsung.com>
 
 Package : tizen-dibs-test
index 0342bb40a8a7464e8a918542d308fa23ac40f2f5..bfd7c05dc17f9d9f055cdba8a0247fa4bf325ae4 100644 (file)
@@ -462,6 +462,15 @@ class Distribution
                        end
                end
 
+               # remove unused changes
+               Dir.new( @location + "/changes" ).each do |change|
+                       if change.start_with? "." then next end
+
+                       if not remain_snapshot_list.include? change.sub(/\.log/,'') then
+                               FileUtils.rm_f "#{@location}/changes/#{change}"
+                       end
+               end
+
                # upate snapshot.info file
                update_snapshot_info_file(remain_snapshot_list)
        end
@@ -593,6 +602,15 @@ class Distribution
                        end
                end
 
+               # remove unused changes
+               Dir.new( @location + "/changes" ).each do |change|
+                       if change.start_with? "." then next end
+
+                       if removed_snapshot.include? change.sub(/\.log/,'') then
+                               FileUtils.rm_f "#{@location}/changes/#{change}"
+                       end
+               end
+
                if not snapshot_list.empty? then
                        @log.output( "snapshot not exist : #{snapshot_list.join(",")}", Log::LV_USER )
                end