Tambourine作業メモ

主にスキル習得のためにやった作業のメモ。他人には基本的に無用のものです。

MacへSubversionを入れたい

2020年にもなって、svnを使っているプロジェクトに関わることになった。まあ、だからどうと言うことはない。 どうと言うことはないんだけども、Macでのsvnには苦い思い出がある。 かなり前のことだけど、WindowsなどとUnicodeの正規化の扱いが違い、濁点が含まれたファイルが2つに分裂するなど、悲しいことが結構起きた。 特別なパッチを当てたsvnをインストールする必要があったを記憶している。

詳細はあんまりわかってないんだけど、APFSでこの扱いが変更されたので今は問題なくなっているのかなーと推測しているが、詳細は全然わかってない。 ググってみたんだけど、まあ、もうみんなsvnなんか使っていないのか、これと言った情報が引っかからない。 そして、さらにOS標準のsvnはCatalinaでなくなっちゃったんだと。あれま。

とりあえず、brewでインストールしてみる

> brew info svn
subversion: stable 1.13.0 (bottled), HEAD
Version control system designed to be a better CVS
https://subversion.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/subversion.rb
==> Dependencies
Build: openjdk ✔, pkg-config ✘, scons ✘, swig@3 ✘
Required: apr ✘, apr-util ✘, gettext ✘, lz4 ✘, openssl@1.1 ✘, perl ✘, sqlite ✘, utf8proc ✘
==> Requirements
Required: macOS is required ✔
==> Options
--HEAD
    Install HEAD version
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

The perl bindings are located in various subdirectories of:
  /usr/local/opt/subversion/lib/perl5

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib
==> Analytics
install: 8,763 (30 days), 34,364 (90 days), 108,450 (365 days)
install-on-request: 7,790 (30 days), 29,555 (90 days), 83,898 (365 days)
build-error: 0 (30 days)

> brew install svn
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/apr-1.7.0.catalina.bottle.t
==> Downloading from https://akamai.bintray.com/27/277c42fcf2f5ca298a14279d1325f
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/openssl%401.1-1.1.1g.catali
==> Downloading from https://akamai.bintray.com/19/1926679569c6af5337de812d86f4d
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/apr-util-1.6.1_3.catalina.b
==> Downloading from https://akamai.bintray.com/42/425955a21c3fec8e78f365cd7fc4c
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.20.2_1.catalina.b
==> Downloading from https://akamai.bintray.com/71/71f4ded03e8258b5e6896eebb00d2
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/lz4-1.9.2.catalina.bottle.t
==> Downloading from https://akamai.bintray.com/7d/7de6165d86c7a7ae01d254a5d0ea0
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/perl-5.30.2_1.catalina.bott
==> Downloading from https://akamai.bintray.com/b2/b25dbfa43f3fea68a3acdf7f59e18
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/readline-8.0.4.catalina.bot
==> Downloading from https://akamai.bintray.com/6a/6ae1c8e7c783f32bd22c6085caa4d
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.31.1.catalina.bott
==> Downloading from https://akamai.bintray.com/e0/e09e8c96db88178e4f47b0cdab647
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/utf8proc-2.5.0.catalina.bot
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/subversion-1.13.0_5.catalin
==> Downloading from https://akamai.bintray.com/0c/0c131c339c9d452563aeda9dffc0a
######################################################################## 100.0%
==> Installing dependencies for subversion: apr, openssl@1.1, apr-util, gettext, lz4, perl, readline, sqlite and utf8proc
==> Installing subversion dependency: apr
==> Pouring apr-1.7.0.catalina.bottle.tar.gz
==> Caveats
apr is keg-only, which means it was not symlinked into /usr/local,
because Apple's CLT provides apr.

If you need to have apr first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/apr/bin" $fish_user_paths' >> ~/.config/fish/config.fish

==> Summary
🍺  /usr/local/Cellar/apr/1.7.0: 59 files, 1.4MB
==> Installing subversion dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1g.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@1.1/certs

and run
  /usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/openssl@1.1/bin" $fish_user_paths' >> ~/.config/fish/config.fish

For compilers to find openssl@1.1 you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/openssl@1.1/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/openssl@1.1/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/openssl@1.1/1.1.1g: 8,059 files, 18MB
==> Installing subversion dependency: apr-util
==> Pouring apr-util-1.6.1_3.catalina.bottle.tar.gz
==> Caveats
apr-util is keg-only, which means it was not symlinked into /usr/local,
because Apple's CLT provides apr (but not apr-util).

If you need to have apr-util first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/apr-util/bin" $fish_user_paths' >> ~/.config/fish/config.fish

==> Summary
🍺  /usr/local/Cellar/apr-util/1.6.1_3: 54 files, 785.7KB
==> Installing subversion dependency: gettext
==> Pouring gettext-0.20.2_1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/gettext/0.20.2_1: 1,923 files, 18.6MB
==> Installing subversion dependency: lz4
==> Pouring lz4-1.9.2.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/lz4/1.9.2: 22 files, 589.5KB
==> Installing subversion dependency: perl
==> Pouring perl-5.30.2_1.catalina.bottle.tar.gz
==> Caveats
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
  echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.config/fish/config.fish
==> Summary
🍺  /usr/local/Cellar/perl/5.30.2_1: 2,444 files, 62MB
==> Installing subversion dependency: readline
==> Pouring readline-8.0.4.catalina.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.

For compilers to find readline you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/readline/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/readline/include"

For pkg-config to find readline you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/readline/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/readline/8.0.4: 48 files, 1.5MB
==> Installing subversion dependency: sqlite
==> Pouring sqlite-3.31.1.catalina.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have sqlite first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/sqlite/bin" $fish_user_paths' >> ~/.config/fish/config.fish

For compilers to find sqlite you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/sqlite/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/sqlite/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/sqlite/3.31.1: 11 files, 4MB
==> Installing subversion dependency: utf8proc
==> Pouring utf8proc-2.5.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/utf8proc/2.5.0: 10 files, 650.2KB
==> Installing subversion
==> Pouring subversion-1.13.0_5.catalina.bottle.tar.gz
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

The perl bindings are located in various subdirectories of:
  /usr/local/opt/subversion/lib/perl5

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/subversion/1.13.0_5: 234 files, 30.4MB
==> Caveats
==> apr
apr is keg-only, which means it was not symlinked into /usr/local,
because Apple's CLT provides apr.

If you need to have apr first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/apr/bin" $fish_user_paths' >> ~/.config/fish/config.fish

==> openssl@1.1
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@1.1/certs

and run
  /usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/openssl@1.1/bin" $fish_user_paths' >> ~/.config/fish/config.fish

For compilers to find openssl@1.1 you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/openssl@1.1/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/openssl@1.1/lib/pkgconfig"

==> apr-util
apr-util is keg-only, which means it was not symlinked into /usr/local,
because Apple's CLT provides apr (but not apr-util).

If you need to have apr-util first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/apr-util/bin" $fish_user_paths' >> ~/.config/fish/config.fish

==> perl
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
  echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.config/fish/config.fish
==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.

For compilers to find readline you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/readline/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/readline/include"

For pkg-config to find readline you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/readline/lib/pkgconfig"

==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have sqlite first in your PATH run:
  echo 'set -g fish_user_paths "/usr/local/opt/sqlite/bin" $fish_user_paths' >> ~/.config/fish/config.fish

For compilers to find sqlite you may need to set:
  set -gx LDFLAGS "-L/usr/local/opt/sqlite/lib"
  set -gx CPPFLAGS "-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set:
  set -gx PKG_CONFIG_PATH "/usr/local/opt/sqlite/lib/pkgconfig"

==> subversion
svntools have been installed to:
  /usr/local/opt/subversion/libexec

The perl bindings are located in various subdirectories of:
  /usr/local/opt/subversion/lib/perl5

You may need to link the Java bindings into the Java Extensions folder:
  sudo mkdir -p /Library/Java/Extensions
  sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions/libsvnjavahl-1.dylib

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

さて、これでプロジェクトの適当なドキュメントをチェックアウトし、ファイル名に濁点が入っている(「ベースライン」という言葉が含まれていた)Excelファイルを開き、シートを1つ増やして保存。svn statusしてみた。ちゃんと変更が捉えられていた。昔はこれが、ファイルが2つに増えて、1つは新規と認識されていたのだ。つまり、ファイル名が「へ゛ースライン」と「ベースライン」の2つになっちゃったわけだ。見た目は表示するときに「へ゛」を「べ」にするからおんなじなんだけど。

とりあえず、大丈夫そうで良かった。