at posts/single.html

CVS HEAD に追従

tDiary の開発最新版(2.1.1)が出て、n日表示にも対応したので、CVS HEADに追従する。

自宅PC内のcoLinux上でSubversionを動かして、最新版との差分はそこで管理することにした。基本的には先日の日記の方法を使う。

  • 最新版のソースを取得
  • 手元の修正(index.rb, update.rb の1行目、category.rb)との差分をマージする
  • ファイルのリネーム
  • サイトのファイルを更新

これが自動化できれば、結構楽になるはず。

ソースの管理はSubversionで、ファイルのリネームにはRakefileを使うことにした。

Rakefileの中身はこのとおり。…シェルでもいいような気がしてきたな。

task :move do
  movelist = {
    'core/index.rb' => 'core/index.cgi',
    'core/update.rb' => 'core/update.cgi',
    'core/dot.htaccess' => 'core/.htaccess',
    'core/tdiary.conf.sample' => 'core/tdiary.conf',
    'core/misc/style/wiki/wiki_parser.rb' => 'core/tdiary/',
    'core/misc/style/wiki/wiki_style.rb' => 'core/tdiary/',
    'plugin/trackback/tb.rb' => 'core/tb.cgi',
    'contrib/plugin/antirefspam/plugin/antirefspam.rb' => 'core/plugin',
    'contrib/plugin/antirefspam/plugin/ja/antirefspam.rb' => 'core/plugin/ja',
    'contrib/plugin/antirefspam/filter/antirefspam.rb' => 'core/tdiary/filter',
    'contrib/plugin/tdiarygraph/tdiarygraph125x125e.swf' => 'core',
    'contrib/plugin/tdiarygraph/tdiarygraph_flashstyle.rb' => 'plugin',
  }
  movelist.each {|old, new| mv old, new if File.exist?(old) }
end

task :default => [:move]

サイトの更新には、これまでsitecopyを使っていたんだけど、これからはrsyncを使うことにした。 理由は一つ。.sitecopyrcのignore設定では、.svnディレクトリのアップデートを止められないから。

今はこんなコマンドでアップロードしている。(参考: rsyncコマンドの使い方

# rsync -rvtp -e ssh --delete --exclude '.svn' core/ machu.jp:/home/machu/www/www.machu.jp/diary/
# rsync -rvtp -e ssh --delete --exclude '.svn' plugin/ machu.jp:/home/machu/lib/tdiary/plugin/

んで、最新版に追随といいつつ、とりあえず5月末バージョンに更新。 これから、Subversionのマージ機能のテストを兼ねつつ、CVS HEADに追従する予定。

関連する日記