[1848] in Moira Commits

home help back first fref pref prev next nref lref last post

/svn/moira r3994 - trunk/moira/gen

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed Mar 24 00:20:57 2010

Date: Wed, 24 Mar 2010 00:20:51 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201003240420.o2O4Kpff022029@drugstore.mit.edu>
To: moira-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2010-03-24 00:20:51 -0400 (Wed, 24 Mar 2010)
New Revision: 3994

Modified:
   trunk/moira/gen/hesiod.pc
Log:
Handle CUPS server pass-thtough queues.

Modified: trunk/moira/gen/hesiod.pc
===================================================================
--- trunk/moira/gen/hesiod.pc	2010-03-22 21:51:31 UTC (rev 3993)
+++ trunk/moira/gen/hesiod.pc	2010-03-24 04:20:51 UTC (rev 3994)
@@ -895,9 +895,22 @@
       if (!valid(name))
 	continue;
       strtrim(rp);
-      fprintf(out, "%s.pcap\t%s %s \"%s:rp=%s:rm=%s:ka#%d:mc#%d:",
-	      name, HCLASS, HTYPE, name, rp, rmname, ka, mc);
 
+      strtrim(type);
+
+      /* Build Hesiod pcap entries based on type.  Aliases should
+       * go to their "real" printer names while pass-through
+       * queues on the CUPS servers need to have their real names.
+       * It's not ideal, since it's overriding the 'rp' field, but
+       * life is hard.
+      */
+      if (!strcmp(type,"ALIAS"))
+        fprintf(out, "%s.pcap\t%s %s \"%s:rp=%s:rm=%s:ka#%d:mc#%d:",
+	        name, HCLASS, HTYPE, name, rp, rmname, ka, mc);
+      else
+        fprintf(out, "%s.pcap\t%s %s \"%s:rp=%s:rm=%s:ka#%d:mc#%d:",
+	        name, HCLASS, HTYPE, name, name, rmname, ka, mc);
+
       strtrim(pskind);
       if (!strcmp(pskind, "BSD"))
 	fprintf(out, "auth=none:remote_support=RQM:");


home help back first fref pref prev next nref lref last post