jpmobile(Git)プラグイン

折角 Git入れたので、jpmobile開発版を取って来る。(ずっと attachment_fu試用した photoアプリケーションでやってます(attachment-fu/RMagick で画像アップロードサービス - Rubyとか Illustratorとか SFとか折紙とか, attachment-fu/RMagick で画像アップロードサービス(その2) - Rubyとか Illustratorとか SFとか折紙とか, Windowsでの attachment_fuプラグイン - Rubyとか Illustratorとか SFとか折紙とか)、これ用にはちょっと branches切ったりした)

[2349] script/plugin install git://github.com/darashi/jpmobile.git
removing: /home/hs9587/rails/photo_sid/vendor/plugins/jpmobile/.git
Usage: /usr/bin/git-clone [--template=] [--use-separate-remote] [--reference ] [--bare] [-l [-s]] [-q] [-u ] [--origin ] [-n]  []

駄目だった。
Usageメッセージがこの辺「git-clone(1)」と違う辺り gitのバージョンが古い(前述(Git を入れる - Rubyとか Illustratorとか SFとか折紙とか)通り Debian/etchの git version 1.4.4.4)のだろうか。それとも RubyGemsの git系パッケージが必要とか、「gem list -r -d git」して眺めてみるけどそんな感じはしない。
Railsの git を使っているあたりのソースを眺める。

rails-2.1.2/lib/commands/plugin.rb l.272

    def git_command(cmd, options = {})
      root = rails_env.root
      mkdir_p "#{root}/vendor/plugins"
      base_cmd = "git #{cmd} --depth 1 #{uri} \"#{root}/vendor/plugins/#{name}\""
      puts base_cmd if $verbose
      puts "removing: #{root}/vendor/plugins/#{name}/.git"
      system(base_cmd)
      rm_rf "#{root}/vendor/plugins/#{name}/.git"
    end

これを cmd = :clone の状態で呼んでたりする訳だ。verboseモードがあるっぽいのでそうしてみる。

[2382] ./script/plugin install --verbose git://github.com/darashi/jpmobile.git
Plugin not found: ["git://github.com/darashi/jpmobile.git"]

それよりそうか、「--depth 1」とかオプションつけてるけど、Usageメッセーにはないオプションだ、一方最新の方には存在するオプションの様だ。

Gitのバージョン

Debianのパッケージを検索してみる。

etch-backports (devel): fast, scalable, distributed revision control system 
1:1.5.6.5-1~bpo40+1 [backports]: amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc 
1:1.5.6.3-1+lenny2~bpo40+1 [backports]: alpha 

lenny (testing) (devel): fast, scalable, distributed revision control system 
1:1.5.6.5-1: alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc 

この辺を入れ直した方が良いって事かな。自分の環境のメインが etch なので、etch-backports の方が良いのかとも思うが、既に lenny のパッケージを幾らでも入れてるので lennyで。
その前に今入れてる git は aptitude対話でアンインストールする。curl とか rsync もなくなる、まあ、lennyのを入れ直すまでの間だ。

[2394] sudo aptitude install git-core -t testing

依存関係ちょっとあるけど、何となく第2案(下記)で。

以下のパッケージをインストールします:
libcwidget3 [0.5.12-3 (testing)]
libdigest-sha1-perl [2.11-1 (stable)]
libept0 [0.5.22 (testing)]
libxapian15 [1.0.7-4 (testing)]

以下のパッケージを現在のバージョンに一時固定します:
perl [5.8.8-7etch3 (stable, stable, now)]
perl-base [5.8.8-7etch3 (stable, stable, now)]
perl-modules [5.8.8-7etch3 (stable, stable, now)]

以下のパッケージを更新します:
apt [0.6.46.4-0.1 (stable, now) -> 0.7.16+b1 (testing)]
apt-utils [0.6.46.4-0.1 (stable, now) -> 0.7.16+b1 (testing)]
aptitude [0.4.4-4 (stable, now) -> 0.4.11.10-1lenny1.1+b1 (testing)]
libncursesw5 [5.5-5 (stable, now) -> 5.6+20080830-1 (testing)]

スコアは -533 です

apt とか aptitude自身も更新される、凄いや。

[2395] git --version
git version 1.5.6.5

なってる。

jpmobile再び

[2403] ruby script/plugin install --verbose git://github.com/darashi/jpmobile.git
Plugin not found: ["git://github.com/darashi/jpmobile.git"]

では同じく駄目だった。

[2405] ruby script/plugin install git://github.com/darashi/jpmobile.git
removing: /home/hs9587/rails/photo_sid/vendor/plugins/jpmobile/.git
Initialized empty Git repository in /home/hs9587/rails/photo_sid/vendor/plugins/jpmobile/.git/
remote: Counting objects: 794, done.
remote: Compressing objects: 100% (680/680), done.
remote: Total 794 (delta 78), reused 644 (delta 42)
Receiving objects: 100% (794/794), 459.10 KiB | 19 KiB/s, done.
Resolving deltas: 100% (78/78), done.

今度はなんとか。

で、jpmobile の Transit SID を設定、何とかなってる、っぽい。
(/11/07追記、Transit SID なんとかなってないみたい、ローカルのIEがなんとかしちゃってたみたいで気が付かなかった。)

=== セッションIDの付与(Transit SID)
==== Cookie非対応携帯だけに付与する
  class MyController
    trans_sid
  end

==== PCにも付与する
  class MyController
    trans_sid :always
  end