How do I use rpm to update/replace existing files?

后端 未结 3 948
刺人心
刺人心 2021-01-01 13:38

I have several applications that I wish to deploy using rpm. Some of the files in my application deployments override files from other deployed packages. Simply including

3条回答
  •  感动是毒
    2021-01-01 14:32

    See here for more info on RPM %files directives:

    http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html

    You can use the arguments from the %post and %pre sections in the RPM scriptlets to determine if you are installing, upgrading or removing packages.

    If $1 is 0 - then we're removing old stuff. Targeting 0 packages installed. If $1 is 1 - then we're installing new stuff. Targeting a total of 1 package to be installed. If $1 is 2 or more - then we're upgrading this package and $1 represents the number of packages already installed.

    These sections help with managing files among the versions. Keep track of what you're doing between versions and consider what one might do if they were to skip a version or two.

    Have consideration for these things and you should be good to go!

提交回复
热议问题