gonzui-win32を入れる
ソースコードの検索サイトとしては、Kodersってのが有名だが、漏れにもインスコ可能な検索エンジンとして、gonzuiってのがある。
gonzuiの設置は結構簡単で、ソースをコンパイルし、検索したいコードを gonzui-import コマンドでデータベースに突っ込ませた後、 gonzui-server コマンドを実行すれば、HTTPサーバが起動するという寸法。
ちなみに、Windowsでは Cygwin 環境での動作は確認している。
(最新の1.2は まだ試してないが、少しのパッチを当てればOK)
ただ、漏れは検索エンジンを設置したいのであって、ビルドとか そーゆー面倒な事はしたくないんじゃぁ。といった人も居るのも事実だと思う。
そんな人達の為の、Windows環境でそのまま動くバイナリを配布している方がきた。
gonzui-win32: swiming in windows
http://soutaro.com/gonzui-win32/index.ja.html
インストール方法は簡単で、オフィシャルサイトからZIPファイルをダウンロードして、展開するだけ。
で、一番の問題はソースコードをデータベースに突っ込む方法。
普通なら、"gonzui-import <ソースコード>"とすりゃOK。だけど、オフィシャルにも注意書きがあるが、アーカイブ(.tarとか)されたファイルの直接インポートは無理とある。試しに実証。
C:\User\gonzui-win32>gonzui-import.exe file://h:Python-2.4.1.tar gonzui-import: file://h:Python-2.4.1.tar: malformed URI 0 contents of 0 packages imported in 4.93 sec. (0.00 contents / sec.)
確かにダメっすな。
んじゃぁ、ってんで、tarファイルを展開してインポートしてみる。
C:\User\gonzui-win32>gonzui-import.exe file://h:Python-2.4.1 gonzui-import: file://h:Python-2.4.1: malformed URI 0 contents of 0 packages imported in 1.10 sec. (0.00 contents / sec.) C:\User\gonzui-win32>gonzui-import.exe file://h:/User/python/Python-2.4.1 gonzui-import: No such file or directory - /User/python/Python-2.4.1 0 contents of 0 packages imported in 0.94 sec. (0.00 contents / sec.)
うぉぉぉ、展開してもダメじゃん!
ぐぐると、こんなのが出てきた。
HsbtDiary - gonzui-win32(3)
http://hsbt.que.ne.jp/diary/20050715.html
Cドライブにgonzuiのバイナリを設置してimportしようとすると以下のようにファイルもディレクトリもないと怒られてしまう。
え〜、そうなんだぁ。
C:\User\gonzui-win32>gonzui-import.exe file://../Python-2.4.1.tar gonzui-import: file://../Python-2.4.1.tar: malformed URI 0 contents of 0 packages imported in 1.17 sec. (0.00 contents / sec.) C:\User\gonzui-win32>gonzui-import.exe file://../Python-2.4.1 gonzui-import: file://../Python-2.4.1: malformed URI 0 contents of 0 packages imported in 1.07 sec. (0.00 contents / sec.) C:\User\gonzui-win32>gonzui-import.exe file://User/Python-2.4.1 gonzui-import: No such file or directory - /Python-2.4.1 0 contents of 0 packages imported in 0.96 sec. (0.00 contents / sec.)
…色々試していて、ようやくわかってきた。
どうも、別ドライブへのパスを認識してくれないらしい。(もしくは、別ドライブを指定する特別なURIを、自分が知らない)
/c drive /user /gonzui-win32 <- gonzuiのプログラム /Python-2.4.1 <- Python 2.4.1 のソースコード
と置いておいて、
C:>cd C:\User\gonzui-win32> C:\User\gonzui-win32>gonzui-import.exe file://c:/User/Python-2.4.1 Python-2.4.1: 7% |oo | ETA: 00:02:55
とすればOK。
うまくいったよ。
gonzui-win32の実行結果 posted by フォト蔵
↑補記
id:masatobito さんに教えて頂いたので、早速 フォト蔵から貼り付けてみた。「この写真をブログにはりつける」ってのが画面下部にあるので、コピペすればOKという簡単仕様。うひょぉ。
補記2
現象から察するに、インストール自体は、どこのドライブに突っ込んでもOKなのだと思う。
ただ、コードのインポートだけは、同一ドライブから入れないと うまくいかない。
ただ、それだけのようだ。
要するに、
- インポートは、同一ドライブから実施する事
- インポート時のパスは、絶対パス指定する事
という事みたい。ふぅむ。