Homebrew で古いバージョンの screen に切り戻す手順

## 事の発端

1. [Homebrew の screen](https://formulae.brew.sh/formula/screen) が 5.0.0 に更新された。
1. が, [hardstatus に不具合がある](https://cgit.freebsd.org/ports/commit/?id=d2221ef5ffcf08c73198dd92866c4aa3e2864e70) らしく, 色が正しくない, 表示されない項目があるといった現象が確認された。

## 切り戻しメモ

* [Macのhomebrewでtmux3.3aから3.2aへバージョンを下げる | swfz[:memo] << TIL](https://til.swfz.io/entries/tmux_3_3a_to_3_2a/)

### 既存パッケージ削除

```shell
$ brew uninstall screen
Uninstalling /opt/homebrew/Cellar/screen/5.0.0... (29 files, 907.9KB)
```

### 旧パッケージインストール

* 2024/09/02 時点で 700 MB 強ダウンロードするため, 少し時間がかかる。

```shell
$ brew tap --force homebrew/core
==> Tapping homebrew/core
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 2138179, done.
remote: Counting objects: 100% (451/451), done.
remote: Compressing objects: 100% (233/233), done.
remote: Total 2138179 (delta 283), reused 368 (delta 218), pack-reused 2137728 (from 1)
Receiving objects: 100% (2138179/2138179), 781.61 MiB | 8.38 MiB/s, done.
Resolving deltas: 100% (1544511/1544511), done.
==> Downloading https://formulae.brew.sh/api/formula.jws.json

Tapped 4 commands and 7127 formulae (7,482 files, 866MB).
```

* [git-secrets](https://github.com/awslabs/git-secrets) に関するエラーは無視して OK.

```shell
$ brew tap-new ${USER}/taps
Warning: tap-new is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

Initialized empty Git repository in /opt/homebrew/Library/Taps/ryo/homebrew-taps/.git/
git: 'secrets' is not a git command. See 'git --help'.
Error: Failure while executing; `git commit -m Create\ ryo/taps\ tap` exited with 1.
```

* 利用していたバージョンやコミットハッシュ値は [screen.rb](https://github.com/Homebrew/homebrew-core/commits/master/Formula/s/screen.rb) で確認できる。

```shell
$ brew extract screen ${USER}/taps --version 4.9.1

==> Searching repository history
==> Writing formula for screen at 4.9.1 from revision a40c025 to:
/opt/homebrew/Library/Taps/ryo/homebrew-taps/Formula/screen@4.9.1.rb
```

```shell
$ brew install ${USER}/taps/screen@4.9.1

==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/ryo/homebrew-taps, skipping update!
==> Fetching dependencies for ryo/taps/screen@4.9.1: automake
==> Fetching automake
==> Downloading https://ghcr.io/v2/homebrew/core/automake/manifests/1.17
################################################################################################################################# 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/automake/blobs/sha256:aaf3cb57d50c48af4886c0cd24340aa6ca5628feac4a566254a878f378aaa2e5
################################################################################################################################# 100.0%
==> Fetching ryo/taps/screen@4.9.1
==> Downloading https://gist.githubusercontent.com/yujinakayama/4608863/raw/75669072f227b82777df25f99ffd9657bd113847/gistfile1.diff
################################################################################################################################# 100.0%
==> Downloading https://ftp.gnu.org/gnu/screen/screen-4.9.1.tar.gz
################################################################################################################################# 100.0%
==> Installing screen@4.9.1 from ryo/taps
==> Installing dependencies for ryo/taps/screen@4.9.1: automake
==> Installing ryo/taps/screen@4.9.1 dependency: automake
==> Downloading https://ghcr.io/v2/homebrew/core/automake/manifests/1.17
Already downloaded: /Users/ryo/Library/Caches/Homebrew/downloads/82d9fde65d8d7b9a9a5d18a172cd00f1431472b99237173f4ce154eeb48ab07e--automake-1.17.bottle_manifest.json
==> Pouring automake--1.17.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/automake/1.17: 134 files, 3.6MB
==> Installing ryo/taps/screen@4.9.1
==> Patching
==> Applying gistfile1.diff
patching file acconfig.h
==> ./autogen.sh
==> ./configure --mandir=/opt/homebrew/Cellar/screen@4.9.1/4.9.1/share/man --infodir=/opt/homebrew/Cellar/screen@4.9.1/4.9.1/share/info
==> make
==> make install
🍺  /opt/homebrew/Cellar/screen@4.9.1/4.9.1: 28 files, 886.8KB, built in 12 seconds
==> Running `brew cleanup screen@4.9.1`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/ryo/Library/Caches/Homebrew/screen@4.9.1--patch--9c53320cbe3a24c8fb5d77cf701c47918b3fabe8d6f339a00cfdb59e11af0ad5.diff... (827B)
```

```shell
$ screen --version
Screen version 4.09.01 (GNU) 20-Aug-23
```

```shell
$ brew pin ${USER}/taps/screen@4.9.1
$ brew list --pinned
screen@4.9.1
```

どっとはらい。