[Pkg-cups-devel] r219 - in cupsys/branches/cups-1.2-ubuntu/debian:
local
Martin Pitt
mpitt at costa.debian.org
Tue May 9 15:18:58 UTC 2006
Author: mpitt
Date: Tue May 9 15:18:57 2006
New Revision: 219
Modified:
cupsys/branches/cups-1.2-ubuntu/debian/changelog
cupsys/branches/cups-1.2-ubuntu/debian/local/enable_browsing
cupsys/branches/cups-1.2-ubuntu/debian/local/enable_sharing
cupsys/branches/cups-1.2-ubuntu/debian/local/sharing_status
Log:
make enable_sharing and sharing_status orthogonal to browsing, fix some typos
Modified: cupsys/branches/cups-1.2-ubuntu/debian/changelog
==============================================================================
--- cupsys/branches/cups-1.2-ubuntu/debian/changelog (original)
+++ cupsys/branches/cups-1.2-ubuntu/debian/changelog Tue May 9 15:18:57 2006
@@ -5,9 +5,9 @@
* debian/cupsys.postinst: Fix ownership of files in /var/cache/cups/ so that
they are writable by non-root cupsd. Earlier dapper versions got the
ownership wrong, so fix this for intra-dapper upgrades. Closes: LP#40795
- * Add debian/local/{sharing_status,enable_sharing}: Scripts to
- control printer sharing over the CUPS browsing protocol. Thanks to Ante
- Karamatić for contributing these!
+ * Add debian/local/{sharing_status,enable_sharing}: Scripts to control
+ printer sharing (by opening or closing the TCP port). Thanks to Ante
+ Karamatić for his initial scripts and research!
-- Martin Pitt <martin.pitt at ubuntu.com> Tue, 9 May 2006 16:33:19 +0200
Modified: cupsys/branches/cups-1.2-ubuntu/debian/local/enable_browsing
==============================================================================
--- cupsys/branches/cups-1.2-ubuntu/debian/local/enable_browsing (original)
+++ cupsys/branches/cups-1.2-ubuntu/debian/local/enable_browsing Tue May 9 15:18:57 2006
@@ -4,8 +4,8 @@
# (C) 2005 Canonical Ltd.
#
# Configure CUPS IPP network browsing; this is only possible if
-# cupsd-browsing.conf is included by cupsd.conf and "Browsing" is present in
-# cupsd-browsing.conf (i. e. browsing_status returns 0 or 1). If the setting
+# cups.d/browse.conf is included by cupsd.conf and "Browsing" is present in
+# browse.conf (i. e. browsing_status returns 0 or 1). If the setting
# changed, CUPS will be restarted.
#
# Argument:
Modified: cupsys/branches/cups-1.2-ubuntu/debian/local/enable_sharing
==============================================================================
--- cupsys/branches/cups-1.2-ubuntu/debian/local/enable_sharing (original)
+++ cupsys/branches/cups-1.2-ubuntu/debian/local/enable_sharing Tue May 9 15:18:57 2006
@@ -3,17 +3,16 @@
# Author: Martin Pitt <martin.pitt at ubuntu.com>
# (C) 2005 Canonical Ltd.
#
-# Configure CUPS IPP network browsing; this is only possible if
-# cupsd-browsing.conf is included by cupsd.conf and "Browsing" is present in
-# cupsd-browsing.conf (i. e. browsing_status returns 0 or 1). If the setting
+# Configure CUPS IPP LAN printer sharing; this is only possible if
+# cups.d/ports.conf is included by cupsd.conf and "Listen" is present in
+# ports.conf (i. e. sharing_status returns 0 or 1). If the setting
# changed, CUPS will be restarted.
#
# Argument:
-# 0: disable browsing
-# 1: enabled browsing
+# 0: disable sharing
+# 1: enabled sharing
# Return 0 on success, or 1 on failure (prints error to stderr)
-CONF=/etc/cups/cups.d/browse.conf
STATUS_SCRIPT=/usr/share/cups/sharing_status
PORTSCONF=/etc/cups/cups.d/ports.conf
@@ -53,7 +52,6 @@
sed -ri "s/^([[:space:]]*Listen[[:space:]]+)(631)([[:space:]]*(#.*)?)\$/\\1localhost:631\\3/i" $PORTSCONF
else
sed -ri "s/^([[:space:]]*Listen[[:space:]]+)(localhost:631)([[:space:]]*(#.*)?)\$/\\1631\\3/i" $PORTSCONF
- sed -ri "s/^([[:space:]]*Browsing[[:space:]]+)(No|Off|Yes|On)([[:space:]]*(#.*)?)\$/\\1$NEWVAL\\3/i" $CONF
fi
Modified: cupsys/branches/cups-1.2-ubuntu/debian/local/sharing_status
==============================================================================
--- cupsys/branches/cups-1.2-ubuntu/debian/local/sharing_status (original)
+++ cupsys/branches/cups-1.2-ubuntu/debian/local/sharing_status Tue May 9 15:18:57 2006
@@ -5,30 +5,23 @@
#
# Get the status of IPP network browsing through exit code:
#
-# 0: browsing is disabled (default configuration)
-# 1: browsing is enabled for LAN
-# 2: the configuration was adapted manually; in this case enable_browsing cannot
+# 0: sharing is disabled (default configuration)
+# 1: sharing is enabled for LAN
+# 2: the configuration was adapted manually; in this case enable_sharing cannot
# be used
MAINCONF=/etc/cups/cupsd.conf
-BROWSECONF=/etc/cups/cups.d/browse.conf
PORTSCONF=/etc/cups/cups.d/ports.conf
-[ -f $MAINCONF -a -f $BROWSECONF ] || exit 2
+[ -f $MAINCONF -a -f $PORTSCONF ] || exit 2
-# if BROWSECONF & PORTSCONF are not included -> custom
-egrep -qi "^[[:space:]]*Include[[:space:]]+($BROWSECONF|$(basename $BROWSECONF))[[:space:]]*(#.*)?\$" $MAINCONF || exit 2
+# if PORTSCONF is not included -> custom
egrep -qi "^[[:space:]]*Include[[:space:]]+($PORTSCONF|$(basename $PORTSCONF))[[:space:]]*(#.*)?\$" $MAINCONF || exit 2
-if egrep -qi '^[[:space:]]*Browsing[[:space:]]+(No|Off)[[:space:]]*(#.*)?$' $BROWSECONF; then
- exit 0
+if egrep -qi '^[[:space:]]*Listen[[:space:]]+(631)[[:space:]]*(#.*)?$' $PORTSCONF; then
+ exit 1
fi
-
-if egrep -qi '^[[:space:]]*Browsing[[:space:]]+(Yes|On)[[:space:]]*(#.*)?$' $BROWSECONF; then
- if egrep -qi '^[[:space:]]*Listen[[:space:]]+(631)[[:space:]]*(#.*)?$' $PORTSCONF; then
- exit 1
- else
- exit 0
- fi
+if egrep -qi '^[[:space:]]*Listen[[:space:]]+(localhost:631)[[:space:]]*(#.*)?$' $PORTSCONF; then
+ exit 0
fi
exit 2
More information about the Pkg-cups-devel
mailing list