[Openvas-commits] r5481 - trunk/openvas-packaging/openvas-plugins/debian/trunk/debian

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Oct 11 23:12:54 CEST 2009


Author: waja
Date: 2009-10-11 23:12:53 +0200 (Sun, 11 Oct 2009)
New Revision: 5481

Modified:
   trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/changelog
   trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.postrm
   trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.preinst
Log:
also consider /var/openvas/plugins

Modified: trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/changelog
===================================================================
--- trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/changelog	2009-10-11 20:58:51 UTC (rev 5480)
+++ trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/changelog	2009-10-11 21:12:53 UTC (rev 5481)
@@ -1,6 +1,8 @@
 openvas-plugins-dfsg (1.0.7-5+svn20090921) UNRELEASED; urgency=low
 
   * Move Maintainers scripts to openvas-plugins-base
+  * Also consider /var/openvas/plugins as deprecated plugins dir in Maintainers
+    scripts
 
  -- Jan Wagner <waja at cyconet.org>  Sun, 11 Oct 2009 20:23:34 +0200
 

Modified: trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.postrm
===================================================================
--- trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.postrm	2009-10-11 20:58:51 UTC (rev 5480)
+++ trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.postrm	2009-10-11 21:12:53 UTC (rev 5481)
@@ -1,17 +1,19 @@
 #!/bin/sh -e
+PLUGINSDIRS="/usr/lib/openvas/plugins /var/openvas/plugins"
+for PLUGINDIR in $PLUGINSDIRS; do
+  if [ "$1" = "purge" ] && [ -d $PLUGINDIR ]; then
+    echo ""
+    echo "The $PLUGINDIR directory still exists."
+    echo "This might be because you downloaded additional plugins into it"
+    echo "when using a previous OpenVAS version."
+    echo -n "Do you want to remove the full directory now? (yes/no) "
+    read ANSWER
+    case $ANSWER in
+      [yY]*) rm -rf $PLUGINDIR ;;
+    esac
+  fi
+done
 
-if [ "$1" = "purge" ] && [ -d /usr/lib/openvas/plugins ]; then
-  echo ""
-  echo "The /usr/lib/openvas/plugins directory still exists."
-  echo "This might be because you downloaded additional plugins into it"
-  echo "when using a previous OpenVAS version."
-  echo -n "Do you want to remove the full directory now? (yes/no) "
-  read ANSWER
-  case $ANSWER in
-    [yY]*) rm -rf /usr/lib/openvas/plugins ;;
-  esac
-fi
-
 if [ "$1" = "purge" ] && [ -d /var/lib/openvas/plugins ]; then
   echo ""
   echo "The /var/lib/openvas/plugins directory still exists."

Modified: trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.preinst
===================================================================
--- trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.preinst	2009-10-11 20:58:51 UTC (rev 5480)
+++ trunk/openvas-packaging/openvas-plugins/debian/trunk/debian/openvas-plugins-base.preinst	2009-10-11 21:12:53 UTC (rev 5481)
@@ -3,37 +3,38 @@
 # (c) 2004-2007 Javier Fernández-Sanguino
 
 PLUGINDIR=/var/lib/openvas/plugins/
-OPLUGINDIR=/usr/lib/openvas/plugins/
+OPLUGINDIRS="/usr/lib/openvas/plugins/ /var/openvas/plugins/"
 
-# Basicly, check if there is anything 
+for OPLUGINDIR in $OPLUGINDIRS; do
+	# Basicly, check if there is anything 
+	if [ -d $OPLUGINDIR ]; then
 
-[ ! -d $OPLUGINDIR ] && exit 0
+		echo -n "Moving plugins from $OPLUGINDIR to $PLUGINDIR ..."
+		if [ ! -d $PLUGINDIR ] ; then
+			mkdir -p $PLUGINDIR
+			chown root:root $PLUGINDIR
+			chmod 0766 $PLUGINDIR
+		fi
 
-echo -n "Moving plugins from $OPLUGINDIR to $PLUGINDIR ..."
-if [ ! -d $PLUGINDIR ] ; then
-	mkdir -p $PLUGINDIR
-	chown root:root $PLUGINDIR
-	chmod 0766 $PLUGINDIR
-fi
+		# Now, we don't care about descriptions, they will be regenerated
+		[ -d "$OPLUGINDIR/.desc" ] && rm -rf $OPLUGINDIR/.desc
+		[ ! -d "$PLUGINDIR/.desc" ] && mkdir $PLUGINDIR/.desc
 
-# Now, we don't care about descriptions, they will be regenerated
-[ -d "$OPLUGINDIR/.desc" ] && rm -rf $OPLUGINDIR/.desc
-[ ! -d "$PLUGINDIR/.desc" ] && mkdir $PLUGINDIR/.desc
+		find $OPLUGINDIR -maxdepth 1 -mindepth 1 ! -name *.nes | 
+		while read content; do
+			base=`basename $content`
+			if [ -e "$PLUGINDIR/$base" ]; then
+				cp -a "$OPLUGINDIR/$base" $PLUGINDIR
+				rm -rf "$OPLUGINDIR/$base"
+			else
+				mv "$OPLUGINDIR/$base" $PLUGINDIR
+			fi
+		done
 
-find $OPLUGINDIR -maxdepth 1 -mindepth 1 ! -name *.nes | 
-while read content; do
-	base=`basename $content`
-	if [ -e "$PLUGINDIR/$base" ]; then
-		cp -a "$OPLUGINDIR/$base" $PLUGINDIR
-		rm -rf "$OPLUGINDIR/$base"
-	else
-		mv "$OPLUGINDIR/$base" $PLUGINDIR
+		echo ".done"
 	fi
 done
-			
 
-echo ".done"
-
 #DEBHELPER#
 
 exit 0



More information about the Openvas-commits mailing list