Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old IRIX conditional code #4092

Closed
michaelrsweet opened this issue May 21, 2012 · 2 comments
Closed

Remove old IRIX conditional code #4092

michaelrsweet opened this issue May 21, 2012 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.7-feature
CUPS.org User: mike

IRIX hasn't been updated since 2006, and EOL for MIPS-based SGI workstations is 2013. Current SGI offerings are Linux-based, so let's remove all of the IRIX-specific code from CUPS.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str4092.patch":

Index: backend/usb-unix.c

--- backend/usb-unix.c (revision 10629)
+++ backend/usb-unix.c (working copy)
@@ -257,7 +257,6 @@

 close(fd);

}
-#elif defined(__sgi)
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
int i; /* Looping var /
int fd; /
File descriptor */

Index: config-scripts/cups-manpages.m4

--- config-scripts/cups-manpages.m4 (revision 10629)
+++ config-scripts/cups-manpages.m4 (working copy)
@@ -28,12 +28,6 @@
AMANDIR="/usr/share/man"
PMANDIR="/usr/share/man"
;;

  •       IRIX)
    
  •           # SGI IRIX
    
  •           mandir="/usr/share/catman/u_man"
    
  •           AMANDIR="/usr/share/catman/a_man"
    
  •           PMANDIR="/usr/share/catman/p_man"
    
  •           ;;
        *)
            # All others
            mandir="/usr/man"
    

    @@ -51,14 +45,6 @@

    dnl Setup manpage extensions...
    case "$uname" in

  • IRIX*)

  •   # SGI IRIX
    
  •   MAN1EXT=1
    
  •   MAN5EXT=5
    
  •   MAN7EXT=7
    
  •   MAN8EXT=1m
    
  •   MAN8DIR=1
    
  •   ;;
    

    SunOS* | HP-UX*)
    # Solaris and HP-UX
    MAN1EXT=1
    Index: config-scripts/cups-compiler.m4

    --- config-scripts/cups-compiler.m4 (revision 10629)
    +++ config-scripts/cups-compiler.m4 (working copy)
    @@ -202,19 +202,6 @@
    OPTIM="+z $OPTIM"
    fi
    ;;

  •       IRIX)
    
  •       if test -z "$OPTIM"; then
    
  •           if test "x$with_optim" = x; then
    
  •               OPTIM="-O2"
    
  •           else
    
  •               OPTIM="$with_optim $OPTIM"
    
  •           fi
    

- fi

  •       if test "x$with_optim" = x; then
    
  •           OPTIM="-fullwarn -woff 1183,1209,1349,1506,3201 $OPTIM"
    
  •       fi
    
  •       ;;
    OSF*)
        # Tru64 UNIX aka Digital UNIX aka OSF/1
        if test -z "$OPTIM"; then
    

    Index: config-scripts/cups-directories.m4

    --- config-scripts/cups-directories.m4 (revision 10629)
    +++ config-scripts/cups-directories.m4 (working copy)
    @@ -102,9 +102,6 @@
    dnl Fix "libdir" variable...
    if test "$libdir" = "${exec_prefix}/lib"; then
    case "$uname" in

  •   IRIX*)
    
  •       libdir="$exec_prefix/lib32"
    
  •       ;;
    Linux*)
        if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
            libdir="$exec_prefix/lib64"
    

    @@ -169,13 +166,6 @@
    RCSTOP="620"
    ;;

  •   IRIX*)
    
  •       # IRIX
    
  •       INITDIR="/etc"
    
  •       RCSTART="60"
    
  •       RCSTOP="25"
    

- ;;

    Linux | GNU | GNU/k*BSD*)
        # Linux/HURD seems to choose an init.d directory at random...
        if test -d /sbin/init.d; then

Index: config-scripts/cups-opsys.m4

--- config-scripts/cups-opsys.m4 (revision 10629)
+++ config-scripts/cups-opsys.m4 (working copy)
@@ -3,7 +3,7 @@
dnl
dnl Operating system stuff for CUPS.
dnl
-dnl Copyright 2007-2011 by Apple Inc.
+dnl Copyright 2007-2012 by Apple Inc.
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
@@ -22,9 +22,6 @@
GNU* | GNU/*)
uname="GNU"
;;

  • IRIX*)

  •   uname="IRIX"
    
  •   ;;
    

    Linux*)
    uname="Linux"
    ;;
    Index: config-scripts/cups-sharedlibs.m4

    --- config-scripts/cups-sharedlibs.m4 (revision 10629)
    +++ config-scripts/cups-sharedlibs.m4 (working copy)
    @@ -215,8 +215,8 @@
    EXPORT_LDFLAGS="-Wl,-R$libdir"
    fi
    ;;

  •            IRIX | Linux | GNU)
    
  •                    # IRIX, Linux, and HURD...
    
  •            Linux | GNU)
    
  •                    # Linux, and HURD...
        if test $exec_prefix != /usr; then
            DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
            LDFLAGS="$LDFLAGS -Wl,-rpath,$libdir"
    

    Index: doc/help/network.html

    --- doc/help/network.html (revision 10629)
    +++ doc/help/network.html (working copy)
    @@ -38,15 +38,9 @@

    Configuring the IP Address Using BOOTP

-

The BOOTP protocol is used when you need to provide additional information such as the location of a configuration file to the network interface. Using the standard bootpd(8) program supplied with UNIX you simply need to add a line to the /etc/bootptab file; for IRIX:


+

The BOOTP protocol is used when you need to provide additional information such as the location of a configuration file to the network interface. Using the standard bootpd(8) program supplied with UNIX you simply need to add a line to the /etc/bootptab file:

-myprinter 08:00:69:00:12:34 192.0.2.2 myprinter.boot

## -

-

Newer versions of bootpd use a different format:

-


myprinter:ha=080069001234:ip=192.0.2.2:t144=myprinter.boot

Index: doc/help/spec-cmp.html

--- doc/help/spec-cmp.html (revision 10629)
+++ doc/help/spec-cmp.html (working copy)
@@ -245,10 +245,6 @@
Portable tarball with install script

- inst - IRIX inst/tardist - - pkg Solaris pkgadd @@ -268,10 +264,6 @@ swinstall HP-UX swinstall - - tardist - IRIX inst/tardist -

Finally, the tools/testrpm and tools/testosx scripts can be used to create binary packages from the current working copy for testing on Linux and OS X, respectively:

Index: doc/help/ref-cupsd-conf.html.in

--- doc/help/ref-cupsd-conf.html.in (revision 10629)
+++ doc/help/ref-cupsd-conf.html.in (working copy)
@@ -21,7 +21,7 @@

    -
  • AIX, IRIX, Linux, Solaris: -
  • AIX, Linux, Solaris:
      /etc/init.d/cups restart
        
  • @@ -2139,22 +2139,6 @@ Solaris format on Solaris, and the BSD format on other operating systems.

    -

    CUPS 1.1.13PrintcapGUI

    -

    Examples

    -


-PrintGUI /usr/bin/glpoptions

-

-

Description

-

The PrintcapGUI directive sets the program to
-associate with the IRIX printer GUI interface script which is
-used by IRIX applications to display printer-specific options.

-There is no default program.

CUPS 1.1.21ReloadTimeout

Examples

Index: systemv/lpstat.c

--- systemv/lpstat.c (revision 10629)
+++ systemv/lpstat.c (working copy)
@@ -205,38 +205,6 @@
}
break;

-#ifdef __sgi

  •    case 'b' : /\* Show both the local and remote status */
    

- op = 'b';

  •   if (argv[i][2])
    
  •   {
    
  •    /*
    
  •     \* The local and remote status are separated by a blank line;
    
  •     \* since all CUPS jobs are networked, we only output the
    
  •     \* second list for now...  In the future, we might further
    
  •     \* emulate this by listing the remote server's queue, but
    
  •     \* for now this is enough to make the SGI printstatus program
    
  •     \* happy...
    

- */

- check_dest(argv[0], argv[i] + 2, &num_dests, &dests);

  •     puts("");
    
  •     status |= show_jobs(argv[i] + 2, NULL, 3, ranking, which);
    
  •   }
    
  •   else
    
  •   {
    
  •     _cupsLangPrintf(stderr,
    
  •                     _("%s: Error - expected destination after "
    
  •               "\"-b\" option."),
    

- argv[0]);

  •     return (1);
    
  •   }
    
  •   break;
    

    -#endif /* __sgi _/

     case 'c' : /_ Show classes and members */
    op = 'c';
    

@@ -299,18 +267,7 @@
break;

     case 'l' : /* Long status or long job status */

-#ifdef __sgi

- op = 'l';

  •   if (argv[i][2])
    
  •   {
    

- check_dest(argv[0], argv[i] + 2, &num_dests, &dests);

  •     status |= show_jobs(argv[i] + 2, NULL, 3, ranking, which);
    
  •   }
    
  •   else
    

    -#endif /* __sgi */

  •     long_status = 2;
    
  •   long_status = 2;
    break;
    
     case 'o' : /* Show jobs by destination */
    

    Index: cups/http.h

    --- cups/http.h (revision 10629)
    +++ cups/http.h (working copy)
    @@ -36,9 +36,6 @@

    include <winsock2.h>

    include <ws2tcpip.h>

    else

    -# ifdef __sgi
    -# define INET6 /* IRIX IPv6 support... /
    -# endif /
    __sgi */

    include <unistd.h>

    include <sys/time.h>

    include <sys/socket.h>

    Index: cups/http-addr.c

    --- cups/http-addr.c (revision 10629)
    +++ cups/http-addr.c (working copy)
    @@ -162,13 +162,6 @@
    }

-#ifdef __sgi
-# define ADDR_CAST (struct sockaddr *)
-#else
-# define ADDR_CAST (char *)

-#endif /* __sgi */

/*

  • 'httpAddrLookup()' - Lookup the hostname associated with the address.
    *
    @@ -267,11 +260,11 @@

    ifdef AF_INET6

    if (addr->addr.sa_family == AF_INET6)

    •  host = gethostbyaddr(ADDR_CAST &(addr->ipv6.sin6_addr),
      
    •  host = gethostbyaddr((char _)&(addr->ipv6.sin6_addr),
                 sizeof(struct in_addr), AF_INET6);
      
      else

      endif /_ AF_INET6 */

    • host = gethostbyaddr(ADDR_CAST &(addr->ipv4.sin_addr),
    • host = gethostbyaddr((char *)&(addr->ipv4.sin_addr),
      sizeof(struct in_addr), AF_INET);

    if (host == NULL)

    Index: cups/http-private.h

    --- cups/http-private.h (revision 10629)
    +++ cups/http-private.h (working copy)
    @@ -73,14 +73,14 @@

    include <Security/Authorization.h>

    endif /* HAVE_AUTHORIZATION_H */

-# if defined(sgi) || (defined(__APPLE) && !defined(_SOCKLEN_T))
+# if defined(APPLE) && !defined(_SOCKLEN_T)
/*

  • * IRIX and MacOS X 10.2.x do not define socklen_t, and in fact use an int instead of

    • MacOS X 10.2.x does not define socklen_t, and in fact uses an int instead of
    • unsigned type for length values...
      */

    typedef int socklen_t;
    -# endif /* sgi || (__APPLE && !_SOCKLEN_T) /
    +# endif /
    APPLE && !_SOCKLEN_T */

    include <cups/http.h>

    include "md5-private.h"

    Index: Makefile

    --- Makefile (revision 10629)
    +++ Makefile (working copy)
    @@ -316,7 +316,6 @@
    case uname in
    BSD) $(MAKE) $(MFLAGS) bsd;;
    Darwin*) $(MAKE) $(MFLAGS) osx;; \

  •   IRIX_) $(MAKE) $(MFLAGS) tardist;; \
    Linux_) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
    SunOS*) $(MAKE) $(MFLAGS) pkg;; \
    

    esac
    Index: filter/rastertolabel.c

    --- filter/rastertolabel.c (revision 10629)
    +++ filter/rastertolabel.c (working copy)
    @@ -777,17 +777,6 @@
    putchar(0x16);
    fwrite(Buffer, header->cupsBytesPerLine, 1, stdout);
    fflush(stdout);

    -#ifdef __sgi

  • /*

  •      \* This hack works around a bug in the IRIX serial port driver when
    
  • \* run at high baud rates (e.g. 115200 baud)...  This results in
    
  • \* slightly slower label printing, but at least the labels come
    
  • \* out properly.
    

- */

  • sginap(1);
    

    -#endif /* __sgi */
    }
    else
    Feed ++;
    Index: scheduler/conf.c

    --- scheduler/conf.c (revision 10629)
    +++ scheduler/conf.c (working copy)
    @@ -151,7 +151,6 @@
    { "PreserveJobFiles", &JobFiles, CUPSD_VARTYPE_TIME },
    { "PreserveJobHistory", &JobHistory, CUPSD_VARTYPE_TIME },
    { "Printcap", &Printcap, CUPSD_VARTYPE_STRING },
  • { "PrintcapGUI", &PrintcapGUI, CUPSD_VARTYPE_STRING },
    { "ReloadTimeout", &ReloadTimeout, CUPSD_VARTYPE_TIME },
    { "RemoteRoot", &RemoteRoot, CUPSD_VARTYPE_STRING },
    { "RequestRoot", &RequestRoot, CUPSD_VARTYPE_STRING },
    @@ -580,7 +579,6 @@
    "%p %u %j %T %P %C %{job-billing} "
    "%{job-originating-host-name} %{job-name} %{media} %{sides}");
    cupsdSetString(&Printcap, CUPS_DEFAULT_PRINTCAP);
  • cupsdSetString(&PrintcapGUI, "/usr/bin/glpoptions");
    cupsdSetString(&FontPath, CUPS_FONTPATH);
    cupsdSetString(&RemoteRoot, "remroot");
    cupsdSetStringf(&ServerHeader, "CUPS/%d.%d", CUPS_VERSION_MAJOR,
    Index: scheduler/conf.h
    ===================================================================
    --- scheduler/conf.h (revision 10629)
    +++ scheduler/conf.h (working copy)
    @@ -147,8 +147,6 @@
    /* Temporary directory /
    *Printcap VALUE(NULL),
    /
    Printcap file */
  •       *PrintcapGUI        VALUE(NULL),
    
  •               /\* GUI program to use for IRIX _/
        *FontPath       VALUE(NULL),
                /_ Font search path */
        *RemoteRoot     VALUE(NULL),
    

    Index: scheduler/printers.c

    --- scheduler/printers.c (revision 10629)
    +++ scheduler/printers.c (working copy)
    @@ -49,10 +49,6 @@
    • load_ppd() - Load a cached PPD file, updating the cache as
    •                            needed.
      
    • new_media_col() - Create a media-col collection value.
  • * write_irix_config() - Update the config files used by the IRIX
  • * desktop tools.
  • * write_irix_state() - Update the status files used by IRIX printing
  • * desktop tools.
    • write_xml_string() - Write a string with XML escaping.
      */

@@ -96,10 +92,6 @@
static void log_ipp_conformance(cupsd_printer_t _p, const char *reason);
static ipp_t *new_media_col(_pwg_size_t *size, const char *source,
const char *type);
-#ifdef _sgi
-static void write_irix_config(cupsd_printer_t *p);
-static void write_irix_state(cupsd_printer_t *p);
-#endif /
__sgi */
static void write_xml_string(cups_file_t *fp, const char *s);

@@ -720,9 +712,6 @@
{
int i, /* Looping var /
changed = 0; /
Class changed? */
-#ifdef __sgi

  • char filename[1024]; /* Interface script filename /
    -#endif /
    __sgi */

cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDeletePrinter(p=%p(%s), update=%d)",
@@ -756,31 +745,6 @@
cupsArrayRemove(Printers, p);

/*

  • * Remove the dummy interface/icon/option files under IRIX...

- */

-#ifdef __sgi

  • snprintf(filename, sizeof(filename), "/var/spool/lp/interface/%s", p->name);

- unlink(filename);

  • snprintf(filename, sizeof(filename), "/var/spool/lp/gui_interface/ELF/%s.gui",
  •       p->name);
    

- unlink(filename);

  • snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);

- unlink(filename);

  • snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.config", p->name);

- unlink(filename);

  • snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.status", p->name);

- unlink(filename);

  • snprintf(filename, sizeof(filename), "/var/spool/lp/member/%s", p->name);
  • unlink(filename);
    -#endif /* __sgi */
  • /*
    • If p is the default printer, assign a different one...
      */

@@ -1657,14 +1621,6 @@
(long)printer->marker_time);

 cupsFilePuts(fp, "</Printer>\n");

-#ifdef __sgi

  • /*
  • \* Make IRIX desktop & printer status happy
    

- */

  • write_irix_state(printer);
    -#endif /* __sgi */
    }

cupsdCloseCreatedConfFile(fp, filename);
@@ -2457,16 +2413,7 @@

add_printer_defaults(p);

-#ifdef __sgi
/*

  • * Write the IRIX printer config and status files...

- */

  • write_irix_config(p);
  • write_irix_state(p);
    -#endif /* __sgi */
  • /*
    • Let the browse protocols reflect the change
      */

@@ -2653,10 +2600,6 @@
*/

 p->state_time = time(NULL);

-#ifdef __sgi

  • write_irix_state(p);
    -#endif /* __sgi */
    }

/*
@@ -3045,17 +2988,7 @@
cupsd_printer_t p; / Current printer */

-#ifdef __sgi
/*

  • * Update the IRIX printer state for the default printer; if
  • * no printers remain, then the default printer file will be
  • * removed...

- */

  • write_irix_state(DefaultPrinter);
    -#endif /* __sgi */
  • /*
    • See if we have a printcap file; if not, don't bother writing it.
      */

@@ -5079,262 +5012,7 @@
}

-#ifdef __sgi
/*

  • * 'write_irix_config()' - Update the config files used by the IRIX
  • * desktop tools.

- */

-static void
-write_irix_config(cupsd_printer_t p) / I - Printer to update */
-{

  • char filename[1024]; /* Interface script filename */
  • cups_file_t fp; / Interface script file */

- ipp_attribute_t attr; / Attribute data */

  • /*
  • * Add dummy interface and GUI scripts to fool SGI's "challenged" printing
  • * tools. First the interface script that tells the tools what kind of
  • * printer we have...

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/interface/%s", p->name);

  • if (p->type & CUPS_PRINTER_CLASS)
  • unlink(filename);
  • else if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {

- cupsFilePuts(fp, "#!/bin/sh\n");

  • if ((attr = ippFindAttribute(p->attrs, "printer-make-and-model",
  •                             IPP_TAG_TEXT)) != NULL)
    
  •  cupsFilePrintf(fp, "NAME=\"%s\"\n", attr->values[0].string.text);
    
  • else if (p->type & CUPS_PRINTER_CLASS)
  •  cupsFilePuts(fp, "NAME=\"Printer Class\"\n");
    
  • else

- cupsFilePuts(fp, "NAME="Remote Destination"\n");

  • if (p->type & CUPS_PRINTER_COLOR)
  •  cupsFilePuts(fp, "TYPE=ColorPostScript\n");
    
  • else

- cupsFilePuts(fp, "TYPE=MonoPostScript\n");

  • cupsFilePrintf(fp, "HOSTNAME=%s\n", ServerName);

- cupsFilePrintf(fp, "HOSTPRINTER=%s\n", p->name);

- cupsFileClose(fp);

  • chmod(filename, 0755);
  • chown(filename, User, Group);

- }

  • /*
  • * Then the member file that tells which device file the queue is connected
  • * to... Networked printers use "/dev/null" in this file, so that's what
  • * we use (the actual device URI can confuse some apps...)

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/member/%s", p->name);

  • if (p->type & CUPS_PRINTER_CLASS)
  • unlink(filename);
  • else if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {

- cupsFilePuts(fp, "/dev/null\n");

- cupsFileClose(fp);

  • chmod(filename, 0644);
  • chown(filename, User, Group);

- }

  • /*
  • * The gui_interface file is a script or program that launches a GUI
  • * option panel for the printer, using options specified on the
  • * command-line in the third argument. The option panel must send
  • * any printing options to stdout on a single line when the user
  • * accepts them, or nothing if the user cancels the dialog.
  • * The default options panel program is /usr/bin/glpoptions, from
  • * the ESP Print Pro software. You can select another using the
  • * PrintcapGUI option.

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/gui_interface/ELF/%s.gui", p->name);

  • if (p->type & CUPS_PRINTER_CLASS)
  • unlink(filename);
  • else if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {
  • cupsFilePuts(fp, "#!/bin/sh\n");

- cupsFilePrintf(fp, "%s -d %s -o "$3"\n", PrintcapGUI, p->name);

- cupsFileClose(fp);

  • chmod(filename, 0755);
  • chown(filename, User, Group);

- }

  • /*
  • * The POD config file is needed by the printstatus command to show
  • * the printer location and device.

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.config", p->name);

  • if (p->type & CUPS_PRINTER_CLASS)
  • unlink(filename);
  • else if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {
  • cupsFilePrintf(fp, "Printer Class | %s\n",
  •        (p->type & CUPS_PRINTER_COLOR) ? "ColorPostScript" : "MonoPostScript");
    
  • cupsFilePrintf(fp, "Printer Model | %s\n", p->make_model ? p->make_model : "");
  • cupsFilePrintf(fp, "Location Code | %s\n", p->location ? p->location : "");
  • cupsFilePrintf(fp, "Physical Location | %s\n", p->info ? p->info : "");
  • cupsFilePrintf(fp, "Port Path | %s\n", p->device_uri);
  • cupsFilePrintf(fp, "Config Path | /var/spool/lp/pod/%s.config\n", p->name);
  • cupsFilePrintf(fp, "Active Status Path | /var/spool/lp/pod/%s.status\n", p->name);

- cupsFilePuts(fp, "Status Update Wait | 10 seconds\n");

- cupsFileClose(fp);

  • chmod(filename, 0664);
  • chown(filename, User, Group);
  • }
    -}

-/*

  • * 'write_irix_state()' - Update the status files used by IRIX printing
  • * desktop tools.

- */

-static void
-write_irix_state(cupsd_printer_t p) / I - Printer to update */
-{

  • char filename[1024]; /* Interface script filename */
  • cups_file_t fp; / Interface script file */

- int tag; /* Status tag value */

  • if (p)
  • {
  • /*
  • * The POD status file is needed for the printstatus window to
  • * provide the current status of the printer.

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/pod/%s.status", p->name);

  • if (p->type & CUPS_PRINTER_CLASS)
  •  unlink(filename);
    
  • else if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {
  •  cupsFilePrintf(fp, "Operational Status | %s\n",
    
  •          (p->state == IPP_PRINTER_IDLE)       ? "Idle" :
    
  •          (p->state == IPP_PRINTER_PROCESSING) ? "Busy" :
    
  •                                                 "Faulted");
    
  •  cupsFilePrintf(fp, "Information        | 01 00 00 | %s\n", CUPS_SVERSION);
    
  •  cupsFilePrintf(fp, "Information        | 02 00 00 | Device URI: %s\n",
    
  •          p->device_uri);
    
  •  cupsFilePrintf(fp, "Information        | 03 00 00 | %s jobs\n",
    
  •          p->accepting ? "Accepting" : "Not accepting");
    

- cupsFilePrintf(fp, "Information | 04 00 00 | %s\n", p->state_message);

- cupsFileClose(fp);

  •  chmod(filename, 0664);
    
  •  chown(filename, User, Group);
    

- }

  • /*
  • * The activeicons file is needed to provide desktop icons for printers:
  • * [ quoted from /usr/lib/print/tagit ]
  • * --- Type of printer tags (base values)
  • * Dumb=66048 # 0x10200
  • * DumbColor=66080 # 0x10220
  • * Raster=66112 # 0x10240
  • * ColorRaster=66144 # 0x10260
  • * Plotter=66176 # 0x10280
  • * PostScript=66208 # 0x102A0
  • * ColorPostScript=66240 # 0x102C0
  • * MonoPostScript=66272 # 0x102E0
  • * --- Printer state modifiers for local printers
  • * Idle=0 # 0x0
  • * Busy=1 # 0x1
  • * Faulted=2 # 0x2
  • * Unknown=3 # 0x3 (Faulted due to unknown reason)
  • * --- Printer state modifiers for network printers
  • * NetIdle=8 # 0x8
  • * NetBusy=9 # 0x9
  • * NetFaulted=10 # 0xA
  • * NetUnknown=11 # 0xB (Faulted due to unknown reason)

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/activeicons/%s", p->name);

  • if (p->type & CUPS_PRINTER_CLASS)
  •  unlink(filename);
    
  • else if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {
  •  if (p->type & CUPS_PRINTER_COLOR)
    
  • tag = 66240;
  •  else
    

- tag = 66272;

  •  if (p->type & CUPS_PRINTER_REMOTE)
    

- tag |= 8;

  •  if (p->state == IPP_PRINTER_PROCESSING)
    

- tag |= 1;

  •  else if (p->state == IPP_PRINTER_STOPPED)
    

- tag |= 2;

  •  cupsFilePuts(fp, "#!/bin/sh\n");
    

- cupsFilePrintf(fp, "#Tag %d\n", tag);

- cupsFileClose(fp);

  •  chmod(filename, 0755);
    
  •  chown(filename, User, Group);
    
  • }

- }

  • /*
  • * The default file is needed by the printers window to show
  • * the default printer.

- */

- snprintf(filename, sizeof(filename), "/var/spool/lp/default");

  • if (DefaultPrinter != NULL)
  • {
  • if ((fp = cupsFileOpen(filename, "w")) != NULL)
  • {

- cupsFilePrintf(fp, "%s\n", DefaultPrinter->name);

- cupsFileClose(fp);

  •  chmod(filename, 0644);
    
  •  chown(filename, User, Group);
    
  • }
  • }
  • else
  • unlink(filename);
    -}
    -#endif /* __sgi _/

-/_

  • 'write_xml_string()' - Write a string with XML escaping.
    */

Index: scheduler/cups.sh.in

--- scheduler/cups.sh.in (revision 10629)
+++ scheduler/cups.sh.in (working copy)
@@ -4,7 +4,7 @@

Startup/shutdown script for CUPS.

-# Copyright 2007-2011 by Apple Inc.
+# Copyright 2007-2012 by Apple Inc.

Copyright 1997-2007 by Easy Software Products, all rights reserved.

These coded instructions, statements, and computer programs are the

@@ -35,18 +35,6 @@

OS-Dependent Configuration

case "uname" in

  • IRIX*)

- IS_ON=/sbin/chkconfig

  •   if $IS_ON verbose; then
    
  •       ECHO=echo
    
  •   else
    
  •       ECHO=:
    
  •   fi
    
  •   ECHO_OK=:
    
  •   ECHO_ERROR=:
    

- ;;

*BSD*)
        IS_ON=:
    ECHO=echo

@@ -147,7 +135,7 @@
HP-UX* | AIX* | SINIX_)
pid=ps -e | awk '{if (match($4, "._/cupsd$") || $4 == "cupsd") print $1}'
;;

  • IRIX* | SunOS*)
  • SunOS_)
    pid=ps -e | nawk '{if (match($4, "._/cupsd$") || $4 == "cupsd") print $1}'
    ;;
    UnixWare*)
    Index: scheduler/select.c
    ===================================================================
    --- scheduler/select.c (revision 10629)
    +++ scheduler/select.c (working copy)
    @@ -3,7 +3,7 @@
  • Select abstraction functions for the CUPS scheduler.
    *
  • * Copyright 2007-2010 by Apple Inc.
  • * Copyright 2007-2012 by Apple Inc.
    • Copyright 2006-2007 by Easy Software Products.
    • These coded instructions, statements, and computer programs are the
      @@ -49,15 +49,14 @@
      /*
    • Design Notes for Poll/Select API in CUPSD

  • *
    • SUPPORTED APIS
  • *
    • OS              select  poll    epoll   kqueue  /dev/poll
      

    • AIX             YES     YES     NO      NO      NO
      
    • FreeBSD         YES     YES     NO      YES     NO
      
    • HP-UX           YES     YES     NO      NO      NO
      
  • * IRIX YES YES NO NO NO
    • Linux           YES     YES     YES     NO      NO
      
    • MacOS X         YES     YES     NO      YES     NO
      
    • NetBSD          YES     YES     NO      YES     NO
      
      @@ -65,22 +64,22 @@
    • Solaris         YES     YES     NO      NO      YES
      
    • Tru64           YES     YES     NO      NO      NO
      
    • Windows         YES     NO      NO      NO      NO
      
  • *
  • *
    • HIGH-LEVEL API
  • *
    • typedef void (*cupsd_selfunc_t)(void *data);
      
  • *
    • void cupsdStartSelect(void);
      
    • void cupsdStopSelect(void);
      
    • void cupsdAddSelect(int fd, cupsd_selfunc_t read_cb,
      
    •                     cupsd_selfunc_t write_cb, void *data);
      
    • void cupsdRemoveSelect(int fd);
      
    • int cupsdDoSelect(int timeout);
      
  • *
  • *
    • IMPLEMENTATION STRATEGY
  • *
    • 0. Common Stuff
      
    •     a. CUPS array of file descriptor to callback functions
      
    •        and data + temporary array of removed fd's.
      
      @@ -103,7 +102,7 @@
    •        working sets.
      
    •     d. cupsdStopSelect() frees all of the memory used by the
      
    •        CUPS array and fd_set's.
      
  • *
    • 2. poll() - O(n log n)
      
    •     a. Regular array of pollfd, sorted the same as the CUPS
      
    •        array.
      
      @@ -117,7 +116,7 @@
    •     e. cupsdRemoveSelect() flags the pollfd array as invalid.
      
    •     f. cupsdStopSelect() frees all of the memory used by the
      
    •        CUPS array and pollfd array.
      
  • *
    • 3. epoll() - O(n)
      
    •     a. cupsdStartSelect() creates epoll file descriptor using
      
    •        epoll_create() with the maximum fd count, and
      
      @@ -133,7 +132,7 @@
    •        the callback record.
      
    •     d. cupsdStopSelect() closes the epoll file descriptor and
      
    •        frees all of the memory used by the event buffer.
      
  • *
    • 4. kqueue() - O(n)
      
    •     b. cupsdStartSelect() creates kqueue file descriptor
      
    •        using kqueue() function and allocates a global event
      
      @@ -146,7 +145,7 @@
    •        find the callback record.
      
    •     e. cupsdStopSelect() closes the kqueue() file descriptor
      
    •        and frees all of the memory used by the event buffer.
      
  • *
    • 5. /dev/poll - O(n log n) - NOT YET IMPLEMENTED
      
    •     a. cupsdStartSelect() opens /dev/poll and allocates an
      
    •        array of pollfd structs; on failure to open /dev/poll,
      

      Index: scheduler/main.c

      --- scheduler/main.c (revision 10629)
      +++ scheduler/main.c (working copy)
      @@ -129,10 +129,6 @@
      #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
      struct sigaction action; /* Actions for POSIX signals /
      #endif /
      HAVE_SIGACTION && !HAVE_SIGSET */
      -#ifdef __sgi
  • cups_file_t fp; / Fake lpsched lock file */
  • struct stat statbuf; /* Needed for checking lpsched FIFO /
    -#endif /
    *sgi /
    int run_as_child = 0;
    /
    Needed for background fork/exec /
    #ifdef __APPLE

    @@ -565,29 +561,7 @@
    signal(SIGTERM, sigterm_handler);
    #endif /* HAVE_SIGSET */

-#ifdef __sgi
/*

  • * Try to create a fake lpsched lock file if one is not already there.
  • * Some Adobe applications need it under IRIX in order to enable
  • * printing...

- */

  • if ((fp = cupsFileOpen("/var/spool/lp/SCHEDLOCK", "w")) == NULL)
  • {
  • syslog(LOG_LPR, "Unable to create fake lpsched lock file "
  •                "\"/var/spool/lp/SCHEDLOCK\"\' - %s!",
    
  •       strerror(errno));
    
  • }
  • else
  • {
  • fchmod(cupsFileNumber(fp), 0644);

- fchown(cupsFileNumber(fp), User, Group);

  • cupsFileClose(fp);
  • }
    -#endif /* __sgi */
  • /*
    • Initialize authentication certificates...
      */

@@ -1131,18 +1105,6 @@
krb5_free_context(KerberosContext);
#endif /* HAVE_GSSAPI */

-#ifdef __sgi

  • /*
  • * Remove the fake IRIX lpsched lock file, but only if the existing
  • * file is not a FIFO which indicates that the real IRIX lpsched is
  • * running...

- */

  • if (!stat("/var/spool/lp/FIFO", &statbuf))

  • if (!S_ISFIFO(statbuf.st_mode))

  •  unlink("/var/spool/lp/SCHEDLOCK");
    

    -#endif /* __sgi */

    cupsdStopSelect();

    return (!stop_scheduler);

@michaelrsweet michaelrsweet added the enhancement New feature or request label Mar 17, 2016
@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant