Bug 1290388 - when files affected by install are affected in pre, the changes are ignored
Summary: when files affected by install are affected in pre, the changes are ignored
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-10 11:39 UTC by jiri vanek
Modified: 2016-07-04 18:52 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-15 08:43:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.