View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012556CMakeCPackpublic2011-11-03 18:072012-03-27 02:26
ReporterChip Christian 
Assigned ToEric NOULARD 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformx86_64OSRHELOS Version6.0
Product VersionCMake 2.8.6 
Target VersionCMake 2.8.7Fixed in VersionCMake 2.8.7 
Summary0012556: CPackRPM: pre/post-install/uninstall scripts leak from one COMPONENT to the next
DescriptionI have 4 COMPONENTS. One of them needs a pre-uninstall and a post-install script

Once the scripts are referenced all subsequent COMPONENTS get stuck with the same scripts.
Steps To Reproduce    SET(CPACK_COMPONENTS_ALL libraries devel internal perl)

    SET(CPACK_RPM_libraries_PRE_UNINSTALL_SCRIPT_FILE
        ${CMAKE_CURRENT_SOURCE_DIR}/rpm/pre-uninstall)
    SET(CPACK_RPM_libraries_POST_INSTALL_SCRIPT_FILE
        ${CMAKE_CURRENT_SOURCE_DIR}/rpm/post-install)
    SET(CPACK_PACKAGE_FILE_NAME
            ${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${ARCHITECTURE})
Additional InformationTo fix, apply this patch:

--- /usr/share/cmake/Modules/CPackRPM.cmake 2011-10-04 11:09:24.000000000 -0500
+++ cmake/CPackRPM.cmake 2011-11-03 09:59:36.216592884 -0500
@@ -421,6 +421,8 @@
 # The refered script file(s) will be read and directly
 # put after the %post or %postun section
 if(CPACK_RPM_PACKAGE_COMPONENT)
+ set(CPACK_RPM_SPEC_POSTUNINSTALL "")
+ set(CPACK_RPM_SPEC_POSTINSTALL "")
   if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_INSTALL_SCRIPT_FILE)
     set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_INSTALL_SCRIPT_FILE})
   else()
@@ -457,6 +459,8 @@
 # The refered script file(s) will be read and directly
 # put after the %pre or %preun section
 if(CPACK_RPM_PACKAGE_COMPONENT)
+ set(CPACK_RPM_SPEC_PREUNINSTALL "")
+ set(CPACK_RPM_SPEC_PREINSTALL "")
   if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
     set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
   else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027721)
Eric NOULARD (developer)
2011-11-03 18:13

Thank for digging this out,
patch seems reasonable;

I'll look into this rapidly.
Tomorrow or this WE most probably.
(0027730)
Eric NOULARD (developer)
2011-11-05 06:46

Hi Chip,

I did just push a modified equivalent of your patch to next.
Fetching upstream next
Merge topic 'CPackRPM-fix12556' into next

9066886 CPackRPM fix 0012556 and enhance documentation
(0028976)
Eric NOULARD (developer)
2012-03-27 02:26

Included in 2.8.7

 Issue History
Date Modified Username Field Change
2011-11-03 18:07 Chip Christian New Issue
2011-11-03 18:10 Eric NOULARD Assigned To => Eric NOULARD
2011-11-03 18:10 Eric NOULARD Status new => assigned
2011-11-03 18:13 Eric NOULARD Note Added: 0027721
2011-11-05 06:46 Eric NOULARD Target Version => CMake 2.8.7
2011-11-05 06:46 Eric NOULARD Note Added: 0027730
2011-11-05 06:46 Eric NOULARD Status assigned => resolved
2011-11-05 06:46 Eric NOULARD Fixed in Version => CMake 2.8.7
2011-11-05 06:46 Eric NOULARD Resolution open => fixed
2012-03-27 02:26 Eric NOULARD Note Added: 0028976
2012-03-27 02:26 Eric NOULARD Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team