YUKI Hiroshi
yuki****@clear*****
Wed Sep 17 10:10:36 JST 2014
> パッケージの有無をチェックするなら↑とかどうでしょうか? > パッケージじゃなくて手で.repo書いているケースも救いたい意図ならダメで すが。。。 一般的にどういうふうに判別するものなのかが分からなかったので、見よう見ま ねでyumの実行結果から判別するようにしていました。 定番のやり方はepel-releaseがインストールされているかどうかを見る方なので しょうか? であればその方法に合わせたいと思っています。 HAYASHI Kentaro wrote: > > On Tue, 16 Sep 2014 19:14:09 +0900 > YUKI Hiroshi <null+groonga �� clear-code.com> wrote: > >> YUKI Hiroshi 2014-09-16 19:14:09 +0900 (Tue, 16 Sep 2014) >> >> New Revision: 6f6f6d9ea67105d5e434d30fb7c90b5c06221201 >> https://github.com/droonga/droonga-http-server/commit/6f6f6d9ea67105d5e434d30fb7c90b5c06221201 >> >> Message: >> Disable EPEL by default >> >> Modified files: >> install.sh >> >> Modified: install.sh (+13 -7) >> =================================================================== >> --- install.sh 2014-09-16 18:54:56 +0900 (6e6f320) >> +++ install.sh 2014-09-16 19:14:09 +0900 (b9653fd) >> @@ -238,13 +238,19 @@ install_in_debian() { >> } >> >> install_in_centos() { >> - #TODO: We have to take care of a case when EPEL is already activated. >> - # If EPEL is not activated, we have to activate it temporally >> - # and disable it after installation. >> - # Otherwise we should not do anything around EPEL. >> - yum -y update >> - yum -y install epel-release >> - yum -y install npm >> + if [ $(yum repolist | grep epel | wc -l) -lt 1 ]; then >> + # epel-release is not installed, so install it. >> + yum -y install epel-release >> + # however, we should disable it by default because. >> + # the system administrator won't expect to use it >> + # in his daily use. >> + epel_repo=/etc/yum.repos.d/epel.repo >> + backup=/tmp/$(basename $file).bak >> + mv $epel_repo $backup >> + cat $backup | $sed -e "s/enabled=1/enabled=0/" \ >> + > $epel_repo >> + fi >> + yum -y --enablerepo=epel install npm >> >> echo "" >> > > if [ ! rpm -q epel-release > /dev/null ]; then > yum -y install epel-release > fi > > パッケージの有無をチェックするなら↑とかどうでしょうか? > パッケージじゃなくて手で.repo書いているケースも救いたい意図ならダメですが。。。 > -- 結城 洋志 <YUKI Hiroshi> E-mail: yuki �� clear-code.com 株式会社クリアコード 〒170-0005 東京都豊島区南大塚3-29-9 中野ビル3階 TEL : 03-5927-9440 FAX : 03-5927-9441 WWW : http://www.clear-code.com/