Bug 1290388

Summary: when files affected by install are affected in pre, the changes are ignored
Product: [Fedora] Fedora Reporter: jiri vanek <jvanek>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: rawhideCC: ffesti, jzeleny, lkardos, novyjindrich, packaging-team-maint, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-15 08:43:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jiri vanek 2015-12-10 11:39:26 UTC
Description of problem:

Lets have this imaginary scenario scenario.
Package have config(norepalce) files.
%pretrans script do modification to this file
during install, the file is kept, and new one saveds as .rpmnew
  but
Package have config(norepalce) files.
%pre script do modification to this file
during install, the file is replaced by fresh file


Now real life issue.
OpenJDK is installing itself each time to NVRA folder. To persist  config files, in pretrans, there is nasty lua script to transfer them form latrest installtion to future folder:
http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/tree/java-1.8.0-openjdk.spec?h=f23&id=c08d1fcc8822857a97d1cb2b868561e22a00aebd#n1480

It is quite painful, and so in rawhide, to make it at least a bit maintainable, I moved the lua scripts to separate project
 - https://hg.fedorahosted.org/hg/copy_jdk_configs/
Packed this project
 - http://koji.fedoraproject.org/koji/packageinfo?packageID=21499
Made remove lua script from spec pretransa, and jsut call this script in pre
 - http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/commit/?id=4cecfa01fbd65fca9f4a32fb5fd5f7feb94fdd20

Alas, I forgot Why the lua was orriginally in pretrans instead of pre.
When the script is in pre, the issue this bug is addressing occure.

So I moved the call to extracted lua back to pretrans
 - http://pkgs.fedoraproject.org/cgit/java-1.8.0-openjdk.git/commit/?id=c12577c604dbc86753fdfbf61d1c67e6a1ddeaf4

And now I can not depnd on that copy-jdk-configs because requires(pretrans) fails, if the package is not installed before the transaction itself.

Version-Release number of selected component (if applicable):
all fedoras, all rhels, all known versions of RPM ( So I guess it is intentional behavior, but I'm wondering why, and if it is documented)

How reproducible:
always

Actual results:
Files modified in pre are not counted by rpm install

Expected results:
Files modified in pre counted by rpm install in same way as if they are modified in pretrans.

Comment 2 Ľuboš Kardoš 2015-12-15 08:43:31 UTC
During discussion with Jiri we found some solution for what he tries to achieve and we agreed that we can close this bug.