[packages/python-pkpgcounter] - don't treat "no tty" stdin as if there is data to parse there
baggins
baggins at pld-linux.org
Wed Nov 27 14:23:13 CET 2013
commit 7ff6c58117ab5fe38ae6f9833eec356cf00c93e0
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Wed Nov 27 14:18:19 2013 +0100
- don't treat "no tty" stdin as if there is data to parse there
Trying to read stdin also where it's not a tty causes mysterious errors
when pkpgcounter is run from filters/backends (ex. tea4cups):
Unsupported file format for /var/spool/cups/tmp/tmpXXXXXX (input file /var/spool/cups/tmp/tmpXXXXXX is empty !)
because pkpgcounter tries to parse non-existing input from stdin.
pkpgcounter-stdin-noargs.patch | 11 +++++++++++
python-pkpgcounter.spec | 2 ++
2 files changed, 13 insertions(+)
---
diff --git a/python-pkpgcounter.spec b/python-pkpgcounter.spec
index 24e8a36..b006780 100644
--- a/python-pkpgcounter.spec
+++ b/python-pkpgcounter.spec
@@ -10,6 +10,7 @@ Group: Development/Languages/Python
Source0: http://www.pykota.com/software/pkpgcounter/download/tarballs/%{module}-%{version}.tar.gz
# Source0-md5: 564dd96e8a5433564c2e39319e65217e
Patch0: pkpgcounter-postscript-multiple-copies.patch
+Patch1: pkpgcounter-stdin-noargs.patch
URL: http://www.pykota.com/software/pkpgcounter/
BuildRequires: python >= 1:2.5
BuildRequires: python-devel >= 1:2.5
@@ -32,6 +33,7 @@ potrzebne do wydrukowania różnych typów dokumentów.
%prep
%setup -q -n %{module}-%{version}
%patch0 -p1
+%patch1 -p1
%build
%{__python} setup.py build
diff --git a/pkpgcounter-stdin-noargs.patch b/pkpgcounter-stdin-noargs.patch
new file mode 100644
index 0000000..13d1d1d
--- /dev/null
+++ b/pkpgcounter-stdin-noargs.patch
@@ -0,0 +1,11 @@
+--- pkpgcounter-3.50/pkpgpdls/analyzer.py~ 2013-11-27 13:44:25.294545999 +0100
++++ pkpgcounter-3.50/pkpgpdls/analyzer.py 2013-11-27 14:00:38.057131007 +0100
+@@ -225,7 +225,7 @@
+ sys.stderr.write("ERROR: the argument to the --resolution command line option must be between 72 and 1200.\n")
+ sys.stderr.flush()
+ else :
+- if (not arguments) or ((not sys.stdin.isatty()) and ("-" not in arguments)) :
++ if (not arguments) :
+ arguments.append("-")
+ totalsize = 0
+ lines = []
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pkpgcounter.git/commitdiff/47c8887c703d75ad6985a8f9c72784d1e756a17d
More information about the pld-cvs-commit
mailing list