Ticket #3750: 0001-Adding-support-for-RPM-transaction-scripts.patch

File 0001-Adding-support-for-RPM-transaction-scripts.patch, 4.3 KB (added by jtyr, 5 years ago)

0001-Adding-support-for-RPM-transaction-scripts.patch

  • src/vfs/extfs/helpers/rpm

    From 13b8a80b3f2f35f498f4ad264cc9ddeb9c0b9d1e Mon Sep 17 00:00:00 2001
    From: Jiri Tyr <jiri.tyr@gmail.com>
    Date: Thu, 29 Dec 2016 17:59:43 +0000
    Subject: [PATCH] Adding support for RPM transaction scripts
    
    Adding support for PRETRANS, PRETRANSPROG, POSTTRANS and
    POSTTRANSPROG RPM tags which allow the relevant scripts to be visible
    in the INFO/SCRIPTS vfs directory.
    
    Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
    ---
     src/vfs/extfs/helpers/rpm | 16 ++++++++++++++--
     1 file changed, 14 insertions(+), 2 deletions(-)
    
    diff --git a/src/vfs/extfs/helpers/rpm b/src/vfs/extfs/helpers/rpm
    index 4a01453b9..c0d07a00a 100755
    a b  
    3030#             add support for PREINPROG/POSTINPROG/PREUNPROG/POSTUNPROG 
    3131#             add support for VERIFYSCRIPTPROG 
    3232#             add support for TRIGGERSCRIPTS/TRIGGERSCRIPTPROG 
     33#  Jiri Tyr <jiri.tyr@gmail.com> 
     34#       2016: add support for PRETRANS/PRETRANSPROG/POSTTRANS/POSTTRANSPROG 
    3335# 
    3436#  This file is part of the Midnight Commander. 
    3537# 
    mcrpmfs_list_fastRPM () 
    145147    echo "$FILEPREF 0 $DATE INFO/DESCRIPTION" 
    146148    echo "$FILEPREF 0 $DATE INFO/SUMMARY" 
    147149    echo "dr-xr-xr-x   1 root     root     0 $DATE INFO/SCRIPTS" 
     150    echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PRETRANS" 
     151    echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTTRANS" 
    148152    echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREIN" 
    149153    echo "$FILEPREF 0 $DATE INFO/SCRIPTS/POSTIN" 
    150154    echo "$FILEPREF 0 $DATE INFO/SCRIPTS/PREUN" 
    mcrpmfs_list_fullRPM () 
    170174    mcrpmfs_printOneMetaInfo "INFO/DESCRIPTION" "DESCRIPTION" 
    171175    mcrpmfs_printOneMetaInfo "INFO/SUMMARY" "SUMMARY" 
    172176 
    173     if test "`mcrpmfs_getRawOneTag \"%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}%{TRIGGERSCRIPTS}\"`" != "(none)(none)(none)(none)(none)(none)"; then 
     177    if test "`mcrpmfs_getRawOneTag \"%{RPMTAG_PRETRANS}%{RPMTAG_POSTTRANS}%{RPMTAG_PREIN}%{RPMTAG_POSTIN}%{RPMTAG_PREUN}%{RPMTAG_POSTUN}%{VERIFYSCRIPT}%{TRIGGERSCRIPTS}\"`" != "(none)(none)(none)(none)(none)(none)(none)(none)"; then 
     178        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PRETRANS" "RPMTAG_PRETRANS" "raw" 
     179        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTTRANS" "RPMTAG_POSTTRANS" "raw" 
    174180        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREIN" "RPMTAG_PREIN" "raw" 
    175181        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTIN" "RPMTAG_POSTIN" "raw" 
    176182        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREUN" "RPMTAG_PREUN" "raw" 
    mcrpmfs_list_fullRPM () 
    180186        echo "$FILEPREF 0 $DATE INFO/SCRIPTS/ALL" 
    181187    fi 
    182188 
    183     if test "`mcrpmfs_getRawOneTag \"%{RPMTAG_PREINPROG}%{RPMTAG_POSTINPROG}%{RPMTAG_PREUNPROG}%{RPMTAG_POSTUNPROG}%{VERIFYSCRIPTPROG}%{TRIGGERSCRIPTPROG}\"`" != "(none)(none)(none)(none)(none)(none)"; then 
     189    if test "`mcrpmfs_getRawOneTag \"%{RPMTAG_PRETRANSPROG}%{RPMTAG_POSTTRANSPROG}%{RPMTAG_PREINPROG}%{RPMTAG_POSTINPROG}%{RPMTAG_PREUNPROG}%{RPMTAG_POSTUNPROG}%{VERIFYSCRIPTPROG}%{TRIGGERSCRIPTPROG}\"`" != "(none)(none)(none)(none)(none)(none)(none)(none)"; then 
     190        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PRETRANSPROG" "RPMTAG_PRETRANSPROG" "raw" 
     191        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTTRANSPROG" "RPMTAG_POSTTRANSPROG" "raw" 
    184192        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREINPROG" "RPMTAG_PREINPROG" "raw" 
    185193        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/POSTINPROG" "RPMTAG_POSTINPROG" "raw" 
    186194        mcrpmfs_printOneMetaInfo "INFO/SCRIPTS/PREUNPROG" "RPMTAG_PREUNPROG" "raw" 
    mcrpmfs_copyout () 
    295303        INFO/RPMVERSION)        mcrpmfs_getRawOneTag "%{RPMVERSION}\n" >"$2"; exit 0;; 
    296304        INFO/REQUIRES)          mcrpmfs_getRawOneTag "[%{REQUIRENAME} %{REQUIREFLAGS:depflags} %{REQUIREVERSION}\n]" >"$2"; exit 0;; 
    297305        INFO/PROVIDES)          mcrpmfs_getRawOneTag "[%{PROVIDES} %{PROVIDEFLAGS:depflags} %{PROVIDEVERSION}\n]" >"$2"; exit 0;; 
     306        INFO/SCRIPTS/PRETRANS)  mcrpmfs_getRawOneTag "%{RPMTAG_PRETRANS}\n" >"$2"; exit 0;; 
     307        INFO/SCRIPTS/PRETRANSPROG)      mcrpmfs_getRawOneTag "%{RPMTAG_PRETRANSPROG}\n" >"$2"; exit 0;; 
     308        INFO/SCRIPTS/POSTTRANS) mcrpmfs_getRawOneTag "%{RPMTAG_POSTTRANS}\n" >"$2"; exit 0;; 
     309        INFO/SCRIPTS/POSTTRANSPROG)     mcrpmfs_getRawOneTag "%{RPMTAG_POSTTRANSPROG}\n" >"$2"; exit 0;; 
    298310        INFO/SCRIPTS/PREIN)     mcrpmfs_getRawOneTag "%{RPMTAG_PREIN}\n" >"$2"; exit 0;; 
    299311        INFO/SCRIPTS/PREINPROG) mcrpmfs_getRawOneTag "%{RPMTAG_PREINPROG}\n" >"$2"; exit 0;; 
    300312        INFO/SCRIPTS/POSTIN)    mcrpmfs_getRawOneTag "%{RPMTAG_POSTIN}\n" >"$2"; exit 0;;