Skip to content

Commit

Permalink
make: fix a bug that config update messages are removed on install
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jan 20, 2022
1 parent d8e6ea7 commit 72d968f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions lib/init-msys1.sh
Expand Up @@ -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 ]]
Expand Down
8 changes: 6 additions & 2 deletions make_command.sh
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions note.txt
Expand Up @@ -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]
Expand Down

0 comments on commit 72d968f

Please sign in to comment.