[openrtm-commit:02481] r801 - in trunk/OpenRTM-aist-Python: . install_scripts
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 22日 (水) 17:01:11 JST
Author: kawauchi
Date: 2017-02-22 17:01:11 +0900 (Wed, 22 Feb 2017)
New Revision: 801
Added:
trunk/OpenRTM-aist-Python/install_scripts/
trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh
trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh
trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh
trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh
Log:
[compat,bugfix,->RELENG_1_2] Install_scripts deleted with r767 has been restored.
Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh 2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,204 @@
+#!/bin/sh
+#
+# @file pkg_install_debian.sh
+# @brief OpenRTM-aist dependent packages install script for Debian-sarge
+# @author Noriaki Ando <n-ando at aist.go.jp>
+# Shinji Kurihara
+# Tetsuo Ando
+# Harumi Miyamoto
+# Nobu Kawauchi
+# Saburo Takahashi
+#
+
+# Usage: sudo pkg_install_python_debian.sh [-u -y -h]
+# option -u : Uninstall tool_packages.
+# option -y : When yes/no prompt for installing would be presente d, assume that the user entered "yes".
+# option -h : Display a brief help message.
+#
+
+
+#---------------------------------------
+# ããã±ã¼ã¸ãªã¹ã
+#---------------------------------------
+set_package_list()
+{
+ omnipy="python-omniorb-omg python-omniorb omniidl-python"
+ devel="python"
+ openrtm="openrtm-aist-python openrtm-aist-python-example"
+ packages="$devel $omnipy $openrtm"
+ u_packages="$omnipy $openrtm "
+}
+
+#---------------------------------------
+# ãã±ã¼ã«ã®è¨èªç¢ºèª
+#---------------------------------------
+check_lang()
+{
+lang="en"
+
+locale | grep ja_JP > /dev/null && lang="jp"
+
+if test "$lang" = "jp" ;then
+ msg1="ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã確èªãã¦ãã ããã\nDebian以å¤ã®OSã®å¯è½æ§ãããã¾ãã"
+ msg2="ã³ã¼ããã¼ã ï¼ "
+ msg3="ãã®OSã¯ãµãã¼ãããã¦ããã¾ããã"
+ msg4=" OpenRTM-aistã®ãªãã¸ããªãç»é²ããã¦ãã¾ããã"
+ msg5="Source.listã«OpenrRTM-aistã®ãªãã¸ããªï¼"
+ msg6="ã追å ãã¾ããããããã§ããï¼ (y/n) [y] "
+ msg7="ä¸æãã¾ãã"
+ msg8="ã«ã¼ãã¦ã¼ã¶ã¼ã§å®è¡ãã¦ãã ããã"
+ msg9="ã¤ã³ã¹ãã¼ã«ä¸ã§ã..."
+ msg10="å®äº"
+ msg11="ã¢ã³ã¤ã³ã¹ãã¼ã«ä¸ã§ã"
+else
+ msg1="This distribution may not be debian/ubuntu."
+ msg2="The code name is : "
+ msg3="This OS is not supported."
+ msg4="No repository entry for OpenRTM-aist is configured in your system."
+ msg5="repository entry for OpenrRTM-aist: "
+ msg6="Do you want to add the repository entry for OpenrRTM-aist in source.list? (y/n) [y] "
+ msg7="Abort."
+ msg8="This script should be run as root."
+ msg9="Now installing: "
+ msg10="done."
+ msg11="Now uninstalling: "
+
+fi
+
+}
+
+#---------------------------------------
+# ã³ã¼ããã¼ã åå¾
+#---------------------------------------
+check_codename () {
+ cnames="sarge etch lenny squeeze wheezy jessie"
+ for c in $cnames; do
+ if test -f "/etc/apt/sources.list"; then
+ res=`grep $c /etc/apt/sources.list`
+ else
+ echo $msg1
+ exit
+ fi
+ if test ! "x$res" = "x" ; then
+ code_name=$c
+ fi
+ done
+ if test ! "x$code_name" = "x"; then
+ echo $msg2 $code_name
+ else
+ echo $msg3
+ exit
+ fi
+}
+
+#---------------------------------------
+# ãªãã¸ããªãµã¼ã
+#---------------------------------------
+create_srclist () {
+ openrtm_repo="deb http://openrtm.org/pub/Linux/debian/ $code_name main"
+}
+
+#---------------------------------------
+# ã½ã¼ã¹ãªã¹ãæ´æ°é¢æ°ã®å®ç¾©
+#---------------------------------------
+update_source_list () {
+ rtmsite=`grep openrtm /etc/apt/sources.list`
+ if test "x$rtmsite" = "x" ; then
+ echo $msg4
+ echo $msg5
+ echo " " $openrtm_repo
+ read -p $msg6 kick_shell
+
+ if test "x$kick_shell" = "xn" ; then
+ echo $msg7
+ exit 0
+ else
+ echo $openrtm_repo >> /etc/apt/sources.list
+ fi
+ fi
+}
+
+#----------------------------------------
+# root ãã©ããããã§ãã¯
+#----------------------------------------
+check_root () {
+ if test ! `id -u` = 0 ; then
+ echo ""
+ echo $msg8
+ echo $msg7
+ echo ""
+ exit 1
+ fi
+}
+
+#----------------------------------------
+# ããã±ã¼ã¸ã¤ã³ã¹ãã¼ã«é¢æ°
+#----------------------------------------
+install_packages () {
+ for p in $*; do
+ echo $msg9 $p
+ apt-get install $p $force_yes
+ echo $msg10
+ echo ""
+ done
+}
+
+#------------------------------------------------------------
+# ãªã¹ããéé ã«ãã
+#------------------------------------------------------------
+reverse () {
+ for i in $*; do
+ echo $i
+ done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# ããã±ã¼ã¸ãã¢ã³ã¤ã³ã¹ãã¼ã«ãã
+#----------------------------------------
+uninstall_packages () {
+ for p in $*; do
+ echo $msg11 $p
+ aptitude remove $p
+ echo $msg10
+ echo ""
+ done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+ cat << EOF
+Usage: sudo $0 [-u -y -h]
+ option -u : Uninstall tool_packages.
+ option -y : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+ option -h : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# ã¡ã¤ã³
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+ howto_usage
+ exit 1
+fi
+
+check_lang
+check_root
+check_codename
+set_package_list
+
+if test "x$1" = "x-y" ; then
+ force_yes="-y --force-yes"
+fi
+
+if test "x$1" = "x-u" ; then
+ uninstall_packages `reverse $u_packages`
+else
+ create_srclist
+ update_source_list
+ apt-get update
+ install_packages $packages
+fi
+
Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh 2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,191 @@
+#!/bin/sh
+#
+# @file pkg_install_fedora.sh
+# @brief OpenRTM-aist dependent packages install script for Fedora
+# @author Noriaki Ando <n-ando at aist.go.jp>
+# Shinji Kurihara
+# Tetsuo Ando
+# Nobu Kawauchi
+# Saburo Takahashi
+#
+# ãã®ã·ã§ã«ã¹ã¯ãªããã¯ãaceããã³omniORBã®ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã
+# fedoraã®éçºç°å¢ãæ§ç¯ãã¾ãã
+#
+# $Id$
+#
+
+# Usage: sudo pkg_install_python_fedora.sh [-u -y -h]
+# option -u : Uninstall tool_packages.
+# option -y : When yes/no prompt for installing would be presente d, assume that the user entered "yes".
+# option -h : Display a brief help message.
+#
+
+
+#---------------------------------------
+# ããã±ã¼ã¸ãªã¹ã
+#---------------------------------------
+version_num=`cat /etc/fedora-release | awk '/Fedora/{print $3}' -`
+if [ $version_num -le 19 ]; then
+ omnipy="omniORB-servers omniORBpy omniORBpy-devel omniORBpy-standard"
+else
+ omnipy="omniORB-servers python-omniORB omniORBpy-devel"
+fi
+devel="python"
+openrtm="OpenRTM-aist-Python OpenRTM-aist-Python-example"
+packages="$devel $omnipy $openrtm"
+u_packages="$omnipy $openrtm "
+
+#---------------------------------------
+# yum / dnf ã³ãã³ãåæ¿ã
+#---------------------------------------
+if [ $version_num -ge 22 ]; then
+ COMMAND="dnf"
+else
+ COMMAND="yum"
+fi
+
+#----------------------------------------
+# root ãã©ããããã§ãã¯
+#----------------------------------------
+check_root () {
+ if test ! `id -u` = 0 ; then
+ echo ""
+ echo "This script should be run by root user."
+ echo "Abort."
+ echo ""
+ exit 1
+ fi
+}
+
+#---------------------------------------
+# ã¤ã³ã¹ãã¼ã«æ¸ããã±ã¼ã¸ãªã¹ã
+#---------------------------------------
+rpm_qa="/tmp/yum_list.txt"
+get_pkg_list () {
+ rpm -qa > $rpm_qa
+}
+clean_pkg_list () {
+ rm -f $rpm_qa
+}
+
+#---------------------------------------
+# ãªãã¸ããªãµã¤ãè¨å®ãã¡ã¤ã«ãçæ
+#---------------------------------------
+openrtm_repo () {
+cat <<EOF
+[openrtm]
+name=Fedora \$releasever - \$basearch
+failovermethod=priority
+baseurl=http://openrtm.org/pub/Linux/Fedora/releases/\$releasever/Fedora/\$basearch/os/Packages
+enabled=1
+gpgcheck=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+EOF
+}
+create_repo() {
+ repo="/etc/yum.repos.d/openrtm.repo"
+ if test ! -f $repo ; then
+ echo "OpenRTM-aist ã®ãªãã¸ããªãç»é²ããã¦ãã¾ããã"
+ echo "OpenRTM-aist ã®ãªãã¸ããª: "
+ echo " http://www.openrtm.org/pub/Linux/Fedora/"
+ read -p "ã追å ãã¾ããããããã§ããï¼ (y/n) [y] " kick_shell
+
+ if test "x$kick_shell" = "xn" ; then
+ echo "ä¸æãã¾ãã"
+ exit 0
+ else
+ openrtm_repo > /etc/yum.repos.d/openrtm.repo
+ fi
+ fi
+}
+
+#----------------------------------------
+# ããã±ã¼ã¸ã¤ã³ã¹ãã¼ã«é¢æ°
+#----------------------------------------
+install_packages () {
+ for p in $*; do
+ if test "x$p" = "x0.4.2" || test "x$p" = "x0.4.2" ; then
+ :
+ else
+ if echo "$p" | grep -q '=0.4.2' ; then
+ str=`echo "$p" |sed 's/=0.4.2//'`
+ else
+ str="$p"
+ fi
+
+ ins=`rpm -qa $str`
+
+ if test "x$ins" = "x"; then
+ echo "Now installing: " $p
+ $COMMAND install $p $force_yes
+ echo "done."
+ echo ""
+ else
+ if echo "$ins" |grep -q '0.4.2-0' ; then
+ $COMMAND install $p
+ echo "done."
+ echo ""
+ else
+ echo $ins
+ echo $str "is already installed."
+ echo ""
+ fi
+ fi
+ fi
+ done
+}
+
+
+#------------------------------------------------------------
+# ãªã¹ããéé ã«ãã
+#------------------------------------------------------------
+reverse () {
+ for i in $*; do
+ echo $i
+ done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# ããã±ã¼ã¸ãã¢ã³ã¤ã³ã¹ãã¼ã«ãã
+#----------------------------------------
+uninstall_packages () {
+ for p in $*; do
+ echo "Now uninstalling: " $p
+ $COMMAND erase $p
+ echo "done."
+ echo ""
+ done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+ cat << EOF
+Usage: sudo $0 [-u -y -h]
+ option -u : Uninstall tool_packages.
+ option -y : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+ option -h : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# ã¡ã¤ã³
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+ howto_usage
+ exit 1
+fi
+
+check_root
+
+if test "x$1" = "x-y" ; then
+ force_yes="-y"
+fi
+
+if test "x$1" = "x-u" ; then
+ uninstall_packages `reverse $u_packages`
+else
+ create_repo
+ install_packages $packages
+fi
Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh 2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,216 @@
+#!/bin/sh
+#
+# @file pkg_install_ubuntu.sh
+# @brief OpenRTM-aist dependent packages install script for Debian-sarge
+# @author Noriaki Ando <n-ando at aist.go.jp>
+# Shinji Kurihara
+# Tetsuo Ando
+# Harumi Miyamoto
+# Nobu Kawauchi
+# Saburo Takahashi
+#
+
+# Usage: sudo pkg_install_python_ubuntu.sh [-u -y -h]
+# option -u : Uninstall tool_packages.
+# option -y : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+# option -h : Display a brief help message.
+#
+
+this_file=${0##*/}
+
+rtm_ver=`echo "$this_file" | sed -e "s/pkg_install_python_ubuntu-//g" -e "s/\.sh//g"`
+
+if test "$rtm_ver" = "pkg_install_python_ubuntu";then
+ rtm_ver=""
+else
+ rtm_ver="=$rtm_ver"
+fi
+
+echo "rtm_ver is $rtm_ver"
+
+#---------------------------------------
+# ããã±ã¼ã¸ãªã¹ã
+#---------------------------------------
+set_package_list()
+{
+ omnipy="python-pyorbit-omg omniidl-python"
+ devel="python"
+ openrtm="openrtm-aist-python$rtm_ver openrtm-aist-python-example$rtm_ver"
+ packages="$devel $omnipy $openrtm"
+ u_packages="$omnipy $openrtm "
+}
+
+#---------------------------------------
+# ãã±ã¼ã«ã®è¨èªç¢ºèª
+#---------------------------------------
+check_lang()
+{
+lang="en"
+
+locale | grep ja_JP > /dev/null && lang="jp"
+
+if test "$lang" = "jp" ;then
+ msg1="ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã確èªãã¦ãã ããã\nDebianãUbuntu以å¤ã®OSã®å¯è½æ§ãããã¾ãã"
+ msg2="ã³ã¼ããã¼ã :"
+ msg3="ãã®OSã¯ãµãã¼ããã¦ããã¾ããã"
+ msg4="OpenRTM-aist ã®ãªãã¸ããªãç»é²ããã¦ãã¾ããã"
+ msg5="Source.list ã« OpenRTM-aist ã®ãªãã¸ããª: "
+ msg6="ã追å ãã¾ããããããã§ããï¼(y/n)[y] "
+ msg7="ä¸æãã¾ãã"
+ msg8="ã«ã¼ãã¦ã¼ã¶ã¼ã§å®è¡ãã¦ãã ããã"
+ msg9="ã¤ã³ã¹ãã¼ã«ä¸ã§ã..."
+ msg10="å®äº"
+ msg11="ã¢ã³ã¤ã³ã¹ãã¼ã«ä¸ã§ã."
+else
+ msg1="This distribution may not be debian/ubuntu."
+ msg2="The code name is : "
+ msg3="This OS is not supported."
+ msg4="No repository entry for OpenRTM-aist is configured in your system."
+ msg5="repository entry for OpenrRTM-aist: "
+ msg6="Do you want to add new repository entry for OpenrRTM-aist in source.list? (y/n) [y] "
+ msg7="Abort."
+ msg8="This script should be run as root."
+ msg9="Now installing: "
+ msg10="done."
+ msg11="Now uninstalling: "
+fi
+
+}
+
+#---------------------------------------
+# ã³ã¼ããã¼ã åå¾
+#---------------------------------------
+check_codename () {
+ codename=`sed -n /DISTRIB_CODENAME=/p /etc/lsb-release`
+ cnames=`echo "$codename" | sed 's/DISTRIB_CODENAME=//'`
+ #cnames="sarge edgy feisty gutsy hardy intrepid"
+ for c in $cnames; do
+ if test -f "/etc/apt/sources.list"; then
+ res=`grep $c /etc/apt/sources.list`
+ else
+ echo $msg1
+ exit
+ fi
+ if test ! "x$res" = "x" ; then
+ code_name=$c
+ fi
+ done
+ if test ! "x$code_name" = "x"; then
+ echo $msg2 $code_name
+ else
+ echo $msg3
+ exit
+ fi
+}
+
+#---------------------------------------
+# ãªãã¸ããªãµã¼ã
+#---------------------------------------
+create_srclist () {
+ openrtm_repo="deb http://openrtm.org/pub/Linux/ubuntu/ $code_name main"
+}
+
+#---------------------------------------
+# ã½ã¼ã¹ãªã¹ãæ´æ°é¢æ°ã®å®ç¾©
+#---------------------------------------
+update_source_list () {
+ rtmsite=`grep openrtm /etc/apt/sources.list`
+ if test "x$rtmsite" = "x" ; then
+ echo $msg4
+ echo $msg5
+ echo " " $openrtm_repo
+ read -p $msg6 kick_shell
+
+ if test "x$kick_shell" = "xn" ; then
+ echo $msg7
+ exit 0
+ else
+ echo $openrtm_repo >> /etc/apt/sources.list
+ fi
+ fi
+}
+
+#----------------------------------------
+# root ãã©ããããã§ãã¯
+#----------------------------------------
+check_root () {
+ if test ! `id -u` = 0 ; then
+ echo ""
+ echo $msg8
+ echo $msg7
+ echo ""
+ exit 1
+ fi
+}
+
+#----------------------------------------
+# ããã±ã¼ã¸ã¤ã³ã¹ãã¼ã«é¢æ°
+#----------------------------------------
+install_packages () {
+ for p in $*; do
+ echo $msg9 $p
+ apt-get install $p $force_yes
+ echo $msg10
+ echo ""
+ done
+}
+
+#------------------------------------------------------------
+# ãªã¹ããéé ã«ãã
+#------------------------------------------------------------
+reverse () {
+ for i in $*; do
+ echo $i
+ done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# ããã±ã¼ã¸ãã¢ã³ã¤ã³ã¹ãã¼ã«ãã
+#----------------------------------------
+uninstall_packages () {
+ for p in $*; do
+ echo $msg11 $p
+ aptitude remove $p
+ echo $msg10
+ echo ""
+ done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+ cat << EOF
+Usage: sudo $0 [-u -y -h]
+ option -u : Uninstall tool_packages.
+ option -y : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+ option -h : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# ã¡ã¤ã³
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+ howto_usage
+ exit 1
+fi
+
+check_lang
+check_root
+check_codename
+set_package_list
+
+if test "x$1" = "x-y" ; then
+ force_yes="-y --force-yes"
+fi
+
+if test "x$1" = "x-u" ; then
+ uninstall_packages `reverse $u_packages`
+else
+ create_srclist
+ update_source_list
+ apt-get update
+ install_packages $packages
+fi
+
Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh 2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,163 @@
+#!/bin/sh
+#
+# @file pkg_install_vine.sh
+# @brief OpenRTM-aist dependent packages installation script for Vine Linux
+# @author Noriaki Ando <n-ando at aist.go.jp>
+# Shinji Kurihara
+# Tetsuo Ando
+# Saburo Takahashi
+#
+# このシェルスクリプトは、aceおよびomniORBのパッケージをインストールし、
+# Vine Linuxの開発環境を構築します。
+#
+# Usage: sudo pkg_install_python_vine.sh [-u -y -h]
+# option -u : Uninstall tool_packages.
+# option -y : When yes/no prompt for installing would be presente d, assume that the user entered "yes".
+# option -h : Display a brief help message.
+#
+
+#---------------------------------------
+# Vineバージョン特定
+#---------------------------------------
+vinever=`cat /etc/vine-release | sed 's/.*\([0-9].[0-9]\).*/\1/'`
+
+#---------------------------------------
+# リポジトリサーバ
+#---------------------------------------
+openrtm_repo="rpm http://www.openrtm.org/pub/Linux/Vine/apt $vinever/\$(ARCH) main"
+
+#---------------------------------------
+# パッケージリスト
+#---------------------------------------
+omnipy="python omniORB-servers omniORBpy omniORBpy-devel omniORBpy-standard"
+openrtm="OpenRTM-aist-Python OpenRTM-aist-Python-example"
+packages="$omnipy $openrtm"
+
+
+
+
+#----------------------------------------
+# root かどうかをチェック
+#----------------------------------------
+check_root () {
+ if test ! `id -u` = 0 ; then
+ echo ""
+ echo "This script should be run by root user."
+ echo "Abort."
+ echo ""
+ exit 1
+ fi
+}
+
+#---------------------------------------
+# ソースリスト更新関数の定義
+#---------------------------------------
+update_source_list () {
+ rtmsite=`grep openrtm /etc/apt/sources.list`
+ if test "x$rtmsite" = "x" ; then
+ echo "OpenRTM-aist のリポジトリが登録されていません。"
+ echo "Source.list に OpenRTM-aist のリポジトリ: "
+ echo " " $openrtm_repo
+ read -p "を追加します。よろしいですか? (y/n) [y] " kick_shell
+
+ if test "x$kick_shell" = "xn" ; then
+ echo "中断します。"
+ exit 0
+ else
+ echo $openrtm_repo >> /etc/apt/sources.list
+ fi
+ fi
+}
+
+#----------------------------------------
+# パッケージをインストールする
+#----------------------------------------
+install_packages () {
+ for p in $*; do
+ if test "x$p" = "x0.4.2" ; then
+ :
+ else
+ if echo "$p" | grep -q '=0.4.2' ; then
+ str=`echo "$p" |sed 's/=0.4.2//'`
+ else
+ str="$p"
+ fi
+
+ ins=`rpm -qa $str`
+
+ if test "x$ins" = "x"; then
+ echo "Now installing: " $p
+ apt-get install $p $force_yes
+ echo "done."
+ echo ""
+ else
+ if echo "$ins" |grep -q '0.4.2-0' ; then
+ apt-get install $p $force_yes
+ echo "done."
+ echo ""
+ else
+ echo $ins
+ echo $str "is already installed."
+ echo ""
+ fi
+ fi
+ fi
+ done
+}
+
+
+#------------------------------------------------------------
+# リストを逆順にする
+#------------------------------------------------------------
+reverse () {
+ for i in $*; do
+ echo $i
+ done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# パッケージをアンインストールする
+#----------------------------------------
+uninstall_packages () {
+ for p in $*; do
+ echo "Now uninstalling: " $p
+ rpm -e $p
+ echo "done."
+ echo ""
+ done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+ cat << EOF
+Usage: sudo $0 [-u -y -h]
+ option -u : Uninstall tool_packages.
+ option -y : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+ option -h : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# メイン
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+ howto_usage
+ exit 1
+fi
+
+check_root
+
+if test "x$1" = "x-y" ; then
+ force_yes="-y --force-yes"
+fi
+
+if test "x$1" = "x-u" ; then
+ uninstall_packages `reverse $packages`
+else
+ update_source_list
+ apt-get update
+ install_packages $packages
+fi
+
openrtm-commit メーリングリストの案内