[openrtm-commit:01080] r2386 - trunk/OpenRTM-aist/build

openrtm @ openrtm.org openrtm @ openrtm.org
2013年 5月 8日 (水) 13:42:45 JST


Author: kawauchi
Date: 2013-05-08 13:42:45 +0900 (Wed, 08 May 2013)
New Revision: 2386

Modified:
   trunk/OpenRTM-aist/build/pkg_install_debian.sh
   trunk/OpenRTM-aist/build/pkg_install_fedora.sh
   trunk/OpenRTM-aist/build/pkg_install_ubuntu.sh
Log:
C++?\231?\148?\168?\228?\184?\128?\230?\139?\172?\227?\130?\164?\227?\131?\179?\227?\130?\185?\227?\131?\136?\227?\131?\188?\227?\131?\171?\227?\130?\185?\227?\130?\175?\227?\131?\170?\227?\131?\151?\227?\131?\136?\230?\149?\180?\229?\130?\153?\227?\128?\130?\229?\144?\132?\227?\131?\135?\227?\130?\163?\227?\130?\185?\227?\131?\136?\227?\131?\170?\227?\131?\147?\227?\131?\165?\227?\131?\188?\227?\130?\183?\227?\131?\167?\227?\131?\179?\227?\129?\174?\227?\130?\181?\227?\131?\157?\227?\131?\188?\227?\131?\136?\227?\131?\144?\227?\131?\188?\227?\130?\184?\227?\131?\167?\227?\131?\179?\227?\129?\171?\229?\175?\190?\229?\191?\156?\227?\129?\149?\227?\129?\155?\227?\129?\159?\227?\128?\130

Modified: trunk/OpenRTM-aist/build/pkg_install_debian.sh
===================================================================
--- trunk/OpenRTM-aist/build/pkg_install_debian.sh	2013-04-15 11:39:45 UTC (rev 2385)
+++ trunk/OpenRTM-aist/build/pkg_install_debian.sh	2013-05-08 04:42:45 UTC (rev 2386)
@@ -6,18 +6,31 @@
 #         Shinji Kurihara
 #         Tetsuo Ando
 #         Harumi Miyamoto
+#         Nobu Kawauchi
 #
 
 #---------------------------------------
 # パッケージリスト
 #---------------------------------------
-omni="libomniorb4 libomniorb4-dev omniidl4 omniorb4-nameserver"
+set_package_list()
+{
+if [ "$code_name" = "wheezy" ]; then
+	omni="libomniorb4-1 libomniorb4-dev omniidl omniorb-nameserver"
+else
+	omni="libomniorb4 libomniorb4-dev omniidl4 omniorb4-nameserver"
+fi
+ace="libace libace-dev"
 openrtm="openrtm-aist openrtm-aist-doc openrtm-aist-dev openrtm-aist-example"
+openrtm04="openrtm-aist=0.4.2-1 openrtm-aist-doc=0.4.2-1 openrtm-aist-dev=0.4.2-1 openrtm-aist-example=0.4.2-1"
 pyyaml="python-support python-yaml"
 devel="gcc g++ make uuid-dev"
 packages="$devel $omni $pyyaml $openrtm"
-u_packages="$omni $openrtm "
+u_packages="$omni $ace $openrtm "
 
+reposervers="www.openrtm.org www.openrtm.de"
+reposerver=""
+}
+
 #---------------------------------------
 # ロケールの言語確認
 #---------------------------------------
@@ -33,7 +46,7 @@
     msg3="このOSはサポートされておりません。"
     msg4=" OpenRTM-aistのリポジトリが登録されていません。"
     msg5="Source.listにOpenrRTM-aistのリポジトリ:"
-    msg6="を追加します。よろしいですか? (y/n) [y] "
+    msg6="を追加します。よろしいですか?(y/n)[y] "
     msg7="中断します。"
     msg8="ルートユーザーで実行してください。"
     msg9="インストール中です..."
@@ -45,7 +58,7 @@
     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] "
+    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: "
@@ -57,10 +70,10 @@
 }
 
 #---------------------------------------
-# リポジトリサーバ
+# コードネーム取得
 #---------------------------------------
-create_srclist () {
-    cnames="sarge etch lenny"
+check_codename () {
+    cnames="sarge etch lenny squeeze wheezy"
     for c in $cnames; do
 	if test -f "/etc/apt/sources.list"; then
 	    res=`grep $c /etc/apt/sources.list`
@@ -78,14 +91,45 @@
 	echo $msg3
 	exit
     fi
-    openrtm_repo="deb http://www.openrtm.org/pub/Linux/debian/ $code_name main"
 }
 
+#----------------------------------------
+# 近いリポジトリサーバを探す
+#----------------------------------------
+check_reposerver()
+{
+    minrtt=65535
+    nearhost=''
+    for host in $reposervers; do
+	rtt=`ping -c 1 $host | grep 'time=' | sed -e 's/^.*time=\([0-9\.]*\) ms.*/\1/' 2> /dev/null`
+	if test "x$rtt" = "x"; then
+	    rtt=65535
+	fi
+	if test `echo "scale=2 ; $rtt < $minrtt" | bc` -gt 0; then
+	    minrtt=$rtt
+	    nearhost=$host
+	fi
+    done
+    if test "x$nearhost" = "x"; then
+	echo "Repository servers unreachable.", $hosts
+	exit 1
+    fi
+    reposerver=$nearhost
+}
+
+
 #---------------------------------------
+# リポジトリサーバ
+#---------------------------------------
+create_srclist () {
+    openrtm_repo="deb http://$reposerver/pub/Linux/debian/ $code_name main"
+}
+
+#---------------------------------------
 # ソースリスト更新関数の定義
 #---------------------------------------
 update_source_list () {
-    rtmsite=`grep openrtm /etc/apt/sources.list`
+    rtmsite=`grep $reposerver /etc/apt/sources.list`
     if test "x$rtmsite" = "x" ; then
 	echo $msg4
 	echo $msg5
@@ -119,7 +163,7 @@
 #----------------------------------------
 install_packages () {
     for p in $*; do
-	echo $msg9 $p
+	echo $msg9 $p 
 	apt-get install $p
 	echo $msg10
 	echo ""
@@ -140,10 +184,13 @@
 #----------------------------------------
 uninstall_packages () {
     for p in $*; do
-	echo $msg11 $p
-	aptitude remove $p
-	echo $msg10
-	echo ""
+        echo $msg11 $p
+        apt-get remove $p
+        if test "$?" != 0; then
+            apt-get purge $p
+        fi
+        echo $msg10
+        echo ""
     done
 }
 
@@ -152,12 +199,22 @@
 #---------------------------------------
 check_lang
 check_root
+check_codename
+set_package_list
+
+if test "x$1" = "x0.4.2" || test "x$1" = "x0.4" ; then
+    openrtm=$openrtm04
+    packages="$devel $omni $ace $pyyaml $openrtm"
+fi
+
 if test "x$1" = "x-u" ; then
     uninstall_packages `reverse $u_packages`
 else
+    check_reposerver
     create_srclist
     update_source_list
+    apt-get autoclean
     apt-get update
+    uninstall_packages `reverse $openrtm`
     install_packages $packages
 fi
-

Modified: trunk/OpenRTM-aist/build/pkg_install_fedora.sh
===================================================================
--- trunk/OpenRTM-aist/build/pkg_install_fedora.sh	2013-04-15 11:39:45 UTC (rev 2385)
+++ trunk/OpenRTM-aist/build/pkg_install_fedora.sh	2013-05-08 04:42:45 UTC (rev 2386)
@@ -5,23 +5,35 @@
 # @author Noriaki Ando <n-ando at aist.go.jp>
 #         Shinji Kurihara
 #         Tetsuo Ando
+#         Nobu Kawauchi
 #
-# このシェルスクリプトは、aceおよびomniORBのパッケージをインストールし、
-# fedoraの開発環境を構築します。
+# このシェルスクリプトは、aceおよびomniORBのパッケージをインストールし、
+# fedoraの開発環境を構築します。
 #
 # $Id$
 #
-
 #---------------------------------------
-# パッケージリスト
+# パッケージリスト
 #---------------------------------------
-omni="omniORB omniORB-devel omniORB-doc omniORB-servers omniORB-utils omniORB-bootscripts"
+version_num=`cat /etc/fedora-release | awk '/Fedora/{print $3}' -`
+if [ $version_num -ge 16 ] && [ $version_num -le 18 ]; then
+	# バージョンが16,17,18の場合
+	omni="omniORB omniORB-devel omniORB-doc omniORB-servers omniORB-utils"
+else
+	omni="omniORB omniORB-devel omniORB-doc omniORB-servers omniORB-utils omniORB-bootscripts"
+fi
+
+ace="ace ace-devel"
 openrtm="OpenRTM-aist OpenRTM-aist-devel OpenRTM-aist-doc OpenRTM-aist-example PyYAML"
-packages="gcc-c++ $omni $openrtm"
+openrtm04="OpenRTM-aist-0.4.2 OpenRTM-aist-devel-0.4.2 OpenRTM-aist-doc-0.4.2 OpenRTM-aist-example-0.4.2 PyYAML"
+devel="gcc-c++ uuid-devel libuuid-devel"
+packages="$devel $omni $openrtm"
 
+reposervers="www.openrtm.org www.openrtm.de"
+reposerver=""
 
 #----------------------------------------
-# root かどうかをチェック
+# root かどうかをチェック
 #----------------------------------------
 check_root () {
     if test ! `id -u` = 0 ; then
@@ -34,7 +46,7 @@
 }
 
 #---------------------------------------
-# インストール済パッケージリスト
+# インストール済パッケージリスト
 #---------------------------------------
 rpm_qa="/tmp/yum_list.txt"
 get_pkg_list () {
@@ -44,30 +56,56 @@
     rm -f $rpm_qa
 }
 
+#----------------------------------------
+# 近いリポジトリサーバを探す
+#----------------------------------------
+check_reposerver()
+{
+    minrtt=65535
+    nearhost=''
+    for host in $reposervers; do
+	rtt=`ping -c 1 $host | grep 'time=' | sed -e 's/^.*time=\([0-9\.]*\) ms.*/\1/' 2> /dev/null`
+	if test "x$rtt" = "x"; then
+	    rtt=65535
+	fi
+	if test `echo "scale=2 ; $rtt < $minrtt" | bc` -gt 0; then
+	    minrtt=$rtt
+	    nearhost=$host
+	fi
+    done
+    if test "x$nearhost" = "x"; then
+	echo "Repository servers unreachable.", $hosts
+	exit 1
+    fi
+    reposerver=$nearhost
+}
+
+
 #---------------------------------------
-# リポジトリサイト設定ファイルを生成
+# リポジトリサイト設定ファイルを生成
 #---------------------------------------
 openrtm_repo () {
 cat <<EOF
 [openrtm]
 name=Fedora \$releasever - \$basearch
 failovermethod=priority
-baseurl=http://www.openrtm.org/pub/Linux/Fedora/releases/\$releasever/Fedora/\$basearch/os/Packages
+baseurl=http://$reposerver/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 "OpenRTM-aist のリポジトリが登録されていません。"
+	echo "OpenRTM-aist のリポジトリ: "
 	echo "  http://www.openrtm.org/pub/Linux/Fedora/"
-	read -p "を追加します。よろしいですか? (y/n) [y] " kick_shell
+	read -p "を追加します。よろしいですか? (y/n) [y] " kick_shell
 
 	if test "x$kick_shell" = "xn" ; then
-	    echo "中断します。"
+	    echo "中断します。"
 	    exit 0
 	else
 	    openrtm_repo > /etc/yum.repos.d/openrtm.repo
@@ -76,44 +114,25 @@
 }
 
 #----------------------------------------
-# パッケージインストール関数
+# パッケージインストール関数
 #----------------------------------------
 install_packages () {
     for p in $*; do
-	if test "x$p" = "x0.4.2" || test "x$p" = "x0.4.2" ; then
-	    :
+	ins=`rpm -qa $p`
+	if test "x$ins" = "x"; then
+	    echo "Now installing: " $p
+	    yum install $p
+	    echo "done."
+	    echo ""
 	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
-		yum install $p
-		echo "done."
-		echo ""
-	    else  
-		if echo "$ins" |grep -q '0.4.2-0' ; then
-			yum install $p
-			echo "done." 
-			echo ""
-	       else 
- 		    echo $ins
-		    echo $str "is already installed."
-		    echo ""
-		fi
-	    fi
+	    echo $p "is already installed."
+	    echo ""
 	fi
     done
 }
 
-
 #------------------------------------------------------------
-# リストを逆順にする
+# リストを逆順にする
 #------------------------------------------------------------
 reverse () {
     for i in $*; do
@@ -122,7 +141,7 @@
 }
 
 #----------------------------------------
-# パッケージをアンインストールする
+# パッケージをアンインストールする
 #----------------------------------------
 uninstall_packages () {
     for p in $*; do
@@ -134,12 +153,19 @@
 }
 
 #---------------------------------------
-# メイン
+# メイン
 #---------------------------------------
 check_root
+
+if test "x$1" = "x0.4.2" || test "x$1" = "x0.4" ; then
+    openrtm=$openrtm04
+    packages="$devel $omni $ace $openrtm"
+fi
+
 if test "x$1" = "x-u" ; then
     uninstall_packages `reverse $packages`
 else
+    check_reposerver
     create_repo
     install_packages $packages
 fi

Modified: trunk/OpenRTM-aist/build/pkg_install_ubuntu.sh
===================================================================
--- trunk/OpenRTM-aist/build/pkg_install_ubuntu.sh	2013-04-15 11:39:45 UTC (rev 2385)
+++ trunk/OpenRTM-aist/build/pkg_install_ubuntu.sh	2013-05-08 04:42:45 UTC (rev 2386)
@@ -12,11 +12,16 @@
 # パッケージリスト
 #---------------------------------------
 omni="libomniorb4 libomniorb4-dev omniidl4 omniorb4-nameserver omniidl omniorb-nameserver"
+ace="libace libace-dev"
 openrtm="openrtm-aist openrtm-aist-doc openrtm-aist-dev openrtm-aist-example python-yaml"
+openrtm04="openrtm-aist=0.4.2-1 openrtm-aist-doc=0.4.2-1 openrtm-aist-dev=0.4.2-1 openrtm-aist-example=0.4.2-1 python-yaml" 
 devel="gcc g++ make uuid-dev libboost-filesystem-dev"
 packages="$devel $omni $openrtm"
-u_packages="$omni $openrtm "
+u_packages="$omni $ace $openrtm "
 
+reposervers="www.openrtm.org www.openrtm.de"
+reposerver=""
+
 #---------------------------------------
 # ロケールの言語確認
 #---------------------------------------
@@ -54,7 +59,31 @@
 
 }
 
+#----------------------------------------
+# 近いリポジトリサーバを探す
+#----------------------------------------
+check_reposerver()
+{
+    minrtt=65535
+    nearhost=''
+    for host in $reposervers; do
+	rtt=`ping -c 1 $host | grep 'time=' | sed -e 's/^.*time=\([0-9\.]*\) ms.*/\1/' 2> /dev/null`
+	if test "x$rtt" = "x"; then
+	    rtt=65535
+	fi
+	if test `echo "scale=2 ; $rtt < $minrtt" | bc` -gt 0; then
+	    minrtt=$rtt
+	    nearhost=$host
+	fi
+    done
+    if test "x$nearhost" = "x"; then
+	echo "Repository servers unreachable.", $hosts
+	exit 1
+    fi
+    reposerver=$nearhost
+}
 
+
 #---------------------------------------
 # リポジトリサーバ
 #---------------------------------------
@@ -79,7 +108,7 @@
 	echo $msg3
 	exit
     fi
-    openrtm_repo="deb http://www.openrtm.org/pub/Linux/ubuntu/ $code_name main"
+    openrtm_repo="deb http://$reposerver/pub/Linux/ubuntu/ $code_name main"
 }
 
 #---------------------------------------
@@ -142,8 +171,11 @@
 uninstall_packages () {
     for p in $*; do
 	echo $msg11 $p
-	aptitude remove $p
-	echo $msg10
+	apt-get remove $p
+    if test "$?" != 0; then
+        apt-get purge $p
+    fi
+    echo $msg10
 	echo ""
     done
 }
@@ -153,12 +185,21 @@
 #---------------------------------------
 check_lang
 check_root
+
+if test "x$1" = "x0.4.2" || test "x$1" = "x0.4" ; then
+    openrtm=$openrtm04
+    packages="$devel $omni $ace $openrtm"
+fi
+
 if test "x$1" = "x-u" ; then
     uninstall_packages `reverse $u_packages`
 else
+    check_reposerver
     create_srclist
     update_source_list
+    apt-get autoclean
     apt-get update
+    uninstall_packages `reverse $openrtm`
     install_packages $packages
 fi
 



More information about the openrtm-commit mailing list