[Groonga-commit] groonga/groonga [master] apt yum: add uninstall procedure

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 28日 (木) 16:28:39 JST


HAYASHI Kentaro	2012-06-28 16:28:39 +0900 (Thu, 28 Jun 2012)

  New Revision: 84cf8df1cd81104a45e991fdc2479d6b9ac7edb0
  https://github.com/groonga/groonga/commit/84cf8df1cd81104a45e991fdc2479d6b9ac7edb0

  Log:
    apt yum: add uninstall procedure

  Modified files:
    packages/check-utility.sh

  Modified: packages/check-utility.sh (+55 -0)
===================================================================
--- packages/check-utility.sh    2012-06-28 16:17:19 +0900 (1112ae4)
+++ packages/check-utility.sh    2012-06-28 16:28:39 +0900 (f872a4c)
@@ -15,6 +15,7 @@ ENABLE_REPOSITORY=0
 DISABLE_REPOSITORY=0
 INSTALL_SCRIPT=0
 INSTALL_GROONGA=0
+UNINSTALL_GROONGA=0
 
 echo_packages_repository_address ()
 {
@@ -207,6 +208,53 @@ EOF
     done
 }
 
+
+uninstall_groonga_packages ()
+{
+    UNINSTALL_SCRIPT=uninstall-deb-groonga.sh
+    cat > $UNINSTALL_SCRIPT <<EOF
+#!/bin/sh
+sudo apt-get purge groonga-*
+EOF
+    for code in $CODES; do
+	for arch in $DEB_ARCHITECTURES; do
+	    root_dir=$CHROOT_ROOT/$code-$arch
+	    echo "copy uninstall script $UNINSTALL_SCRIPT to $root_dir/tmp"
+	    sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
+	    cp $UNINSTALL_SCRIPT $root_dir/tmp
+	    chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
+	    sudo chname $code-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
+	done
+    done
+    UNINSTALL_SCRIPT=uninstall-rpm-groonga.sh
+    cat > $UNINSTALL_SCRIPT <<EOF
+#!/bin/sh
+sudo yum remove groonga-*
+EOF
+    for dist in $DISTRIBUTIONS; do
+	case $dist in
+	    "fedora")
+		DISTRIBUTIONS_VERSION="16"
+		;;
+	    "centos")
+		DISTRIBUTIONS_VERSION="5 6"
+		;;
+	esac
+	for ver in $DISTRIBUTIONS_VERSION; do
+	    for arch in $RPM_ARCHITECTURES; do
+		root_dir=$CHROOT_ROOT/$dist-$ver-$arch
+		echo "copy install script $UNINSTALL_SCRIPT to $root_dir/tmp"
+		sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
+		cp $UNINSTALL_SCRIPT $root_dir/tmp
+		chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
+		sudo chname $code-$ver-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
+	    done
+	done
+    done
+}
+
+
+
 enable_temporaly_groonga_repository ()
 {
     cat > enable-repository.sh <<EOF
@@ -316,6 +364,10 @@ while [ $# -ne 0 ]; do
 	    INSTALL_GROONGA=1
 	    shift
 	    ;;
+	--uninstall-groonga)
+	    UNINSTALL_GROONGA=1
+	    shift
+	    ;;
 	--code)
 	    shift
 	    CODES=$1
@@ -364,4 +416,7 @@ fi
 if [ $INSTALL_GROONGA -ne 0 ]; then
     install_groonga_packages
 fi
+if [ $UNINSTALL_GROONGA -ne 0 ]; then
+    uninstall_groonga_packages
+fi
 
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



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