0

Is it possible to access/utilize install files in an RPM from within the preinstall section.

My rpm package contains files separated by type of destination host that I would like to pull variables from and make decisions on during the preinstall. The preinstall will remain generic while the files could contain different settings for different packages. I would also like to be able to abort the install based on certain conditions set up by those values.

This seems impossible given that the rpm hasnt unpacked the files yet, I think, but after looking around Im unable to find anything one way or the other.

1 Answers1

0

I also believe it is impossible. I think you need a base package with those files you want to use in the preinstall, and a main package that requires the base. This way you will have the files you want in the preinstall phase.

Please note that you still cannot install different files based on data you found in the preinstall. At most you can delete unneeded files in the postinstall, but this is not a good practice. In this case it is better to create sub-packages, one for each type of host.

Eran Ben-Natan
  • 2,515
  • 2
  • 16
  • 19