From e516191b0fae1b59f85de2a474a8abfb208001ca Mon Sep 17 00:00:00 2001 From: Hyoun Jiil Date: Thu, 14 Aug 2014 15:02:03 +0900 Subject: [PATCH] Fix pkg-svr clean/remove-snapshot bug Now changes folder snapshot log also remove Change-Id: I47adec84463e7716a0781f9c134753a8a8e1d33c --- package/changelog | 4 ++++ package/pkginfo.manifest | 2 +- src/pkg_server/distribution.rb | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/package/changelog b/package/changelog index 762113f..d9a7cde 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,7 @@ +* 2.2.2 +- Fix pkg-svr clean/remove-snapshot bug +-- Now changes folder snapshot log also remove +== hyoun jiil 2014-08-14 * 2.1.65 - fix windows package bug caused by nasca -- package has nasca encript file diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 685bc5d..0366a45 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Source : dibs -Version :2.1.65 +Version :2.2.2 Maintainer : taejun ha, jiil hyoun , donghyuk yang , donghee yang , sungmin kim Package : tizen-dibs-test diff --git a/src/pkg_server/distribution.rb b/src/pkg_server/distribution.rb index 0342bb4..bfd7c05 100644 --- a/src/pkg_server/distribution.rb +++ b/src/pkg_server/distribution.rb @@ -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 -- 2.34.1