posts - 88, comments - 3, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          scriptlets of RPM

          Posted on 2012-07-06 13:41 Milo的海域 閱讀(417) 評論(0)  編輯  收藏 所屬分類: Linux
          The scriptlets also take an argument, passed into them by the controlling rpmbuild process. This argument, accessed via $1 is the number of packages of this name which will be left on the system when the action completes, except for %pretrans and %posttrans which are always run with $1 as 0 (%pretrans and %posttrans are available in rpm 4.4 and later). So for the common case of install, upgrade, and uninstall we have:


          install upgrade uninstall
           %pretrans $1 == 0 $1 == 0 (N/A)
           %pre $1 == 1 $1 == 2 (N/A)
           %post $1 == 1 $1 == 2 (N/A)
           %preun (N/A) $1 == 1 $1 == 0
           %postun (N/A) $1 == 1 $1 == 0
           %posttrans $1 == 0 $1 == 0 (N/A)

          Scriptlets ordering

          The scriptlets in %pre and %post are respectively run before and after a package is installed.
          The scriptlets %preun and %postun are run before and after a package is uninstalled. The
          scriptlets %pretrans and %posttrans are run at start and end of a transaction.

          On upgrade
          , the scripts are run in the following order:

               %pretrans of new package
               %pre of new package
              (package install)
               %post of new package
               %triggerin of other packages (set off by installing new package)
               %triggerin of new package (if any are true)
               %triggerun of old package (if it's set off by uninstalling the old package)
               %triggerun of other packages (set off by uninstalling old package)
               %preun of old package
              (removal of old package)
               %postun of old package
               %triggerpostun of old package (if it's set off by uninstalling the old package)
               %triggerpostun of other packages (if they're setu off by uninstalling the old package)
               %posttrans of new package

          For detail, will ref:
          http://fedoraproject.org/wiki/Packaging:ScriptletSnippets

          主站蜘蛛池模板: 长泰县| 社旗县| 鄂托克前旗| 镇康县| 伊吾县| 罗山县| 许昌市| 香格里拉县| 牟定县| 玉龙| 博客| 巴彦县| 永安市| 分宜县| 太康县| 兴安县| 石首市| 罗山县| 虎林市| 姜堰市| 广灵县| 银川市| 日喀则市| 姚安县| 于都县| 伊宁县| 莱州市| 河北区| 台山市| 通州区| 从化市| 固安县| 东安县| 三江| 卢湾区| 南宁市| 普格县| 比如县| 故城县| 河北省| 台湾省|