[Groonga-mysql-commit] mroonga/mroonga [master] apt: fix groonga apt-line setup position

Back to archive index

null+****@clear***** null+****@clear*****
2012年 5月 29日 (火) 16:25:09 JST


Kouhei Sutou	2012-05-29 16:25:09 +0900 (Tue, 29 May 2012)

  New Revision: a11fa50f592cd4fd7030547040bc025ba8ab9373

  Log:
    apt: fix groonga apt-line setup position

  Modified files:
    packages/apt/build-deb.sh

  Modified: packages/apt/build-deb.sh (+22 -22)
===================================================================
--- packages/apt/build-deb.sh    2012-05-29 16:16:06 +0900 (a225e48)
+++ packages/apt/build-deb.sh    2012-05-29 16:25:09 +0900 (61241c9)
@@ -22,13 +22,31 @@ run()
 grep '^deb ' /etc/apt/sources.list | \
     sed -e 's/^deb /deb-src /' > /etc/apt/sources.list.d/base-source.list
 
-run apt-get update -V
-run apt-get install -V -y --allow-unauthenticated groonga-keyring
-run apt-get upgrade -V -y
-
 distribution=$(lsb_release --id --short)
 code_name=$(lsb_release --codename --short)
 
+groonga_list=/etc/apt/sources.list.d/groonga.list
+if [ ! -f "${groonga_list}" ]; then
+    case ${distribution} in
+	Debian)
+	    component=main
+	    ;;
+	Ubuntu)
+	    component=universe
+	    ;;
+    esac
+    downcased_distribtion=$(echo ${distribution} | tr A-Z a-z)
+    run cat <<EOF | run tee ${groonga_list}
+deb http://packages.groonga.org/${downcased_distribtion}/ ${code_name} ${component}
+deb-src http://packages.groonga.org/${downcased_distribtion}/ ${code_name} ${component}
+EOF
+    apt-get update -V
+    run apt-get -V -y --allow-unauthenticated install groonga-keyring
+fi
+
+run apt-get update -V
+run apt-get upgrade -V -y
+
 security_list=/etc/apt/sources.list.d/security.list
 if [ ! -f "${security_list}" ]; then
     run apt-get install -V -y lsb-release
@@ -56,24 +74,6 @@ EOF
     run apt-get upgrade -V -y
 fi
 
-groonga_list=/etc/apt/sources.list.d/groonga.list
-if [ ! -f "${groonga_list}" ]; then
-    case ${distribution} in
-	Debian)
-	    component=main
-	    ;;
-	Ubuntu)
-	    component=universe
-	    ;;
-    esac
-    run cat <<EOF | run_sudo tee ${groonga_list}
-deb http://packages.groonga.org/${distribution}/ ${code_name} ${component}
-deb-src http://packages.groonga.org/${distribution}/ ${code_name} ${component}
-EOF
-    apt-get update
-    run apt-get -y --allow-unauthenticated install groonga-keyring
-fi
-
 run apt-get install -V -y devscripts ${DEPENDED_PACKAGES}
 run apt-get build-dep -V -y ${mysql_server_package}
 run apt-get clean




Groonga-mysql-commit メーリングリストの案内
Back to archive index