Hello community,

here is the log from the commit of package printer-driver-brlaser for 
openSUSE:Factory checked in at 2020-07-14 07:59:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/printer-driver-brlaser (Old)
 and      /work/SRC/openSUSE:Factory/.printer-driver-brlaser.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "printer-driver-brlaser"

Tue Jul 14 07:59:56 2020 rev:6 rq:820630 version:6+git20200420.9d7ddda

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/printer-driver-brlaser/printer-driver-brlaser.changes
    2020-06-03 20:33:35.941375073 +0200
+++ 
/work/SRC/openSUSE:Factory/.printer-driver-brlaser.new.3060/printer-driver-brlaser.changes
  2020-07-14 08:00:54.190103111 +0200
@@ -1,0 +2,13 @@
+Sat Jul 11 09:56:15 UTC 2020 - [email protected]
+
+- Update to version 6+git20200420.9d7ddda:
+  * Arrange blocks in bands of 128 lines
+    - this is more similar to what the Brother driver does and
+      fixes #52, #40 etc
+  * Tweak compiler flags
+  * Be tolerant of zero-page jobs
+  * Add some new printer definitions
+    - HL-2375DW, HL-2390DW, MFC-7420, MFC-7460DN, DCP-L2520DW
+  * Update README.md
+
+-------------------------------------------------------------------

Old:
----
  brlaser-6+git20191118.2f63d0a.tar.gz

New:
----
  brlaser-6+git20200420.9d7ddda.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ printer-driver-brlaser.spec ++++++
--- /var/tmp/diff_new_pack.qISkbH/_old  2020-07-14 08:00:55.362106905 +0200
+++ /var/tmp/diff_new_pack.qISkbH/_new  2020-07-14 08:00:55.366106918 +0200
@@ -18,7 +18,7 @@
 
 
 Name:           printer-driver-brlaser
-Version:        6+git20191118.2f63d0a
+Version:        6+git20200420.9d7ddda
 Release:        0
 Summary:        Driver for (some) Brother laster printers
 License:        GPL-2.0-or-later
@@ -65,6 +65,8 @@
     Brother HL-2140 series
     Brother HL-2220 series
     Brother HL-2270DW series
+    Brother HL-2375DW
+    Brother HL-2390DW
     Brother HL-5030 series
     Brother HL-L2300D series
     Brother HL-L2320D series
@@ -74,6 +76,8 @@
     Brother MFC-7240
     Brother MFC-7360N
     Brother MFC-7365DN
+    Brother MFC-7420
+    Brother MFC-7460DN
     Brother MFC-7840W
     Brother MFC-L2710DW series
     Lenovo M7605D

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.qISkbH/_old  2020-07-14 08:00:55.414107074 +0200
+++ /var/tmp/diff_new_pack.qISkbH/_new  2020-07-14 08:00:55.418107087 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">git://github.com/pdewacht/brlaser.git</param>
-              <param 
name="changesrevision">e7268ac787a0221e5a7300d321bc7ab7db46e73f</param></service></servicedata>
\ No newline at end of file
+              <param 
name="changesrevision">9d7ddda8383bfc4d205b5e1b49de2b8bcd9137f1</param></service></servicedata>
\ No newline at end of file

++++++ brlaser-6+git20191118.2f63d0a.tar.gz -> 
brlaser-6+git20200420.9d7ddda.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/CMakeLists.txt 
new/brlaser-6+git20200420.9d7ddda/CMakeLists.txt
--- old/brlaser-6+git20191118.2f63d0a/CMakeLists.txt    2019-11-18 
23:04:18.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/CMakeLists.txt    2020-04-20 
21:58:11.000000000 +0200
@@ -39,10 +39,11 @@
 # Compiler warnings
 extra_cxx_compiler_flag("-Wall")
 extra_cxx_compiler_flag("-Wno-missing-braces")
-# Some security flags
+extra_cxx_compiler_flag("-Wdate-time")
+# Some hardening flags
 extra_cxx_compiler_flag("-fstack-protector-strong")
 extra_cxx_compiler_flag("-Wformat")
-extra_cxx_compiler_flag("-Werror=format-security")
+extra_cxx_compiler_flag("-Wformat -Werror=format-security")
 extra_cxx_compiler_flag("-D_FORTIFY_SOURCE=2")
 # Enable the supported flags, but give priority to CXXFLAGS env var
 set(CMAKE_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
@@ -116,15 +117,17 @@
 add_executable(test_lest test/test_lest.cc)
 add_executable(test_line test/test_line.cc src/line.cc)
 add_executable(test_block test/test_block.cc)
+add_executable(test_job test/test_job.cc src/job.cc src/line.cc)
 
 enable_testing()
 add_test(test_lest test_lest)
 add_test(test_line test_line)
 add_test(test_block test_block)
+add_test(test_job test_job)
 
 # Autotools-style "make check" command
 add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
-add_dependencies(check test_lest test_line test_block)
+add_dependencies(check test_lest test_line test_block test_job)
 
 
 # Installation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/README.md 
new/brlaser-6+git20200420.9d7ddda/README.md
--- old/brlaser-6+git20191118.2f63d0a/README.md 2019-11-18 23:04:18.000000000 
+0100
+++ new/brlaser-6+git20200420.9d7ddda/README.md 2020-04-20 21:58:11.000000000 
+0200
@@ -21,6 +21,7 @@
 * Brother DCP-7080
 * Brother DCP-L2500D series
 * Brother DCP-L2520D series
+* Brother DCP-L2520DW series
 * Brother DCP-L2540DW series
 * Brother HL-1110 series
 * Brother HL-1200 series
@@ -33,10 +34,14 @@
 * Brother HL-L2320D series
 * Brother HL-L2340D series
 * Brother HL-L2360D series
+* Brother HL-L2375DW series
+* Brother HL-L2390DW
 * Brother MFC-1910W
 * Brother MFC-7240
 * Brother MFC-7360N
 * Brother MFC-7365DN
+* Brother MFC-7420
+* Brother MFC-7460DN
 * Brother MFC-7840W
 * Brother MFC-L2710DW series
 * Lenovo M7605D
@@ -60,7 +65,8 @@
 ------------
 
 Some operating systems already ship this driver. This is the case for
-at least Debian, Ubuntu, Raspbian, openSUSE, NixOS, Arch Linux and Guix.
+at least Debian, Gentoo, Ubuntu, Raspbian, openSUSE, NixOS, Arch Linux 
+and Guix.
 Look for a package named `printer-driver-brlaser`.
 
 You'll also need Ghostscript, in case that's not installed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/brlaser.drv.in 
new/brlaser-6+git20200420.9d7ddda/brlaser.drv.in
--- old/brlaser-6+git20191118.2f63d0a/brlaser.drv.in    2019-11-18 
23:04:18.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/brlaser.drv.in    2020-04-20 
21:58:11.000000000 +0200
@@ -174,6 +174,14 @@
 }
 
 {
+  ModelName "DCP-L2520DW"
+  Attribute "NickName" "" "Brother DCP-L2520DW series, $USING"
+  Attribute "1284DeviceID" "" "MFG:Brother;CMD:PJL,HBP;MDL:DCP-L2520DW 
series;CLS:PRINTER;CID:Brother Laser Type1;"
+  Duplex rotated
+  PCFileName "brl2520dw.ppd"
+}
+
+{
   ModelName "DCP-L2540DW"
   Attribute "NickName" "" "Brother DCP-L2540DW series, $USING"
   Attribute "1284DeviceID" "" "MFG:Brother;CMD:PJL,HBP;MDL:DCP-L2540DW 
series;CLS:PRINTER;CID:Brother Laser Type1;"
@@ -266,6 +274,22 @@
 }
 
 {
+  ModelName "HL-L2375DW"
+  Attribute "NickName" "" "Brother HL-L2375DW series, $USING"
+  Attribute "1284DeviceID" "" 
"MFG:Brother;CMD:PJL,PCL,PCLXL,URF;MDL:HL-L2375DW 
series;CLS:PRINTER;CID:Brother Laser 
Type1;URF:W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ3-4-5,RS300-600-1200,V1.4,DM1;"
+  Duplex rotated
+  PCFileName "brl2375w.ppd"
+}
+
+{
+  ModelName "HL-L2390DW"
+  Attribute "NickName" "" "Brother HL-L2390DW, $USING"
+  Attribute "1284DeviceID" "" 
"MFG:Brother;CMD:PJL,HBP,URF;MDL:HL-L2390DW;CLS:PRINTER;CID:Brother Laser 
Type1;URF:W8,CP1,IS4-1,MT1-3-4-5-8,OB10,PQ3-4-5,RS300-600-1200,V1.4,DM1;"
+  Duplex rotated
+  PCFileName "brl2390w.ppd"
+}
+
+{
   ModelName "MFC-1910W"
   Attribute "NickName" "" "Brother MFC-1910W, $USING"
   Attribute "1284DeviceID" "" 
"MFG:Brother;MFG:Brother;CMD:PJL,HBP;MDL:MFC-1910W 
series;CLS:PRINTER;CID:Brother Laser Type1;"
@@ -295,6 +319,21 @@
   Duplex rotated
   PCFileName "br7365dn.ppd"
 }
+
+{
+  ModelName "MFC-7420"
+  Attribute "NickName" "" "Brother Brother MFC-7420, $USING"
+  Attribute "1284DeviceID" "" 
"MFG:Brother;CMD:PJL,HBP;MDL:MFC-7420;CLS:PRINTER;"
+  PCFileName "br7420.ppd"
+}
+
+{
+  ModelName "MFC-7460DN"
+  Attribute "NickName" "" "Brother MFC-7460DN, $USING"
+  Attribute "1284DeviceID" "" 
"MFG:Brother;CMD:PJL,HBP;MDL:MFC-7460DN;CLS:PRINTER;CID:Brother Laser Type1;"
+  Duplex rotated
+  PCFileName "br7365dn.ppd"
+}
 
 {
   ModelName "MFC-L2710DW series"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/src/block.h 
new/brlaser-6+git20200420.9d7ddda/src/block.h
--- old/brlaser-6+git20191118.2f63d0a/src/block.h       2019-11-18 
23:04:18.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/src/block.h       2020-04-20 
21:58:11.000000000 +0200
@@ -25,7 +25,6 @@
 class block {
  public:
   block(): line_bytes_(0) {
-    lines_.reserve(max_lines_per_block_);
   }
 
   bool empty() const {
@@ -40,8 +39,7 @@
   }
 
   bool line_fits(unsigned size) {
-    return lines_.size() != max_lines_per_block_
-      && line_bytes_ + size < max_block_size_;
+    return line_bytes_ + size < max_block_size_;
   }
 
   void flush(FILE *f) {
@@ -59,7 +57,6 @@
 
  private:
   static const unsigned max_block_size_ = 16350;
-  static const unsigned max_lines_per_block_ = 64;
 
   std::vector<std::vector<uint8_t>> lines_;
   int line_bytes_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/src/job.cc 
new/brlaser-6+git20200420.9d7ddda/src/job.cc
--- old/brlaser-6+git20191118.2f63d0a/src/job.cc        2019-11-18 
23:04:18.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/src/job.cc        2020-04-20 
21:58:11.000000000 +0200
@@ -26,17 +26,18 @@
 job::job(FILE *out, const std::string &job_name)
     : out_(out),
       job_name_(job_name),
-      page_params_() {
+      page_params_(),
+      pages_(0) {
   // Delete dubious characters from job name
   std::replace_if(job_name_.begin(), job_name_.end(), [](char c) {
       return c < 32 || c >= 127 || c == '"' || c == '\\';
     }, ' ');
-
-  begin_job();
 }
 
 job::~job() {
-  end_job();
+  if (pages_ != 0) {
+    end_job();
+  }
 }
 
 void job::begin_job() {
@@ -86,6 +87,11 @@
                       int lines,
                       int linesize,
                       nextline_fn nextline) {
+  if (pages_ == 0) {
+    begin_job();
+  }
+  ++pages_;
+
   if (!(page_params_ == page_params)) {
     page_params_ = page_params;
     write_page_header();
@@ -103,14 +109,22 @@
 
   fputs("\033*b1030m", out_);
 
+  // XXX brother driver uses 128 lines per band
+  const int lines_per_band = 64;
+
   for (int i = 1; i < lines && nextline(line); ++i) {
-    std::vector<uint8_t> encoded = encode_line(line, reference);
-    if (block.line_fits(encoded.size())) {
-      block.add_line(std::move(encoded));
-    } else {
+    std::vector<uint8_t> encoded;
+    if (i % lines_per_band == 0) {
       block.flush(out_);
-      block.add_line(encode_line(line));
+      encoded = encode_line(line);
+    } else {
+      encoded = encode_line(line, reference);
+      if (!block.line_fits(encoded.size())) {
+        block.flush(out_);
+        encoded = encode_line(line);
+      }
     }
+    block.add_line(std::move(encoded));
     std::swap(line, reference);
   }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/src/job.h 
new/brlaser-6+git20200420.9d7ddda/src/job.h
--- old/brlaser-6+git20191118.2f63d0a/src/job.h 2019-11-18 23:04:18.000000000 
+0100
+++ new/brlaser-6+git20200420.9d7ddda/src/job.h 2020-04-20 21:58:11.000000000 
+0200
@@ -55,6 +55,10 @@
                    int linesize,
                    nextline_fn nextline);
 
+  int pages() const {
+    return pages_;
+  }
+
  private:
   void begin_job();
   void end_job();
@@ -63,6 +67,7 @@
   FILE *out_;
   std::string job_name_;
   page_params page_params_;
+  int pages_;
 };
 
 #endif  // JOB_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/src/main.cc 
new/brlaser-6+git20200420.9d7ddda/src/main.cc
--- old/brlaser-6+git20191118.2f63d0a/src/main.cc       2019-11-18 
23:04:18.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/src/main.cc       2020-04-20 
21:58:11.000000000 +0200
@@ -170,7 +170,6 @@
     return 1;
   }
 
-  int pages = 0;
   {
     job job(stdout, ascii_job_name(job_id, job_user, job_name));
     cups_page_header2_t header;
@@ -179,11 +178,11 @@
           || header.cupsBitsPerColor != 1
           || header.cupsNumColors != 1
           || header.cupsBytesPerLine > 10000) {
-        fprintf(stderr, "ERROR: " PACKAGE ": Page %d: Bogus raster data.\n", 
pages + 1);
+        fprintf(stderr, "ERROR: " PACKAGE ": Page %d: Bogus raster data.\n", 
job.pages() + 1);
         dump_page_header(header);
         return 1;
       }
-      if (pages == 0) {
+      if (job.pages() == 0) {
         fprintf(stderr, "DEBUG: " PACKAGE ": Page header of first page\n");
         dump_page_header(header);
       }
@@ -191,13 +190,12 @@
                       header.cupsHeight,
                       header.cupsBytesPerLine,
                       next_line);
-      fprintf(stderr, "PAGE: %d %d\n", ++pages, header.NumCopies);
+      fprintf(stderr, "PAGE: %d %d\n", job.pages(), header.NumCopies);
     }
-  }
 
-  if (pages == 0) {
-    fprintf(stderr, "ERROR: " PACKAGE ": No pages were found.\n");
-    return 1;
+    if (job.pages() == 0) {
+      fprintf(stderr, "ERROR: " PACKAGE ": No pages were found.\n");
+    }
   }
 
   fflush(stdout);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/test/test_block.cc 
new/brlaser-6+git20200420.9d7ddda/test/test_block.cc
--- old/brlaser-6+git20191118.2f63d0a/test/test_block.cc        2019-11-18 
23:04:18.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/test/test_block.cc        2020-04-20 
21:58:11.000000000 +0200
@@ -37,16 +37,6 @@
     EXPECT(!b.empty());
   },
 
-  "A block can contain 64 lines",
-  [] {
-    block b;
-    for (int i = 0; i < 64; ++i) {
-      EXPECT(b.line_fits(1));
-      b.add_line(vec(1));
-    }
-    EXPECT(!b.line_fits(1));
-  },
-
   "A block has a size limit of about 16 kilobyte",
   [] {
     block b;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/brlaser-6+git20191118.2f63d0a/test/test_job.cc 
new/brlaser-6+git20200420.9d7ddda/test/test_job.cc
--- old/brlaser-6+git20191118.2f63d0a/test/test_job.cc  1970-01-01 
01:00:00.000000000 +0100
+++ new/brlaser-6+git20200420.9d7ddda/test/test_job.cc  2020-04-20 
21:58:11.000000000 +0200
@@ -0,0 +1,35 @@
+// This file is part of the brlaser printer driver.
+//
+// Copyright 2020 Peter De Wachter
+//
+// brlaser is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// brlaser is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with brlaser.  If not, see <http://www.gnu.org/licenses/>.
+
+#include "lest.hpp"
+#include "tempfile.h"
+#include "../src/job.h"
+
+const lest::test specification[] = {
+  "An empty job produces no output",
+  [] {
+    tempfile f;
+    {
+      job j(f.file(), "name");
+    }
+    EXPECT(f.data().empty());
+  },
+};
+
+int main() {
+  return lest::run(specification);
+}


Reply via email to