openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
July 2014
- 1 participants
- 1416 discussions
Hello community,
here is the log from the commit of package python-pytest-cov for openSUSE:Factory checked in at 2014-07-31 10:04:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-cov (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-cov.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-cov"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-cov/python-pytest-cov.changes 2013-08-18 22:35:21.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-pytest-cov.new/python-pytest-cov.changes 2014-07-31 10:04:32.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jul 30 07:27:46 UTC 2014 - toddrme2178(a)gmail.com
+
+- Update to 1.7.0
+ * No upstream changelog
+
+-------------------------------------------------------------------
Old:
----
pytest-cov-1.6.tar.gz
New:
----
pytest-cov-1.7.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-cov.spec ++++++
--- /var/tmp/diff_new_pack.aH0TCU/_old 2014-07-31 10:04:34.000000000 +0200
+++ /var/tmp/diff_new_pack.aH0TCU/_new 2014-07-31 10:04:34.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-cov
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
Name: python-pytest-cov
-Version: 1.6
+Version: 1.7.0
Release: 0
License: MIT
Summary: Pytest plugin for coverage reporting
@@ -25,9 +25,13 @@
Source: https://pypi.python.org/packages/source/p/pytest-cov/pytest-cov-%{version}.…
BuildRequires: python-devel
BuildRequires: python-setuptools
+BuildRequires: python-cov-core >= 1.12
+BuildRequires: python-pytest >= 2.2.3
# Test requirements:
BuildRequires: python-py
+BuildRequires: python-virtualenv
Requires: python-pytest >= 2.2.3
+Requires: python-cov-core >= 1.12
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@@ -56,7 +60,7 @@
%files
%defattr(-,root,root,-)
-%doc LICENSE.txt README.txt
+%doc LICENSE.txt README.rst
%{python_sitelib}/*
%changelog
++++++ pytest-cov-1.6.tar.gz -> pytest-cov-1.7.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/MANIFEST.in new/pytest-cov-1.7.0/MANIFEST.in
--- old/pytest-cov-1.6/MANIFEST.in 2010-08-02 15:27:37.000000000 +0200
+++ new/pytest-cov-1.7.0/MANIFEST.in 2014-04-24 21:56:06.000000000 +0200
@@ -1,4 +1,4 @@
-include README.txt
+include README.rst
include LICENSE.txt
include setup.py
include pytest_cov.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/PKG-INFO new/pytest-cov-1.7.0/PKG-INFO
--- old/pytest-cov-1.6/PKG-INFO 2012-05-12 02:03:20.000000000 +0200
+++ new/pytest-cov-1.7.0/PKG-INFO 2014-06-12 20:24:03.000000000 +0200
@@ -1,14 +1,30 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: pytest-cov
-Version: 1.6
+Version: 1.7.0
Summary: py.test plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing
-Home-page: http://bitbucket.org/memedough/pytest-cov/overview
-Author: Meme Dough
-Author-email: memedough(a)gmail.com
+Home-page: https://github.com/schlamar/pytest-cov
+Author: Marc Schlaich
+Author-email: marc.schlaich(a)gmail.com
License: MIT License
Description: pytest-cov
==========
+ .. image:: https://travis-ci.org/schlamar/pytest-cov.svg?branch=master
+ :target: https://travis-ci.org/schlamar/pytest-cov
+ :alt: Build status
+
+ .. image:: https://pypip.in/download/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi//pytest-cov/
+ :alt: Downloads
+
+ .. image:: https://pypip.in/version/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi/pytest-cov/
+ :alt: Latest Version
+
+ .. image:: https://pypip.in/license/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi/pytest-cov/
+ :alt: License
+
This plugin produces coverage reports. It supports centralised testing and distributed testing in
both load and each modes. It also supports coverage of subprocesses.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/README.rst new/pytest-cov-1.7.0/README.rst
--- old/pytest-cov-1.6/README.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-cov-1.7.0/README.rst 2014-06-12 19:58:28.000000000 +0200
@@ -0,0 +1,266 @@
+pytest-cov
+==========
+
+.. image:: https://travis-ci.org/schlamar/pytest-cov.svg?branch=master
+ :target: https://travis-ci.org/schlamar/pytest-cov
+ :alt: Build status
+
+.. image:: https://pypip.in/download/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi//pytest-cov/
+ :alt: Downloads
+
+.. image:: https://pypip.in/version/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi/pytest-cov/
+ :alt: Latest Version
+
+.. image:: https://pypip.in/license/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi/pytest-cov/
+ :alt: License
+
+This plugin produces coverage reports. It supports centralised testing and distributed testing in
+both load and each modes. It also supports coverage of subprocesses.
+
+All features offered by the coverage package should be available, either through pytest-cov or
+through coverage's config file.
+
+
+Installation
+------------
+
+Install with pip::
+
+ pip install pytest-cov
+
+For distributed testing support install pytest-xdist::
+
+ pip install pytest-xdist
+
+.. NOTE::
+
+ Ensure you use pip instead of easy_install as the latter does not correctly install the
+ init_cov_core.pth file needed for subprocess measurement.
+
+
+Uninstallation
+--------------
+
+Uninstall with pip::
+
+ pip uninstall pytest-cov
+ pip uninstall cov-core
+
+.. NOTE::
+
+ Ensure that you manually delete the init_cov_core.pth file in your site-packages directory.
+
+ This file starts coverage collection of subprocesses if appropriate during site initialisation
+ at python startup.
+
+
+Usage
+-----
+
+Centralised Testing
+~~~~~~~~~~~~~~~~~~~
+
+Centralised testing will report on the combined coverage of the main process and all of it's
+subprocesses.
+
+Running centralised testing::
+
+ py.test --cov myproj tests/
+
+Shows a terminal report::
+
+ -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/__init__ 2 0 100%
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+
+Distributed Testing: Load
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Distributed testing with dist mode set to load will report on the combined coverage of all slaves.
+The slaves may be spread out over any number of hosts and each slave may be located anywhere on the
+file system. Each slave will have it's subprocesses measured.
+
+Running distributed testing with dist mode set to load::
+
+ py.test --cov myproj -n 2 tests/
+
+Shows a terminal report::
+
+ -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/__init__ 2 0 100%
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+
+Again but spread over different hosts and different directories::
+
+ py.test --cov myproj --dist load
+ --tx ssh=memedough@host1//chdir=testenv1
+ --tx ssh=memedough@host2//chdir=/tmp/testenv2//python=/tmp/env1/bin/python
+ --rsyncdir myproj --rsyncdir tests --rsync examples
+ tests/
+
+Shows a terminal report::
+
+ -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/__init__ 2 0 100%
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+
+Distributed Testing: Each
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Distributed testing with dist mode set to each will report on the combined coverage of all slaves.
+Since each slave is running all tests this allows generating a combined coverage report for multiple
+environments.
+
+Running distributed testing with dist mode set to each::
+
+ py.test --cov myproj --dist each
+ --tx popen//chdir=/tmp/testenv3//python=/usr/local/python27/bin/python
+ --tx ssh=memedough@host2//chdir=/tmp/testenv4//python=/tmp/env2/bin/python
+ --rsyncdir myproj --rsyncdir tests --rsync examples
+ tests/
+
+Shows a terminal report::
+
+ ---------------------------------------- coverage ----------------------------------------
+ platform linux2, python 2.6.5-final-0
+ platform linux2, python 2.7.0-final-0
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/__init__ 2 0 100%
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+
+Reporting
+---------
+
+It is possible to generate any combination of the reports for a single test run.
+
+The available reports are terminal (with or without missing line numbers shown), HTML, XML and
+annotated source code.
+
+The terminal report without line numbers (default)::
+
+ py.test --cov-report term --cov myproj tests/
+
+ -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/__init__ 2 0 100%
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+
+The terminal report with line numbers::
+
+ py.test --cov-report term-missing --cov myproj tests/
+
+ -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover Missing
+ --------------------------------------------------
+ myproj/__init__ 2 0 100%
+ myproj/myproj 257 13 94% 24-26, 99, 149, 233-236, 297-298, 369-370
+ myproj/feature4286 94 7 92% 183-188, 197
+ --------------------------------------------------
+ TOTAL 353 20 94%
+
+
+The remaining three reports output to files without showing anything on the terminal (useful for
+when the output is going to a continuous integration server)::
+
+ py.test --cov-report html
+ --cov-report xml
+ --cov-report annotate
+ --cov myproj tests/
+
+
+Coverage Data File
+------------------
+
+The data file is erased at the beginning of testing to ensure clean data for each test run.
+
+The data file is left at the end of testing so that it is possible to use normal coverage tools to
+examine it.
+
+
+Coverage Config File
+--------------------
+
+This plugin provides a clean minimal set of command line options that are added to pytest. For
+further control of coverage use a coverage config file.
+
+For example if tests are contained within the directory tree being measured the tests may be
+excluded if desired by using a .coveragerc file with the omit option set::
+
+ py.test --cov-config .coveragerc
+ --cov myproj
+ myproj/tests/
+
+Where the .coveragerc file contains file globs::
+
+ [run]
+ omit = tests/*
+
+For full details refer to the `coverage config file`_ documentation.
+
+.. _`coverage config file`: http://nedbatchelder.com/code/coverage/config.html
+
+Note that this plugin controls some options and setting the option in the config file will have no
+effect. These include specifying source to be measured (source option) and all data file handling
+(data_file and parallel options).
+
+
+Limitations
+-----------
+
+For distributed testing the slaves must have the pytest-cov package installed. This is needed since
+the plugin must be registered through setuptools / distribute for pytest to start the plugin on the
+slave.
+
+For subprocess measurement environment variables must make it from the main process to the
+subprocess. The python used by the subprocess must have pytest-cov installed. The subprocess must
+do normal site initialisation so that the environment variables can be detected and coverage
+started.
+
+
+Acknowledgements
+----------------
+
+Whilst this plugin has been built fresh from the ground up it has been influenced by the work done
+on pytest-coverage (Ross Lawley, James Mills, Holger Krekel) and nose-cover (Jason Pellerin) which are
+other coverage plugins.
+
+Ned Batchelder for coverage and its ability to combine the coverage results of parallel runs.
+
+Holger Krekel for pytest with its distributed testing support.
+
+Jason Pellerin for nose.
+
+Michael Foord for unittest2.
+
+No doubt others have contributed to these tools as well.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/README.txt new/pytest-cov-1.7.0/README.txt
--- old/pytest-cov-1.6/README.txt 2012-05-12 01:54:33.000000000 +0200
+++ new/pytest-cov-1.7.0/README.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1,250 +0,0 @@
-pytest-cov
-==========
-
-This plugin produces coverage reports. It supports centralised testing and distributed testing in
-both load and each modes. It also supports coverage of subprocesses.
-
-All features offered by the coverage package should be available, either through pytest-cov or
-through coverage's config file.
-
-
-Installation
-------------
-
-Install with pip::
-
- pip install pytest-cov
-
-For distributed testing support install pytest-xdist::
-
- pip install pytest-xdist
-
-.. NOTE::
-
- Ensure you use pip instead of easy_install as the latter does not correctly install the
- init_cov_core.pth file needed for subprocess measurement.
-
-
-Uninstallation
---------------
-
-Uninstall with pip::
-
- pip uninstall pytest-cov
- pip uninstall cov-core
-
-.. NOTE::
-
- Ensure that you manually delete the init_cov_core.pth file in your site-packages directory.
-
- This file starts coverage collection of subprocesses if appropriate during site initialisation
- at python startup.
-
-
-Usage
------
-
-Centralised Testing
-~~~~~~~~~~~~~~~~~~~
-
-Centralised testing will report on the combined coverage of the main process and all of it's
-subprocesses.
-
-Running centralised testing::
-
- py.test --cov myproj tests/
-
-Shows a terminal report::
-
- -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
- Name Stmts Miss Cover
- ----------------------------------------
- myproj/__init__ 2 0 100%
- myproj/myproj 257 13 94%
- myproj/feature4286 94 7 92%
- ----------------------------------------
- TOTAL 353 20 94%
-
-
-Distributed Testing: Load
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Distributed testing with dist mode set to load will report on the combined coverage of all slaves.
-The slaves may be spread out over any number of hosts and each slave may be located anywhere on the
-file system. Each slave will have it's subprocesses measured.
-
-Running distributed testing with dist mode set to load::
-
- py.test --cov myproj -n 2 tests/
-
-Shows a terminal report::
-
- -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
- Name Stmts Miss Cover
- ----------------------------------------
- myproj/__init__ 2 0 100%
- myproj/myproj 257 13 94%
- myproj/feature4286 94 7 92%
- ----------------------------------------
- TOTAL 353 20 94%
-
-
-Again but spread over different hosts and different directories::
-
- py.test --cov myproj --dist load
- --tx ssh=memedough@host1//chdir=testenv1
- --tx ssh=memedough@host2//chdir=/tmp/testenv2//python=/tmp/env1/bin/python
- --rsyncdir myproj --rsyncdir tests --rsync examples
- tests/
-
-Shows a terminal report::
-
- -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
- Name Stmts Miss Cover
- ----------------------------------------
- myproj/__init__ 2 0 100%
- myproj/myproj 257 13 94%
- myproj/feature4286 94 7 92%
- ----------------------------------------
- TOTAL 353 20 94%
-
-
-Distributed Testing: Each
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Distributed testing with dist mode set to each will report on the combined coverage of all slaves.
-Since each slave is running all tests this allows generating a combined coverage report for multiple
-environments.
-
-Running distributed testing with dist mode set to each::
-
- py.test --cov myproj --dist each
- --tx popen//chdir=/tmp/testenv3//python=/usr/local/python27/bin/python
- --tx ssh=memedough@host2//chdir=/tmp/testenv4//python=/tmp/env2/bin/python
- --rsyncdir myproj --rsyncdir tests --rsync examples
- tests/
-
-Shows a terminal report::
-
- ---------------------------------------- coverage ----------------------------------------
- platform linux2, python 2.6.5-final-0
- platform linux2, python 2.7.0-final-0
- Name Stmts Miss Cover
- ----------------------------------------
- myproj/__init__ 2 0 100%
- myproj/myproj 257 13 94%
- myproj/feature4286 94 7 92%
- ----------------------------------------
- TOTAL 353 20 94%
-
-
-Reporting
----------
-
-It is possible to generate any combination of the reports for a single test run.
-
-The available reports are terminal (with or without missing line numbers shown), HTML, XML and
-annotated source code.
-
-The terminal report without line numbers (default)::
-
- py.test --cov-report term --cov myproj tests/
-
- -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
- Name Stmts Miss Cover
- ----------------------------------------
- myproj/__init__ 2 0 100%
- myproj/myproj 257 13 94%
- myproj/feature4286 94 7 92%
- ----------------------------------------
- TOTAL 353 20 94%
-
-
-The terminal report with line numbers::
-
- py.test --cov-report term-missing --cov myproj tests/
-
- -------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
- Name Stmts Miss Cover Missing
- --------------------------------------------------
- myproj/__init__ 2 0 100%
- myproj/myproj 257 13 94% 24-26, 99, 149, 233-236, 297-298, 369-370
- myproj/feature4286 94 7 92% 183-188, 197
- --------------------------------------------------
- TOTAL 353 20 94%
-
-
-The remaining three reports output to files without showing anything on the terminal (useful for
-when the output is going to a continuous integration server)::
-
- py.test --cov-report html
- --cov-report xml
- --cov-report annotate
- --cov myproj tests/
-
-
-Coverage Data File
-------------------
-
-The data file is erased at the beginning of testing to ensure clean data for each test run.
-
-The data file is left at the end of testing so that it is possible to use normal coverage tools to
-examine it.
-
-
-Coverage Config File
---------------------
-
-This plugin provides a clean minimal set of command line options that are added to pytest. For
-further control of coverage use a coverage config file.
-
-For example if tests are contained within the directory tree being measured the tests may be
-excluded if desired by using a .coveragerc file with the omit option set::
-
- py.test --cov-config .coveragerc
- --cov myproj
- myproj/tests/
-
-Where the .coveragerc file contains file globs::
-
- [run]
- omit = tests/*
-
-For full details refer to the `coverage config file`_ documentation.
-
-.. _`coverage config file`: http://nedbatchelder.com/code/coverage/config.html
-
-Note that this plugin controls some options and setting the option in the config file will have no
-effect. These include specifying source to be measured (source option) and all data file handling
-(data_file and parallel options).
-
-
-Limitations
------------
-
-For distributed testing the slaves must have the pytest-cov package installed. This is needed since
-the plugin must be registered through setuptools / distribute for pytest to start the plugin on the
-slave.
-
-For subprocess measurement environment variables must make it from the main process to the
-subprocess. The python used by the subprocess must have pytest-cov installed. The subprocess must
-do normal site initialisation so that the environment variables can be detected and coverage
-started.
-
-
-Acknowledgements
-----------------
-
-Whilst this plugin has been built fresh from the ground up it has been influenced by the work done
-on pytest-coverage (Ross Lawley, James Mills, Holger Krekel) and nose-cover (Jason Pellerin) which are
-other coverage plugins.
-
-Ned Batchelder for coverage and its ability to combine the coverage results of parallel runs.
-
-Holger Krekel for pytest with its distributed testing support.
-
-Jason Pellerin for nose.
-
-Michael Foord for unittest2.
-
-No doubt others have contributed to these tools as well.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/pytest_cov.egg-info/PKG-INFO new/pytest-cov-1.7.0/pytest_cov.egg-info/PKG-INFO
--- old/pytest-cov-1.6/pytest_cov.egg-info/PKG-INFO 2012-05-12 02:03:20.000000000 +0200
+++ new/pytest-cov-1.7.0/pytest_cov.egg-info/PKG-INFO 2014-06-12 20:24:03.000000000 +0200
@@ -1,14 +1,30 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
Name: pytest-cov
-Version: 1.6
+Version: 1.7.0
Summary: py.test plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing
-Home-page: http://bitbucket.org/memedough/pytest-cov/overview
-Author: Meme Dough
-Author-email: memedough(a)gmail.com
+Home-page: https://github.com/schlamar/pytest-cov
+Author: Marc Schlaich
+Author-email: marc.schlaich(a)gmail.com
License: MIT License
Description: pytest-cov
==========
+ .. image:: https://travis-ci.org/schlamar/pytest-cov.svg?branch=master
+ :target: https://travis-ci.org/schlamar/pytest-cov
+ :alt: Build status
+
+ .. image:: https://pypip.in/download/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi//pytest-cov/
+ :alt: Downloads
+
+ .. image:: https://pypip.in/version/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi/pytest-cov/
+ :alt: Latest Version
+
+ .. image:: https://pypip.in/license/pytest-cov/badge.png
+ :target: https://pypi.python.org/pypi/pytest-cov/
+ :alt: License
+
This plugin produces coverage reports. It supports centralised testing and distributed testing in
both load and each modes. It also supports coverage of subprocesses.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/pytest_cov.egg-info/SOURCES.txt new/pytest-cov-1.7.0/pytest_cov.egg-info/SOURCES.txt
--- old/pytest-cov-1.6/pytest_cov.egg-info/SOURCES.txt 2012-05-12 02:03:20.000000000 +0200
+++ new/pytest-cov-1.7.0/pytest_cov.egg-info/SOURCES.txt 2014-06-12 20:24:03.000000000 +0200
@@ -1,6 +1,6 @@
LICENSE.txt
MANIFEST.in
-README.txt
+README.rst
pytest_cov.py
setup.py
test_pytest_cov.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/pytest_cov.egg-info/requires.txt new/pytest-cov-1.7.0/pytest_cov.egg-info/requires.txt
--- old/pytest-cov-1.6/pytest_cov.egg-info/requires.txt 2012-05-12 02:03:20.000000000 +0200
+++ new/pytest-cov-1.7.0/pytest_cov.egg-info/requires.txt 2014-06-12 20:24:03.000000000 +0200
@@ -1,2 +1,2 @@
-pytest>=2.2.3
-cov-core>=1.6
\ No newline at end of file
+pytest>=2.5.2
+cov-core>=1.12
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/pytest_cov.py new/pytest-cov-1.7.0/pytest_cov.py
--- old/pytest-cov-1.6/pytest_cov.py 2011-07-25 11:12:24.000000000 +0200
+++ new/pytest-cov-1.7.0/pytest_cov.py 2014-04-26 17:27:42.000000000 +0200
@@ -1,26 +1,50 @@
"""Coverage plugin for pytest."""
+
+import pytest
+
+import cov_core
+
+
def pytest_addoption(parser):
"""Add options to control coverage."""
- group = parser.getgroup('coverage reporting with distributed testing support')
+ group = parser.getgroup('coverage reporting with distributed testing '
+ 'support')
group.addoption('--cov', action='append', default=[], metavar='path',
dest='cov_source',
- help='measure coverage for filesystem path (multi-allowed)')
- group.addoption('--cov-report', action='append', default=[], metavar='type',
- choices=['term', 'term-missing', 'annotate', 'html', 'xml'],
- dest='cov_report',
- help='type of report to generate: term, term-missing, annotate, html, xml (multi-allowed)')
- group.addoption('--cov-config', action='store', default='.coveragerc', metavar='path',
- dest='cov_config',
+ help='measure coverage for filesystem path '
+ '(multi-allowed)')
+ group.addoption('--cov-report', action='append', default=[],
+ metavar='type', dest='cov_report',
+ choices=['term', 'term-missing', 'annotate', 'html',
+ 'xml'],
+ help='type of report to generate: term, term-missing, '
+ 'annotate, html, xml (multi-allowed)')
+ group.addoption('--cov-config', action='store', default='.coveragerc',
+ metavar='path', dest='cov_config',
help='config file for coverage, default: .coveragerc')
+ group.addoption('--no-cov-on-fail', action='store_true', default=False,
+ dest='no_cov_on_fail',
+ help='do not report coverage if test run fails, '
+ 'default: False')
+
+
+(a)pytest.mark.try_last
+def pytest_load_initial_conftests(early_config, parser, args):
+ ns = parser.parse_known_args(args)
+ if ns.cov_source:
+ plugin = CovPlugin(ns, early_config.pluginmanager)
+ early_config.pluginmanager.register(plugin, '_cov')
def pytest_configure(config):
"""Activate coverage plugin if appropriate."""
-
if config.getvalue('cov_source'):
- config.pluginmanager.register(CovPlugin(), '_cov')
+ if not config.pluginmanager.hasplugin('_cov'):
+ plugin = CovPlugin(config.option, config.pluginmanager,
+ start=False)
+ config.pluginmanager.register(plugin, '_cov')
class CovPlugin(object):
@@ -31,7 +55,7 @@
distributed slave.
"""
- def __init__(self):
+ def __init__(self, options, pluginmanager, start=True):
"""Creates a coverage pytest plugin.
We read the rc file that coverage uses to get the data file
@@ -41,45 +65,49 @@
# Our implementation is unknown at this time.
self.cov_controller = None
+ self.failed = False
+ self.options = options
+
+ is_dist = (getattr(options, 'numprocesses', False) or
+ getattr(options, 'distload', False) or
+ getattr(options, 'dist', 'no') != 'no')
+ if is_dist and start:
+ self.start(cov_core.DistMaster)
+ elif start:
+ self.start(cov_core.Central)
+
+ # slave is started in pytest hook
+
+ def start(self, controller_cls, config=None, nodeid=None):
+ if config is None:
+ # fake config option for cov_core
+ class Config(object):
+ option = self.options
+
+ config = Config()
+
+ self.cov_controller = controller_cls(
+ self.options.cov_source,
+ self.options.cov_report or ['term'],
+ self.options.cov_config,
+ config,
+ nodeid
+ )
+ self.cov_controller.start()
def pytest_sessionstart(self, session):
"""At session start determine our implementation and delegate to it."""
-
- import cov_core
-
- cov_source = session.config.getvalue('cov_source')
- cov_report = session.config.getvalue('cov_report') or ['term']
- cov_config = session.config.getvalue('cov_config')
-
- session_name = session.__class__.__name__
- is_master = (session.config.pluginmanager.hasplugin('dsession') or
- session_name == 'DSession')
- is_slave = (hasattr(session.config, 'slaveinput') or
- session_name == 'SlaveSession')
- nodeid = None
-
- if is_master:
- controller_cls = cov_core.DistMaster
- elif is_slave:
- controller_cls = cov_core.DistSlave
- nodeid = session.config.slaveinput.get('slaveid', getattr(session, 'nodeid'))
- else:
- controller_cls = cov_core.Central
-
- self.cov_controller = controller_cls(cov_source,
- cov_report,
- cov_config,
- session.config,
- nodeid)
-
- self.cov_controller.start()
+ is_slave = hasattr(session.config, 'slaveinput')
+ if is_slave:
+ nodeid = session.config.slaveinput.get('slaveid',
+ getattr(session, 'nodeid'))
+ self.start(cov_core.DistSlave, session.config, nodeid)
def pytest_configure_node(self, node):
"""Delegate to our implementation.
Mark this hook as optional in case xdist is not installed.
"""
-
self.cov_controller.configure_node(node)
pytest_configure_node.optionalhook = True
@@ -88,23 +116,24 @@
Mark this hook as optional in case xdist is not installed.
"""
-
self.cov_controller.testnodedown(node, error)
pytest_testnodedown.optionalhook = True
def pytest_sessionfinish(self, session, exitstatus):
"""Delegate to our implementation."""
-
+ self.failed = exitstatus != 0
self.cov_controller.finish()
def pytest_terminal_summary(self, terminalreporter):
"""Delegate to our implementation."""
-
- self.cov_controller.summary(terminalreporter._tw)
+ if not (self.failed and self.options.no_cov_on_fail):
+ self.cov_controller.summary(terminalreporter._tw)
def pytest_funcarg__cov(request):
- """A pytest funcarg that provides access to the underlying coverage object."""
+ """A pytest funcarg that provides access to the underlying coverage
+ object.
+ """
# Check with hasplugin to avoid getplugin exception in older pytest.
if request.config.pluginmanager.hasplugin('_cov'):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/setup.py new/pytest-cov-1.7.0/setup.py
--- old/pytest-cov-1.6/setup.py 2012-05-12 01:28:20.000000000 +0200
+++ new/pytest-cov-1.7.0/setup.py 2014-06-12 20:21:48.000000000 +0200
@@ -1,15 +1,17 @@
import setuptools
setuptools.setup(name='pytest-cov',
- version='1.6',
- description='py.test plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing',
- long_description=open('README.txt').read().strip(),
- author='Meme Dough',
- author_email='memedough(a)gmail.com',
- url='http://bitbucket.org/memedough/pytest-cov/overview',
+ version='1.7.0',
+ description='py.test plugin for coverage reporting with '
+ 'support for both centralised and distributed testing, '
+ 'including subprocesses and multiprocessing',
+ long_description=open('README.rst').read().strip(),
+ author='Marc Schlaich',
+ author_email='marc.schlaich(a)gmail.com',
+ url='https://github.com/schlamar/pytest-cov',
py_modules=['pytest_cov'],
- install_requires=['pytest>=2.2.3',
- 'cov-core>=1.6'],
+ install_requires=['pytest>=2.5.2',
+ 'cov-core>=1.12'],
entry_points={'pytest11': ['pytest_cov = pytest_cov']},
license='MIT License',
zip_safe=False,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-cov-1.6/test_pytest_cov.py new/pytest-cov-1.7.0/test_pytest_cov.py
--- old/pytest-cov-1.6/test_pytest_cov.py 2012-03-12 02:44:09.000000000 +0100
+++ new/pytest-cov-1.7.0/test_pytest_cov.py 2014-05-01 23:50:06.000000000 +0200
@@ -14,10 +14,14 @@
is fine with simple assignment statement.
"""
-import py
import os
import sys
+import virtualenv
+
+import py
+
+
pytest_plugins = 'pytester', 'cov'
SCRIPT = '''
@@ -28,21 +32,9 @@
metafunc.addcall()
def test_foo():
- version = sys.version_info[:2]
- if version == (2, 4):
- a = True
- if version == (2, 5):
- a = True
- if version == (2, 6):
- a = True
- if version == (2, 7):
- a = True
- if version == (3, 0):
- a = True
- if version == (3, 1):
- a = True
- if version == (3, 2):
- a = True
+ assert True
+ if sys.version_info[0] > 5:
+ assert False
'''
SCRIPT_CHILD = '''
@@ -65,7 +57,14 @@
metafunc.addcall(funcargs=dict(idx=i))
def test_foo(idx):
- out, err = subprocess.Popen([sys.executable, 'child_script.py', str(idx)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ out, err = subprocess.Popen(
+ [sys.executable, 'child_script.py', str(idx)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE).communicate()
+
+# there is a issue in coverage.py with multiline statements at
+# end of file: https://bitbucket.org/ned/coveragepy/issue/293
+pass
'''
SCRIPT_FUNCARG = '''
@@ -94,6 +93,17 @@
'''
+SCRIPT_FAIL = '''
+def test_fail():
+ assert False
+
+'''
+
+SCRIPT_RESULT = '8 * 88%'
+CHILD_SCRIPT_RESULT = '6 * 100%'
+PARENT_SCRIPT_RESULT = '8 * 100%'
+
+
def test_central(testdir):
script = testdir.makepyfile(SCRIPT)
@@ -103,13 +113,26 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'test_central * 20 * 70%*',
- '*10 passed*'
- ])
+ '*- coverage: platform *, python * -*',
+ 'test_central * %s *' % SCRIPT_RESULT,
+ '*10 passed*'
+ ])
assert result.ret == 0
+def test_no_cov_on_fail(testdir):
+ script = testdir.makepyfile(SCRIPT_FAIL)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing',
+ '--no-cov-on-fail',
+ script)
+
+ assert 'coverage: platform' not in result.stdout.str()
+ result.stdout.fnmatch_lines(['*1 failed*'])
+
+
def test_dist_collocated(testdir):
script = testdir.makepyfile(SCRIPT)
@@ -121,10 +144,10 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'test_dist_collocated * 20 * 70%*',
- '*10 passed*'
- ])
+ '*- coverage: platform *, python * -*',
+ 'test_dist_collocated * %s *' % SCRIPT_RESULT,
+ '*10 passed*'
+ ])
assert result.ret == 0
@@ -143,15 +166,16 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'test_dist_not_collocated * 20 * 70%*',
- '*10 passed*'
- ])
+ '*- coverage: platform *, python * -*',
+ 'test_dist_not_collocated * %s *' % SCRIPT_RESULT,
+ '*10 passed*'
+ ])
assert result.ret == 0
def test_central_subprocess(testdir):
- scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT, child_script=SCRIPT_CHILD)
+ scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT,
+ child_script=SCRIPT_CHILD)
parent_script = scripts.dirpath().join('parent_script.py')
result = testdir.runpytest('-v',
@@ -160,15 +184,16 @@
parent_script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'child_script * 6 * 100%*',
- 'parent_script * 7 * 100%*',
- ])
+ '*- coverage: platform *, python * -*',
+ 'child_script * %s *' % CHILD_SCRIPT_RESULT,
+ 'parent_script * %s *' % PARENT_SCRIPT_RESULT,
+ ])
assert result.ret == 0
def test_dist_subprocess_collocated(testdir):
- scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT, child_script=SCRIPT_CHILD)
+ scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT,
+ child_script=SCRIPT_CHILD)
parent_script = scripts.dirpath().join('parent_script.py')
result = testdir.runpytest('-v',
@@ -179,15 +204,16 @@
parent_script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'child_script * 6 * 100%*',
- 'parent_script * 7 * 100%*',
- ])
+ '*- coverage: platform *, python * -*',
+ 'child_script * %s *' % CHILD_SCRIPT_RESULT,
+ 'parent_script * %s *' % PARENT_SCRIPT_RESULT,
+ ])
assert result.ret == 0
def test_dist_subprocess_not_collocated(testdir, tmpdir):
- scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT, child_script=SCRIPT_CHILD)
+ scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT,
+ child_script=SCRIPT_CHILD)
parent_script = scripts.dirpath().join('parent_script.py')
child_script = scripts.dirpath().join('child_script.py')
@@ -205,10 +231,10 @@
parent_script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'child_script * 6 * 100%*',
- 'parent_script * 7 * 100%*',
- ])
+ '*- coverage: platform *, python * -*',
+ 'child_script * %s *' % CHILD_SCRIPT_RESULT,
+ 'parent_script * %s *' % PARENT_SCRIPT_RESULT,
+ ])
assert result.ret == 0
@@ -221,31 +247,21 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- '*10 passed*'
- ])
+ '*- coverage: platform *, python * -*',
+ '*10 passed*'
+ ])
assert result.ret == 0
matching_lines = [line for line in result.outlines if '%' in line]
assert not matching_lines
def test_dist_missing_data(testdir):
- version = sys.version_info[:2]
- if version == (2, 4):
- exe = '/usr/local/py24/bin/python'
- if version == (2, 5):
- exe = '/usr/local/py25/bin/python'
- if version == (2, 6):
- exe = '/usr/local/py26/bin/python'
- if version == (2, 7):
- exe = '/usr/local/py27/bin/python'
- if version == (3, 0):
- exe = '/usr/local/py30/bin/python3.0'
- if version == (3, 1):
- exe = '/usr/local/py31/bin/python3.1'
- if version == (3, 2):
- exe = '/usr/local/py32/bin/python3.2'
-
+ venv_path = os.path.join(str(testdir.tmpdir), 'venv')
+ virtualenv.create_environment(venv_path)
+ if sys.platform == 'win32':
+ exe = os.path.join(venv_path, 'Scripts', 'python.exe')
+ else:
+ exe = os.path.join(venv_path, 'bin', 'python')
script = testdir.makepyfile(SCRIPT)
result = testdir.runpytest('-v',
@@ -256,8 +272,8 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: failed slaves -*'
- ])
+ '*- coverage: failed slaves -*'
+ ])
assert result.ret == 0
@@ -270,10 +286,10 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'test_funcarg * 3 * 100%*',
- '*1 passed*'
- ])
+ '*- coverage: platform *, python * -*',
+ 'test_funcarg * 3 * 100%*',
+ '*1 passed*'
+ ])
assert result.ret == 0
@@ -284,8 +300,8 @@
script)
result.stdout.fnmatch_lines([
- '*1 passed*'
- ])
+ '*1 passed*'
+ ])
assert result.ret == 0
@@ -300,8 +316,123 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
- 'test_multiprocessing_subprocess * 8 * 100%*',
- '*1 passed*'
- ])
+ '*- coverage: platform *, python * -*',
+ 'test_multiprocessing_subprocess * 8 * 100%*',
+ '*1 passed*'
+ ])
+ assert result.ret == 0
+
+
+MODULE = '''
+def func():
+ return 1
+
+'''
+
+CONFTEST = '''
+
+import mod
+mod.func()
+
+'''
+
+BASIC_TEST = '''
+
+def test_basic():
+ assert True
+
+'''
+
+CONF_RESULT = 'mod * 2 * 100% *'
+
+
+def test_cover_conftest(testdir):
+ testdir.makepyfile(mod=MODULE)
+ testdir.makeconftest(CONFTEST)
+ script = testdir.makepyfile(BASIC_TEST)
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing',
+ script)
+ assert result.ret == 0
+ result.stdout.fnmatch_lines([CONF_RESULT])
+
+
+def test_cover_conftest_dist(testdir):
+ testdir.makepyfile(mod=MODULE)
+ testdir.makeconftest(CONFTEST)
+ script = testdir.makepyfile(BASIC_TEST)
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing',
+ '--dist=load',
+ '--tx=2*popen',
+ script)
+ assert result.ret == 0
+ result.stdout.fnmatch_lines([CONF_RESULT])
+
+
+COVERAGERC = '''
+[report]
+# Regexes for lines to exclude from consideration
+exclude_lines =
+ raise NotImplementedError
+
+'''
+
+EXCLUDED_TEST = '''
+
+def func():
+ raise NotImplementedError
+
+def test_basic():
+ assert True
+
+'''
+
+EXCLUDED_RESULT = '3 * 100% *'
+
+
+def test_coveragerc(testdir):
+ testdir.makefile('', coveragerc=COVERAGERC)
+ script = testdir.makepyfile(EXCLUDED_TEST)
+ result = testdir.runpytest('-v',
+ '--cov-config=coveragerc',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing',
+ script)
+ assert result.ret == 0
+ result.stdout.fnmatch_lines(['test_coveragerc * %s' % EXCLUDED_RESULT])
+
+
+def test_coveragerc_dist(testdir):
+ testdir.makefile('', coveragerc=COVERAGERC)
+ script = testdir.makepyfile(EXCLUDED_TEST)
+ result = testdir.runpytest('-v',
+ '--cov-config=coveragerc',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing',
+ '-n', '2',
+ script)
+ assert result.ret == 0
+ result.stdout.fnmatch_lines(
+ ['test_coveragerc_dist * %s' % EXCLUDED_RESULT])
+
+
+CLEAR_ENVIRON_TEST = '''
+
+import os
+
+def test_basic():
+ os.environ.clear()
+
+'''
+
+
+def test_clear_environ(testdir):
+ script = testdir.makepyfile(CLEAR_ENVIRON_TEST)
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing',
+ script)
assert result.ret == 0
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python3-py for openSUSE:Factory checked in at 2014-07-31 10:04:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-py (Old)
and /work/SRC/openSUSE:Factory/.python3-py.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-py"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-py/python3-py.changes 2014-07-15 16:26:10.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3-py.new/python3-py.changes 2014-07-31 10:04:29.000000000 +0200
@@ -1,0 +2,22 @@
+Wed Jul 30 07:50:37 UTC 2014 - toddrme2178(a)gmail.com
+
+- Update to 1.4.22
+ - refactor class-level registry on ForkedFunc child start/finish
+ event to become instance based (i.e. passed into the constructor)
+- Update to 1.4.21
+ - ForkedFunc now has class-level register_on_start/on_exit()
+ methods to allow adding information in the boxed process.
+ Thanks Marc Schlaich.
+ - ForkedFunc in the child opens in "auto-flush" mode for
+ stdout/stderr so that when a subprocess dies you can see
+ its output even if it didn't flush itself.
+ - refactor traceback generation in light of pytest issue 364
+ (shortening tracebacks). you can now set a new traceback style
+ on a per-entry basis such that a caller can force entries to be
+ isplayed as short or long entries.
+ - win32: py.path.local.sysfind(name) will preferrably return files with
+ extensions so that if "X" and "X.bat" or "X.exe" is on the PATH,
+ one of the latter two will be returned.
+- Enable unit tests
+
+-------------------------------------------------------------------
Old:
----
py-1.4.21.tar.gz
New:
----
py-1.4.22.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-py.spec ++++++
--- /var/tmp/diff_new_pack.WZZzwp/_old 2014-07-31 10:04:31.000000000 +0200
+++ /var/tmp/diff_new_pack.WZZzwp/_new 2014-07-31 10:04:31.000000000 +0200
@@ -17,7 +17,7 @@
Name: python3-py
-Version: 1.4.21
+Version: 1.4.22
Release: 0
Summary: Library with cross-python path, ini-parsing, io, code, log facilities
License: MIT
@@ -27,8 +27,8 @@
BuildRequires: python3-Sphinx
BuildRequires: python3
BuildRequires: python3-devel
+BuildRequires: python3-pytest
BuildRequires: python3-setuptools
-BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
@@ -52,6 +52,12 @@
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%check
+export PATH="%{buildroot}%{python3_sitelib}:$PATH"
+export PYTHONPATH="%{buildroot}%{python3_sitelib}:$PYTHONPATH"
+export PYTHON3PATH="%{buildroot}%{python3_sitelib}:$PYTHON3PATH"
+py.test -k "not TestUnicodePy2Py3"
+
%files
%defattr(-,root,root,-)
%doc LICENSE README.txt doc/_build/html
++++++ py-1.4.21.tar.gz -> py-1.4.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/CHANGELOG new/py-1.4.22/CHANGELOG
--- old/py-1.4.21/CHANGELOG 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/CHANGELOG 2014-07-17 10:51:42.000000000 +0200
@@ -1,3 +1,9 @@
+1.4.22
+==================================================
+
+- refactor class-level registry on ForkedFunc child start/finish
+ event to become instance based (i.e. passed into the constructor)
+
1.4.21
==================================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/PKG-INFO new/py-1.4.22/PKG-INFO
--- old/py-1.4.21/PKG-INFO 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/PKG-INFO 2014-07-17 10:51:42.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: py
-Version: 1.4.21
+Version: 1.4.22
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Home-page: http://pylib.readthedocs.org/
Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others
@@ -21,7 +21,7 @@
Bugs and issues: http://bitbucket.org/hpk42/py/issues/
- Authors: Holger Krekel and others, 2004-2013
+ Authors: Holger Krekel and others, 2004-2014
Platform: unix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/README.txt new/py-1.4.22/README.txt
--- old/py-1.4.21/README.txt 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/README.txt 2014-07-17 10:51:42.000000000 +0200
@@ -13,5 +13,5 @@
Bugs and issues: http://bitbucket.org/hpk42/py/issues/
-Authors: Holger Krekel and others, 2004-2013
+Authors: Holger Krekel and others, 2004-2014
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/py/__init__.py new/py-1.4.22/py/__init__.py
--- old/py-1.4.21/py/__init__.py 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/py/__init__.py 2014-07-17 10:51:42.000000000 +0200
@@ -8,7 +8,7 @@
(c) Holger Krekel and others, 2004-2013
"""
-__version__ = '1.4.21'
+__version__ = '1.4.22'
from py import _apipkg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/py/_process/forkedfunc.py new/py-1.4.22/py/_process/forkedfunc.py
--- old/py-1.4.21/py/_process/forkedfunc.py 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/py/_process/forkedfunc.py 2014-07-17 10:51:42.000000000 +0200
@@ -11,31 +11,6 @@
import marshal
-class HookMixin(object):
- _on_start = list()
- _on_exit = list()
-
- @classmethod
- def register_on_start(cls, callback):
- cls._on_start.append(callback)
-
- @classmethod
- def register_on_exit(self, callback):
- self._on_exit.append(callback)
-
- def _run_on_start(self):
- self._run_callbacks(self._on_start)
-
- def _run_on_exit(self):
- self._run_callbacks(self._on_exit)
-
- def _run_callbacks(self, callbacks):
- for callback in callbacks:
- callback(self)
- sys.stdout.flush()
- sys.stderr.flush()
-
-
def get_unbuffered_io(fd, filename):
f = open(str(filename), "w")
if fd != f.fileno():
@@ -49,11 +24,12 @@
return AutoFlush()
-class ForkedFunc(HookMixin):
+class ForkedFunc:
EXITSTATUS_EXCEPTION = 3
- def __init__(self, fun, args=None, kwargs=None, nice_level=0):
+ def __init__(self, fun, args=None, kwargs=None, nice_level=0,
+ child_on_start=None, child_on_exit=None):
if args is None:
args = []
if kwargs is None:
@@ -71,9 +47,9 @@
self.pid = pid
else: # in child process
self.pid = None
- self._child(nice_level)
+ self._child(nice_level, child_on_start, child_on_exit)
- def _child(self, nice_level):
+ def _child(self, nice_level, child_on_start, child_on_exit):
# right now we need to call a function, but first we need to
# map all IO that might happen
sys.stdout = stdout = get_unbuffered_io(1, self.STDOUT)
@@ -84,10 +60,12 @@
if nice_level:
os.nice(nice_level)
try:
- self._run_on_start()
+ if child_on_start is not None:
+ child_on_start()
retval = self.fun(*self.args, **self.kwargs)
retvalf.write(marshal.dumps(retval))
- self._run_on_exit()
+ if child_on_exit is not None:
+ child_on_exit()
except:
excinfo = py.code.ExceptionInfo()
stderr.write(str(excinfo._getreprcrash()))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/py.egg-info/PKG-INFO new/py-1.4.22/py.egg-info/PKG-INFO
--- old/py-1.4.21/py.egg-info/PKG-INFO 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/py.egg-info/PKG-INFO 2014-07-17 10:51:42.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: py
-Version: 1.4.21
+Version: 1.4.22
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Home-page: http://pylib.readthedocs.org/
Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others
@@ -21,7 +21,7 @@
Bugs and issues: http://bitbucket.org/hpk42/py/issues/
- Authors: Holger Krekel and others, 2004-2013
+ Authors: Holger Krekel and others, 2004-2014
Platform: unix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/setup.py new/py-1.4.22/setup.py
--- old/py-1.4.21/setup.py 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/setup.py 2014-07-17 10:51:42.000000000 +0200
@@ -7,7 +7,7 @@
name='py',
description='library with cross-python path, ini-parsing, io, code, log facilities',
long_description = open('README.txt').read(),
- version='1.4.21',
+ version='1.4.22',
url='http://pylib.readthedocs.org/',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.21/testing/process/test_forkedfunc.py new/py-1.4.22/testing/process/test_forkedfunc.py
--- old/py-1.4.21/testing/process/test_forkedfunc.py 2014-07-14 22:00:47.000000000 +0200
+++ new/py-1.4.22/testing/process/test_forkedfunc.py 2014-07-17 10:51:42.000000000 +0200
@@ -3,10 +3,6 @@
pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')")
-(a)pytest.fixture(autouse=True)
-def clear_forkedfunc(monkeypatch):
- monkeypatch.setattr(py.process.ForkedFunc, "_on_start", [])
- monkeypatch.setattr(py.process.ForkedFunc, "_on_exit", [])
def test_waitfinish_removes_tempdir():
ff = py.process.ForkedFunc(boxf1)
@@ -126,20 +122,19 @@
def test_hooks(monkeypatch):
- monkeypatch.setattr(py.process.ForkedFunc, "_on_exit", [])
- monkeypatch.setattr(py.process.ForkedFunc, "_on_start", [])
def _boxed():
return 1
- def _on_start(proc):
+ def _on_start():
sys.stdout.write("some out\n")
+ sys.stdout.flush()
- def _on_exit(proc):
+ def _on_exit():
sys.stderr.write("some err\n")
+ sys.stderr.flush()
- py.process.ForkedFunc.register_on_start(_on_start)
- py.process.ForkedFunc.register_on_exit(_on_exit)
- result = py.process.ForkedFunc(_boxed).waitfinish()
+ result = py.process.ForkedFunc(_boxed, child_on_start=_on_start,
+ child_on_exit=_on_exit).waitfinish()
assert result.out == "some out\n"
assert result.err == "some err\n"
assert result.exitstatus == 0
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package cups-filters for openSUSE:Factory checked in at 2014-07-31 10:04:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cups-filters (Old)
and /work/SRC/openSUSE:Factory/.cups-filters.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cups-filters"
Changes:
--------
--- /work/SRC/openSUSE:Factory/cups-filters/cups-filters.changes 2014-06-18 07:47:48.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cups-filters.new/cups-filters.changes 2014-07-31 10:04:26.000000000 +0200
@@ -1,0 +2,47 @@
+Wed Jul 30 13:22:22 CEST 2014 - jsmeix(a)suse.de
+
+- Version upgrade to 1.0.55
+ Changes in 1.0.54 (excerpt - for details see the NEWS file):
+ * pdftopdf: Fixed manual duplex by adding a blank page to even
+ pages if the total number of pages of the document is odd.
+ Otherwise the last page of the document would stay in
+ the input tray. This fixes also a side effect as the set of
+ even pages reducing to a zero page job if the job consists
+ of only one page, making Poppler's pdftops error out
+ (Ubuntu bug #1340435).
+ * cups-browsed: Do not mark a discovered printer as already
+ provided by another server when the other server's queue has
+ "disappeared" status. This queue can be from the same server
+ before it changed its name.
+ * cups-browsed: Do not create a local queue pointing to a
+ remote raw queue (Ubuntu bug #1335211).
+ * foomatic-rip, imagetoraster, pdftoraster, rastertopclx,
+ rastertopdf: Added colord "device_inhibit" support for
+ color-managed filters.
+ * bannertopdf: Fixed "Printer Location" and "Driver Version"
+ entries on test page/banners (linuxfoundation.org bug #1209).
+ * bannertopdf: Added new PDF template files which contain the
+ text strings appropriate to the banners, before the banners
+ were all equal, without text (linuxfoundation.org bug #1209).
+ * pstopdf: Use "grep -E" instead of "grep -P" as the latter
+ generates executable code and executes it, requiring
+ "execmem" privileges which could be not available in some
+ security policies. Thanks to Tim Waugh from Red Hat for the
+ patch (Red Hat bug #1079534).
+ * pdftoraster: Fixed segfault caused by introduction of
+ "no-color-management" option (linuxfoundation.org bug #1214).
+ * libcupsfilters: Let cupsRasterParseIPPOptions() also accept
+ "pwg-raster-document-type" settings with hyphen between
+ color space name and color depth.
+- Our separated source files classified.pdf confidential.pdf
+ secret.pdf standard.pdf topsecret.pdf unclassified.pdf (see
+ the entry below dated "Thu Jun 12 17:27:56 CEST 2014") are
+ no longer needed because it is now provided in the upstream
+ sources (see "linuxfoundation.org bug #1209" entries above).
+- Added CVE-2014-4336 CVE-2014-4337 bnc#883543 and
+ CVE-2014-4338 bnc#883536 to the matching entry below
+ dated "Mon Apr 28 10:49:21 CEST 2014" because those CVEs
+ and bncs have not been known at that time (cf. bnc#871327
+ therein comment#47 and bnc#883307 therein comment#2).
+
+-------------------------------------------------------------------
@@ -67 +114,2 @@
- (bnc#871327 therein comment#23 and subsequent comments).
+ (CVE-2014-4338 bnc#883536 and bnc#871327 therein comment#23
+ and subsequent comments).
@@ -70,2 +118,3 @@
- against OOB access are done
- (bnc#871327 therein comment#30 and subsequent comments).
+ against OOB access are done (CVE-2014-4336 CVE-2014-4337
+ bnc#883543 and bnc#871327 therein comment#30 and subsequent
+ comments).
Old:
----
classified.pdf
confidential.pdf
cups-filters-1.0.54.tar.gz
secret.pdf
standard.pdf
topsecret.pdf
unclassified.pdf
New:
----
cups-filters-1.0.55.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cups-filters.spec ++++++
--- /var/tmp/diff_new_pack.VN2u7C/_old 2014-07-31 10:04:28.000000000 +0200
+++ /var/tmp/diff_new_pack.VN2u7C/_new 2014-07-31 10:04:28.000000000 +0200
@@ -36,7 +36,7 @@
# and also run: zypper vcmp 'next version' 'current version'
# e.g. zypper vcmp '1.0.49' '1.0.49.20140326' -> 1.0.49 is older than 1.0.49.20140326
# and zypper vcmp '1.0.50' '1.0.49.20140326' -> 1.0.50 is newer than 1.0.49.20140326
-Version: 1.0.54
+Version: 1.0.55
Release: 0
# tarball_version is used below to specify the directory via "setup -n":
# Special tarball_version needed for current cups-filters e.g. "define tarball_version 9.10rc1".
@@ -44,14 +44,6 @@
# Special tarball_version needed for current cups-filters e.g. "define tarball_version 9.10rc1".
%define tarball_version %{version}
Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{tarball_ve…
-# PDF template files for PDF-BANNER printouts
-# see https://bugs.linuxfoundation.org/show_bug.cgi?id=1209
-Source10: classified.pdf
-Source11: confidential.pdf
-Source12: secret.pdf
-Source13: standard.pdf
-Source14: topsecret.pdf
-Source15: unclassified.pdf
# Since cups-filters version 1.0.42 foomatic-rip is also provided by cups-filters.
# The foomatic-rip version that is provided by cups-filters is not specified in the cups-filters sources
# but on http://www.openprinting.org/download/foomatic/ the foomatic-filters-4.0-current.tar.gz
@@ -331,23 +323,6 @@
rm -f %{buildroot}%{_libdir}/lib*.la
# Not sure what is this good for
rm -f %{buildroot}%{_bindir}/ttfread
-# Install the PDF template files for PDF-BANNER printouts and
-# modify the banner template files accordingly to use those PDF template files
-# see https://bugs.linuxfoundation.org/show_bug.cgi?id=1209
-install -m 644 %{SOURCE10} %{buildroot}%{_datadir}/cups/data/classified.pdf
-install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/cups/data/confidential.pdf
-install -m 644 %{SOURCE12} %{buildroot}%{_datadir}/cups/data/secret.pdf
-install -m 644 %{SOURCE13} %{buildroot}%{_datadir}/cups/data/standard.pdf
-install -m 644 %{SOURCE14} %{buildroot}%{_datadir}/cups/data/topsecret.pdf
-install -m 644 %{SOURCE15} %{buildroot}%{_datadir}/cups/data/unclassified.pdf
-for T in classified confidential secret standard topsecret unclassified
-do F="%{buildroot}%{_datadir}/cups/banners/$T"
- if grep -q 'Template default.pdf' $F
- then sed -i -e "s/Template default.pdf/Template $T.pdf/" $F
- else echo "No longer 'Template default.pdf' in banner template file $T - clean up cups-filters.spec"
- exit 9
- fi
-done
%post
/sbin/ldconfig
++++++ cups-filters-1.0.54.tar.gz -> cups-filters-1.0.55.tar.gz ++++++
++++ 1674 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/INSTALL new/cups-filters-1.0.55/INSTALL
--- old/cups-filters-1.0.54/INSTALL 2014-06-06 16:26:11.000000000 +0200
+++ new/cups-filters-1.0.55/INSTALL 2014-07-27 19:47:52.000000000 +0200
@@ -1,4 +1,4 @@
-INSTALL - OpenPrinting CUPS Filters v1.0.54 - 2014-06-06
+INSTALL - OpenPrinting CUPS Filters v1.0.55 - 2014-07-27
--------------------------------------------------------
This file describes how to compile and install OpenPrinting CUPS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/Makefile.am new/cups-filters-1.0.55/Makefile.am
--- old/cups-filters-1.0.54/Makefile.am 2014-05-15 15:02:49.000000000 +0200
+++ new/cups-filters-1.0.55/Makefile.am 2014-06-18 14:04:59.000000000 +0200
@@ -207,7 +207,13 @@
data/form_english_in.odt \
data/form_russian_in.odt \
data/default-testpage.pdf \
- data/testprint
+ data/testprint \
+ data/classified.pdf \
+ data/confidential.pdf \
+ data/secret.pdf \
+ data/standard.pdf \
+ data/topsecret.pdf \
+ data/unclassified.pdf
EXTRA_DIST += $(pkgcupsdata_DATA)
@@ -467,7 +473,9 @@
$(FONTCONFIG_LIBS) \
libfontembed.la
-bannertopdf_DEPENDENCIES = $(GETLINE)
+bannertopdf_DEPENDENCIES = \
+ $(GETLINE) \
+ libfontembed.la
commandtoescpx_SOURCES = \
cupsfilters/driver.h \
@@ -566,10 +574,14 @@
filter/rastertopdf.cpp
rastertopdf_CXXFLAGS = \
$(CUPS_CFLAGS) \
- $(LIBQPDF_CFLAGS)
+ $(LCMS_CFLAGS) \
+ $(LIBQPDF_CFLAGS) \
+ -I$(srcdir)/cupsfilters/
rastertopdf_LDADD = \
$(CUPS_LIBS) \
- $(LIBQPDF_LIBS)
+ $(LCMS_LIBS) \
+ $(LIBQPDF_LIBS) \
+ libcupsfilters.la
pdftoijs_SOURCES = \
filter/pdftoijs.cxx \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/NEWS new/cups-filters-1.0.55/NEWS
--- old/cups-filters-1.0.54/NEWS 2014-06-06 16:25:32.000000000 +0200
+++ new/cups-filters-1.0.55/NEWS 2014-07-27 19:48:09.000000000 +0200
@@ -1,6 +1,54 @@
-NEWS - OpenPrinting CUPS Filters v1.0.54 - 2014-06-06
+NEWS - OpenPrinting CUPS Filters v1.0.55 - 2014-07-27
-----------------------------------------------------
+CHANGES IN V1.0.55
+
+ - pdftopdf: Fixed manual duplex by adding a blank page to evn
+ pages if the total number of pages of the document is
+ odd. Otherwise the last page of the document would stay in
+ the input tray. This fixes also a side effect as the set of
+ even pages reducing to a zero page job if the job consists
+ of only one page, making Poppler's pdftops error out (Ubuntu
+ bug #1340435).
+ - cups-browsed: Do not mark a discovered printer as already
+ provided by another server when the other server's queue has
+ "disappeared" status. This queue can be from the same server
+ before it changed its name.
+ - cups-browsed: Do not create a local queue pointing to a
+ remote raw queue (Ubuntu bug #1335211).
+ - foomatic-rip, imagetoraster, pdftoraster, rastertopclx,
+ rastertopdf: Added colord "device_inhibit" support for
+ color-managed filters.
+ - foomatic-rip: Let it also build correctly on systems which
+ already provide the strlcat() and strlcpy() functions, like
+ Mac OS X. Thanks to Matt Broughton for reporting this
+ (bug #1215).
+ - bannertopdf: Added support for PPD-less printing, especially
+ one gets a useful test page with PPD-less queues now.
+ - bannertopdf: Fixed "Printer Location" and "Driver Version"
+ entries on the test page/the banners.
+ - bannertopdf: Added new PDF template files which contain the
+ text strings appropriate to the banners, before the banners
+ were all equal, without text. Thanks to Johannes Meixner
+ from SUSE/Novell for this fix (Bug #1209).
+ - bannertopdf: Fixed Makefile to mark it dependent on
+ libfontembed.la. Thanks to Tim Waugh from Red Hat for the
+ patch (Red Hat bug #1106101).
+ - pstopdf: Use "grep -E" instead of "grep -P" as the latter
+ generates executable code and executes it, requiring
+ "execmem" privileges which could be not available in some
+ security policies. Thanks to Tim Waugh from Red Hat for the
+ patch (Red Hat bug #1079534).
+ - foomatic-rip: NetBSD does not provide a mkstemps() function,
+ use appropriate workaround then (Bug #1211).
+ - cups-browsed: Reorder inclusion of headers for compatibility
+ with NetBSD (Bug #1212).
+ - pdftoraster: Fixed segfault caused by introduction of
+ "no-color-management" option (Bug #1214).
+ - libcupsfilters: Let cupsRasterParseIPPOptions() also accept
+ "pwg-raster-document-type" settings with hyphen between
+ color space name and color depth.
+
CHANGES IN V1.0.54
- pdftoraster: Support for output in the color spaces 18
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/README new/cups-filters-1.0.55/README
--- old/cups-filters-1.0.54/README 2014-06-06 16:25:51.000000000 +0200
+++ new/cups-filters-1.0.55/README 2014-07-27 19:47:35.000000000 +0200
@@ -1,4 +1,4 @@
-README - OpenPrinting CUPS Filters v1.0.54 - 2014-06-06
+README - OpenPrinting CUPS Filters v1.0.55 - 2014-07-27
-------------------------------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/classified new/cups-filters-1.0.55/banners/classified
--- old/cups-filters-1.0.54/banners/classified 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/banners/classified 2014-06-14 19:58:26.000000000 +0200
@@ -1,4 +1,4 @@
#PDF-BANNER
-Template default.pdf
+Template classified.pdf
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/confidential new/cups-filters-1.0.55/banners/confidential
--- old/cups-filters-1.0.54/banners/confidential 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/banners/confidential 2014-06-14 19:58:26.000000000 +0200
@@ -1,4 +1,4 @@
#PDF-BANNER
-Template default.pdf
+Template confidential.pdf
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/secret new/cups-filters-1.0.55/banners/secret
--- old/cups-filters-1.0.54/banners/secret 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/banners/secret 2014-06-14 19:58:26.000000000 +0200
@@ -1,4 +1,4 @@
#PDF-BANNER
-Template default.pdf
+Template secret.pdf
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/standard new/cups-filters-1.0.55/banners/standard
--- old/cups-filters-1.0.54/banners/standard 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/banners/standard 2014-06-14 19:58:26.000000000 +0200
@@ -1,4 +1,4 @@
#PDF-BANNER
-Template default.pdf
+Template standard.pdf
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/topsecret new/cups-filters-1.0.55/banners/topsecret
--- old/cups-filters-1.0.54/banners/topsecret 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/banners/topsecret 2014-06-14 19:58:26.000000000 +0200
@@ -1,4 +1,4 @@
#PDF-BANNER
-Template default.pdf
+Template topsecret.pdf
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/unclassified new/cups-filters-1.0.55/banners/unclassified
--- old/cups-filters-1.0.54/banners/unclassified 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/banners/unclassified 2014-06-14 19:58:26.000000000 +0200
@@ -1,4 +1,4 @@
#PDF-BANNER
-Template default.pdf
+Template unclassified.pdf
Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/config.h.in new/cups-filters-1.0.55/config.h.in
--- old/cups-filters-1.0.54/config.h.in 2014-06-06 16:28:20.000000000 +0200
+++ new/cups-filters-1.0.55/config.h.in 2014-07-27 19:50:46.000000000 +0200
@@ -129,6 +129,12 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/configure.ac new/cups-filters-1.0.55/configure.ac
--- old/cups-filters-1.0.54/configure.ac 2014-06-06 16:26:23.000000000 +0200
+++ new/cups-filters-1.0.55/configure.ac 2014-07-27 19:48:22.000000000 +0200
@@ -7,7 +7,7 @@
# ====================
m4_define([cups_filters_version_major],[1])
m4_define([cups_filters_version_minor],[0])
-m4_define([cups_filters_version_micro],[54])
+m4_define([cups_filters_version_micro],[55])
m4_define([cups_filters_version],[cups_filters_version_major.cups_filters_version_minor.cups_filters_version_micro])
# =============
@@ -169,6 +169,8 @@
# ======================
# Check system functions
# ======================
+AC_CHECK_FUNCS(strlcat)
+AC_CHECK_FUNCS(strlcpy)
AC_CHECK_FUNCS(sigaction)
AC_CHECK_FUNCS(waitpid wait3)
AC_CHECK_FUNCS(strtoll)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/cupsfilters/raster.c new/cups-filters-1.0.55/cupsfilters/raster.c
--- old/cups-filters-1.0.54/cupsfilters/raster.c 2013-12-11 22:21:56.000000000 +0100
+++ new/cups-filters-1.0.55/cupsfilters/raster.c 2014-06-06 19:34:23.000000000 +0200
@@ -763,14 +763,14 @@
bitspercolor = 8;
if (!strncasecmp(val, "AdobeRgb", 8))
{
- if (*(val + 8) == '_')
+ if (*(val + 8) == '_' || *(val + 8) == '-')
ptr = val + 9;
colorspace = 20;
numcolors = 3;
}
else if (!strncasecmp(val, "Black", 5))
{
- if (*(val + 5) == '_')
+ if (*(val + 5) == '_' || *(val + 5) == '-')
ptr = val + 6;
bitspercolor = 1;
colorspace = 3;
@@ -778,7 +778,7 @@
}
else if (!strncasecmp(val, "Cmyk", 4))
{
- if (*(val + 4) == '_')
+ if (*(val + 4) == '_' || *(val + 4) == '-')
ptr = val + 5;
colorspace = 6;
numcolors = 4;
@@ -787,7 +787,7 @@
{
ptr = val + 6;
numcolors = strtol(ptr, (char **)&ptr, 10);
- if (*ptr == '_')
+ if (*ptr == '_' || *ptr == '-')
{
ptr ++;
colorspace = 47 + numcolors;
@@ -800,21 +800,21 @@
}
else if (!strncasecmp(val, "Sgray", 5))
{
- if (*(val + 5) == '_')
+ if (*(val + 5) == '_' || *(val + 5) == '-')
ptr = val + 6;
colorspace = 18;
numcolors = 1;
}
else if (!strncasecmp(val, "Srgb", 4))
{
- if (*(val + 4) == '_')
+ if (*(val + 4) == '_' || *(val + 4) == '-')
ptr = val + 5;
colorspace = 19;
numcolors = 3;
}
else if (!strncasecmp(val, "Rgb", 3))
{
- if (*(val + 3) == '_')
+ if (*(val + 3) == '_' || *(val + 3) == '-')
ptr = val + 4;
colorspace = 1;
numcolors = 3;
Files old/cups-filters-1.0.54/data/classified.pdf and new/cups-filters-1.0.55/data/classified.pdf differ
Files old/cups-filters-1.0.54/data/confidential.pdf and new/cups-filters-1.0.55/data/confidential.pdf differ
Files old/cups-filters-1.0.54/data/secret.pdf and new/cups-filters-1.0.55/data/secret.pdf differ
Files old/cups-filters-1.0.54/data/standard.pdf and new/cups-filters-1.0.55/data/standard.pdf differ
Files old/cups-filters-1.0.54/data/topsecret.pdf and new/cups-filters-1.0.55/data/topsecret.pdf differ
Files old/cups-filters-1.0.54/data/unclassified.pdf and new/cups-filters-1.0.55/data/unclassified.pdf differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/bannertopdf.c new/cups-filters-1.0.55/filter/bannertopdf.c
--- old/cups-filters-1.0.54/filter/bannertopdf.c 2014-02-27 16:33:34.000000000 +0100
+++ new/cups-filters-1.0.55/filter/bannertopdf.c 2014-06-16 23:45:47.000000000 +0200
@@ -28,6 +28,12 @@
#include <cups/cups.h>
#include <cups/ppd.h>
+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 6)
+#define HAVE_CUPS_1_7 1
+#endif
+#ifdef HAVE_CUPS_1_7
+#include <cups/pwg.h>
+#endif /* HAVE_CUPS_1_7 */
#include "banner.h"
#include "pdf.h"
@@ -71,8 +77,14 @@
756.0, /* top */
};
const ppd_size_t *pagesize;
+#ifdef HAVE_CUPS_1_7
+ pwg_media_t *size_found; /* page size found for given name */
+ const char *val; /* Pointer into value */
+ char *ptr1, *ptr2, /* Pointer into string */
+ s[255]; /* Temporary string */
+#endif /* HAVE_CUPS_1_7 */
- if (!(pagesize = ppdPageSize(ppd, NULL)))
+ if (!ppd || !(pagesize = ppdPageSize(ppd, NULL)))
pagesize = &defaultsize;
*width = pagesize->width;
@@ -90,20 +102,72 @@
media_limits[3] = get_float_option("page-top",
noptions, options,
fabs(pagesize->top));
+
+#ifdef HAVE_CUPS_1_7
+ if (!ppd) {
+ if ((val = cupsGetOption("media-size", noptions, options)) != NULL ||
+ (val = cupsGetOption("MediaSize", noptions, options)) != NULL ||
+ (val = cupsGetOption("page-size", noptions, options)) != NULL ||
+ (val = cupsGetOption("PageSize", noptions, options)) != NULL ||
+ (val = cupsGetOption("media", noptions, options)) != NULL) {
+ for (ptr1 = (char *)val; *ptr1;) {
+ for (ptr2 = s; *ptr1 && *ptr1 != ',' && (ptr2 - s) < (sizeof(s) - 1);)
+ *ptr2++ = *ptr1++;
+ *ptr2++ = '\0';
+ if (*ptr1 == ',')
+ ptr1 ++;
+ size_found = NULL;
+ if ((size_found = pwgMediaForPWG(s)) == NULL)
+ if ((size_found = pwgMediaForPPD(s)) == NULL)
+ size_found = pwgMediaForLegacy(s);
+ if (size_found != NULL) {
+ *width = size_found->width * 72.0 / 2540.0;
+ *length = size_found->length * 72.0 / 2540.0;
+ media_limits[2] += (*width - 612.0);
+ media_limits[3] += (*length - 792.0);
+ }
+ }
+ }
+ if ((val = cupsGetOption("media-left-margin", noptions, options))
+ != NULL)
+ media_limits[0] = atol(val) * 72.0 / 2540.0;
+ if ((val = cupsGetOption("media-bottom-margin", noptions, options))
+ != NULL)
+ media_limits[1] = atol(val) * 72.0 / 2540.0;
+ if ((val = cupsGetOption("media-right-margin", noptions, options))
+ != NULL)
+ media_limits[2] = *width - atol(val) * 72.0 / 2540.0;
+ if ((val = cupsGetOption("media-top-margin", noptions, options))
+ != NULL)
+ media_limits[3] = *length - atol(val) * 72.0 / 2540.0;
+ }
+#endif /* HAVE_CUPS_1_7 */
}
-static int duplex_marked(ppd_file_t *ppd)
+static int duplex_marked(ppd_file_t *ppd,
+ int noptions,
+ cups_option_t *options)
{
+ const char *val; /* Pointer into value */
return
- ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") ||
+ (ppd &&
+ (ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") ||
ppdIsMarked(ppd, "Duplex", "DuplexTumble") ||
ppdIsMarked(ppd, "JCLDuplex", "DuplexNoTumble") ||
ppdIsMarked(ppd, "JCLDuplex", "DuplexTumble") ||
ppdIsMarked(ppd, "EFDuplex", "DuplexNoTumble") ||
ppdIsMarked(ppd, "EFDuplex", "DuplexTumble") ||
ppdIsMarked(ppd, "KD03Duplex", "DuplexNoTumble") ||
- ppdIsMarked(ppd, "KD03Duplex", "DuplexTumble");
+ ppdIsMarked(ppd, "KD03Duplex", "DuplexTumble"))) ||
+ ((val = cupsGetOption("Duplex", noptions, options))
+ != NULL &&
+ (!strcasecmp(val, "DuplexNoTumble") ||
+ !strcasecmp(val, "DuplexTumble"))) ||
+ ((val = cupsGetOption("sides", noptions, options))
+ != NULL &&
+ (!strcasecmp(val, "two-sided-long-edge") ||
+ !strcasecmp(val, "two-sided-short-edge")));
}
@@ -198,6 +262,7 @@
int noptions,
cups_option_t *options) {
+ ppd_attr_t *attr;
opt_t *opt = NULL;
/* Job ID */
@@ -252,7 +317,7 @@
cupsGetOption("security-context-range", noptions, options));
/* Security context current range part */
- char * full_range = cupsGetOption("security-context-range", noptions, options);
+ const char * full_range = cupsGetOption("security-context-range", noptions, options);
if ( full_range ) {
size_t cur_size = strcspn(full_range, "-");
char * cur_range = strndup(full_range, cur_size);
@@ -271,14 +336,18 @@
opt = add_opt(opt, "security-context-user",
cupsGetOption("security-context-user", noptions, options));
- /* Driver */
- opt = add_opt(opt, "driver", ppd->pcfilename);
+ if (ppd) {
+ /* Driver */
+ opt = add_opt(opt, "driver", ppd->pcfilename);
+
+ /* Driver version */
+ opt = add_opt(opt, "driver-version",
+ (attr = ppdFindAttr(ppd, "FileVersion", NULL)) ?
+ attr->value : "");
- /* Driver version */
- opt = add_opt(opt, "driver-version", ppd->pcfilename);
-
- /* Make and model */
- opt = add_opt(opt, "make-and-model", ppd->nickname);
+ /* Make and model */
+ opt = add_opt(opt, "make-and-model", ppd->nickname);
+ }
return opt;
}
@@ -371,10 +440,10 @@
info_line(s, "Job UUID",
cupsGetOption("job-uuid", noptions, options));
- if (banner->infos & INFO_PRINTER_DRIVER_NAME)
+ if (ppd && banner->infos & INFO_PRINTER_DRIVER_NAME)
info_line(s, "Driver", ppd->pcfilename);
- if (banner->infos & INFO_PRINTER_DRIVER_VERSION)
+ if (ppd && banner->infos & INFO_PRINTER_DRIVER_VERSION)
info_line(s, "Driver Version",
(attr = ppdFindAttr(ppd, "FileVersion", NULL)) ? attr->value : "");
@@ -382,9 +451,9 @@
info_line(s, "Description", getenv("PRINTER_INFO"));
if (banner->infos & INFO_PRINTER_LOCATION)
- info_line(s, "Driver Version", getenv("PRINTER_INFO"));
+ info_line(s, "Printer Location", getenv("PRINTER_LOCATION"));
- if (banner->infos & INFO_PRINTER_MAKE_AND_MODEL)
+ if (ppd && banner->infos & INFO_PRINTER_MAKE_AND_MODEL)
info_line(s, "Make and Model", ppd->nickname);
if (banner->infos & INFO_PRINTER_NAME)
@@ -436,7 +505,7 @@
}
copies = get_int_option("number-up", noptions, options, 1);
- if (duplex_marked(ppd))
+ if (duplex_marked(ppd, noptions, options))
copies *= 2;
if (copies > 1)
@@ -465,14 +534,14 @@
}
ppd = ppdOpenFile(getenv("PPD"));
- if (!ppd) {
- fprintf(stderr, "Error: could not open PPD file '%s'\n", getenv("PPD"));
- return 1;
- }
+ if (!ppd)
+ fprintf(stderr, "DEBUG: Could not open PPD file '%s'\n", getenv("PPD"));
noptions = cupsParseOptions(argv[5], 0, &options);
- ppdMarkDefaults(ppd);
- cupsMarkOptions(ppd, noptions, options);
+ if (ppd) {
+ ppdMarkDefaults(ppd);
+ cupsMarkOptions(ppd, noptions, options);
+ }
banner = banner_new_from_file(argc == 7 ? argv[6] : "-", &noptions, &options);
if (!banner) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/foomatic-rip/foomaticrip.c new/cups-filters-1.0.55/filter/foomatic-rip/foomaticrip.c
--- old/cups-filters-1.0.54/filter/foomatic-rip/foomaticrip.c 2014-06-06 10:49:59.000000000 +0200
+++ new/cups-filters-1.0.55/filter/foomatic-rip/foomaticrip.c 2014-06-23 12:48:30.000000000 +0200
@@ -142,9 +142,10 @@
int pdfconvertedtops;
-/* no-color-management flag */
-int cm_off = 0;
+/* cm-calibration flag */
+int cm_calibrate = 0;
+int device_inhibited = 0;
/* These variables were in 'dat' before */
char colorprofile [128];
@@ -320,10 +321,15 @@
_log("Pondering option '%s'\n", key);
/* "profile" option to supply a color correction profile to a CUPS raster driver */
- if (!strcmp(key, "profile") && !cm_off) {
+ if (!strcmp(key, "profile")) {
strlcpy(colorprofile, value, 128);
continue;
}
+ /* option to set color calibration mode */
+ if (!strcmp(key, "cm-calibration")) {
+ cm_calibrate = 1;
+ continue;
+ }
/* Solaris options that have no reason to be */
if (!strcmp(key, "nobanner") || !strcmp(key, "dest") || !strcmp(key, "protocol"))
continue;
@@ -416,6 +422,15 @@
}
free(cmdlineopts);
+ /* We 'clear' the profile if cm-calibration mode was specified */
+ if (cm_calibrate) {
+ colorprofile[0] = '\0';
+ device_inhibited = 1;
+ }
+
+ _log("CM Color Calibration Mode in CUPS: %s\n", cm_calibrate ?
+ "Activated" : "Off");
+
_log("Options from the PPD file:\n");
cmdlineopts = strdup(job->optstr->data);
for (nextopt = extract_next_option(cmdlineopts, &pagerange, &key, &value);
@@ -701,7 +716,7 @@
char *p, *filename;
const char *path;
FILE *ppdfh = NULL;
- char tmp[1024], gstoraster[256];
+ char tmp[1024], gstoraster[256], tmpstr[1024];
int havefilter, havegstoraster;
dstr_t *filelist;
list_t * arglist;
@@ -740,7 +755,7 @@
debug = 1;
if (debug) {
-#ifdef __UCLIBC__
+#if defined(__UCLIBC__) || defined(__NetBSD__)
sprintf(tmp, "%s-log-XXXXXX", LOG_FILE);
int fd = mkstemp (tmp);
#else
@@ -781,6 +796,9 @@
spooler = SPOOLER_CUPS;
}
+ snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER"));
+ device_inhibited = colord_get_inhibit_for_device_id (tmpstr);
+
/* CUPS calls foomatic-rip only with 5 or 6 positional parameters,
not with named options, like for example "-p <string>". */
if (spooler != SPOOLER_CUPS) {
@@ -806,9 +824,11 @@
while ((str = arglist_get_value(arglist, "-o"))) {
strncpy_omit(tmp, str, 1024, omit_shellescapes);
dstrcatf(job->optstr, "%s ", tmp);
- /* if "-o no-color-management" was passed, we raise a flag */
- if (!strcmp(tmp, "no-color-management"))
- cm_off = 1;
+ /* if "-o cm-calibration" was passed, we raise a flag */
+ if (!strcmp(tmp, "cm-calibration")) {
+ cm_calibrate = 1;
+ device_inhibited = 1;
+ }
arglist_remove(arglist, "-o");
/* We print without spooler */
spooler = SPOOLER_DIRECT;
@@ -828,6 +848,9 @@
}
+ _log("'CM Color Calibration' Mode in SPOOLER-LESS: %s\n", cm_calibrate ?
+ "Activated" : "Off");
+
/* spooler specific initialization */
switch (spooler) {
@@ -947,23 +970,26 @@
const char **qualifier = NULL;
const char *icc_profile = NULL;
- qualifier = get_ppd_qualifier();
- _log("INFO: Using qualifer: '%s.%s.%s'\n",
- qualifier[0], qualifier[1], qualifier[2]);
+ if (!device_inhibited) {
+ qualifier = get_ppd_qualifier();
+ _log("INFO: Using qualifer: '%s.%s.%s'\n",
+ qualifier[0], qualifier[1], qualifier[2]);
/* ask colord for the profile */
- icc_profile = colord_get_profile_for_device_id ((const char *) getenv("PRINTER"),
- qualifier);
- /* fall back to PPD */
- if (icc_profile == NULL) {
- _log("INFO: need to look in PPD for matching qualifer\n");
- icc_profile = get_icc_profile_for_qualifier(qualifier);
+ icc_profile = colord_get_profile_for_device_id ((const char *) getenv("PRINTER"),
+ qualifier);
+
+ /* fall back to PPD */
+ if (icc_profile == NULL) {
+ _log("INFO: need to look in PPD for matching qualifer\n");
+ icc_profile = get_icc_profile_for_qualifier(qualifier);
+ }
}
/* ICC profile is specified for Ghostscript unless
- "no-color-management" option was passed in foomatic-rip */
- if (icc_profile != NULL && !cm_off)
+ "cm-calibration" option was passed in foomatic-rip */
+ if (icc_profile != NULL)
snprintf(cmd, sizeof(cmd),
"-sOutputICCProfile='%s'", icc_profile);
else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/foomatic-rip/util.c new/cups-filters-1.0.55/filter/foomatic-rip/util.c
--- old/cups-filters-1.0.54/filter/foomatic-rip/util.c 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/filter/foomatic-rip/util.c 2014-06-20 21:23:39.000000000 +0200
@@ -164,6 +164,7 @@
#endif
#ifndef __OpenBSD__
+#ifndef HAVE_STRLCPY
size_t strlcpy(char *dest, const char *src, size_t size)
{
char *pdest = dest;
@@ -182,7 +183,9 @@
while (*psrc++);
return (psrc - src -1);
}
+#endif /* ! HAVE_STRLCPY */
+#ifndef HAVE_STRLCAT
size_t strlcat(char *dest, const char *src, size_t size)
{
char *pdest = dest;
@@ -203,6 +206,7 @@
return len + (psrc - src);
}
+#endif /* ! HAVE_STRLCAT */
#endif /* ! __OpenBSD__ */
void strrepl(char *str, const char *chars, char repl)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/foomatic-rip/util.h new/cups-filters-1.0.55/filter/foomatic-rip/util.h
--- old/cups-filters-1.0.54/filter/foomatic-rip/util.h 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/filter/foomatic-rip/util.h 2014-06-20 21:20:39.000000000 +0200
@@ -70,8 +70,12 @@
/* Copy at most size-1 characters from src to dest
dest will always be \0 terminated (unless size == 0)
returns strlen(src) */
+#ifndef HAVE_STRLCPY
size_t strlcpy(char *dest, const char *src, size_t size);
+#endif /* ! HAVE_STRLCPY */
+#ifndef HAVE_STRLCAT
size_t strlcat(char *dest, const char *src, size_t size);
+#endif /* ! HAVE_STRLCAT */
/* Replace all occurences of each of the characters in 'chars' by 'repl' */
void strrepl(char *str, const char *chars, char repl);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/gstopxl new/cups-filters-1.0.55/filter/gstopxl
--- old/cups-filters-1.0.54/filter/gstopxl 2014-06-06 16:28:31.000000000 +0200
+++ new/cups-filters-1.0.55/filter/gstopxl 2014-07-27 19:50:54.000000000 +0200
@@ -208,11 +208,11 @@
cat >"$ifile"
-echo INFO: Starting GPL Ghostscript `gs --version`... 1>&2
-echo DEBUG: Running gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" 1>&2
+echo INFO: Starting GPL Ghostscript `/usr/bin/gs --version`... 1>&2
+echo DEBUG: Running /usr/bin/gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" 1>&2
# Now run Ghostscript...
-gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile"
+/usr/bin/gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile"
#
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/gstoraster.c new/cups-filters-1.0.55/filter/gstoraster.c
--- old/cups-filters-1.0.54/filter/gstoraster.c 2014-06-06 10:49:59.000000000 +0200
+++ new/cups-filters-1.0.55/filter/gstoraster.c 2014-06-18 14:04:59.000000000 +0200
@@ -545,6 +545,7 @@
int n;
int num_options;
int status = 1;
+ int cm_calibrate = 0;
ppd_file_t *ppd = NULL;
struct sigaction sa;
#ifdef HAVE_CUPS_1_7
@@ -621,12 +622,14 @@
goto out;
}
- /* support colord and the "no-color-management" option */
+ /* support colord and the "cm-calibration" option */
snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER"));
device_inhibited = colord_get_inhibit_for_device_id (tmpstr);
- t = cupsGetOption("no-color-management", num_options, options);
- if (t != NULL)
+ t = cupsGetOption("cm-calibration", num_options, options);
+ if (t != NULL) {
device_inhibited = 1;
+ cm_calibrate = 1;
+ }
if (device_inhibited)
fprintf(stderr, "DEBUG: Device is inhibited, no CM performed\n");
if (ppd)
@@ -648,6 +651,9 @@
fprintf(stderr, "DEBUG: Using ICC Profile '%s'\n", icc_profile);
}
+ fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ?
+ "Calibration Mode/Enabled" : "Calibration Mode/Off");
+
/* Ghostscript parameters */
gs_args = cupsArrayNew(NULL, NULL);
if (!gs_args) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/imagetoraster.c new/cups-filters-1.0.55/filter/imagetoraster.c
--- old/cups-filters-1.0.54/filter/imagetoraster.c 2014-06-06 10:49:59.000000000 +0200
+++ new/cups-filters-1.0.55/filter/imagetoraster.c 2014-06-23 12:48:30.000000000 +0200
@@ -36,6 +36,7 @@
*/
#include "common.h"
+#include <cupsfilters/colord.h>
#include <cupsfilters/image-private.h>
#include <unistd.h>
#include <math.h>
@@ -191,8 +192,9 @@
int plane, /* Current color plane */
num_planes; /* Number of color planes */
char filename[1024]; /* Name of file to print */
- int cm_off; /* Is color management off? */
-
+ int cm_calibrate; /* Are we color calibrating the device? */
+ int device_inhibited;
+ char tmpstr[1024];
/*
* Make sure status messages are not buffered...
@@ -217,6 +219,8 @@
return (1);
}
+ cm_calibrate = 0;
+
/*
* See if we need to use the imagetops and pstoraster filters instead...
*/
@@ -493,11 +497,17 @@
else
resolution = "";
- /* support the "no-color-management" option */
- if ((cupsGetOption("no-color-management", num_options, options)) == NULL)
- cm_off = 1;
- else
- cm_off = 0;
+ snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER"));
+ device_inhibited = colord_get_inhibit_for_device_id (tmpstr);
+
+ /* support the "cm-calibration" option */
+ if ((cupsGetOption("cm-calibration", num_options, options)) != NULL) {
+ cm_calibrate = 1;
+ device_inhibited = 1;
+ }
+
+ fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ?
+ "Calibration Mode/Enabled" : "Calibration Mode/Off");
/*
* Choose the appropriate colorspace...
@@ -612,7 +622,7 @@
*/
if ((val = cupsGetOption("profile", num_options, options)) != NULL &&
- !cm_off)
+ !device_inhibited)
{
profile = &userprofile;
sscanf(val, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f",
@@ -636,8 +646,7 @@
userprofile.matrix[2][1] *= 0.001f;
userprofile.matrix[2][2] *= 0.001f;
}
- else if (ppd != NULL &&
- !cm_off)
+ else if (ppd != NULL && !device_inhibited)
{
fprintf(stderr, "DEBUG: Searching for profile \"%s/%s\"...\n",
resolution, media_type);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/pdftopdf/pdftopdf_processor.cc new/cups-filters-1.0.55/filter/pdftopdf/pdftopdf_processor.cc
--- old/cups-filters-1.0.54/filter/pdftopdf/pdftopdf_processor.cc 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/filter/pdftopdf/pdftopdf_processor.cc 2014-07-27 19:39:40.000000000 +0200
@@ -328,7 +328,7 @@
}
}
- if ( (param.evenDuplex)&&(outputno&1) ) {
+ if ( (param.evenDuplex || !param.oddPages) && (outputno & 1) ) {
// need to output empty page to not confuse duplex
proc.add_page(proc.new_page(param.page.width,param.page.height),param.reverse);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/pdftoraster.cxx new/cups-filters-1.0.55/filter/pdftoraster.cxx
--- old/cups-filters-1.0.54/filter/pdftoraster.cxx 2014-06-06 12:40:02.000000000 +0200
+++ new/cups-filters-1.0.55/filter/pdftoraster.cxx 2014-06-23 12:48:30.000000000 +0200
@@ -53,6 +53,7 @@
#include <cups/raster.h>
#include <cupsfilters/image.h>
#include <cupsfilters/raster.h>
+#include <cupsfilters/colord.h>
#include <splash/SplashTypes.h>
#include <splash/SplashBitmap.h>
#include <strings.h>
@@ -188,7 +189,8 @@
cmsHTRANSFORM colorTransform = NULL;
cmsCIEXYZ D65WhitePoint;
int renderingIntent = INTENT_PERCEPTUAL;
- bool cm_off = false;
+ int device_inhibited = 0;
+ bool cm_calibrate = false;
}
#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19
@@ -364,6 +366,7 @@
int num_options = 0;
cups_option_t *options = 0;
GooString profilePath;
+ char tmpstr[1024];
ppd_attr_t *attr;
if (argc < 6 || argc > 7) {
@@ -443,10 +446,17 @@
}
}
}
- /* support the "no-color-management" option */
- if (cupsGetOption("no-color-management", num_options, options) == NULL)
- cm_off = true;
- if (!cm_off) {
+
+ snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER"));
+ device_inhibited = colord_get_inhibit_for_device_id (tmpstr);
+
+ /* support the "cm-calibration" option */
+ if (cupsGetOption("cm-calibration", num_options, options) != NULL) {
+ cm_calibrate = true;
+ device_inhibited = 1;
+ }
+
+ if (!device_inhibited) {
if (getColorProfilePath(ppd,&profilePath)) {
/* ICCProfile is specified */
colorProfile = cmsOpenProfileFromFile(profilePath.getCString(),"r");
@@ -1316,7 +1326,8 @@
}
allocLineBuf = true;
- if (colorProfile != NULL && popplerColorProfile != colorProfile) {
+ if (colorProfile != NULL && popplerColorProfile != colorProfile
+ && !device_inhibited) {
unsigned int bytes;
switch (header.cupsColorSpace) {
@@ -1372,6 +1383,9 @@
pdfError(-1,const_cast<char *>("Can't create color transform"));
exit(1);
}
+ } else if (device_inhibited) {
+ convertCSpace = convertCSpaceNone;
+ convertBits = convertBitsNoop;
} else {
/* select convertCSpace function */
switch (header.cupsColorSpace) {
@@ -1837,6 +1851,9 @@
globalParams = new GlobalParams();
parseOpts(argc, argv);
+ fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ?
+ "Calibration Mode/Enabled" : "Calibration Mode/Off");
+
if (argc == 6) {
/* stdin */
int fd;
@@ -1981,7 +1998,7 @@
break;
}
- if (!cm_off) {
+ if (!device_inhibited) {
setPopplerColorProfile();
}
@@ -1998,9 +2015,7 @@
pdfError(-1,const_cast<char *>("Can't open raster stream"));
exit(1);
}
- if (!cm_off) {
- selectConvertFunc(raster);
- }
+ selectConvertFunc(raster);
for (i = 1;i <= npages;i++) {
outPage(doc,catalog,i,out,raster);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/pstopdf new/cups-filters-1.0.55/filter/pstopdf
--- old/cups-filters-1.0.54/filter/pstopdf 2013-12-10 22:20:15.000000000 +0100
+++ new/cups-filters-1.0.55/filter/pstopdf 2014-06-11 15:35:00.000000000 +0200
@@ -105,7 +105,7 @@
eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)orientation-requested=4.*/orientation="${orientation:-90}"/p')"
eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)orientation-requested=5.*/orientation="${orientation:-270}"/p')"
eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)orientation-requested=6.*/orientation="${orientation:-180}"/p')"
-if printf "%s" "$5" | grep -iPq '(\s|^)landscape(=(1|on|yes|true))?(\s|$)'; then
+if printf "%s" "$5" | grep -qiE '(\s|^)landscape(=(1|on|yes|true))?(\s|$)'; then
if test -e "$PPD"; then
eval "$(sed -nre 's/^\*LandscapeOrientation:\s*Plus90.*/orientation="${orientation:-90}"/p' "$PPD")"
eval "$(sed -nre 's/^\*LandscapeOrientation:\s*Minus90.*/orientation="${orientation:-270}"/p' "$PPD")"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/rastertopclx.c new/cups-filters-1.0.55/filter/rastertopclx.c
--- old/cups-filters-1.0.54/filter/rastertopclx.c 2014-06-06 10:49:59.000000000 +0200
+++ new/cups-filters-1.0.55/filter/rastertopclx.c 2014-06-23 12:48:30.000000000 +0200
@@ -118,6 +118,9 @@
{
int i; /* Temporary/looping var */
int plane; /* Current plane */
+ int cm_calibrate; /* Color calibration mode */
+ int device_inhibited; /* Device Color Inhibited */
+ char tmpstr[1024]; /* Printer String */
char s[255]; /* Temporary value */
const char *colormodel; /* Color model string */
char resolution[PPD_MAX_NAME],
@@ -229,7 +232,10 @@
case CUPS_CSPACE_CMYK :
colormodel = "CMYK";
break;
- }
+ }
+
+ cm_calibrate = 0;
+ device_inhibited = 0;
if (header->HWResolution[0] != header->HWResolution[1])
snprintf(resolution, sizeof(resolution), "%dx%ddpi",
@@ -342,8 +348,16 @@
fprintf(stderr, "DEBUG: MediaType = %s\n", header->MediaType);
fprintf(stderr, "DEBUG: Resolution = %s\n", resolution);
- /* support the "no-color-management" option */
- if (ppd && (cupsGetOption("no-color-management", num_options, options) == NULL))
+ snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER"));
+ device_inhibited = colord_get_inhibit_for_device_id (tmpstr);
+
+ /* support the "cm-calibration" option */
+ if ((cupsGetOption("cm-calibration", num_options, options)) != NULL) {
+ cm_calibrate = 1;
+ device_inhibited = 1;
+ }
+
+ if (ppd && !device_inhibited)
{
if (header->cupsColorSpace == CUPS_CSPACE_RGB ||
header->cupsColorSpace == CUPS_CSPACE_W)
@@ -352,6 +366,9 @@
CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution);
}
+ fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ?
+ "Calibration Mode/Enabled" : "Calibration Mode/Off");
+
if (RGB)
fputs("DEBUG: Loaded RGB separation from PPD.\n", stderr);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/rastertopdf.cpp new/cups-filters-1.0.55/filter/rastertopdf.cpp
--- old/cups-filters-1.0.54/filter/rastertopdf.cpp 2014-06-06 11:54:35.000000000 +0200
+++ new/cups-filters-1.0.55/filter/rastertopdf.cpp 2014-06-23 12:48:30.000000000 +0200
@@ -19,6 +19,7 @@
* @author Till Kamppeter <till.kamppeter(a)gmail.com> (c) 2014
*/
+#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -31,6 +32,8 @@
#include <signal.h>
#include <cups/cups.h>
#include <cups/raster.h>
+#include <cupsfilters/colord.h>
+//#include <cupsfilters/image.h>
#include <arpa/inet.h> // ntohl
@@ -42,6 +45,39 @@
#include <qpdf/Pl_Flate.hh>
#include <qpdf/Pl_Buffer.hh>
+#ifdef USE_LCMS1
+#include <lcms.h>
+#define cmsColorSpaceSignature icColorSpaceSignature
+#define cmsSetLogErrorHandler cmsSetErrorHandler
+#define cmsSigXYZData icSigXYZData
+#define cmsSigLuvData icSigLuvData
+#define cmsSigLabData icSigLabData
+#define cmsSigYCbCrData icSigYCbCrData
+#define cmsSigYxyData icSigYxyData
+#define cmsSigRgbData icSigRgbData
+#define cmsSigHsvData icSigHsvData
+#define cmsSigHlsData icSigHlsData
+#define cmsSigCmyData icSigCmyData
+#define cmsSig3colorData icSig3colorData
+#define cmsSigGrayData icSigGrayData
+#define cmsSigCmykData icSigCmykData
+#define cmsSig4colorData icSig4colorData
+#define cmsSig2colorData icSig2colorData
+#define cmsSig5colorData icSig5colorData
+#define cmsSig6colorData icSig6colorData
+#define cmsSig7colorData icSig7colorData
+#define cmsSig8colorData icSig8colorData
+#define cmsSig9colorData icSig9colorData
+#define cmsSig10colorData icSig10colorData
+#define cmsSig11colorData icSig11colorData
+#define cmsSig12colorData icSig12colorData
+#define cmsSig13colorData icSig13colorData
+#define cmsSig14colorData icSig14colorData
+#define cmsSig15colorData icSig15colorData
+#else
+#include <lcms2.h>
+#endif
+
#define DEFAULT_PDF_UNIT 72 // 1/72 inch
#define PROGRAM "rastertopdf"
@@ -50,6 +86,27 @@
#define iprintf(format, ...) fprintf(stderr, "INFO: (" PROGRAM ") " format, __VA_ARGS__)
+cmsHPROFILE inputColorProfile = NULL;
+cmsHPROFILE outputColorProfile = NULL;
+cmsHTRANSFORM colorTransform = NULL;
+int renderingIntent = INTENT_PERCEPTUAL;
+int device_inhibited = 0;
+bool cm_calibrate = false;
+
+#ifdef USE_LCMS1
+static int lcmsErrorHandler(int ErrorCode, const char *ErrorText)
+{
+ fprintf(stderr, "ERROR: %s\n",ErrorText);
+ return 1;
+}
+#else
+static void lcmsErrorHandler(cmsContext contextId, cmsUInt32Number ErrorCode,
+ const char *ErrorText)
+{
+ fprintf(stderr, "ERROR: %s\n",ErrorText);
+}
+#endif
+
void die(const char * str)
{
fprintf(stderr, "ERROR: (" PROGRAM ") %s\n", str);
@@ -116,21 +173,49 @@
dict["/Height"]=QPDFObjectHandle::newInteger(height);
dict["/BitsPerComponent"]=QPDFObjectHandle::newInteger(bpc);
- if (cs==CUPS_CSPACE_K) {
- dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceGray");
- } else if (cs==CUPS_CSPACE_RGB) {
- dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB");
- } else if (cs==CUPS_CSPACE_CMYK) {
- dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceCMYK");
- } else if (cs==CUPS_CSPACE_SW) {
- dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceGray");
- } else if (cs==CUPS_CSPACE_SRGB) {
- dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB");
- } else if (cs==CUPS_CSPACE_ADOBERGB) {
+ /* TODO Adjust for color calibration */
+ if (!device_inhibited) {
+ switch (cs) {
+ case CUPS_CSPACE_CIELab:
+ case CUPS_CSPACE_ICC1:
+ case CUPS_CSPACE_ICC2:
+ case CUPS_CSPACE_ICC3:
+ case CUPS_CSPACE_ICC4:
+ case CUPS_CSPACE_ICC5:
+ case CUPS_CSPACE_ICC6:
+ case CUPS_CSPACE_ICC7:
+ case CUPS_CSPACE_ICC8:
+ case CUPS_CSPACE_ICC9:
+ case CUPS_CSPACE_ICCA:
+ case CUPS_CSPACE_ICCB:
+ case CUPS_CSPACE_ICCC:
+ case CUPS_CSPACE_ICCD:
+ case CUPS_CSPACE_ICCE:
+ case CUPS_CSPACE_ICCF:
+ case CUPS_CSPACE_CIEXYZ:
+ dict["/ColorSpace"]=QPDFObjectHandle::newName("/CalRGB");
+ break;
+ case CUPS_CSPACE_K:
+ case CUPS_CSPACE_W:
+ case CUPS_CSPACE_SW:
+ case CUPS_CSPACE_WHITE:
+ dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceGray");
+ break;
+ case CUPS_CSPACE_CMYK:
+ dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceCMYK");
+ break;
+ case CUPS_CSPACE_RGB:
+ case CUPS_CSPACE_SRGB:
+ case CUPS_CSPACE_ADOBERGB:
+ dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB");
+ break;
+ default:
+ return QPDFObjectHandle();
+ }
+ } else if (device_inhibited) {
dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB");
- } else {
+ } else
return QPDFObjectHandle();
- }
ret.replaceDict(QPDFObjectHandle::newDictionary(dict));
@@ -251,9 +336,10 @@
int bpp, int bpl, struct pdf_info * info)
{
// We should be at raster start
- int i;
+ int i, pixels;
unsigned cur_line = 0;
unsigned char *PixelBuffer, *ptr;
+ unsigned char * TransformBuffer = NULL;
PixelBuffer = (unsigned char *)malloc(bpl);
@@ -281,20 +367,204 @@
*(ptr + 1) = swap;
}
}
-#endif /* !ARCH_IS_BIG_ENDIAN */
- // write lines
- pdf_set_line(info, cur_line, PixelBuffer);
+#endif /* !ARCH_IS_BIG_ENDIAN */
+
+ // write lines
+ if (colorTransform != NULL && !device_inhibited) {
+ // If a profile was specified, we apply the transformation
+ TransformBuffer = (unsigned char *)malloc(bpl);
+ pixels = bpl / (info->bpp / info->bpc);
+
+ cmsDoTransform(colorTransform, PixelBuffer,
+ TransformBuffer, pixels);
+ pdf_set_line(info, cur_line, TransformBuffer);
+ } else
+ pdf_set_line(info, cur_line, PixelBuffer);
++cur_line;
}
while(cur_line < height);
free(PixelBuffer);
+ if (TransformBuffer != NULL)
+ free(TransformBuffer);
return 0;
}
+static unsigned int getCMSColorSpaceType(cmsColorSpaceSignature cs)
+{
+ switch (cs) {
+ case cmsSigXYZData:
+ return PT_XYZ;
+ break;
+ case cmsSigLabData:
+ return PT_Lab;
+ break;
+ case cmsSigLuvData:
+ return PT_YUV;
+ break;
+ case cmsSigYCbCrData:
+ return PT_YCbCr;
+ break;
+ case cmsSigYxyData:
+ return PT_Yxy;
+ break;
+ case cmsSigRgbData:
+ return PT_RGB;
+ break;
+ case cmsSigGrayData:
+ return PT_GRAY;
+ break;
+ case cmsSigHsvData:
+ return PT_HSV;
+ break;
+ case cmsSigHlsData:
+ return PT_HLS;
+ break;
+ case cmsSigCmykData:
+ return PT_CMYK;
+ break;
+ case cmsSigCmyData:
+ return PT_CMY;
+ break;
+ case cmsSig2colorData:
+ case cmsSig3colorData:
+ case cmsSig4colorData:
+ case cmsSig5colorData:
+ case cmsSig6colorData:
+ case cmsSig7colorData:
+ case cmsSig8colorData:
+ case cmsSig9colorData:
+ case cmsSig10colorData:
+ case cmsSig11colorData:
+ case cmsSig12colorData:
+ case cmsSig13colorData:
+ case cmsSig14colorData:
+ case cmsSig15colorData:
+ default:
+ break;
+ }
+ return PT_RGB;
+}
+
+int setProfile(const char * path)
+{
+ if (path != NULL)
+ inputColorProfile = cmsOpenProfileFromFile(path,"r");
+
+ if (inputColorProfile != NULL)
+ // test using sRGB Profile
+ outputColorProfile = cmsCreate_sRGBProfile();
+
+ if (inputColorProfile != NULL && outputColorProfile != NULL)
+ return 0;
+ else
+ return 1;
+}
+
+/* Obtain a source profile using color qualifiers */
+int setCupsColorProfile(ppd_file_t* ppd, const char* cupsRenderingIntent,
+ const char * mediaType, cups_cspace_t cs, unsigned xdpi, unsigned ydpi)
+{
+ std::string MediaType;
+ std::string resolution;
+ std::string colorModel;
+
+ std::string path;
+ ppd_attr_t *attr;
+
+ if (ppd == NULL) {
+ return 1;
+ }
+
+ if (cupsRenderingIntent != NULL) {
+ if (strcasecmp(cupsRenderingIntent,"PERCEPTUAL") != 0) {
+ renderingIntent = INTENT_PERCEPTUAL;
+ } else if (strcasecmp(cupsRenderingIntent,"RELATIVE_COLORIMETRIC") != 0) {
+ renderingIntent = INTENT_RELATIVE_COLORIMETRIC;
+ } else if (strcasecmp(cupsRenderingIntent,"SATURATION") != 0) {
+ renderingIntent = INTENT_SATURATION;
+ } else if (strcasecmp(cupsRenderingIntent,"ABSOLUTE_COLORIMETRIC") != 0) {
+ renderingIntent = INTENT_ABSOLUTE_COLORIMETRIC;
+ }
+ }
+
+ // ColorModel
+ switch (cs) {
+ case CUPS_CSPACE_RGB:
+ colorModel = "Rgb";
+ break;
+ case CUPS_CSPACE_SRGB:
+ colorModel = "Srgb";
+ break;
+ case CUPS_CSPACE_ADOBERGB:
+ colorModel = "AdobeRgb";
+ break;
+ case CUPS_CSPACE_K:
+ colorModel = "Sgray";
+ break;
+ case CUPS_CSPACE_CMYK:
+ colorModel = "Cmyk";
+ break;
+ default:
+ colorModel = "";
+ break;
+ }
+
+ // Resolution
+ resolution = xdpi + "x" + ydpi;
+
+ // MediaType
+ if (mediaType != NULL)
+ MediaType = mediaType;
+
+ for (attr = ppdFindAttr(ppd,"cupsICCProfile",NULL);attr != NULL;
+ attr = ppdFindNextAttr(ppd,"cupsICCProfile",NULL)) {
+ // check color model
+ char buf[PPD_MAX_NAME];
+ char *p, *r;
+
+ strncpy(buf,attr->spec,sizeof(buf));
+ if ((p = strchr(buf,'.')) != NULL) {
+ *p = '\0';
+ }
+ if (!colorModel.empty() && buf[0] != '\0'
+ && strcasecmp(buf,colorModel.c_str()) != 0) continue;
+ if (p == NULL) {
+ break;
+ } else {
+ p++;
+ if ((r = strchr(p,'.')) != 0) {
+ *r = '\0';
+ }
+ }
+ if (!resolution.empty() && p[0] != '\0'
+ && strcasecmp(p,resolution.c_str()) != 0) continue;
+ if (r == NULL) {
+ break;
+ } else {
+ r++;
+ if ((p = strchr(r,'.')) != 0) {
+ *p = '\0';
+ }
+ }
+ if (!MediaType.empty() || r[0] == '\0'
+ || strcasecmp(r,MediaType.c_str()) == 0) break;
+ }
+ if (attr != NULL) {
+ // matched
+ path = "";
+ if (attr->value[0] != '/') {
+ path = path + CUPS_DATADIR + "/profiles/";
+ }
+ path = path + CUPS_DATADIR + attr->value;
+ }
+
+ return setProfile(path.c_str());
+}
+
int main(int argc, char **argv)
{
int fd, Page;
@@ -305,17 +575,30 @@
ppd_file_t *ppd; /* PPD file */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
+ const char *val; /* Option value */
+ char tmpstr[1024];
// Make sure status messages are not buffered...
setbuf(stderr, NULL);
+ cmsSetLogErrorHandler(lcmsErrorHandler);
+
if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s <job> <user> <job name> <copies> <option> [file]\n", argv[0]);
return 1;
}
- num_options = cupsParseOptions(argv[5], 0, &options);
+ num_options = cupsParseOptions(argv[5], 0, &options);
+
+ snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER"));
+ device_inhibited = colord_get_inhibit_for_device_id (tmpstr);
+
+ /* support the "cm-calibration" option */
+ if (cupsGetOption("cm-calibration", num_options, options) != NULL) {
+ cm_calibrate = true;
+ device_inhibited = 1;
+ }
// Open the PPD file...
ppd = ppdOpenFile(getenv("PPD"));
@@ -359,12 +642,38 @@
if (create_pdf_file(&pdf) != 0)
die("Unable to create PDF file");
+ fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ?
+ "Calibration Mode/Enabled" : "Calibration Mode/Off");
+
while (cupsRasterReadHeader2(ras, &header))
{
// Write a status message with the page number
Page ++;
fprintf(stderr, "INFO: Starting page %d.\n", Page);
+ // Set profile from PPD and raster header
+ if (!device_inhibited) {
+ // Set user profile from command-line
+ if ((val = cupsGetOption("profile", num_options, options)) != NULL) {
+ setProfile(val);
+ } /* else if (setCupsColorProfile(ppd, header.cupsRenderingIntent,
+ header.MediaType, header.cupsColorSpace,
+ header.HWResolution[0], header.HWResolution[1]) != 0) {
+ } */
+
+ // TESTING create color transformation
+ if (inputColorProfile != NULL && outputColorProfile != NULL) {
+ /* TODO apply conversion by other cases (color space) */
+ unsigned int bytes = header.cupsBitsPerColor/8;
+ unsigned int dcst = getCMSColorSpaceType(cmsGetColorSpace(inputColorProfile));
+ colorTransform = cmsCreateTransform(inputColorProfile,
+ COLORSPACE_SH(dcst) |CHANNELS_SH(header.cupsNumColors) | BYTES_SH(bytes),
+ outputColorProfile,
+ COLORSPACE_SH(PT_RGB) |
+ CHANNELS_SH(3) | BYTES_SH(1),
+ renderingIntent,0);
+ }
+ }
// Add a new page to PDF file
if (add_pdf_page(&pdf, Page, header.cupsWidth, header.cupsHeight,
header.cupsBitsPerPixel, header.cupsBitsPerColor,
@@ -382,6 +691,16 @@
close_pdf_file(&pdf); // will output to stdout
+ if (inputColorProfile != NULL) {
+ cmsCloseProfile(inputColorProfile);
+ }
+ if (outputColorProfile != NULL && outputColorProfile != inputColorProfile) {
+ cmsCloseProfile(outputColorProfile);
+ }
+ if (colorTransform != NULL) {
+ cmsDeleteTransform(colorTransform);
+ }
+
cupsFreeOptions(num_options, options);
cupsRasterClose(ras);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/utils/cups-browsed.c new/cups-filters-1.0.55/utils/cups-browsed.c
--- old/cups-filters-1.0.54/utils/cups-browsed.c 2014-05-07 16:09:53.000000000 +0200
+++ new/cups-filters-1.0.55/utils/cups-browsed.c 2014-07-25 18:01:46.000000000 +0200
@@ -23,12 +23,12 @@
#include <ctype.h>
#include <errno.h>
-#include <ifaddrs.h>
#if defined(__OpenBSD__)
#include <sys/socket.h>
#endif /* __OpenBSD__ */
#include <net/if.h>
#include <netinet/in.h>
+#include <ifaddrs.h>
#include <resolv.h>
#include <stdio.h>
#include <sys/types.h>
@@ -394,7 +394,7 @@
q = (remote_printer_t *)cupsArrayNext(remote_printers))
if (!strcasecmp(q->name, p->name))
break;
- p->duplicate = q ? 1 : 0;
+ p->duplicate = (q && q->status != STATUS_DISAPPEARED) ? 1 : 0;
if (p->duplicate)
debug_printf("cups-browsed: Printer %s already available through host %s.\n",
p->name, q->host);
@@ -1006,6 +1006,32 @@
remote_queue = remove_bad_chars(resource + 9, 0);
debug_printf("cups-browsed: Found CUPS queue: %s on host %s.\n",
remote_queue, remote_host);
+#ifdef HAVE_AVAHI
+ /* If the remote queue has a PPD file, the "product" field of the
+ TXT record is populated. If it has no PPD file the remote queue
+ is a raw queue and so we do not jknow enough about the printer
+ behind it for auto-creating a local queue pointing to it. */
+ int raw_queue = 0;
+ if (txt) {
+ entry = avahi_string_list_find((AvahiStringList *)txt, "product");
+ if (entry) {
+ avahi_string_list_get_pair(entry, &key, &value, NULL);
+ if (!key || !value || strcasecmp(key, "product") || value[0] != '(' ||
+ value[strlen(value) - 1] != ')') {
+ raw_queue = 1;
+ }
+ } else
+ raw_queue = 1;
+ } else
+ raw_queue = 1;
+ if (raw_queue) {
+ /* The remote CUPS queue is raw, ignore it */
+ debug_printf("cups-browsed: Remote CUPS queue %s on host %s is raw, ignored.\n",
+ remote_queue, remote_host);
+ free (remote_host);
+ return;
+ }
+#endif /* HAVE_AVAHI */
} else if (!strncasecmp(resource, "classes/", 8)) {
/* This is a remote CUPS queue, use the remote queue name for the
local queue */
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
31 Jul '14
Hello community,
here is the log from the commit of package installation-images-openSUSE for openSUSE:Factory checked in at 2014-07-31 10:04:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/installation-images-openSUSE (Old)
and /work/SRC/openSUSE:Factory/.installation-images-openSUSE.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "installation-images-openSUSE"
Changes:
--------
--- /work/SRC/openSUSE:Factory/installation-images-openSUSE/installation-images-openSUSE.changes 2014-07-23 22:05:35.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.installation-images-openSUSE.new/installation-images-openSUSE.changes 2014-07-31 10:04:24.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jul 30 13:12:49 CEST 2014 - snwint(a)suse.de
+
+- set hostname and get ip from wicked (bnc #889374)
+- 14.121
+
+-------------------------------------------------------------------
Old:
----
installation-images-14.120.tar.xz
New:
----
installation-images-14.121.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ installation-images-openSUSE.spec ++++++
--- /var/tmp/diff_new_pack.uZ4qmj/_old 2014-07-31 10:04:26.000000000 +0200
+++ /var/tmp/diff_new_pack.uZ4qmj/_new 2014-07-31 10:04:26.000000000 +0200
@@ -354,10 +354,10 @@
Summary: Installation Image Files for %theme
License: GPL-2.0+
Group: Metapackages
-Version: 14.120
+Version: 14.121
Release: 0
Provides: installation-images = %version-%release
-Source: installation-images-14.120.tar.xz
+Source: installation-images-14.121.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define _binary_payload w.ufdio
++++++ installation-images-14.120.tar.xz -> installation-images-14.121.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.120/VERSION new/installation-images-14.121/VERSION
--- old/installation-images-14.120/VERSION 2014-07-21 09:43:51.000000000 +0200
+++ new/installation-images-14.121/VERSION 2014-07-30 13:12:36.000000000 +0200
@@ -1 +1 @@
-14.120
+14.121
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.120/changelog new/installation-images-14.121/changelog
--- old/installation-images-14.120/changelog 2014-07-21 09:43:55.000000000 +0200
+++ new/installation-images-14.121/changelog 2014-07-30 13:12:44.000000000 +0200
@@ -1,4 +1,7 @@
-2014-07-21: HEAD
+2014-07-30: HEAD
+ - set hostname and get ip from wicked (bnc #889374)
+
+2014-07-21: 14.120
- adjust module config
2014-07-18: 14.119
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.120/data/root/etc/inst_setup new/installation-images-14.121/data/root/etc/inst_setup
--- old/installation-images-14.120/data/root/etc/inst_setup 2014-06-17 12:51:31.000000000 +0200
+++ new/installation-images-14.121/data/root/etc/inst_setup 2014-07-30 12:40:31.000000000 +0200
@@ -54,43 +54,17 @@
unset SSH_FAILED
stty sane
-# hostname may come from cmdline
-if test -z "$hostname" ; then
- hostname=`hostname`
-else
- hostname "$hostname"
-fi
-if [ -s /etc/install.inf ]; then
-# # fix fonts for japanese
-# lang=`awk '{ if(/^Locale:/) print $2 }' /etc/install.inf`
-# if [ "$lang" = ja_JP ]; then
-# rm -f /usr/X11R6/lib/X11/fonts/truetype/FZSongTi.ttf
-# rm -f /usr/X11R6/lib/X11/fonts/truetype/gulim.ttf
-# fi
- if [ "$hostname" = "(none)" ] ; then
- hostname=
-
- # hostname and domainname may come from cmdline
- if test -z "$hostname" ; then
- hostname=$(awk ' /^Hostname:/ { print $2 }' < /etc/install.inf)
- fi
- if test -z "$hostname" ; then
- hostname=$(awk ' /^IP:/ { print $2 }' < /etc/install.inf)
- fi
- if test -z "$hostname" ; then
- hostname=linux
- fi
-
- if test -z "$domain" ; then
- domain=$(awk ' /^Domain:/ { print $2 }' < /etc/install.inf)
- fi
- if test -z "$domain" ; then
- domain=local
- fi
- hostname $hostname
- domainname $domain
- fi
-fi
+# set hostname and domainname
+hostip_from_wicked >/tmp/hostips
+
+hostname=$(awk ' /^Hostname:/ { print $2 }' < /etc/install.inf)
+[ -n "$hostname" ] && hostname $hostname
+hostname=`hostname`
+
+domain=$(awk ' /^Domain:/ { print $2 }' < /etc/install.inf)
+[ -z "$domain" ] && domain=local
+domainname $domain
+
#
# a few files should be restored when installation has completed if we
# return to linuxrc.
@@ -211,6 +185,9 @@
echo "ATTENTION: Starting shell... (use 'exit' to proceed with installation)"
bash -l
}
+
+[ -f /tmp/hostips ] && cat /tmp/hostips
+
[ "$START_SHELL" ] && start_shell
# anounce VNC via slpd
@@ -235,8 +212,8 @@
if [ "$YAST2_SSH" = "true" ] ; then
cat <<EOF
- *** login using 'ssh -X root@${hostname}' ***
- *** run '${yast}.ssh' to start the installation ***
+*** login using 'ssh -X root@${hostname}' ***
+*** run '${yast}.ssh' to start the installation ***
EOF
cp /etc/issue /etc/motd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.120/data/root/etc/inst_setup_ssh new/installation-images-14.121/data/root/etc/inst_setup_ssh
--- old/installation-images-14.120/data/root/etc/inst_setup_ssh 2014-03-12 11:28:10.000000000 +0100
+++ new/installation-images-14.121/data/root/etc/inst_setup_ssh 2014-07-30 12:39:18.000000000 +0200
@@ -45,26 +45,17 @@
/usr/sbin/sshd-gen-keys-start
-echo "Starting SSH daemon ... "
+echo -n "Starting SSH daemon... "
/usr/sbin/sshd || {
export SSH_FAILED=true
export YAST2_SSH=false
- echo 'sshd did NOT start!'
+ echo failed
}
if [ ! "$SSH_FAILED" ] ; then
- echo
- ip -oneline -family inet link show up | \
- sed -n '/link\/\(ether\|ieee1394\|tr\)/s@^[^ ]\+[ ]\+\([^:]\+\).*@\1@p' | \
- xargs --no-run-if-empty -n1 ip addr show dev | \
- sed 's@^[0-9]\+: *@@'
+ echo ok
export YAST2_SSH=true
- cat <<EOF
-
- *** sshd has been started ***
-
-EOF
fi
[ -f /proc/splash ] && echo verbose >/proc/splash
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.120/data/root/hostip_from_wicked new/installation-images-14.121/data/root/hostip_from_wicked
--- old/installation-images-14.120/data/root/hostip_from_wicked 1970-01-01 01:00:00.000000000 +0100
+++ new/installation-images-14.121/data/root/hostip_from_wicked 2014-07-30 12:01:08.000000000 +0200
@@ -0,0 +1,26 @@
+#! /usr/bin/perl
+
+$up = 0;
+
+for (`wicked show all 2>/dev/null`) {
+ chomp;
+ if(/^(\S+)\s*(\S+)/) {
+ $up = $1 ne 'lo' && $2 eq 'up';
+ next;
+ }
+ next unless $up;
+
+ if(/^\s+addr:\s+ipv\S+\s+(\S+)/) {
+ $addr = $1;
+ $addr =~ s#/.*$##;
+ push @addr, $addr;
+ }
+}
+
+if(@addr) {
+ system "hostname $addr[0]";
+
+ print "IP addresses:\n";
+ print " $_\n" for @addr;
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/installation-images-14.120/data/root/root.file_list new/installation-images-14.121/data/root/root.file_list
--- old/installation-images-14.120/data/root/root.file_list 2014-07-14 11:58:21.000000000 +0200
+++ new/installation-images-14.121/data/root/root.file_list 2014-07-30 12:26:41.000000000 +0200
@@ -619,8 +619,10 @@
x /usr/lib/YaST/.Reh /usr/lib/YaST2
x etc/inst_setup /sbin/inst_setup
x etc/adddir /sbin/adddir
+x hostip_from_wicked /sbin/hostip_from_wicked
c 755 0 0 /sbin/inst_setup
c 755 0 0 /sbin/adddir
+c 755 0 0 /sbin/hostip_from_wicked
if instsys_complain_root
e echo "InstsysComplain: <instsys_complain_root>" >>.instsys.config
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package ca-certificates for openSUSE:Factory checked in at 2014-07-31 10:04:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ca-certificates (Old)
and /work/SRC/openSUSE:Factory/.ca-certificates.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ca-certificates"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ca-certificates/ca-certificates.changes 2014-07-21 10:35:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ca-certificates.new/ca-certificates.changes 2014-07-31 10:04:22.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jul 30 11:45:54 UTC 2014 - lnussel(a)suse.de
+
+- removed the version in the Obsoletes. The package in SLE11 got
+ version updated (bnc#887099).
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ca-certificates.spec ++++++
--- /var/tmp/diff_new_pack.7cr5Hq/_old 2014-07-31 10:04:24.000000000 +0200
+++ /var/tmp/diff_new_pack.7cr5Hq/_new 2014-07-31 10:04:24.000000000 +0200
@@ -47,7 +47,7 @@
# we need to obsolete openssl-certs to make sure it's files are
# gone when a package providing actual certificates gets
# installed (bnc#594434).
-Obsoletes: openssl-certs < 0.9.9
+Obsoletes: openssl-certs
# no need for a separate Java package anymore. The bundle is
# created by C code.
Obsoletes: java-ca-certificates = 1
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package numactl for openSUSE:Factory checked in at 2014-07-31 10:04:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/numactl (Old)
and /work/SRC/openSUSE:Factory/.numactl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "numactl"
Changes:
--------
--- /work/SRC/openSUSE:Factory/numactl/numactl.changes 2014-06-19 13:19:57.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.numactl.new/numactl.changes 2014-07-31 10:04:20.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Jul 29 08:26:28 UTC 2014 - juwolf(a)suse.com
+
+- Fixed patch 0001-Fixed-segfault-when-no-node-could-be-found-in-sysfs-.patch
+ for bnc#872922
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ 0001-Fixed-segfault-when-no-node-could-be-found-in-sysfs-.patch ++++++
--- /var/tmp/diff_new_pack.qo4Lek/_old 2014-07-31 10:04:22.000000000 +0200
+++ /var/tmp/diff_new_pack.qo4Lek/_new 2014-07-31 10:04:22.000000000 +0200
@@ -1,49 +1,43 @@
-From a60b4ae108d7853f604e2d75147f6175ba908dfd Mon Sep 17 00:00:00 2001
+From 5dce07818a2f2c6ebde399f58702fe5beecb2eed Mon Sep 17 00:00:00 2001
From: Julian Wolf <juwolf(a)suse.com>
-Date: Fri, 13 Jun 2014 14:24:36 +0200
+Date: Fri, 18 Jul 2014 14:05:05 +0200
Subject: [PATCH] Fixed segfault when no node could be found in sysfs
bnc#872922
---
- distance.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ distance.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/distance.c b/distance.c
-index 4a26972..84affa3 100755
+index 4a26972..5db7fe2 100755
--- a/distance.c
+++ b/distance.c
-@@ -57,6 +57,7 @@ static int read_distance_table(void)
- int maxnode = numa_max_node() + 1;
+@@ -58,19 +58,16 @@ static int read_distance_table(void)
int *table = NULL;
int err = -1;
-+ int cnt = 0;
- for (nd = 0;; nd++) {
+- for (nd = 0;; nd++) {
++ for (nd = 0; nd < maxnode; nd++) {
char fn[100];
-@@ -70,6 +71,8 @@ static int read_distance_table(void)
- continue;
- else
- break;
-+ }else {
-+ cnt++;
- }
+ FILE *dfh;
+ sprintf(fn, "/sys/devices/system/node/node%d/distance", nd);
+ dfh = fopen(fn, "r");
+- if (!dfh) {
+- if (errno == ENOENT)
+- err = 0;
+- if (!err && nd<maxnode)
+- continue;
+- else
+- break;
+- }
++ if (dfh)
++ err = 0;
++ else
++ continue;
++
len = getdelim(&line, &linelen, '\n', dfh);
fclose(dfh);
-@@ -87,12 +90,12 @@ static int read_distance_table(void)
- parse_numbers(line, table + nd * maxnode);
- }
- free(line);
-- if (err) {
-+ if (err || !cnt) {
- numa_warn(W_distance,
- "Cannot parse distance information in sysfs: %s",
- strerror(errno));
- free(table);
-- return err;
-+ return -1;
- }
- /* Update the global table pointer. Race window here with
- other threads, but in the worst case we leak one distance
+ if (len <= 0)
--
1.8.1.4
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package valgrind for openSUSE:Factory checked in at 2014-07-31 10:04:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/valgrind (Old)
and /work/SRC/openSUSE:Factory/.valgrind.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "valgrind"
Changes:
--------
--- /work/SRC/openSUSE:Factory/valgrind/valgrind.changes 2014-06-26 08:00:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.valgrind.new/valgrind.changes 2014-07-31 10:04:17.000000000 +0200
@@ -1,0 +2,5 @@
+Sat Jul 26 18:02:35 UTC 2014 - schwab(a)suse.de
+
+- Fix patch conflicts.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ valgrind.spec ++++++
--- /var/tmp/diff_new_pack.W6GOwW/_old 2014-07-31 10:04:20.000000000 +0200
+++ /var/tmp/diff_new_pack.W6GOwW/_new 2014-07-31 10:04:20.000000000 +0200
@@ -145,20 +145,21 @@
cd VEX
%ifarch aarch64
%patch8
-%endif
+%else
%patch9
+%endif
cd ..
%patch1
-%ifnarch aarch64
+%ifarch aarch64
+%patch7
+%else
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6
-%else
-%patch7
-%endif
%patch10
+%endif
%build
%ifarch %arm
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2014-07-31 10:04:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/linuxrc (Old)
and /work/SRC/openSUSE:Factory/.linuxrc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "linuxrc"
Changes:
--------
--- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes 2014-07-29 21:21:50.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2014-07-31 10:04:15.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Jul 30 10:57:03 CEST 2014 - snwint(a)suse.de
+
+- pass along hostname if explicitly set (bnc #889374)
+- 5.0.7
+
+-------------------------------------------------------------------
Old:
----
linuxrc-5.0.6.tar.xz
New:
----
linuxrc-5.0.7.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ linuxrc.spec ++++++
--- /var/tmp/diff_new_pack.Mv0jVq/_old 2014-07-31 10:04:17.000000000 +0200
+++ /var/tmp/diff_new_pack.Mv0jVq/_new 2014-07-31 10:04:17.000000000 +0200
@@ -25,9 +25,9 @@
Summary: SUSE Installation Program
License: GPL-3.0+
Group: System/Boot
-Version: 5.0.6
+Version: 5.0.7
Release: 0
-Source: linuxrc-5.0.6.tar.xz
+Source: linuxrc-5.0.7.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
++++++ linuxrc-5.0.6.tar.xz -> linuxrc-5.0.7.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.6/README.md new/linuxrc-5.0.7/README.md
--- old/linuxrc-5.0.6/README.md 1970-01-01 01:00:00.000000000 +0100
+++ new/linuxrc-5.0.7/README.md 2014-07-28 17:24:50.000000000 +0200
@@ -0,0 +1,4 @@
+This is the early part of the SUSE installation process, before
+[YaST](https://en.opensuse.org/Portal:YaST) runs.
+
+See <https://en.opensuse.org/SDB:Linuxrc>.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.6/VERSION new/linuxrc-5.0.7/VERSION
--- old/linuxrc-5.0.6/VERSION 2014-07-28 16:39:01.000000000 +0200
+++ new/linuxrc-5.0.7/VERSION 2014-07-30 10:56:55.000000000 +0200
@@ -1 +1 @@
-5.0.6
+5.0.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.6/changelog new/linuxrc-5.0.7/changelog
--- old/linuxrc-5.0.6/changelog 2014-07-28 16:39:03.000000000 +0200
+++ new/linuxrc-5.0.7/changelog 2014-07-30 10:56:57.000000000 +0200
@@ -1,4 +1,12 @@
-2014-07-28: HEAD
+2014-07-30: HEAD
+ - Merge pull request #15 from openSUSE/sw_0003
+ - pass along hostname if explicitly set (bnc #889374)
+ - pass along hostname if explicitly set (bnc #889374)
+ - Merge pull request #14 from mvidner/readme
+ - Read me.
+ - Read me.
+
+2014-07-28: 5.0.6
- Merge pull request #13 from openSUSE/sw_0002
- Sw 0002
- add missing break
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.6/file.c new/linuxrc-5.0.7/file.c
--- old/linuxrc-5.0.6/file.c 2014-07-28 16:37:52.000000000 +0200
+++ new/linuxrc-5.0.7/file.c 2014-07-30 10:56:14.000000000 +0200
@@ -1803,6 +1803,8 @@
if(config.url.proxy) fprintf(f, "ProxyURL: %s\n", url_print(config.url.proxy, 1));
+ if(config.net.realhostname) file_write_str(f, key_hostname, config.net.realhostname);
+
file_write_modparms(f);
file_write_str(f, key_loghost, config.loghost);
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python-pytest for openSUSE:Factory checked in at 2014-07-31 10:04:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest (Old)
and /work/SRC/openSUSE:Factory/.python-pytest.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest/python-pytest.changes 2014-06-19 13:08:46.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-pytest.new/python-pytest.changes 2014-07-31 10:04:12.000000000 +0200
@@ -1,0 +2,74 @@
+Wed Jul 30 07:38:02 UTC 2014 - toddrme2178(a)gmail.com
+
+- Update to 2.6.0
+ - Cache exceptions from fixtures according to their scope (issue 467).
+ - fix issue537: Avoid importing old assertion reinterpretation code by default.
+ - fix issue364: shorten and enhance tracebacks representation by default.
+ The new "--tb=auto" option (default) will only display long tracebacks
+ for the first and last entry. You can get the old behaviour of printing
+ all entries as long entries with "--tb=long". Also short entries by
+ default are now printed very similarly to "--tb=native" ones.
+ - fix issue514: teach assertion reinterpretation about private class attributes
+ - change -v output to include full node IDs of tests. Users can copy
+ a node ID from a test run, including line number, and use it as a
+ positional argument in order to run only a single test.
+ - fix issue 475: fail early and comprehensible if calling
+ pytest.raises with wrong exception type.
+ - fix issue516: tell in getting-started about current dependencies.
+ - cleanup setup.py a bit and specify supported versions. Thanks Jurko
+ Gospodnetic for the PR.
+ - change XPASS colour to yellow rather then red when tests are run
+ with -v.
+ - fix issue473: work around mock putting an unbound method into a class
+ dict when double-patching.
+ - fix issue498: if a fixture finalizer fails, make sure that
+ the fixture is still invalidated.
+ - fix issue453: the result of the pytest_assertrepr_compare hook now gets
+ it's newlines escaped so that format_exception does not blow up.
+ - internal new warning system: pytest will now produce warnings when
+ it detects oddities in your test collection or execution.
+ Warnings are ultimately sent to a new pytest_logwarning hook which is
+ currently only implemented by the terminal plugin which displays
+ warnings in the summary line and shows more details when -rw (report on
+ warnings) is specified.
+ - change skips into warnings for test classes with an __init__ and
+ callables in test modules which look like a test but are not functions.
+ - fix issue436: improved finding of initial conftest files from command
+ line arguments by using the result of parse_known_args rather than
+ the previous flaky heuristics. Thanks Marc Abramowitz for tests
+ and initial fixing approaches in this area.
+ - fix issue #479: properly handle nose/unittest(2) SkipTest exceptions
+ during collection/loading of test modules. Thanks to Marc Schlaich
+ for the complete PR.
+ - fix issue490: include pytest_load_initial_conftests in documentation
+ and improve docstring.
+ - fix issue472: clarify that ``pytest.config.getvalue()`` cannot work
+ if it's triggered ahead of command line parsing.
+ - merge PR123: improved integration with mock.patch decorator on tests.
+ - fix issue412: messing with stdout/stderr FD-level streams is now
+ captured without crashes.
+ - fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR.
+ - improve example for pytest integration with "python setup.py test"
+ which now has a generic "-a" or "--pytest-args" option where you
+ can pass additional options as a quoted string. Thanks Trevor Bekolay.
+ - simplified internal capturing mechanism and made it more robust
+ against tests or setups changing FD1/FD2, also better integrated
+ now with pytest.pdb() in single tests.
+ - improvements to pytest's own test-suite leakage detection, courtesy of PRs
+ from Marc Abramowitz
+ - fix issue492: avoid leak in test_writeorg. Thanks Marc Abramowitz.
+ - fix issue493: don't run tests in doc directory with ``python setup.py test``
+ (use tox -e doctesting for that)
+ - fix issue486: better reporting and handling of early conftest loading failures
+ - some cleanup and simplification of internal conftest handling.
+ - work a bit harder to break reference cycles when catching exceptions.
+ Thanks Jurko Gospodnetic.
+ - fix issue443: fix skip examples to use proper comparison. Thanks Alex
+ Groenholm.
+ - support nose-style ``__test__`` attribute on modules, classes and
+ functions, including unittest-style Classes. If set to False, the
+ test will not be collected.
+ - fix issue512: show "<notset>" for arguments which might not be set
+ in monkeypatch plugin. Improves output in documentation.
+
+-------------------------------------------------------------------
Old:
----
pytest-2.5.2.tar.gz
New:
----
pytest-2.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest.spec ++++++
--- /var/tmp/diff_new_pack.4aZPhE/_old 2014-07-31 10:04:14.000000000 +0200
+++ /var/tmp/diff_new_pack.4aZPhE/_new 2014-07-31 10:04:14.000000000 +0200
@@ -17,7 +17,7 @@
Name: python-pytest
-Version: 2.5.2
+Version: 2.6.0
Release: 0
Summary: Simple powerful testing with Python
License: MIT
@@ -30,8 +30,8 @@
# Documentation requirements:
BuildRequires: python-Sphinx
# Test requirements:
-BuildRequires: python-py >= 1.4.20
-Requires: python-py >= 1.4.20
+BuildRequires: python-py >= 1.4.22
+Requires: python-py >= 1.4.22
Requires(post): update-alternatives
Requires(postun): update-alternatives
#/usr/bin/py.test imports pkg_resources
++++++ pytest-2.5.2.tar.gz -> pytest-2.6.0.tar.gz ++++++
++++ 7620 lines of diff (skipped)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package python-py for openSUSE:Factory checked in at 2014-07-31 10:04:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-py (Old)
and /work/SRC/openSUSE:Factory/.python-py.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-py"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-py/python-py.changes 2014-05-17 06:43:25.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-py.new/python-py.changes 2014-07-31 10:04:10.000000000 +0200
@@ -1,0 +2,21 @@
+Wed Jul 30 07:50:37 UTC 2014 - toddrme2178(a)gmail.com
+
+- Update to 1.4.22
+ - refactor class-level registry on ForkedFunc child start/finish
+ event to become instance based (i.e. passed into the constructor)
+- Update to 1.4.21
+ - ForkedFunc now has class-level register_on_start/on_exit()
+ methods to allow adding information in the boxed process.
+ Thanks Marc Schlaich.
+ - ForkedFunc in the child opens in "auto-flush" mode for
+ stdout/stderr so that when a subprocess dies you can see
+ its output even if it didn't flush itself.
+ - refactor traceback generation in light of pytest issue 364
+ (shortening tracebacks). you can now set a new traceback style
+ on a per-entry basis such that a caller can force entries to be
+ isplayed as short or long entries.
+ - win32: py.path.local.sysfind(name) will preferrably return files with
+ extensions so that if "X" and "X.bat" or "X.exe" is on the PATH,
+ one of the latter two will be returned.
+
+-------------------------------------------------------------------
Old:
----
py-1.4.20.tar.gz
New:
----
py-1.4.22.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-py.spec ++++++
--- /var/tmp/diff_new_pack.DLPsck/_old 2014-07-31 10:04:12.000000000 +0200
+++ /var/tmp/diff_new_pack.DLPsck/_new 2014-07-31 10:04:12.000000000 +0200
@@ -17,7 +17,7 @@
Name: python-py
-Version: 1.4.20
+Version: 1.4.22
Release: 0
Summary: Library with cross-python path, ini-parsing, io, code, log facilities
License: MIT
@@ -25,7 +25,6 @@
Url: http://pylib.org
Source: http://pypi.python.org/packages/source/p/py/py-%{version}.tar.gz
BuildRequires: python-devel
-BuildRequires: unzip
# Documentation requirements:
BuildRequires: python-Sphinx
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ py-1.4.20.tar.gz -> py-1.4.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/AUTHORS new/py-1.4.22/AUTHORS
--- old/py-1.4.20/AUTHORS 1970-01-01 01:00:00.000000000 +0100
+++ new/py-1.4.22/AUTHORS 2014-07-17 10:51:42.000000000 +0200
@@ -0,0 +1,24 @@
+Holger Krekel, holger at merlinux eu
+Benjamin Peterson, benjamin at python org
+Ronny Pfannschmidt, Ronny.Pfannschmidt at gmx de
+Guido Wesdorp, johnny at johnnydebris net
+Samuele Pedroni, pedronis at openend se
+Carl Friedrich Bolz, cfbolz at gmx de
+Armin Rigo, arigo at tunes org
+Maciek Fijalkowski, fijal at genesilico pl
+Brian Dorsey, briandorsey at gmail com
+Floris Bruynooghe, flub at devork be
+merlinux GmbH, Germany, office at merlinux eu
+
+Contributors include::
+
+Ross Lawley
+Ralf Schmitt
+Chris Lamb
+Harald Armin Massa
+Martijn Faassen
+Ian Bicking
+Jan Balster
+Grig Gheorghiu
+Bob Ippolito
+Christian Tismer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/CHANGELOG new/py-1.4.22/CHANGELOG
--- old/py-1.4.20/CHANGELOG 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/CHANGELOG 2014-07-17 10:51:42.000000000 +0200
@@ -1,3 +1,29 @@
+1.4.22
+==================================================
+
+- refactor class-level registry on ForkedFunc child start/finish
+ event to become instance based (i.e. passed into the constructor)
+
+1.4.21
+==================================================
+
+- ForkedFunc now has class-level register_on_start/on_exit()
+ methods to allow adding information in the boxed process.
+ Thanks Marc Schlaich.
+
+- ForkedFunc in the child opens in "auto-flush" mode for
+ stdout/stderr so that when a subprocess dies you can see
+ its output even if it didn't flush itself.
+
+- refactor traceback generation in light of pytest issue 364
+ (shortening tracebacks). you can now set a new traceback style
+ on a per-entry basis such that a caller can force entries to be
+ isplayed as short or long entries.
+
+- win32: py.path.local.sysfind(name) will preferrably return files with
+ extensions so that if "X" and "X.bat" or "X.exe" is on the PATH,
+ one of the latter two will be returned.
+
1.4.20
==================================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/MANIFEST.in new/py-1.4.22/MANIFEST.in
--- old/py-1.4.20/MANIFEST.in 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/MANIFEST.in 2014-07-17 10:51:42.000000000 +0200
@@ -1,4 +1,5 @@
include CHANGELOG
+include AUTHORS
include README.txt
include setup.py
include LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/PKG-INFO new/py-1.4.22/PKG-INFO
--- old/py-1.4.20/PKG-INFO 2014-01-29 13:16:53.000000000 +0100
+++ new/py-1.4.22/PKG-INFO 2014-07-17 10:51:42.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: py
-Version: 1.4.20
+Version: 1.4.22
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Home-page: http://pylib.readthedocs.org/
Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others
@@ -13,7 +13,6 @@
* py.apipkg: explicit API control and lazy-importing
* py.iniconfig: easy parsing of .ini files
* py.code: dynamic code generation and introspection
- * py.path: uniform local and svn path objects
NOTE: prior to the 1.4 release this distribution used to
contain py.test which is now its own package, see http://pytest.org
@@ -22,7 +21,7 @@
Bugs and issues: http://bitbucket.org/hpk42/py/issues/
- Authors: Holger Krekel and others, 2004-2013
+ Authors: Holger Krekel and others, 2004-2014
Platform: unix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/README.txt new/py-1.4.22/README.txt
--- old/py-1.4.20/README.txt 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/README.txt 2014-07-17 10:51:42.000000000 +0200
@@ -5,7 +5,6 @@
* py.apipkg: explicit API control and lazy-importing
* py.iniconfig: easy parsing of .ini files
* py.code: dynamic code generation and introspection
-* py.path: uniform local and svn path objects
NOTE: prior to the 1.4 release this distribution used to
contain py.test which is now its own package, see http://pytest.org
@@ -14,5 +13,5 @@
Bugs and issues: http://bitbucket.org/hpk42/py/issues/
-Authors: Holger Krekel and others, 2004-2013
+Authors: Holger Krekel and others, 2004-2014
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/py/__init__.py new/py-1.4.22/py/__init__.py
--- old/py-1.4.20/py/__init__.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/py/__init__.py 2014-07-17 10:51:42.000000000 +0200
@@ -8,7 +8,7 @@
(c) Holger Krekel and others, 2004-2013
"""
-__version__ = '1.4.20'
+__version__ = '1.4.22'
from py import _apipkg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/py/_code/code.py new/py-1.4.22/py/_code/code.py
--- old/py-1.4.20/py/_code/code.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/py/_code/code.py 2014-07-17 10:51:42.000000000 +0200
@@ -133,12 +133,17 @@
class TracebackEntry(object):
""" a single entry in a traceback """
+ _repr_style = None
exprinfo = None
def __init__(self, rawentry):
self._rawentry = rawentry
self.lineno = rawentry.tb_lineno - 1
+ def set_repr_style(self, mode):
+ assert mode in ("short", "long")
+ self._repr_style = mode
+
@property
def frame(self):
return py.code.Frame(self._rawentry.tb_frame)
@@ -470,17 +475,17 @@
line_index = 0
if line_index < 0:
line_index += len(source)
- for i in range(len(source)):
- if i == line_index:
- prefix = self.flow_marker + " "
- else:
- if short:
- continue
- prefix = " "
- line = prefix + source[i]
- lines.append(line)
+ space_prefix = " "
+ if short:
+ lines.append(space_prefix + source.lines[line_index].strip())
+ else:
+ for line in source.lines[:line_index]:
+ lines.append(space_prefix + line)
+ lines.append(self.flow_marker + " " + source.lines[line_index])
+ for line in source.lines[line_index+1:]:
+ lines.append(space_prefix + line)
if excinfo is not None:
- indent = self._getindent(source)
+ indent = 4 if short else self._getindent(source)
lines.extend(self.get_exconly(excinfo, indent=indent, markall=True))
return lines
@@ -520,7 +525,6 @@
return ReprLocals(lines)
def repr_traceback_entry(self, entry, excinfo=None):
- # excinfo is not None if this is the last tb entry
source = self._getentrysource(entry)
if source is None:
source = py.code.Source("???")
@@ -530,11 +534,12 @@
line_index = entry.lineno - max(entry.getfirstlinesource(), 0)
lines = []
- if self.style in ("short", "long"):
- short = self.style == "short"
- reprargs = None
- if not short:
- reprargs = self.repr_args(entry)
+ style = entry._repr_style
+ if style is None:
+ style = self.style
+ if style in ("short", "long"):
+ short = style == "short"
+ reprargs = self.repr_args(entry) if not short else None
s = self.get_source(source, line_index, excinfo, short=short)
lines.extend(s)
if short:
@@ -546,10 +551,10 @@
localsrepr = None
if not short:
localsrepr = self.repr_locals(entry.locals)
- return ReprEntry(lines, reprargs, localsrepr, filelocrepr, short)
+ return ReprEntry(lines, reprargs, localsrepr, filelocrepr, style)
if excinfo:
lines.extend(self.get_exconly(excinfo, indent=4))
- return ReprEntry(lines, None, None, None, False)
+ return ReprEntry(lines, None, None, None, style)
def _makepath(self, path):
if not self.abspath:
@@ -628,14 +633,18 @@
self.style = style
def toterminal(self, tw):
- sepok = False
- for entry in self.reprentries:
- if self.style == "long":
- if sepok:
- tw.sep(self.entrysep)
+ # the entries might have different styles
+ last_style = None
+ for i, entry in enumerate(self.reprentries):
+ if entry.style == "long":
tw.line("")
- sepok = True
entry.toterminal(tw)
+ if i < len(self.reprentries) - 1:
+ next_entry = self.reprentries[i+1]
+ if entry.style == "long" or \
+ entry.style == "short" and next_entry.style == "long":
+ tw.sep(self.entrysep)
+
if self.extraline:
tw.line(self.extraline)
@@ -646,6 +655,8 @@
self.extraline = None
class ReprEntryNative(TerminalRepr):
+ style = "native"
+
def __init__(self, tblines):
self.lines = tblines
@@ -655,15 +666,15 @@
class ReprEntry(TerminalRepr):
localssep = "_ "
- def __init__(self, lines, reprfuncargs, reprlocals, filelocrepr, short):
+ def __init__(self, lines, reprfuncargs, reprlocals, filelocrepr, style):
self.lines = lines
self.reprfuncargs = reprfuncargs
self.reprlocals = reprlocals
self.reprfileloc = filelocrepr
- self.short = short
+ self.style = style
def toterminal(self, tw):
- if self.short:
+ if self.style == "short":
self.reprfileloc.toterminal(tw)
for line in self.lines:
red = line.startswith("E ")
@@ -680,7 +691,8 @@
tw.line("")
self.reprlocals.toterminal(tw)
if self.reprfileloc:
- tw.line("")
+ if self.lines:
+ tw.line("")
self.reprfileloc.toterminal(tw)
def __str__(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/py/_path/local.py new/py-1.4.22/py/_path/local.py
--- old/py-1.4.20/py/_path/local.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/py/_path/local.py 2014-07-17 10:51:42.000000000 +0200
@@ -700,9 +700,10 @@
for path in paths]
else:
paths = py.std.os.environ['PATH'].split(':')
- tryadd = ['']
+ tryadd = []
if iswin32:
tryadd += os.environ['PATHEXT'].split(os.pathsep)
+ tryadd.append("")
for x in paths:
for addext in tryadd:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/py/_process/forkedfunc.py new/py-1.4.22/py/_process/forkedfunc.py
--- old/py-1.4.20/py/_process/forkedfunc.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/py/_process/forkedfunc.py 2014-07-17 10:51:42.000000000 +0200
@@ -3,8 +3,6 @@
ForkedFunc provides a way to run a function in a forked process
and get at its return value, stdout and stderr output as well
as signals and exitstatusus.
-
- XXX see if tempdir handling is sane
"""
import py
@@ -12,9 +10,26 @@
import sys
import marshal
-class ForkedFunc(object):
+
+def get_unbuffered_io(fd, filename):
+ f = open(str(filename), "w")
+ if fd != f.fileno():
+ os.dup2(f.fileno(), fd)
+ class AutoFlush:
+ def write(self, data):
+ f.write(data)
+ f.flush()
+ def __getattr__(self, name):
+ return getattr(f, name)
+ return AutoFlush()
+
+
+class ForkedFunc:
EXITSTATUS_EXCEPTION = 3
- def __init__(self, fun, args=None, kwargs=None, nice_level=0):
+
+
+ def __init__(self, fun, args=None, kwargs=None, nice_level=0,
+ child_on_start=None, child_on_exit=None):
if args is None:
args = []
if kwargs is None:
@@ -28,35 +43,32 @@
self.STDERR = tempdir.ensure('stderr')
pid = os.fork()
- if pid: # in parent process
+ if pid: # in parent process
self.pid = pid
- else: # in child process
- self._child(nice_level)
+ else: # in child process
+ self.pid = None
+ self._child(nice_level, child_on_start, child_on_exit)
- def _child(self, nice_level):
+ def _child(self, nice_level, child_on_start, child_on_exit):
# right now we need to call a function, but first we need to
# map all IO that might happen
- # make sure sys.stdout points to file descriptor one
- sys.stdout = stdout = self.STDOUT.open('w')
- sys.stdout.flush()
- fdstdout = stdout.fileno()
- if fdstdout != 1:
- os.dup2(fdstdout, 1)
- sys.stderr = stderr = self.STDERR.open('w')
- fdstderr = stderr.fileno()
- if fdstderr != 2:
- os.dup2(fdstderr, 2)
+ sys.stdout = stdout = get_unbuffered_io(1, self.STDOUT)
+ sys.stderr = stderr = get_unbuffered_io(2, self.STDERR)
retvalf = self.RETVAL.open("wb")
EXITSTATUS = 0
try:
if nice_level:
os.nice(nice_level)
try:
+ if child_on_start is not None:
+ child_on_start()
retval = self.fun(*self.args, **self.kwargs)
retvalf.write(marshal.dumps(retval))
+ if child_on_exit is not None:
+ child_on_exit()
except:
excinfo = py.code.ExceptionInfo()
- stderr.write(excinfo.exconly())
+ stderr.write(str(excinfo._getreprcrash()))
EXITSTATUS = self.EXITSTATUS_EXCEPTION
finally:
stdout.close()
@@ -73,8 +85,6 @@
exitstatus = os.WTERMSIG(systemstatus) + 128
else:
exitstatus = os.WEXITSTATUS(systemstatus)
- #raise ExecutionFailed(status, systemstatus, cmd,
- # ''.join(out), ''.join(err))
else:
exitstatus = 0
signal = systemstatus & 0x7f
@@ -97,7 +107,9 @@
self.tempdir.remove()
def __del__(self):
- self._removetemp()
+ if self.pid is not None: # only clean up in main process
+ self._removetemp()
+
class Result(object):
def __init__(self, exitstatus, signal, retval, stdout, stderr):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/py.egg-info/PKG-INFO new/py-1.4.22/py.egg-info/PKG-INFO
--- old/py-1.4.20/py.egg-info/PKG-INFO 2014-01-29 13:16:53.000000000 +0100
+++ new/py-1.4.22/py.egg-info/PKG-INFO 2014-07-17 10:51:42.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: py
-Version: 1.4.20
+Version: 1.4.22
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Home-page: http://pylib.readthedocs.org/
Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others
@@ -13,7 +13,6 @@
* py.apipkg: explicit API control and lazy-importing
* py.iniconfig: easy parsing of .ini files
* py.code: dynamic code generation and introspection
- * py.path: uniform local and svn path objects
NOTE: prior to the 1.4 release this distribution used to
contain py.test which is now its own package, see http://pytest.org
@@ -22,7 +21,7 @@
Bugs and issues: http://bitbucket.org/hpk42/py/issues/
- Authors: Holger Krekel and others, 2004-2013
+ Authors: Holger Krekel and others, 2004-2014
Platform: unix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/py.egg-info/SOURCES.txt new/py-1.4.22/py.egg-info/SOURCES.txt
--- old/py-1.4.20/py.egg-info/SOURCES.txt 2014-01-29 13:16:53.000000000 +0100
+++ new/py-1.4.22/py.egg-info/SOURCES.txt 2014-07-17 10:51:42.000000000 +0200
@@ -1,3 +1,4 @@
+AUTHORS
CHANGELOG
LICENSE
MANIFEST.in
@@ -87,6 +88,7 @@
testing/code/test_excinfo.py
testing/code/test_source.py
testing/io_/__init__.py
+testing/io_/test_capture.py
testing/io_/test_saferepr.py
testing/io_/test_terminalwriter.py
testing/log/__init__.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/setup.py new/py-1.4.22/setup.py
--- old/py-1.4.20/setup.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/setup.py 2014-07-17 10:51:42.000000000 +0200
@@ -7,7 +7,7 @@
name='py',
description='library with cross-python path, ini-parsing, io, code, log facilities',
long_description = open('README.txt').read(),
- version='1.4.20',
+ version='1.4.22',
url='http://pylib.readthedocs.org/',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/testing/code/test_excinfo.py new/py-1.4.22/testing/code/test_excinfo.py
--- old/py-1.4.20/testing/code/test_excinfo.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/testing/code/test_excinfo.py 2014-07-17 10:51:42.000000000 +0200
@@ -547,7 +547,7 @@
reprtb = p.repr_traceback_entry(excinfo.traceback[-2])
lines = reprtb.lines
basename = py.path.local(mod.__file__).basename
- assert lines[0] == '> func1()'
+ assert lines[0] == ' func1()'
assert basename in str(reprtb.reprfileloc.path)
assert reprtb.reprfileloc.lineno == 5
@@ -555,8 +555,8 @@
p = FormattedExcinfo(style="short")
reprtb = p.repr_traceback_entry(excinfo.traceback[-1], excinfo)
lines = reprtb.lines
- assert lines[0] == '> raise ValueError("hello")'
- assert lines[1] == 'E ValueError: hello'
+ assert lines[0] == ' raise ValueError("hello")'
+ assert lines[1] == 'E ValueError: hello'
assert basename in str(reprtb.reprfileloc.path)
assert reprtb.reprfileloc.lineno == 3
@@ -611,10 +611,10 @@
last_lines = last_reprtb.lines
monkeypatch.undo()
basename = py.path.local(mod.__file__).basename
- assert lines[0] == '> func1()'
+ assert lines[0] == ' func1()'
- assert last_lines[0] == '> raise ValueError("hello")'
- assert last_lines[1] == 'E ValueError: hello'
+ assert last_lines[0] == ' raise ValueError("hello")'
+ assert last_lines[1] == 'E ValueError: hello'
def test_repr_traceback_and_excinfo(self, importasmod):
mod = importasmod("""
@@ -819,3 +819,40 @@
# python 2.4 fails to get the source line for the assert
if py.std.sys.version_info >= (2, 5):
assert s.count('assert 0') == 2
+
+ def test_traceback_repr_style(self, importasmod):
+ mod = importasmod("""
+ def f():
+ g()
+ def g():
+ h()
+ def h():
+ i()
+ def i():
+ raise ValueError()
+ """)
+ excinfo = py.test.raises(ValueError, mod.f)
+ excinfo.traceback = excinfo.traceback.filter()
+ excinfo.traceback[1].set_repr_style("short")
+ excinfo.traceback[2].set_repr_style("short")
+ r = excinfo.getrepr(style="long")
+ tw = TWMock()
+ r.toterminal(tw)
+ for line in tw.lines: print (line)
+ assert tw.lines[0] == ""
+ assert tw.lines[1] == " def f():"
+ assert tw.lines[2] == "> g()"
+ assert tw.lines[3] == ""
+ assert tw.lines[4].endswith("mod.py:3: ")
+ assert tw.lines[5] == ("_ ", None)
+ assert tw.lines[6].endswith("in g")
+ assert tw.lines[7] == " h()"
+ assert tw.lines[8].endswith("in h")
+ assert tw.lines[9] == " i()"
+ assert tw.lines[10] == ("_ ", None)
+ assert tw.lines[11] == ""
+ assert tw.lines[12] == " def i():"
+ assert tw.lines[13] == "> raise ValueError()"
+ assert tw.lines[14] == "E ValueError"
+ assert tw.lines[15] == ""
+ assert tw.lines[16].endswith("mod.py:9: ValueError")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/testing/io_/test_capture.py new/py-1.4.22/testing/io_/test_capture.py
--- old/py-1.4.20/testing/io_/test_capture.py 1970-01-01 01:00:00.000000000 +0100
+++ new/py-1.4.22/testing/io_/test_capture.py 2014-07-17 10:51:42.000000000 +0200
@@ -0,0 +1,501 @@
+from __future__ import with_statement
+
+import os, sys
+import py
+
+needsdup = py.test.mark.skipif("not hasattr(os, 'dup')")
+
+from py.builtin import print_
+
+if sys.version_info >= (3,0):
+ def tobytes(obj):
+ if isinstance(obj, str):
+ obj = obj.encode('UTF-8')
+ assert isinstance(obj, bytes)
+ return obj
+ def totext(obj):
+ if isinstance(obj, bytes):
+ obj = str(obj, 'UTF-8')
+ assert isinstance(obj, str)
+ return obj
+else:
+ def tobytes(obj):
+ if isinstance(obj, unicode):
+ obj = obj.encode('UTF-8')
+ assert isinstance(obj, str)
+ return obj
+ def totext(obj):
+ if isinstance(obj, str):
+ obj = unicode(obj, 'UTF-8')
+ assert isinstance(obj, unicode)
+ return obj
+
+def oswritebytes(fd, obj):
+ os.write(fd, tobytes(obj))
+
+class TestTextIO:
+ def test_text(self):
+ f = py.io.TextIO()
+ f.write("hello")
+ s = f.getvalue()
+ assert s == "hello"
+ f.close()
+
+ def test_unicode_and_str_mixture(self):
+ f = py.io.TextIO()
+ if sys.version_info >= (3,0):
+ f.write("\u00f6")
+ py.test.raises(TypeError, "f.write(bytes('hello', 'UTF-8'))")
+ else:
+ f.write(unicode("\u00f6", 'UTF-8'))
+ f.write("hello") # bytes
+ s = f.getvalue()
+ f.close()
+ assert isinstance(s, unicode)
+
+def test_bytes_io():
+ f = py.io.BytesIO()
+ f.write(tobytes("hello"))
+ py.test.raises(TypeError, "f.write(totext('hello'))")
+ s = f.getvalue()
+ assert s == tobytes("hello")
+
+def test_dontreadfrominput():
+ from py._io.capture import DontReadFromInput
+ f = DontReadFromInput()
+ assert not f.isatty()
+ py.test.raises(IOError, f.read)
+ py.test.raises(IOError, f.readlines)
+ py.test.raises(IOError, iter, f)
+ py.test.raises(ValueError, f.fileno)
+ f.close() # just for completeness
+
+def pytest_funcarg__tmpfile(request):
+ testdir = request.getfuncargvalue("testdir")
+ f = testdir.makepyfile("").open('wb+')
+ request.addfinalizer(f.close)
+ return f
+
+@needsdup
+def test_dupfile(tmpfile):
+ flist = []
+ for i in range(5):
+ nf = py.io.dupfile(tmpfile, encoding="utf-8")
+ assert nf != tmpfile
+ assert nf.fileno() != tmpfile.fileno()
+ assert nf not in flist
+ print_(i, end="", file=nf)
+ flist.append(nf)
+ for i in range(5):
+ f = flist[i]
+ f.close()
+ tmpfile.seek(0)
+ s = tmpfile.read()
+ assert "01234" in repr(s)
+ tmpfile.close()
+
+def test_dupfile_no_mode():
+ """
+ dupfile should trap an AttributeError and return f if no mode is supplied.
+ """
+ class SomeFileWrapper(object):
+ "An object with a fileno method but no mode attribute"
+ def fileno(self):
+ return 1
+ tmpfile = SomeFileWrapper()
+ assert py.io.dupfile(tmpfile) is tmpfile
+ with py.test.raises(AttributeError):
+ py.io.dupfile(tmpfile, raising=True)
+
+def lsof_check(func):
+ pid = os.getpid()
+ try:
+ out = py.process.cmdexec("lsof -p %d" % pid)
+ except py.process.cmdexec.Error:
+ py.test.skip("could not run 'lsof'")
+ func()
+ out2 = py.process.cmdexec("lsof -p %d" % pid)
+ len1 = len([x for x in out.split("\n") if "REG" in x])
+ len2 = len([x for x in out2.split("\n") if "REG" in x])
+ assert len2 < len1 + 3, out2
+
+class TestFDCapture:
+ pytestmark = needsdup
+
+ def test_not_now(self, tmpfile):
+ fd = tmpfile.fileno()
+ cap = py.io.FDCapture(fd, now=False)
+ data = tobytes("hello")
+ os.write(fd, data)
+ f = cap.done()
+ s = f.read()
+ assert not s
+ cap = py.io.FDCapture(fd, now=False)
+ cap.start()
+ os.write(fd, data)
+ f = cap.done()
+ s = f.read()
+ assert s == "hello"
+
+ def test_simple(self, tmpfile):
+ fd = tmpfile.fileno()
+ cap = py.io.FDCapture(fd)
+ data = tobytes("hello")
+ os.write(fd, data)
+ f = cap.done()
+ s = f.read()
+ assert s == "hello"
+ f.close()
+
+ def test_simple_many(self, tmpfile):
+ for i in range(10):
+ self.test_simple(tmpfile)
+
+ def test_simple_many_check_open_files(self, tmpfile):
+ lsof_check(lambda: self.test_simple_many(tmpfile))
+
+ def test_simple_fail_second_start(self, tmpfile):
+ fd = tmpfile.fileno()
+ cap = py.io.FDCapture(fd)
+ f = cap.done()
+ py.test.raises(ValueError, cap.start)
+ f.close()
+
+ def test_stderr(self):
+ cap = py.io.FDCapture(2, patchsys=True)
+ print_("hello", file=sys.stderr)
+ f = cap.done()
+ s = f.read()
+ assert s == "hello\n"
+
+ def test_stdin(self, tmpfile):
+ tmpfile.write(tobytes("3"))
+ tmpfile.seek(0)
+ cap = py.io.FDCapture(0, tmpfile=tmpfile)
+ # check with os.read() directly instead of raw_input(), because
+ # sys.stdin itself may be redirected (as py.test now does by default)
+ x = os.read(0, 100).strip()
+ f = cap.done()
+ assert x == tobytes("3")
+
+ def test_writeorg(self, tmpfile):
+ data1, data2 = tobytes("foo"), tobytes("bar")
+ try:
+ cap = py.io.FDCapture(tmpfile.fileno())
+ tmpfile.write(data1)
+ cap.writeorg(data2)
+ finally:
+ tmpfile.close()
+ f = cap.done()
+ scap = f.read()
+ assert scap == totext(data1)
+ stmp = open(tmpfile.name, 'rb').read()
+ assert stmp == data2
+
+
+class TestStdCapture:
+ def getcapture(self, **kw):
+ return py.io.StdCapture(**kw)
+
+ def test_capturing_done_simple(self):
+ cap = self.getcapture()
+ sys.stdout.write("hello")
+ sys.stderr.write("world")
+ outfile, errfile = cap.done()
+ s = outfile.read()
+ assert s == "hello"
+ s = errfile.read()
+ assert s == "world"
+
+ def test_capturing_reset_simple(self):
+ cap = self.getcapture()
+ print("hello world")
+ sys.stderr.write("hello error\n")
+ out, err = cap.reset()
+ assert out == "hello world\n"
+ assert err == "hello error\n"
+
+ def test_capturing_readouterr(self):
+ cap = self.getcapture()
+ try:
+ print ("hello world")
+ sys.stderr.write("hello error\n")
+ out, err = cap.readouterr()
+ assert out == "hello world\n"
+ assert err == "hello error\n"
+ sys.stderr.write("error2")
+ finally:
+ out, err = cap.reset()
+ assert err == "error2"
+
+ def test_capturing_readouterr_unicode(self):
+ cap = self.getcapture()
+ print ("hx\xc4\x85\xc4\x87")
+ out, err = cap.readouterr()
+ assert out == py.builtin._totext("hx\xc4\x85\xc4\x87\n", "utf8")
+
+ @py.test.mark.skipif('sys.version_info >= (3,)',
+ reason='text output different for bytes on python3')
+ def test_capturing_readouterr_decode_error_handling(self):
+ cap = self.getcapture()
+ # triggered a internal error in pytest
+ print('\xa6')
+ out, err = cap.readouterr()
+ assert out == py.builtin._totext('\ufffd\n', 'unicode-escape')
+
+ def test_capturing_mixed(self):
+ cap = self.getcapture(mixed=True)
+ sys.stdout.write("hello ")
+ sys.stderr.write("world")
+ sys.stdout.write(".")
+ out, err = cap.reset()
+ assert out.strip() == "hello world."
+ assert not err
+
+ def test_reset_twice_error(self):
+ cap = self.getcapture()
+ print ("hello")
+ out, err = cap.reset()
+ py.test.raises(ValueError, cap.reset)
+ assert out == "hello\n"
+ assert not err
+
+ def test_capturing_modify_sysouterr_in_between(self):
+ oldout = sys.stdout
+ olderr = sys.stderr
+ cap = self.getcapture()
+ sys.stdout.write("hello")
+ sys.stderr.write("world")
+ sys.stdout = py.io.TextIO()
+ sys.stderr = py.io.TextIO()
+ print ("not seen")
+ sys.stderr.write("not seen\n")
+ out, err = cap.reset()
+ assert out == "hello"
+ assert err == "world"
+ assert sys.stdout == oldout
+ assert sys.stderr == olderr
+
+ def test_capturing_error_recursive(self):
+ cap1 = self.getcapture()
+ print ("cap1")
+ cap2 = self.getcapture()
+ print ("cap2")
+ out2, err2 = cap2.reset()
+ out1, err1 = cap1.reset()
+ assert out1 == "cap1\n"
+ assert out2 == "cap2\n"
+
+ def test_just_out_capture(self):
+ cap = self.getcapture(out=True, err=False)
+ sys.stdout.write("hello")
+ sys.stderr.write("world")
+ out, err = cap.reset()
+ assert out == "hello"
+ assert not err
+
+ def test_just_err_capture(self):
+ cap = self.getcapture(out=False, err=True)
+ sys.stdout.write("hello")
+ sys.stderr.write("world")
+ out, err = cap.reset()
+ assert err == "world"
+ assert not out
+
+ def test_stdin_restored(self):
+ old = sys.stdin
+ cap = self.getcapture(in_=True)
+ newstdin = sys.stdin
+ out, err = cap.reset()
+ assert newstdin != sys.stdin
+ assert sys.stdin is old
+
+ def test_stdin_nulled_by_default(self):
+ print ("XXX this test may well hang instead of crashing")
+ print ("XXX which indicates an error in the underlying capturing")
+ print ("XXX mechanisms")
+ cap = self.getcapture()
+ py.test.raises(IOError, "sys.stdin.read()")
+ out, err = cap.reset()
+
+ def test_suspend_resume(self):
+ cap = self.getcapture(out=True, err=False, in_=False)
+ try:
+ print ("hello")
+ sys.stderr.write("error\n")
+ out, err = cap.suspend()
+ assert out == "hello\n"
+ assert not err
+ print ("in between")
+ sys.stderr.write("in between\n")
+ cap.resume()
+ print ("after")
+ sys.stderr.write("error_after\n")
+ finally:
+ out, err = cap.reset()
+ assert out == "after\n"
+ assert not err
+
+class TestStdCaptureNotNow(TestStdCapture):
+ def getcapture(self, **kw):
+ kw['now'] = False
+ cap = py.io.StdCapture(**kw)
+ cap.startall()
+ return cap
+
+class TestStdCaptureFD(TestStdCapture):
+ pytestmark = needsdup
+
+ def getcapture(self, **kw):
+ return py.io.StdCaptureFD(**kw)
+
+ def test_intermingling(self):
+ cap = self.getcapture()
+ oswritebytes(1, "1")
+ sys.stdout.write(str(2))
+ sys.stdout.flush()
+ oswritebytes(1, "3")
+ oswritebytes(2, "a")
+ sys.stderr.write("b")
+ sys.stderr.flush()
+ oswritebytes(2, "c")
+ out, err = cap.reset()
+ assert out == "123"
+ assert err == "abc"
+
+ def test_callcapture(self):
+ def func(x, y):
+ print (x)
+ py.std.sys.stderr.write(str(y))
+ return 42
+
+ res, out, err = py.io.StdCaptureFD.call(func, 3, y=4)
+ assert res == 42
+ assert out.startswith("3")
+ assert err.startswith("4")
+
+ def test_many(self, capfd):
+ def f():
+ for i in range(10):
+ cap = py.io.StdCaptureFD()
+ cap.reset()
+ lsof_check(f)
+
+class TestStdCaptureFDNotNow(TestStdCaptureFD):
+ pytestmark = needsdup
+
+ def getcapture(self, **kw):
+ kw['now'] = False
+ cap = py.io.StdCaptureFD(**kw)
+ cap.startall()
+ return cap
+
+@needsdup
+def test_stdcapture_fd_tmpfile(tmpfile):
+ capfd = py.io.StdCaptureFD(out=tmpfile)
+ os.write(1, "hello".encode("ascii"))
+ os.write(2, "world".encode("ascii"))
+ outf, errf = capfd.done()
+ assert outf == tmpfile
+
+class TestStdCaptureFDinvalidFD:
+ pytestmark = needsdup
+ def test_stdcapture_fd_invalid_fd(self, testdir):
+ testdir.makepyfile("""
+ import py, os
+ def test_stdout():
+ os.close(1)
+ cap = py.io.StdCaptureFD(out=True, err=False, in_=False)
+ cap.done()
+ def test_stderr():
+ os.close(2)
+ cap = py.io.StdCaptureFD(out=False, err=True, in_=False)
+ cap.done()
+ def test_stdin():
+ os.close(0)
+ cap = py.io.StdCaptureFD(out=False, err=False, in_=True)
+ cap.done()
+ """)
+ result = testdir.runpytest("--capture=fd")
+ assert result.ret == 0
+ assert result.parseoutcomes()['passed'] == 3
+
+def test_capture_not_started_but_reset():
+ capsys = py.io.StdCapture(now=False)
+ capsys.done()
+ capsys.done()
+ capsys.reset()
+
+@needsdup
+def test_capture_no_sys():
+ capsys = py.io.StdCapture()
+ try:
+ cap = py.io.StdCaptureFD(patchsys=False)
+ sys.stdout.write("hello")
+ sys.stderr.write("world")
+ oswritebytes(1, "1")
+ oswritebytes(2, "2")
+ out, err = cap.reset()
+ assert out == "1"
+ assert err == "2"
+ finally:
+ capsys.reset()
+
+@needsdup
+def test_callcapture_nofd():
+ def func(x, y):
+ oswritebytes(1, "hello")
+ oswritebytes(2, "hello")
+ print (x)
+ sys.stderr.write(str(y))
+ return 42
+
+ capfd = py.io.StdCaptureFD(patchsys=False)
+ try:
+ res, out, err = py.io.StdCapture.call(func, 3, y=4)
+ finally:
+ capfd.reset()
+ assert res == 42
+ assert out.startswith("3")
+ assert err.startswith("4")
+
+@needsdup
+(a)py.test.mark.multi(use=[True, False])
+def test_fdcapture_tmpfile_remains_the_same(tmpfile, use):
+ if not use:
+ tmpfile = True
+ cap = py.io.StdCaptureFD(out=False, err=tmpfile, now=False)
+ cap.startall()
+ capfile = cap.err.tmpfile
+ cap.suspend()
+ cap.resume()
+ capfile2 = cap.err.tmpfile
+ assert capfile2 == capfile
+
+(a)py.test.mark.multi(method=['StdCapture', 'StdCaptureFD'])
+def test_capturing_and_logging_fundamentals(testdir, method):
+ if method == "StdCaptureFD" and not hasattr(os, 'dup'):
+ py.test.skip("need os.dup")
+ # here we check a fundamental feature
+ p = testdir.makepyfile("""
+ import sys, os
+ import py, logging
+ cap = py.io.%s(out=False, in_=False)
+
+ logging.warn("hello1")
+ outerr = cap.suspend()
+ print ("suspend, captured %%s" %%(outerr,))
+ logging.warn("hello2")
+
+ cap.resume()
+ logging.warn("hello3")
+
+ outerr = cap.suspend()
+ print ("suspend2, captured %%s" %% (outerr,))
+ """ % (method,))
+ result = testdir.runpython(p)
+ result.stdout.fnmatch_lines([
+ "suspend, captured*hello1*",
+ "suspend2, captured*hello2*WARNING:root:hello3*",
+ ])
+ assert "atexit" not in result.stderr.str()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/testing/path/test_local.py new/py-1.4.22/testing/path/test_local.py
--- old/py-1.4.20/testing/path/test_local.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/testing/path/test_local.py 2014-07-17 10:51:42.000000000 +0200
@@ -295,6 +295,14 @@
class TestExecutionOnWindows:
pytestmark = win32only
+ def test_sysfind_bat_exe_before(self, tmpdir, monkeypatch):
+ monkeypatch.setenv("PATH", str(tmpdir), prepend=os.pathsep)
+ tmpdir.ensure("hello")
+ h = tmpdir.ensure("hello.bat")
+ x = py.path.local.sysfind("hello")
+ assert x == h
+
+
class TestExecution:
pytestmark = skiponwin32
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.20/testing/process/test_forkedfunc.py new/py-1.4.22/testing/process/test_forkedfunc.py
--- old/py-1.4.20/testing/process/test_forkedfunc.py 2014-01-29 13:16:52.000000000 +0100
+++ new/py-1.4.22/testing/process/test_forkedfunc.py 2014-07-17 10:51:42.000000000 +0200
@@ -1,7 +1,9 @@
+import pytest
import py, sys, os
pytestmark = py.test.mark.skipif("not hasattr(os, 'fork')")
+
def test_waitfinish_removes_tempdir():
ff = py.process.ForkedFunc(boxf1)
assert ff.tempdir.check()
@@ -50,6 +52,21 @@
assert result.signal == 0
assert result.retval == 2
+def test_forkedfunc_on_fds_output():
+ result = py.process.ForkedFunc(boxf3).waitfinish()
+ assert result.signal == 11
+ assert result.out == "s"
+
+
+def test_forkedfunc_on_stdout():
+ def boxf3():
+ import sys
+ sys.stdout.write("hello\n")
+ os.kill(os.getpid(), 11)
+ result = py.process.ForkedFunc(boxf3).waitfinish()
+ assert result.signal == 11
+ assert result.out == "hello\n"
+
def test_forkedfunc_signal():
result = py.process.ForkedFunc(boxseg).waitfinish()
assert result.retval is None
@@ -104,6 +121,26 @@
assert result.signal == 15
+def test_hooks(monkeypatch):
+ def _boxed():
+ return 1
+
+ def _on_start():
+ sys.stdout.write("some out\n")
+ sys.stdout.flush()
+
+ def _on_exit():
+ sys.stderr.write("some err\n")
+ sys.stderr.flush()
+
+ result = py.process.ForkedFunc(_boxed, child_on_start=_on_start,
+ child_on_exit=_on_exit).waitfinish()
+ assert result.out == "some out\n"
+ assert result.err == "some err\n"
+ assert result.exitstatus == 0
+ assert result.signal == 0
+ assert result.retval == 1
+
# ======================================================================
# examples
@@ -120,6 +157,10 @@
os.write(2, "someerr".encode('ascii'))
return 2
+def boxf3():
+ os.write(1, "s".encode('ascii'))
+ os.kill(os.getpid(), 11)
+
def boxseg():
os.kill(os.getpid(), 11)
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0