Skip to content

Commit

Permalink
* plugin/90migrate.rb: fix typos to convert category cache correctly.
Browse files Browse the repository at this point in the history
	set @conf.tdiary_version just after converting tdiary.conf to prevent
	converting twice.


git-svn-id: https://tdiary.svn.sourceforge.net/svnroot/tdiary/trunk/core@3351 7f22e88f-374d-0410-998f-c91420d97ba2
  • Loading branch information
kazuhiko committed Aug 8, 2008
1 parent 1169d69 commit 1f900e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2008-08-08 Kazuhiko <kazuhiko@fdiary.net>
* plugin/90migrate.rb: fix typos to convert category cache correctly.
set @conf.tdiary_version just after converting tdiary.conf to prevent
converting twice.

2008-08-05 TADA Tadashi <sho@spc.gr.jp>
* defaultio.rb: detected error of no style file.
* plugin/00default.rb: fixed #104, error on no existent day.
Expand Down
9 changes: 5 additions & 4 deletions plugin/90migrate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def convert_element( data )

require "fileutils"

# convert tdiary.conf in @data_path
# convert tdiary.conf in @conf.data_path
begin
conf_path = "#{@conf.data_path}tdiary.conf"
conf = File::open( conf_path ){|f| @conf.migrate_to_utf8( f.read ) }
Expand All @@ -64,21 +64,22 @@ def convert_element( data )
o.puts %Q!tdiary_version = "#{TDIARY_VERSION}"!
o.print( conf ) if conf
end
@conf.tdiary_version = TDIARY_VERSION

# convert pstore cache files of plugins
dir = @cache_path || "#{@data_path}cache"
dir = @cache_path || "#{@conf.data_path}cache"
%w(makerss.cache recent_comments recent_trackbacks tlink/tlink.dat whatsnew-list blog_category).each do |e|
convert_pstore( "#{dir}/#{e}" ) if File.exist?( "#{dir}/#{e}" )
end
Dir["#{dir}/disp_referrer2.d/*"].each do |file|
convert_pstore( file )
end
Dir["#{@data_path}category/*"].each do |file|
Dir["#{@conf.data_path}category/*"].each do |file|
convert_pstore( file )
end

# rename category cache files
Dir["#{@data_path}category/*"].each do |file|
Dir["#{@conf.data_path}category/*"].each do |file|
dirname, basename = File.split( file )
new_basename = u( @conf.migrate_to_utf8( CGI::unescape( basename ) ) )
FileUtils.mv( file, File.join( dirname, new_basename ) ) unless basename == new_basename
Expand Down

0 comments on commit 1f900e5

Please sign in to comment.