[Pkg-cups-devel] r273 - in cupsys/branches/cups-1.2/debian: .

Kenshi Muto kmuto at costa.debian.org
Mon Jun 19 16:12:29 UTC 2006


Author: kmuto
Date: Mon Jun 19 16:12:28 2006
New Revision: 273

Modified:
   cupsys/branches/cups-1.2/debian/changelog
   cupsys/branches/cups-1.2/debian/cupsys.dirs
   cupsys/branches/cups-1.2/debian/cupsys.postinst
   cupsys/branches/cups-1.2/debian/patches/00list

Log:
merge splitted cups.d files to /etc/cups/cupsd.conf and modify file permissions under /etc/cups.

Modified: cupsys/branches/cups-1.2/debian/changelog
==============================================================================
--- cupsys/branches/cups-1.2/debian/changelog	(original)
+++ cupsys/branches/cups-1.2/debian/changelog	Mon Jun 19 16:12:28 2006
@@ -11,6 +11,11 @@
     Make symlink /usr/share/ppd/cups-transitional-dir -> /usr/share/cups/ppd
     for keeping a compatibility. We'll migrate all of PPD files to
     /usr/share/ppd in the future.
+  * Revert to use single /etc/cups/cupsd.conf file for the configuration
+    instead of using separate files in /etc/cups/cups.d. The migration will
+    be done automatically. (closes: #345973, #372727)
+  * Apply correct permission modes to the files under /etc/cups at postinst
+    stage.
   * Update debconf translations:
     - Danish (closes: #371170)
     - French (closes: #372714) 

Modified: cupsys/branches/cups-1.2/debian/cupsys.dirs
==============================================================================
--- cupsys/branches/cups-1.2/debian/cupsys.dirs	(original)
+++ cupsys/branches/cups-1.2/debian/cupsys.dirs	Mon Jun 19 16:12:28 2006
@@ -1,7 +1,6 @@
 var/run/cups
 usr/share/doc/cupsys
 etc/default
-etc/cups/cups.d
 etc/cups/ssl
 usr/lib/cups/backend-available
 var/cache/cups/ppd

Modified: cupsys/branches/cups-1.2/debian/cupsys.postinst
==============================================================================
--- cupsys/branches/cups-1.2/debian/cupsys.postinst	(original)
+++ cupsys/branches/cups-1.2/debian/cupsys.postinst	Mon Jun 19 16:12:28 2006
@@ -52,6 +52,9 @@
 	    mv /var/spool/cups/certs/* /var/run/cups/certs || true
 	    rm -rf /var/spool/cups/certs
 	fi
+	if [ -d /var/lib/cups/certs ]; then
+	    rm -rf /va/lib/cups/certs
+	fi
 
 	[ -f /etc/cups/ppds.dat ] && mv /etc/cups/ppds.dat /var/cache/cups/ppd
 
@@ -125,52 +128,71 @@
 	#  chmod 600 /etc/cups/passwd.md5
 	#fi
 
-	# Create /etc/cups/cups.d/ports.conf and /etc/cups/cups.d/browse.conf
-	db_get cupsys/ports
-	VAL=$(echo "$RET" | perl -e '$ret = ""; while (<STDIN>) { chomp;
-	    @values = split(/\s+/);
-	    foreach(@values) {
-	      if (/^\d+$/ && $_ >= 0 && $_ < 65536) {
-	        # PORT
-	        $ret .= "Port $_\\n";
-	      } elsif (/^\d+\.\d+\.\d+\.\d+$/ || /^\d+\.\d+\.\d+\.\d+:\d+$/) {
-	        # IP
-	        $ret .= "Listen $_\\n";
-	      } elsif (/^[a-zA-Z0-9-_.*]+$/ || /^[a-zA-Z0-9-_.*]+:\d+$/) {
-	        my($tmp) = $_;
-	        if (/^[a-zA-Z0-9-_.*]+:(\d+)$/) {
-	          if ($1 < 0 || $1 > 65535) {
-	            # ERROR
-	            $ret = "";
-	            last;
-	          }
-	        }
-	        # HOSTNAME
-	        $ret .= "Listen $_\\n";
-	      } elsif (/^\//) {
-	        # domain socket
-	        $ret .= "Listen $_\\n";
-	      } else {
-	        # ERROR
-	        $ret = "";
-	        last;
-	      }
-	    }
-	    print $ret;
-	  }')
-
-	if [ -z "$VAL" ]; then
-	  echo "Error: debconf has an invalid value. Run 'dpkg-reconfigure cupsys' again."
-	  return 1
-	else
-	  /bin/echo -e -n "$VAL" > /etc/cups/cups.d/ports.conf
+	# Revert to single file
+	if [ -f /etc/cups/cups.d/ports.conf -o -f /etc/cups/cups.d/browse.conf ]; then
+	  perl -e 'sub readfile { local($_) = @_; open(F, $_); while (<F>) { print; } }; while (<STDIN>) { s#^Include\s+(/etc/cups/cups.d/(?:ports.conf|browse.conf))#&readfile($1)#e; print;}' < /etc/cups/cupsd.conf > /etc/cups/cupsd.conf.$$
+	  mv /etc/cups/cupsd.conf.$$ /etc/cups/cupsd.conf
+	  rm -f /etc/cups/cups.d/ports.conf /etc/cups/cups.d/browse.conf
+	  rmdir /etc/cups/cups.d 2>/dev/null || /bin/true
 	fi
+	#
+	# Create /etc/cups/cups.d/ports.conf and /etc/cups/cups.d/browse.conf
+	#db_get cupsys/ports
+	#VAL=$(echo "$RET" | perl -e '$ret = ""; while (<STDIN>) { chomp;
+	#    @values = split(/\s+/);
+	#    foreach(@values) {
+	#      if (/^\d+$/ && $_ >= 0 && $_ < 65536) {
+	#        # PORT
+	#        $ret .= "Port $_\\n";
+	#      } elsif (/^\d+\.\d+\.\d+\.\d+$/ || /^\d+\.\d+\.\d+\.\d+:\d+$/) {
+	#        # IP
+	#        $ret .= "Listen $_\\n";
+	#      } elsif (/^[a-zA-Z0-9-_.*]+$/ || /^[a-zA-Z0-9-_.*]+:\d+$/) {
+	#        my($tmp) = $_;
+	#        if (/^[a-zA-Z0-9-_.*]+:(\d+)$/) {
+	#          if ($1 < 0 || $1 > 65535) {
+	#            # ERROR
+	#            $ret = "";
+	#            last;
+	#          }
+	#        }
+	#        # HOSTNAME
+	#        $ret .= "Listen $_\\n";
+	#      } elsif (/^\//) {
+	#        # domain socket
+	#        $ret .= "Listen $_\\n";
+	#      } else {
+	#        # ERROR
+	#        $ret = "";
+	#        last;
+	#      }
+	#    }
+	#    print $ret;
+	#  }')
+
+	#if [ -z "$VAL" ]; then
+	#  echo "Error: debconf has an invalid value. Run 'dpkg-reconfigure cupsys' again."
+	#  return 1
+	#else
+	#  /bin/echo -e -n "$VAL" > /etc/cups/cups.d/ports.conf
+	#fi
 
-	db_get cupsys/browse
-	if [ "$RET" = "true" ]; then
-	  /bin/echo "Browsing on" > /etc/cups/cups.d/browse.conf
-	else
-	  /bin/echo "Browsing off" > /etc/cups/cups.d/browse.conf
+	#db_get cupsys/browse
+	#if [ "$RET" = "true" ]; then
+	#  /bin/echo "Browsing on" > /etc/cups/cups.d/browse.conf
+	#else
+	#  /bin/echo "Browsing off" > /etc/cups/cups.d/browse.conf
+	#fi
+
+	# permission configuration
+	chown root:lp /etc/cups ; chmod 3755 /etc/cups
+	chown root:lp /etc/cups/cupsd.conf ; chmod 640 /etc/cups/cupsd.conf
+	chown root:lp /etc/cups/ppd ; chmod 755 /etc/cups/ppd
+	if [ -f /etc/cups/classes.conf ]; then
+	  chown root:lp /etc/cups/classes.conf ; chmod 600 /etc/cups/classes.conf
+	fi
+	if [ -f /etc/cups/printers.conf ]; then
+	  chown root:lp /etc/cups/printers.conf ; chmod 600 /etc/cups/printers.conf
 	fi
     ;;
 

Modified: cupsys/branches/cups-1.2/debian/patches/00list
==============================================================================
--- cupsys/branches/cups-1.2/debian/patches/00list	(original)
+++ cupsys/branches/cups-1.2/debian/patches/00list	Mon Jun 19 16:12:28 2006
@@ -6,7 +6,7 @@
 #05_avoidunknowngroup.dpatch
 06_disable_backend_setuid.dpatch
 07_removecvstag.dpatch
-08_cupsd.conf.conf.d.dpatch
+#08_cupsd.conf.conf.d.dpatch
 09_runasuser.dpatch
 09_runasuser_autoconf.dpatch
 11_pam.dpatch



More information about the Pkg-cups-devel mailing list