/[smeserver]/rpms/e-smith-LPRng/sme8/e-smith-LPRng-1.14.0-create_all.patch
ViewVC logotype

Contents of /rpms/e-smith-LPRng/sme8/e-smith-LPRng-1.14.0-create_all.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Tue Oct 7 18:43:04 2008 UTC (16 years, 1 month ago) by slords
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
New streams

1 diff -Nur -x '*.orig' -x '*.rej' e-smith-LPRng-1.14.0/createlinks mezzanine_patched_e-smith-LPRng-1.14.0/createlinks
2 --- e-smith-LPRng-1.14.0/createlinks 2006-03-16 01:41:21.000000000 -0500
3 +++ mezzanine_patched_e-smith-LPRng-1.14.0/createlinks 2006-04-19 10:45:03.000000000 -0400
4 @@ -55,6 +55,7 @@
5
6 templates2events("/etc/lpd/lpd.perms", $event);
7 templates2events("/etc/printcap", $event);
8 +event_link("printer-create", $event, "15");
9
10 # Make service statup symlinks
11 safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/lpd");
12 diff -Nur -x '*.orig' -x '*.rej' e-smith-LPRng-1.14.0/root/etc/e-smith/events/actions/printer-create mezzanine_patched_e-smith-LPRng-1.14.0/root/etc/e-smith/events/actions/printer-create
13 --- e-smith-LPRng-1.14.0/root/etc/e-smith/events/actions/printer-create 2005-08-26 10:43:15.000000000 -0400
14 +++ mezzanine_patched_e-smith-LPRng-1.14.0/root/etc/e-smith/events/actions/printer-create 2006-04-19 10:46:45.000000000 -0400
15 @@ -1,8 +1,8 @@
16 -#!/usr/bin/perl -w
17 +#!/usr/bin/perl
18
19 #----------------------------------------------------------------------
20 # copyright (C) 1999 Ip, Tak Hong
21 -# copyright (C) 2000-2005 Mitel Networks Corporation
22 +# copyright (C) 2000-2006 Mitel Networks Corporation
23 #
24 # This program is free software; you can redistribute it and/or modify
25 # it under the terms of the GNU General Public License as published by
26 @@ -23,6 +23,7 @@
27 package esmith;
28
29 use strict;
30 +use warnings;
31 use Errno;
32 use esmith::util;
33
34 @@ -31,25 +32,34 @@
35
36 my $event = $ARGV [0];
37 my $printerName = $ARGV [1];
38 +my @printers;
39
40 #------------------------------------------------------------
41 # Create the printer
42 #------------------------------------------------------------
43
44 -die "Printername argument missing." unless defined ($printerName);
45 -
46 -my $p = $adb->get($printerName) || undef;
47 -if (not defined $p || $p->prop('type') ne 'printer')
48 +if ($printerName)
49 +{
50 + my $p = $adb->get($printerName);
51 + die "Invalid printer $printerName; create printer failed.\n"
52 + unless ($p and $p->prop('type') eq 'printer');
53 + @printers = ($p);
54 +}
55 +else
56 {
57 - die "Invalid printer $printerName; create printer failed.\n";
58 + @printers = $adb->printers;
59 }
60
61 -unless (-d "/var/spool/lpd/$printerName")
62 +foreach (@printers)
63 {
64 - mkdir ("/var/spool/lpd/$printerName", 0700)
65 - or die "Could not create spool directory " .
66 - "'/var/spool/lpd/$printerName'; $! : create printer failed.\n";
67 + $printerName = $_->key;
68 + unless (-d "/var/spool/lpd/$printerName")
69 + {
70 + mkdir ("/var/spool/lpd/$printerName", 0700)
71 + or die "Could not create spool directory " .
72 + "'/var/spool/lpd/$printerName'; $! : create printer failed.\n";
73 + esmith::util::chownFile ("lp", "lp", "/var/spool/lpd/$printerName");
74 + }
75 }
76 -esmith::util::chownFile ("lp", "lp", "/var/spool/lpd/$printerName");
77
78 exit (0);

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed