From 72d968feff4415304837be1f5f4405b96882d73a Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 13 Jan 2022 15:09:13 +0900 Subject: [PATCH] make: fix a bug that config update messages are removed on install --- docs/ChangeLog.md | 1 + lib/init-msys1.sh | 3 +-- make_command.sh | 8 ++++++-- note.txt | 12 ++++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index b4dfaada..42228828 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -220,6 +220,7 @@ - util (visible-bell): erase visible-bell before running external commands `#D1723` 0da0c1c - util (`ble/function`): work around `shopt -u extglob` `#D1725` 952c388 - syntax: fix uninitialized syntax-highlighting in bash-3.2 `#D1731` 0000000 +- make: fix a bug that config update messages are removed on install `#D1736` 0000000 ## Documentation diff --git a/lib/init-msys1.sh b/lib/init-msys1.sh index ca50e72d..916dfa3d 100644 --- a/lib/init-msys1.sh +++ b/lib/init-msys1.sh @@ -37,9 +37,8 @@ function ble-edit/io:msys1/compile-helper { [[ -x $helper && -s $helper && $helper -nt $_ble_base/lib/init-msys1.sh ]] && return 0 # /mingw/bin/gcc - local include='#include' # '#' で始まる行はインストール時に消される gcc -O2 -s -o "$helper" -xc - << EOF || return 1 -#%$ sed 's/^#include/$include/' lib/init-msys1-helper.c +#%include init-msys1-helper.c EOF [[ -x $helper ]] diff --git a/make_command.sh b/make_command.sh index d0e3bc97..a81b9bc0 100755 --- a/make_command.sh +++ b/make_command.sh @@ -60,8 +60,12 @@ function sub:install { local dst=$2 mkd "${dst%/*}" if [[ $src == *.sh ]]; then - local nl=$'\n' q=\' script=$'1i\\\n# this script is a part of blesh (https://github.com/akinomyoga/ble.sh) under BSD-3-Clause license' - script=$script$nl'/^[[:space:]]*#/d;/^[[:space:]]*$/d' + local nl=$'\n' q=\' + local script='1i\ +# this script is a part of blesh (https://github.com/akinomyoga/ble.sh) under BSD-3-Clause license +/<<[[:space:]]*EOF/,/^[[:space:]]*EOF/{p;d;} +/^[[:space:]]*#/d +/^[[:space:]]*$/d' [[ $flag_release ]] && script=$script$nl's/^\([[:space:]]*_ble_base_repository=\)'$q'.*'$q'\([[:space:]]*\)$/\1'${q}release:$dist_git_branch$q'/' sed "$script" "$src" >| "$dst.part" && mv "$dst.part" "$dst" diff --git a/note.txt b/note.txt index 265e0a9d..d1ad1809 100644 --- a/note.txt +++ b/note.txt @@ -5810,6 +5810,18 @@ bash_tips Done (実装ログ) ------------------------------------------------------------------------------- +2022-01-11 + + * def.sh にある設定更新メッセージが make install で削除されるのでは? [#D1736] + + # で始まる行は全て一律に削除している。 + + 色々考えたが init-msys2 にある様な変な回避方法はやはり不自然なのでやめたい。 + インストールスクリプトでコメント・空白行を削除している箇所を確認した所、意 + 外と簡単に heredocument だけ出力する様にできそうなので、その様に修正した。 + それに伴って init-msys2 にある回避も削除した。ちゃんと正しくインストールさ + れている。 + 2022-01-09 * test: テストログをファイルに出力する [#D1735]