~rpm5/rpm/rpm.org

Viewing all changes in revision 12820.

  • Committer: Florian Festi
  • Author(s): Jean Delvare
  • Date: 2015-01-26 13:14:52 UTC
  • Revision ID: git-v1:6845efae0dcc005f3bbb4cd4179a3ccce9d9638c
Read uncompressed patches from stdin

Since commit 15e9e1ff64aaf986ab0dd97b9b12c3d4fb22a484 ("Simplify
doPatch()" in May 2008), uncompressed patches are read with "cat" then
piped to "patch". The idea was to simplify the code, however this
change had consequences which I suspect were not considered.

The first consequence is a performance regression. Forking and passing
the data through a pipe is much more expensive than reading from
stdin. For packages with a lot of patches, this makes a significant
difference.

A second issue is the integration with other tools. I am working on
quilt. Quilt has a "setup" command which reads a rpm spec file and
produces a compliant working tree with all patches ready to be
applied. This is implemented with rpmbuild as the backend. We
intercept the calls to patch to record the name and sequencing of the
patch files. If the file is read from stdin, we can obtain its name
directly. But if it comes through a pipe, we have to compare the
md5sum of the contents with the md5sum of all candidates in
$RPM_SOURCE_DIR. Again this is much more expensive.

For these reasons I would like to ask that commit
15e9e1ff64aaf986ab0dd97b9b12c3d4fb22a484 is partly reverted. In my
experience, uncompressed patches account for 99% of patches in rpm
packages so I believe it makes sense to optimize for this case.

Signed-off-by: Jean Delvare <jdelvare@suse.de>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: