[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6234-g829d225

Michael Tautschnig mt at debian.org
Wed Sep 8 10:07:42 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 829d225a8c7cf83a1b47b83fc4a332f40aeb3b76
Author: Michael Tautschnig <mt at debian.org>
Date:   Wed Sep 8 11:51:32 2010 +0200

    Ensure order of DatabaseMirror entries is preserved
    
    - This is somewhat non-trivial: The user may configure mirror X through debconf
      and later modify the config file manually
    - Now the first entry in the config file is written back to the debconf database
      before starting to ask questions; hence the user can configure the first
      DatabaseMirror line through debconf. Whatever remains in the config file will
      be restored as second, third, etc. entries.
    - Initial testing seems to confirm that it now works properly
    
    Signed-off-by: Michael Tautschnig <mt at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 69f4df6..fe10a5f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ clamav (0.96.2+dfsg-1) unstable; urgency=low
   * Set data segment limit in tests to 524288 to make kfreebsd-i386 systems
     happy (closes: #591245).
   * Bumped Standards-Version to 3.9.1, no changes needed.
+  * Preserve order of database mirrors (closes: #592322).
 
  -- Michael Tautschnig <mt at debian.org>  Wed, 08 Sep 2010 10:12:34 +0200
 
diff --git a/debian/clamav-freshclam.config.in b/debian/clamav-freshclam.config.in
index 59d6fbc..0f52f16 100644
--- a/debian/clamav-freshclam.config.in
+++ b/debian/clamav-freshclam.config.in
@@ -31,6 +31,8 @@ if [ -n "$Interface" ]; then
   db_set clamav-freshclam/internet_interface "$Interface" || true
 fi
 if [ -n "$DatabaseMirror" ]; then
+  # pick the first entry, there may be more than one of them
+  DatabaseMirror="`echo $DatabaseMirror | awk '{print $1}'`"
   if [ -e /usr/share/doc/clamav-freshclam/mirror-list.gz ]; then
     if zgrep -q "$DatabaseMirror" /usr/share/doc/clamav-freshclam/mirror-list.gz;then
       db_set clamav-freshclam/local_mirror `zgrep "$DatabaseMirror" /usr/share/doc/clamav-freshclam/mirror-list.gz` || true
diff --git a/debian/clamav-freshclam.postinst.in b/debian/clamav-freshclam.postinst.in
index 932e516..d1216c5 100644
--- a/debian/clamav-freshclam.postinst.in
+++ b/debian/clamav-freshclam.postinst.in
@@ -231,14 +231,12 @@ EOF
       echo "DatabaseMirror $i" >> $DEBCONFILE
     done
   fi
-  if ! echo "$mirrors" | grep -q database.clamav.net; then
-    echo "DatabaseMirror database.clamav.net" >> $DEBCONFILE
-  fi
-  if [ -n "$DatabaseMirror" ]; then
-    for m in $DatabaseMirror; do
-      grep -q "$m" "$DEBCONFILE" || echo "DatabaseMirror $m" >> $DEBCONFILE
-    done
-  fi
+  # the first mirror is managed via debconf (and might have been changed)
+  DatabaseMirror="`echo $DatabaseMirror | sed 's/^[[:space:]]*[^[:space:]]\+[[:space:]]\*//'`"
+  DatabaseMirror="$DatabaseMirror database.clamav.net"
+  for m in $DatabaseMirror; do
+    grep -q "$m" "$DEBCONFILE" || echo "DatabaseMirror $m" >> $DEBCONFILE
+  done
 
   if [ -n "$phost" ] && [ -n "$pport" ]; then
     echo "# Proxy: $fullurl" >> $DEBCONFILE
diff --git a/debian/common_functions b/debian/common_functions
index 2ee73c7..df5e9cc 100644
--- a/debian/common_functions
+++ b/debian/common_functions
@@ -101,7 +101,7 @@ slurp_config()
         DatabaseMirror)
         if [ -z "$DatabaseMirror" ]; then
           for i in `grep ^$variable $CLAMAVCONF | awk '{print $2}'`; do
-            value="$i $value"
+            value="$value $i"
           done
         else
           continue

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list