[Groonga-commit] groonga/groonga [master] apt: enable security repository

Back to archive index

null+****@clear***** null+****@clear*****
2012年 4月 24日 (火) 13:27:38 JST


Kouhei Sutou	2012-04-24 13:27:38 +0900 (Tue, 24 Apr 2012)

  New Revision: b8e2d812e926bcf42a9bada43880f40086502623

  Log:
    apt: enable security repository

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

  Modified: packages/apt/build-deb.sh (+27 -7)
===================================================================
--- packages/apt/build-deb.sh    2012-04-23 21:43:18 +0900 (fa1844b)
+++ packages/apt/build-deb.sh    2012-04-24 13:27:38 +0900 (831c05a)
@@ -17,18 +17,38 @@ run()
     fi
 }
 
-distribution=debian
-lsb_release=/etc/lsb-release
-if [ -f $lsb_release ]; then
-    case $(grep "DISTRIB_ID=" $lsb_release) in
-	*Ubuntu*)
-	    distribution=ubuntu
+if [ ! -x /usr/bin/lsb_release ]; then
+    run apt-get update
+    run apt-get install -y lsb-release
+fi
+
+distribution=$(lsb_release --id --short)
+code_name=$(lsb_release --codename --short)
+
+security_list=/etc/apt/sources.list.d/security.list
+if [ ! -d "${security_list}" ]; then
+    case ${distribution} in
+	Debian)
+	    if [ "${code_name}" = "sid" ]; then
+		touch "${security_list}"
+	    else
+		cat <<EOF > "${security_list}"
+deb http://security.debian.org/ ${code_name}/updates main
+deb-src http://security.debian.org/ ${code_name}/updates main
+EOF
+		;;
+	    fi
+	Ubuntu)
+	    cat <<EOF > "${security_list}"
+deb http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
+deb-src http://security.ubuntu.com/ubuntu ${code_name}-security main restricted
+EOF
 	    ;;
     esac
 fi
 
 sources_list=/etc/apt/sources.list
-if [ "$distribution" = "ubuntu" ] && \
+if [ "$distribution" = "Ubuntu" ] && \
     ! (grep '^deb' $sources_list | grep -q universe); then
     run sed -i'' -e 's/main$/main universe/g' $sources_list
 fi




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