rpms/hplip/FC-4 hplip-0.9.7-2.patch, NONE, 1.1 hplip-quiet.patch, NONE, 1.1 hplip.spec, 1.24, 1.25 sources, 1.4, 1.5

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 23 09:17:15 UTC 2005


Author: twaugh

Update of /cvs/dist/rpms/hplip/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv29523

Modified Files:
	hplip.spec sources 
Added Files:
	hplip-0.9.7-2.patch hplip-quiet.patch 
Log Message:
* Fri Dec 23 2005 Tim Waugh <twaugh at redhat.com> 0.9.7-4.1
- Build for FC4.


hplip-0.9.7-2.patch:
 io/hpiod/channel.cpp        |    6 -
 io/hpiod/device.cpp         |   23 +++----
 io/hpiod/dot4.cpp           |   13 ++--
 io/hpiod/jddevice.cpp       |    8 +-
 io/hpiod/mlc.cpp            |    8 +-
 io/hpiod/pp.cpp             |    4 -
 io/hpiod/ppdevice.cpp       |   11 ++-
 io/hpiod/ppdot4.cpp         |    4 -
 io/hpiod/system.cpp         |  139 +++++++++++++++++++++++++-------------------
 io/hpiod/udevice.cpp        |    6 -
 io/hpiod/uppdevice.cpp      |    6 -
 prnt/hpijs/djgenericvip.cpp |    8 ++
 prnt/hpijs/ojprokx50.h      |    7 ++
 scan/sane/hpaio.h           |    7 --
 14 files changed, 144 insertions(+), 106 deletions(-)

--- NEW FILE hplip-0.9.7-2.patch ---
diff -uNr hplip-0.9.7.old/io/hpiod/channel.cpp hplip-0.9.7.new/io/hpiod/channel.cpp
--- hplip-0.9.7.old/io/hpiod/channel.cpp	2005-10-12 14:13:40.000000000 -0700
+++ hplip-0.9.7.new/io/hpiod/channel.cpp	2005-12-06 11:21:20.000000000 -0800
@@ -49,7 +49,7 @@
 
 int Channel::WriteData(unsigned char *data, int length, char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelDataOutResult\nresult-code=%d\nbytes-written=%d\n"; 
+   const char res[] = "msg=ChannelDataOutResult\nresult-code=%d\nbytes-written=%d\n"; 
    int len, size, sLen, total=0;
 
    *result=R_IO_ERROR;
@@ -77,7 +77,7 @@
 
 int Channel::CutBuf(char *sendBuf, int length)
 {
-   char res[] =  "msg=ChannelDataInResult\nresult-code=%d\nlength=%d\ndata:\n";
+   const char res[] =  "msg=ChannelDataInResult\nresult-code=%d\nlength=%d\ndata:\n";
    int sendLen, total;
 
    if (rcnt > length)
@@ -114,7 +114,7 @@
 ******************************************************************************/
 int Channel::ReadData(int length, int timeout, char *sendBuf, int sendBufLength, int *result)
 {
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int len=0, sLen;
    char buffer[BUFFER_SIZE];
 
diff -uNr hplip-0.9.7.old/io/hpiod/device.cpp hplip-0.9.7.new/io/hpiod/device.cpp
--- hplip-0.9.7.old/io/hpiod/device.cpp	2005-11-01 16:57:14.000000000 -0800
+++ hplip-0.9.7.new/io/hpiod/device.cpp	2005-12-06 11:13:00.000000000 -0800
@@ -320,7 +320,7 @@
 
 int Device::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceCloseResult\nresult-code=%d\n";
    int len=0;
 
    *result = R_AOK;
@@ -344,7 +344,7 @@
 
 int Device::GetDeviceID(char *sendBuf, int slen, int *result)
 {
-   char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
    int len=0, idLen;
 
    *result = R_AOK;
@@ -392,9 +392,10 @@
 
 int Device::GetDeviceStatus(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char eres[] = "msg=DeviceStatusResult\nresult-code=%d\n";
    int len=0, r;
-   unsigned char status;
+   unsigned int status;
    char vstatus[16];
 
    *result = R_AOK;
@@ -403,7 +404,7 @@
    {
       syslog(LOG_ERR, "invalid data link Device::GetDeviceStatus: %d\n", OpenFD);
       *result = R_INVALID_DESCRIPTOR;
-      len = sprintf(sendBuf, res, *result);  
+      len = sprintf(sendBuf, eres, *result);  
       goto ujmp;
    }
 
@@ -417,7 +418,7 @@
       {
          syslog(LOG_ERR, "unable to read Device::GetDeviceStatus: %m\n");
          *result = R_IO_ERROR;
-         len = sprintf(sendBuf, res, *result);  
+         len = sprintf(sendBuf, eres, *result);  
          goto ujmp;
       }
    }
@@ -425,7 +426,7 @@
    {
       syslog(LOG_ERR, "unable to lock Device::GetDeviceStatus: %m\n");
       *result = R_IO_ERROR;
-      len = sprintf(sendBuf, res, *result);  
+      len = sprintf(sendBuf, eres, *result);  
       goto ujmp;
    }
 
@@ -448,7 +449,7 @@
 
 int Device::WriteData(unsigned char *data, int length, int channel, char *sendBuf, int *result)
 {   
-   char res[] = "msg=ChannelDataOutResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataOutResult\nresult-code=%d\n";
    int sLen;
 
    if (OpenFD<0)
@@ -486,7 +487,7 @@
 
 int Device::ReadData(int length, int channel, int timeout, char *sendBuf, int slen, int *result)
 {   
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int sLen;
 
    if (OpenFD<0)
@@ -608,7 +609,7 @@
 
 int Device::ChannelOpen(char *sn, int *channel, char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelOpenResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelOpenResult\nresult-code=%d\n";
    Channel *pC;
    int len=0;
    unsigned char sockid;
@@ -682,7 +683,7 @@
 int Device::ChannelClose(int channel, char *sendBuf, int *result)
 {
    Channel *pC = pChannel[channel];
-   char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
    int len=0;
 
    if (pC == NULL)
diff -uNr hplip-0.9.7.old/io/hpiod/dot4.cpp hplip-0.9.7.new/io/hpiod/dot4.cpp
--- hplip-0.9.7.old/io/hpiod/dot4.cpp	2005-11-10 11:30:24.000000000 -0800
+++ hplip-0.9.7.new/io/hpiod/dot4.cpp	2005-12-06 11:13:21.000000000 -0800
@@ -707,7 +707,7 @@
 
 int Dot4Channel::Open(char *sendBuf, int *result)
 {
-   char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
+   const char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
    int supportedProtocols=0;
    int twoints[2];
    int len, slen;
@@ -797,9 +797,9 @@
 
 int Dot4Channel::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
    int len=0;
-   unsigned char nullByte=0;
+   //   unsigned char nullByte=0;
 
    *result = R_AOK;
 
@@ -826,7 +826,8 @@
       if (pDev->NewProtocol == USB_PROTOCOL_712)
       {
          ioctl(pDev->GetOpenFD(), LPIOC_HP_SET_CHANNEL, 78);  /* reset DOT4 (ECP channel-78) */
-         pDev->Write(pDev->GetOpenFD(), &nullByte, 1);  
+	 /* Nullbute is not necessary for dot4, causes USB High Speed blue-screen assert on PS2575. */
+	 //         pDev->Write(pDev->GetOpenFD(), &nullByte, 1);  
          ioctl(pDev->GetOpenFD(), LPIOC_HP_SET_CHANNEL, 0);   /* set raw mode (ECP channel-0) */
       }
       ioctl(pDev->GetOpenFD(), LPIOC_SET_PROTOCOL, pDev->CurrentProtocol);
@@ -842,7 +843,7 @@
 
 int Dot4Channel::WriteData(unsigned char *data, int length, char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelDataOutResult\nresult-code=%d\nbytes-written=%d\n"; 
+   const char res[] = "msg=ChannelDataOutResult\nresult-code=%d\nbytes-written=%d\n"; 
    int ret, len, size, sLen, dlen, total=0;
    int cnt=0;
 
@@ -927,7 +928,7 @@
  */
 int Dot4Channel::ReadData(int length, int timeout, char *sendBuf, int sendBufLength, int *result)
 {
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int sendLen;
 
    *result=R_IO_ERROR;
diff -uNr hplip-0.9.7.old/io/hpiod/jddevice.cpp hplip-0.9.7.new/io/hpiod/jddevice.cpp
--- hplip-0.9.7.old/io/hpiod/jddevice.cpp	2005-11-15 11:28:58.000000000 -0800
+++ hplip-0.9.7.new/io/hpiod/jddevice.cpp	2005-12-06 11:21:41.000000000 -0800
@@ -113,7 +113,7 @@
 
 int JetDirectDevice::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceCloseResult\nresult-code=%d\n";
    int len=0;
 
    *result = R_AOK;
@@ -131,7 +131,7 @@
 
 int JetDirectDevice::GetDeviceStatus(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
    int len=0;
    unsigned char status = NFAULT_BIT;
 
@@ -144,7 +144,7 @@
 
 int JetDirectDevice::WriteData(unsigned char *data, int length, int channel, char *sendBuf, int *result)
 {   
-   char res[] = "msg=ChannelDataOutResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataOutResult\nresult-code=%d\n";
    int sLen;
 
    if (pChannel[channel] == NULL)
@@ -163,7 +163,7 @@
 
 int JetDirectDevice::ReadData(int length, int channel, int timeout, char *sendBuf, int slen, int *result)
 {   
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int sLen;
 
    if (pChannel[channel] == NULL)
diff -uNr hplip-0.9.7.old/io/hpiod/mlc.cpp hplip-0.9.7.new/io/hpiod/mlc.cpp
--- hplip-0.9.7.old/io/hpiod/mlc.cpp	2005-10-12 14:13:41.000000000 -0700
+++ hplip-0.9.7.new/io/hpiod/mlc.cpp	2005-12-06 11:21:53.000000000 -0800
@@ -709,7 +709,7 @@
 
 int MlcChannel::Open(char *sendBuf, int *result)
 {
-   char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
+   const char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
    int supportedProtocols=0;
    int twoints[2];
    int len, slen;
@@ -794,7 +794,7 @@
 
 int MlcChannel::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
    int len=0;
    unsigned char nullByte=0;
 
@@ -840,7 +840,7 @@
 
 int MlcChannel::WriteData(unsigned char *data, int length, char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelDataOutResult\nresult-code=%d\nbytes-written=%d\n"; 
+   const char res[] = "msg=ChannelDataOutResult\nresult-code=%d\nbytes-written=%d\n"; 
    int ret, len, size, sLen, dlen, total=0;
 
    *result=R_IO_ERROR;
@@ -915,7 +915,7 @@
  */
 int MlcChannel::ReadData(int length, int timeout, char *sendBuf, int sendBufLength, int *result)
 {
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int sendLen;
 
    *result=R_IO_ERROR;
diff -uNr hplip-0.9.7.old/io/hpiod/pp.cpp hplip-0.9.7.new/io/hpiod/pp.cpp
--- hplip-0.9.7.old/io/hpiod/pp.cpp	2005-10-12 14:13:41.000000000 -0700
+++ hplip-0.9.7.new/io/hpiod/pp.cpp	2005-12-06 11:22:04.000000000 -0800
@@ -33,7 +33,7 @@
 
 int ParMlcChannel::Open(char *sendBuf, int *result)
 {
-   char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
+   const char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
    int slen, m;
    ParDevice *pD = (ParDevice *)pDev;
 
@@ -85,7 +85,7 @@
 
 int ParMlcChannel::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
    int len=0, m;
    ParDevice *pD = (ParDevice *)pDev;
 
diff -uNr hplip-0.9.7.old/io/hpiod/ppdevice.cpp hplip-0.9.7.new/io/hpiod/ppdevice.cpp
--- hplip-0.9.7.old/io/hpiod/ppdevice.cpp	2005-11-15 11:30:49.000000000 -0800
+++ hplip-0.9.7.new/io/hpiod/ppdevice.cpp	2005-12-06 11:13:36.000000000 -0800
@@ -637,7 +637,8 @@
 
 int ParDevice::GetDeviceStatus(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char eres[] = "msg=DeviceStatusResult\nresult-code=%d\n";
    int len=0;
    unsigned char status;
    char vstatus[16];
@@ -659,6 +660,8 @@
          if (ioctl (OpenFD, PPNEGOT, &m))
          {
             syslog(LOG_ERR, "unable to read ParDevice::GetDeviceStatus: %m\n");
+            *result = R_IO_ERROR;
+            len = sprintf(sendBuf, eres, *result);  
             goto bugout;
          }
          status = read_status(OpenFD);
@@ -669,7 +672,7 @@
    {
       syslog(LOG_ERR, "unable to lock ParDevice::GetDeviceStatus: %m\n");
       *result = R_IO_ERROR;
-      len = sprintf(sendBuf, res, *result);  
+      len = sprintf(sendBuf, eres, *result);  
       goto bugout;
    }
 
@@ -692,7 +695,7 @@
 
 int ParDevice::GetDeviceID(char *sendBuf, int slen, int *result)
 {
-   char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
    int len=0, idLen, m;
 
    *result = R_AOK;
@@ -890,7 +893,7 @@
 
 int ParDevice::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceCloseResult\nresult-code=%d\n";
    int len=0;
 
    *result = R_AOK;
diff -uNr hplip-0.9.7.old/io/hpiod/ppdot4.cpp hplip-0.9.7.new/io/hpiod/ppdot4.cpp
--- hplip-0.9.7.old/io/hpiod/ppdot4.cpp	2005-10-11 16:35:06.000000000 -0700
+++ hplip-0.9.7.new/io/hpiod/ppdot4.cpp	2005-12-06 11:22:19.000000000 -0800
@@ -33,7 +33,7 @@
 
 int ParDot4Channel::Open(char *sendBuf, int *result)
 {
-   char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
+   const char res[] = "msg=OpenChannelResult\nresult-code=%d\n";
    int slen, m;
    ParDevice *pD = (ParDevice *)pDev;
 
@@ -85,7 +85,7 @@
 
 int ParDot4Channel::Close(char *sendBuf, int *result)
 {
-   char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelCloseResult\nresult-code=%d\n";
    int len=0, m;
    ParDevice *pD = (ParDevice *)pDev;
 
diff -uNr hplip-0.9.7.old/io/hpiod/system.cpp hplip-0.9.7.new/io/hpiod/system.cpp
--- hplip-0.9.7.old/io/hpiod/system.cpp	2005-11-15 17:41:18.000000000 -0800
+++ hplip-0.9.7.new/io/hpiod/system.cpp	2005-12-06 11:20:07.000000000 -0800
@@ -857,7 +857,7 @@
 ******************************************************************************/
 int System::SetPml(int device, int channel, char *snmp_oid, int type, unsigned char *data, int dataLen, char *sendBuf)
 {
-   char res[] = "msg=SetPMLResult\nresult-code=%d\n";
+   const char res[] = "msg=SetPMLResult\nresult-code=%d\n";
    char message[BUFFER_SIZE];
    unsigned char oid[LINE_SIZE];
    unsigned char *p=(unsigned char *)message;
@@ -941,7 +941,7 @@
 ******************************************************************************/
 int System::GetPml(int device, int channel, char *snmp_oid, char *sendBuf)
 {
-   char res[] = "msg=GetPMLResult\nresult-code=%d\n";
+   const char res[] = "msg=GetPMLResult\nresult-code=%d\n";
    char message[BUFFER_SIZE];
    unsigned char oid[LINE_SIZE];
    //   unsigned char cmd[LINE_SIZE+3];
@@ -1038,7 +1038,7 @@
 ******************************************************************************/
 int System::MakeUriFromIP(char *ip, int port, char *sendBuf)
 {
-   char res[] = "msg=MakeURIResult\nresult-code=%d\n";
+   const char res[] = "msg=MakeURIResult\nresult-code=%d\n";
    int len=0, result, dt, status;
    char devid[1024];
    char model[128];
@@ -1076,7 +1076,7 @@
 ******************************************************************************/
 int System::MakeUriFromUsb(char *dnode, char *sendBuf)
 {
-   char res[] = "msg=MakeURIResult\nresult-code=%d\n";
+   const char res[] = "msg=MakeURIResult\nresult-code=%d\n";
    MsgAttributes ma;
    char model[128];
    char serial[128];
@@ -1135,7 +1135,7 @@
 ******************************************************************************/
 int System::MakeUriFromPar(char *dnode, char *sendBuf)
 {
-   char res[] = "msg=MakeURIResult\nresult-code=%d\n";
+   const char res[] = "msg=MakeURIResult\nresult-code=%d\n";
    MsgAttributes ma;
    char model[128];
    char dummyBuf[2048];
@@ -1466,6 +1466,9 @@
             if (ma->prt_mode == UNI_MODE)
             {
                pD = new UniUsbDevice(this);
+               pD->SetPrintMode(ma->prt_mode);            /* io mode for printing */
+               pD->SetMfpMode(ma->mfp_mode);              /* io mode for mfp functions */
+               pD->SetFlowCtl(ma->flow_ctl);              /* flow control for mfp mode */
             }
             else
             {
@@ -1486,6 +1489,9 @@
             if (ma->prt_mode == UNI_MODE)
             {
                pD = new UniParDevice(this);
+               pD->SetPrintMode(ma->prt_mode);            /* io mode for printing */
+               pD->SetMfpMode(ma->mfp_mode);              /* io mode for mfp functions */
+               pD->SetFlowCtl(ma->flow_ctl);              /* flow control for mfp mode */
             }
             else
             {
@@ -1582,11 +1588,11 @@
    if (ma.length == 0)
    {
       recvBuf[rlen]=0;
-      syslog(LOG_INFO, "tid:%x %s\n", (int)psa->tid, recvBuf);
+      syslog(LOG_INFO, "tid:%d %s\n", (int)psa->tid, recvBuf);
    }
    else
    {
-      syslog(LOG_INFO, "tid:%x %s di=%d ci=%d oid=%s pml_type=%d size=%d\n", psa->tid, ma.cmd, ma.descriptor, ma.channel, ma.oid, ma.type, ma.length);
+      syslog(LOG_INFO, "tid:%d %s di=%d ci=%d oid=%s pml_type=%d size=%d\n", (int)psa->tid, ma.cmd, ma.descriptor, ma.channel, ma.oid, ma.type, ma.length);
       if (ma.length < 64)
         sysdump(ma.data, ma.length);
    }
@@ -1597,33 +1603,8 @@
    //   } 
 #endif
 
-   if (strcasecmp(ma.cmd, "DeviceID") == 0) 
-   {
-      len = pDevice[ma.descriptor]->GetDeviceID(sendBuf, slen, &ret);
-   }
-   else if (strcasecmp(ma.cmd, "DeviceStatus") == 0)
-   {
-      len = pDevice[ma.descriptor]->GetDeviceStatus(sendBuf, &ret);       
-   }
-   else if (strcasecmp(ma.cmd, "ChannelDataOut") == 0)
-   {
-      pD = pDevice[ma.descriptor];
-      len = pD->WriteData(ma.data, ma.length, ma.channel, sendBuf, &ret);               
-   }
-   else if (strcasecmp(ma.cmd, "ChannelDataIn") == 0)
-   {
-      pD = pDevice[ma.descriptor];
-      len = pD->ReadData(ma.readlen, ma.channel, ma.timeout, sendBuf, slen, &ret);       
-   }
-   else if (strcasecmp(ma.cmd, "SetPML") == 0)
-   {
-      len = SetPml(ma.descriptor, ma.channel, ma.oid, ma.type, ma.data, ma.length, sendBuf);       
-   }
-   else if (strcasecmp(ma.cmd, "GetPML") == 0)
-   {
-      len = GetPml(ma.descriptor, ma.channel, ma.oid, sendBuf);       
-   }
-   else if (strcasecmp(ma.cmd, "DeviceOpen") == 0)
+   /* Check for state less commands first. */
+   if (strcasecmp(ma.cmd, "DeviceOpen") == 0)
    {
       if (psa->descriptor != -1)
          len = sprintf(sendBuf, ERR_MSG, R_INVALID_DEVICE_OPEN); /* allow only one DeviceOpen per session */
@@ -1644,27 +1625,6 @@
          }
       }
    }
-   else if (strcasecmp(ma.cmd, "DeviceClose") == 0)
-   {
-      pD = pDevice[ma.descriptor];
-      len = pD->Close(sendBuf, &ret);
-      DelDevice(ma.descriptor);
-      psa->descriptor = -1;  /*  track device descriptor for session clean up */     
-   }
-   else if (strcasecmp(ma.cmd, "ChannelOpen") == 0)
-   {
-      int channel;
-      pD = pDevice[ma.descriptor];
-      len = pD->ChannelOpen(ma.service, &channel, sendBuf, &ret);
-      if (ret == R_AOK)
-         psa->channel[channel] = 1;   /* track channel descriptor for session clean up */
-   }
-   else if (strcasecmp(ma.cmd, "ChannelClose") == 0)
-   {
-      pD = pDevice[ma.descriptor];
-      len = pD->ChannelClose(ma.channel, sendBuf, &ret);
-      psa->channel[ma.channel] = 0;   /* track channel descriptor for session clean up */
-   }
    else if (strcasecmp(ma.cmd, "ProbeDevices") == 0)
    {
       len = ProbeDevices(sendBuf, ma.bus);       
@@ -1684,9 +1644,68 @@
    }
    else
    {
-      /* Unknown message. */
-      syslog(LOG_ERR, "invalid message:%s\n", ma.cmd);
-      len = sprintf(sendBuf, ERR_MSG, R_INVALID_MESSAGE);
+      /* The following commands require a valid device descriptor. */ 
+      if (ma.descriptor < 0)
+      {
+         syslog(LOG_ERR, "invalid message: %s %d\n", __FILE__, __LINE__);
+         sysdump(recvBuf, rlen);
+         len = sprintf(sendBuf, ERR_MSG, R_INVALID_MESSAGE);
+         goto bugout;
+      }
+
+      if (strcasecmp(ma.cmd, "DeviceID") == 0) 
+      {
+         len = pDevice[ma.descriptor]->GetDeviceID(sendBuf, slen, &ret);
+      }
+      else if (strcasecmp(ma.cmd, "DeviceStatus") == 0)
+      {
+         len = pDevice[ma.descriptor]->GetDeviceStatus(sendBuf, &ret);       
+      }
+      else if (strcasecmp(ma.cmd, "ChannelDataOut") == 0)
+      {
+         pD = pDevice[ma.descriptor];
+         len = pD->WriteData(ma.data, ma.length, ma.channel, sendBuf, &ret);               
+      }
+      else if (strcasecmp(ma.cmd, "ChannelDataIn") == 0)
+      {
+         pD = pDevice[ma.descriptor];
+         len = pD->ReadData(ma.readlen, ma.channel, ma.timeout, sendBuf, slen, &ret);       
+      }
+      else if (strcasecmp(ma.cmd, "SetPML") == 0)
+      {
+         len = SetPml(ma.descriptor, ma.channel, ma.oid, ma.type, ma.data, ma.length, sendBuf);       
+      }
+      else if (strcasecmp(ma.cmd, "GetPML") == 0)
+      {
+         len = GetPml(ma.descriptor, ma.channel, ma.oid, sendBuf);       
+      }
+      else if (strcasecmp(ma.cmd, "DeviceClose") == 0)
+      {
+         pD = pDevice[ma.descriptor];
+         len = pD->Close(sendBuf, &ret);
+         DelDevice(ma.descriptor);
+         psa->descriptor = -1;  /*  track device descriptor for session clean up */     
+      }
+      else if (strcasecmp(ma.cmd, "ChannelOpen") == 0)
+      {
+         int channel;
+         pD = pDevice[ma.descriptor];
+         len = pD->ChannelOpen(ma.service, &channel, sendBuf, &ret);
+         if (ret == R_AOK)
+            psa->channel[channel] = 1;   /* track channel descriptor for session clean up */
+      }
+      else if (strcasecmp(ma.cmd, "ChannelClose") == 0)
+      {
+         pD = pDevice[ma.descriptor];
+         len = pD->ChannelClose(ma.channel, sendBuf, &ret);
+         psa->channel[ma.channel] = 0;   /* track channel descriptor for session clean up */
+      }
+      else
+      {
+         /* Unknown message. */
+         syslog(LOG_ERR, "invalid message:%s\n", ma.cmd);
+         len = sprintf(sendBuf, ERR_MSG, R_INVALID_MESSAGE);
+      }
    }
 
 bugout:
@@ -1695,11 +1714,11 @@
    ParseMsg(sendBuf, len, &ma);
    if (ma.length == 0)
    {
-      syslog(LOG_INFO, "-tid:%x %s\n", (int)psa->tid, sendBuf);
+      syslog(LOG_INFO, "-tid:%d %s\n", (int)psa->tid, sendBuf);
    }
    else
    {
-      syslog(LOG_INFO, "-tid:%x %s di=%d ci=%d result=%d pml_result=%d pml_type=%d size=%d\n", psa->tid, ma.cmd, ma.descriptor, ma.channel, ma.result, ma.pml_result, ma.type, ma.length);
+      syslog(LOG_INFO, "-tid:%d %s di=%d ci=%d result=%d pml_result=%d pml_type=%d size=%d\n", (int)psa->tid, ma.cmd, ma.descriptor, ma.channel, ma.result, ma.pml_result, ma.type, ma.length);
       if (ma.length < 64)
         sysdump(ma.data, ma.length);
    }
diff -uNr hplip-0.9.7.old/io/hpiod/udevice.cpp hplip-0.9.7.new/io/hpiod/udevice.cpp
--- hplip-0.9.7.old/io/hpiod/udevice.cpp	2005-10-13 10:53:05.000000000 -0700
+++ hplip-0.9.7.new/io/hpiod/udevice.cpp	2005-12-06 11:22:34.000000000 -0800
@@ -27,7 +27,7 @@
 
 int UniUsbDevice::GetDeviceStatus(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
    int len=0;
    unsigned char status = NFAULT_BIT;
 
@@ -40,7 +40,7 @@
 
 int UniUsbDevice::GetDeviceID(char *sendBuf, int slen, int *result)
 {
-   char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
    int len=0, idLen;
 
    *result = R_AOK;
@@ -148,7 +148,7 @@
 
 int UniUsbDevice::ReadData(int length, int channel, int timeout, char *sendBuf, int slen, int *result)
 {   
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int sLen;
 
    syslog(LOG_ERR, "invalid commnad UniUsbDevice::ReadData: %m\n");
diff -uNr hplip-0.9.7.old/io/hpiod/uppdevice.cpp hplip-0.9.7.new/io/hpiod/uppdevice.cpp
--- hplip-0.9.7.old/io/hpiod/uppdevice.cpp	2005-10-13 10:53:57.000000000 -0700
+++ hplip-0.9.7.new/io/hpiod/uppdevice.cpp	2005-12-06 11:22:45.000000000 -0800
@@ -29,7 +29,7 @@
 
 int UniParDevice::GetDeviceStatus(char *sendBuf, int *result)
 {
-   char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
+   const char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n";
    int len=0;
    unsigned char status = NFAULT_BIT;
 
@@ -42,7 +42,7 @@
 
 int UniParDevice::GetDeviceID(char *sendBuf, int slen, int *result)
 {
-   char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
+   const char res[] = "msg=DeviceIDResult\nresult-code=%d\n";
    int len=0, idLen;
 
    *result = R_AOK;
@@ -158,7 +158,7 @@
 
 int UniParDevice::ReadData(int length, int channel, int timeout, char *sendBuf, int slen, int *result)
 {   
-   char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
+   const char res[] = "msg=ChannelDataInResult\nresult-code=%d\n";
    int sLen;
 
    syslog(LOG_ERR, "invalid command UniParDevice::ReadData: %m\n");
diff -uNr hplip-0.9.7.old/prnt/hpijs/djgenericvip.cpp hplip-0.9.7.new/prnt/hpijs/djgenericvip.cpp
--- hplip-0.9.7.old/prnt/hpijs/djgenericvip.cpp	2005-11-22 11:31:26.000000000 -0800
+++ hplip-0.9.7.new/prnt/hpijs/djgenericvip.cpp	2005-12-06 12:03:31.000000000 -0800
@@ -350,6 +350,14 @@
         fMargins[3] = (float) 0.125;
     }
 
+    if (ps == SUPERB_SIZE)
+    {
+        fMargins[0] = (float) 0.125;
+        fMargins[1] = (float) 0.5;
+        fMargins[2] = (float) 0.125;
+        fMargins[3] = (float) 0.75;
+    }
+
     return TRUE;
 }
 
diff -uNr hplip-0.9.7.old/prnt/hpijs/ojprokx50.h hplip-0.9.7.new/prnt/hpijs/ojprokx50.h
--- hplip-0.9.7.old/prnt/hpijs/ojprokx50.h	2005-11-22 11:31:26.000000000 -0800
+++ hplip-0.9.7.new/prnt/hpijs/ojprokx50.h	2005-12-06 12:03:43.000000000 -0800
@@ -51,6 +51,13 @@
         fMargins[1] = (float) 0.125;
         fMargins[2] = (float) 0.125;
         fMargins[3] = (float) 0.5;
+        if (ps == SUPERB_SIZE)
+        {
+            fMargins[0] = (float) 0.125;
+            fMargins[1] = (float) 0.5;
+            fMargins[2] = (float) 0.125;
+            fMargins[3] = (float) 0.75;
+        }
 	    return TRUE;
 	}
 };
diff -uNr hplip-0.9.7.old/scan/sane/hpaio.h hplip-0.9.7.new/scan/sane/hpaio.h
--- hplip-0.9.7.old/scan/sane/hpaio.h	2005-10-20 10:39:47.000000000 -0700
+++ hplip-0.9.7.new/scan/sane/hpaio.h	2005-12-06 12:41:37.328337848 -0800
@@ -29,12 +29,11 @@
 #if !defined( __HPAIO_H__ )
 #define __HPAIO_H__
 
-#include <stdio.h>
-
-#ifndef __USE_GNU
-#define __USE_GNU
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
 #endif
 
+#include <stdio.h>
 #include <sys/time.h>
 #include <time.h>
 #include <string.h>

hplip-quiet.patch:
 hpssd.py |    1 -
 1 files changed, 1 deletion(-)

--- NEW FILE hplip-quiet.patch ---
--- hplip-0.9.6/hpssd.py.quiet	2005-10-14 15:26:23.000000000 +0100
+++ hplip-0.9.6/hpssd.py	2005-10-14 15:27:47.000000000 +0100
@@ -1410,7 +1410,6 @@
 def main(args):
     prop.prog = sys.argv[0]
     prop.daemonize = True
-    utils.log_title('Services and Status Daemon', _VERSION)
 
     try:
         opts, args = getopt.getopt(sys.argv[1:], 'l:xhp:', ['level=', 'help', 'port='])


Index: hplip.spec
===================================================================
RCS file: /cvs/dist/rpms/hplip/FC-4/hplip.spec,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- hplip.spec	20 Sep 2005 12:11:34 -0000	1.24
+++ hplip.spec	23 Dec 2005 09:17:13 -0000	1.25
@@ -1,17 +1,17 @@
 Summary: HP Linux Imaging and Printing Project
 Name: hplip
-Version: 0.9.5
-Release: 1.1
+Version: 0.9.7
+Release: 4.1
 License: GPL/MIT/BSD
 Group: System Environment/Daemons
-Conflicts: system-config-printer < 0.6.131.3
+Conflicts: system-config-printer < 0.6.132
 
 Url: http://sourceforge.net/projects/hpinkjet
 Source: http://kent.dl.sourceforge.net/sourceforge/hpinkjet/%{name}-%{version}.tar.gz
-Patch1: hplip-compile.patch
+Patch1: hplip-quiet.patch
 Patch2: hplip-desktop.patch
 Patch3: hplip-config.patch
-Patch4: http://kent.dl.sourceforge.net/sourceforge/hpinkjet/hplip-0.9.5-2.patch
+Patch4: hplip-0.9.7-2.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot
 
 Requires: desktop-file-utils >= 0.2.92
@@ -22,6 +22,8 @@
 
 BuildRequires: net-snmp-devel
 BuildRequires: cups-devel
+BuildRequires: python-devel
+BuildRequires: libjpeg-devel
 
 %description
 The Hewlett-Packard Linux Imaging and Printing Project provides
@@ -53,8 +55,8 @@
 rm -rf $RPM_BUILD_DIR/%{name}-%{version}
 %setup -q
 
-# Fix compile errors.
-%patch1 -p1 -b .compile
+# Quieten the hpssd daemon at startup (bug #170762).
+%patch1 -p1 -b .quiet
 
 # Use /usr/share/applications for putting desktop files in.
 %patch2 -p1 -b .desktop
@@ -62,8 +64,8 @@
 # Use static IP ports (for SELinux policy).
 %patch3 -p1 -b .config
 
-# Apply upstream patch to fix scanning in LaserJets and parallel InkJets.
-%patch4 -p1 -b .config
+# Apply patch 0.9.7-2
+%patch4 -p1 -b .0.9.7-2
 
 %build
 %configure
@@ -71,6 +73,7 @@
 
 %install
 rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_bindir}
 make install DESTDIR=%{buildroot}
 
 # Move SANE backend into correct directory
@@ -89,8 +92,8 @@
 	%{buildroot}%{_datadir}/cups/model/foomatic-ppds \
 	%{buildroot}%{_datadir}/applications/hplip.desktop
 
-# Desktop file installation.
 mkdir -p %{buildroot}%{_datadir}/applications
+echo 'Hidden=true' >> %{buildroot}%{_datadir}/hplip/data/hplip.desktop
 desktop-file-install --vendor HP				\
 	--dir %{buildroot}%{_datadir}/applications		\
 	--add-category X-Red-Hat-Extra				\
@@ -98,6 +101,10 @@
 	--add-category Application				\
 	%{buildroot}%{_datadir}/hplip/data/hplip.desktop
 
+# Move initscript
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
+mv %{buildroot}%{_sysconfdir}/{init.d,rc.d/init.d}/hplip
+
 %clean
 rm -rf %{buildroot}
 
@@ -106,7 +113,7 @@
 %doc COPYING hplip_readme.html hplip_overview.png
 %dir %{_sysconfdir}/hp
 %config(noreplace) %{_sysconfdir}/hp/hplip.conf
-%config(noreplace) %{_sysconfdir}/init.d/hplip
+%config(noreplace) %{_sysconfdir}/rc.d/init.d/hplip
 %{_bindir}/hp-*
 %{_sbindir}/hpiod
 %{_libdir}/cups/backend/hp
@@ -145,20 +152,59 @@
 fi
 
 %changelog
-* Tue Sep 20 2005 Tim Waugh <twaugh at redhat.com>
+* Fri Dec 23 2005 Tim Waugh <twaugh at redhat.com> 0.9.7-4.1
+- Build for FC4.
+
+* Wed Dec 21 2005 Tim Waugh <twaugh at redhat.com> 0.9.7-4
+- Build requires python-devel, libjpeg-devel (bug #176317).
+
+* Fri Dec 09 2005 Jesse Keating <jkeating at redhat.com>
+- rebuilt
+
+* Wed Dec  7 2005 Tim Waugh <twaugh at redhat.com> 0.9.7-3
+- Use upstream patch 0.9.7-2.
+- No longer need lpgetstatus or compile patches.
+
+* Fri Nov 25 2005 Tim Waugh <twaugh at redhat.com> 0.9.7-2
+- Prevent LPGETSTATUS overrunning format buffer.
+
+* Thu Nov 24 2005 Tim Waugh <twaugh at redhat.com> 0.9.7-1
+- 0.9.7.
+
+* Fri Nov 18 2005 Tim Waugh <twaugh at redhat.com> 0.9.6-7
+- Fix compilation.
+
+* Wed Nov  9 2005 Tomas Mraz <tmraz at redhat.com> 0.9.6-6
+- rebuilt against new openssl
+
+* Mon Nov  7 2005 Tim Waugh <twaugh at redhat.com> 0.9.6-5
+- Rebuilt.
+
+* Wed Oct 26 2005 Tim Waugh <twaugh at redhat.com> 0.9.6-4
+- Ship initscript in %%{_sysconfdir}/rc.d/init.d.
+
+* Fri Oct 14 2005 Tim Waugh <twaugh at redhat.com>
+- Install the desktop file with Hidden=True (bug #170762).
+
+* Fri Oct 14 2005 Tim Waugh <twaugh at redhat.com> 0.9.6-3
+- Don't install desktop file (bug #170762).
+- Quieten the hpssd daemon at startup (bug #170762).
+
+* Wed Oct 12 2005 Tim Waugh <twaugh at redhat.com> 0.9.6-2
+- 0.9.6.
+
+* Tue Sep 20 2005 Tim Waugh <twaugh at redhat.com> 0.9.5-3
 - Apply upstream patch to fix scanning in LaserJets and parallel InkJets.
 
-* Mon Sep 19 2005 Tim Waugh <twaugh at redhat.com> 0.9.5-1.1
-- Build for Fedora Core 4.
-- Fix compile errors.
+* Mon Sep 19 2005 Tim Waugh <twaugh at redhat.com> 0.9.5-2
 - 0.9.5.
 - No longer need condrestart patch.
+- Fix compile errors.
 
-* Tue Jul 26 2005 Tim Waugh <twaugh at redhat.com>
+* Tue Jul 26 2005 Tim Waugh <twaugh at redhat.com> 0.9.4-3
 - Fix condrestart in the initscript.
 
-* Mon Jul 25 2005 Tim Waugh <twaugh at redhat.com> 0.9.4-1.1
-- Build for Fedora Core 4.
+* Mon Jul 25 2005 Tim Waugh <twaugh at redhat.com> 0.9.4-2
 - Use 'condrestart' not 'restart' in %%post scriptlet.
 
 * Fri Jul 22 2005 Tim Waugh <twaugh at redhat.com> 0.9.4-1


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/hplip/FC-4/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sources	19 Sep 2005 10:50:31 -0000	1.4
+++ sources	23 Dec 2005 09:17:13 -0000	1.5
@@ -1 +1 @@
-cb71d665ff935129029c78148b2b0c23  hplip-0.9.5.tar.gz
+d2ee27d7c347f549306a880561c5030a  hplip-0.9.7.tar.gz




More information about the fedora-cvs-commits mailing list