Revision: 14819
Author: roelf.diedericks
Date: Wed Nov  3 17:05:23 2010
Log: Update postinst and config to remove some SERIOUS legacy upgrade logic
Get rid of db_get templates, since thats not required anymore due to the above

http://code.google.com/p/lusca-cache/source/detail?r=14819

Deleted:
 /branches/LUSCA_HEAD/debian/patched
 /branches/LUSCA_HEAD/debian/templates
Modified:
 /branches/LUSCA_HEAD/debian/config
 /branches/LUSCA_HEAD/debian/postinst
 /branches/LUSCA_HEAD/debian/rules

=======================================
--- /branches/LUSCA_HEAD/debian/templates       Wed Nov  3 16:18:37 2010
+++ /dev/null
@@ -1,27 +0,0 @@
-# These templates need translation
-
-Template: lusca/fix_lines
-Type: boolean
-Default: true
-_Description: Upgrade squid.conf automatically?
- Incompatible settings have been found in the existing squid.conf file.
- .
- They will prevent Lusca/Squid from starting or working correctly.
- .
- These settings can be corrected now. Please choose whether you want
- to apply the needed changes.
-
-Template: lusca/fix_cachedir_perms
-Type: boolean
-Default: false
-_Description: Fix permissions of 'cache_dir'?
- The values for 'cache_effective_user' and/or 'cache_effective_group'
- in Lusca/Squid's configuration file are incompatible with the owner/group of the cache
- directories.
- .
- Please choose whether this should be fixed automatically.
- .
- However, please note that if you specified a cache directory
- different from /var/spool/squid (such as /tmp), this could affect
- any other programs using that directory.
-
=======================================
--- /branches/LUSCA_HEAD/debian/config  Wed Nov  3 16:18:37 2010
+++ /branches/LUSCA_HEAD/debian/config  Wed Nov  3 17:05:23 2010
@@ -35,39 +35,4 @@
        echo "$res"
 }

-conf_fix_check_cache_dir () {
-
-  if [ -f "/etc/squid/squid.conf" ]; then
-
-    sq=/etc/squid/squid.conf
-    w="     " # space tab
-    grep -q "^cache_dir[$w]*[^/$w]" /etc/squid/squid.conf && return
-    umask 022
-
- if grep -q '^dns_children\|^dns_defnames\|^cache_dns_program' $sq || ( grep -q '^cache_dir' $sq && ! grep -q '^cache_dir.*ufs' $sq ); then
-
-       # ask debconf-question here
-       db_input high lusca/fix_lines || true
-       db_go
-
-    fi
-
-  fi
-}
-
-conf_fix_cachedir_perms () {
-
-  if [ -f "/etc/squid/squid.conf" ]; then
-       dir=`grepconf2 cache_dir /var/spool/squid`
-       usr=`grepconf cache_effective_user proxy`
-       grp=`grepconf cache_effective_group proxy`
-
- if [ "$(/usr/bin/stat -L -c %U $dir)" != "$usr" ] || [ "$(/usr/bin/stat -L -c %G $dir)" != "$grp" ] ; then
-         db_input high "lusca/fix_cachedir_perms" || true
-         db_go
-       fi
-  fi
-}
-
-conf_fix_check_cache_dir
-conf_fix_cachedir_perms
+
=======================================
--- /branches/LUSCA_HEAD/debian/postinst        Wed Nov  3 16:18:37 2010
+++ /branches/LUSCA_HEAD/debian/postinst        Wed Nov  3 17:05:23 2010
@@ -30,26 +30,6 @@
        echo "$res"
 }

-#
-#      Fix old style "cache_dir /var/spool/squid 100 16 256"
-#      to include "aufs" (Async Unix File System) after "cache_dir".
-#
-conf_fix_cache_dir () {
-
-   # get value for squid/fix_lines
-   db_get squid/fix_lines
-
-   # handle it!
-   if [ "$RET" = "true" ] ; then
-      sed -e 's/^cache_dir\(.*\)$/cache_dir aufs\1/' \
-      -e 's/^\(dns_children.*\)$/#NOT IN 2.3#\1/' \
-      -e 's/^\(dns_defnames.*\)$/#NOT IN 2.3#\1/' \
-      -e 's/^\(cache_dns_program.*\)$/#NOT IN 2.3#\1/' \
-      < /etc/squid/squid.conf > /etc/squid/squid.conf.TMP && \
-      mv /etc/squid/squid.conf.TMP /etc/squid/squid.conf
-   fi
-
-}
 #
 #      We moved from /etc/cron.d/squid to /etc/logrotate.d/squid
 #
@@ -104,13 +84,6 @@
                        chmod 0600 /etc/squid/squid.conf
                fi

-               # Check for old incompatible configs
-               case "$2" in
-                       2.[12].*)
-                               conf_fix_cache_dir
-                               FIXLINES="$RET"
-                               ;;
-               esac
                conf_fix_logrotate
                conf_fix_http_port

@@ -121,23 +94,6 @@
         usr=`grepconf cache_effective_user proxy`
                grp=`grepconf cache_effective_group proxy`

-               if [ "$FIXLINES" = "false" ]; then
-                 echo "squid.conf contains 2.2.5 syntax - not doing anything!"
-               else
- if [ "$(/usr/bin/stat -c %U $dir)" != "$usr" ] || [ "$(/usr/bin/stat -c %G $dir)" != "$grp" ] ; then
-                               db_get "squid/fix_cachedir_perms"
-                               if [ "$RET" = "true" ] ; then
-                               chown $usr:$grp $dir -R
-                               fi
-                               db_reset "squid/fix_cachedir_perms"
-                       fi
- if [ "$(/usr/bin/stat -c %U /var/log/squid)" != "$usr" ] || [ "$(/usr/bin/stat -c %G /var/log/squid)" != "$grp" ] ; then
-                               # Check if there is an override of ownership
- if [ "$(/usr/sbin/dpkg-statoverride --list /var/log/squid)" = "" ] ; then
-                                       chown $usr:$grp /var/log/squid -R
-                               fi
-                       fi
-               fi

                #
                # Create spool dirs if they don't exist.
@@ -186,11 +142,4 @@

 cd /

-if [ "$FIXLINES" = "false" ]; then
- echo "squid.conf contains 2.2.5 syntax - cache_dir directive - not starting "
-  echo "Run 'dpkg-reconfigure -plow squid' to fix this automatically,"
-  echo "or fix the 'cache_dir'-entry in your squid.conf manually."
-  echo "See documentation in /usr/share/doc/lusca for more instructions."
-else
-  invoke-rc.d squid restart
-fi
+invoke-rc.d squid restart
=======================================
--- /branches/LUSCA_HEAD/debian/rules   Wed Nov  3 16:18:37 2010
+++ /branches/LUSCA_HEAD/debian/rules   Wed Nov  3 17:05:23 2010
@@ -302,10 +302,6 @@
        $(INSTALL_SCRIPT) debian/prerm $(tmp)/DEBIAN/prerm
        $(INSTALL_SCRIPT) debian/postrm $(tmp)/DEBIAN/postrm
        $(INSTALL_FILE) debian/conffiles $(tmp)/DEBIAN/conffiles
-       $(INSTALL_FILE) debian/templates $(tmp)/DEBIAN/templates
-       #no translations yet:(
-       #po2debconf debian/templates > debian/templates.merged
-       $(INSTALL_FILE) debian/templates $(tmp)/DEBIAN/templates
        $(INSTALL_SCRIPT) debian/config $(tmp)/DEBIAN/config

        # overrides file
@@ -342,7 +338,6 @@
        $(INSTALL_SCRIPT) debian/postrm.lusca-cgi $(tmp)/DEBIAN/postrm
        $(INSTALL_SCRIPT) debian/prerm.lusca-cgi $(tmp)/DEBIAN/prerm
        $(INSTALL_FILE) debian/conffiles.lusca-cgi $(tmp)/DEBIAN/conffiles
-       $(INSTALL_FILE) debian/templates $(tmp)/DEBIAN/templates
        dpkg-shlibdeps tools/cachemgr.cgi
        dpkg-gencontrol -isp -plusca-cgi
        dpkg --build $(tmp) ..
@@ -364,7 +359,7 @@
rm -f helpers/external_acl/ldap_group/{Makefile,squid_ldap_group,squid_ldap_group.o} rm -f helpers/external_acl/unix_group/{Makefile,squid_unix_group,check_group.o}
        rm -f helpers/ntlm_auth/SMB/{Makefile,ntlm_auth,*.o,smbval/*.o}
-       rm -f build debian/{substvars,files,templates.merged}
+       rm -f build debian/{substvars,files}
        rm -rf $(tmp) *~
        find . -name '*.bak' -o -name '*~' | xargs -r rm -f --
        #cd icons && /bin/sh ./icons.shar

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to