Ver Fonte

ENH: try to fix compress failure

Bill Hoffman há 19 anos atrás
pai
commit
fe3d8078c5

+ 8 - 2
Tests/SimpleInstall/CMakeLists.txt

@@ -176,18 +176,24 @@ IF(WIN32 AND NOT UNIX)
     SET(CPACK_GENERATOR TGZ)
     SET(CPACK_GENERATOR TGZ)
   ENDIF(NOT NSIS_MAKENSIS)
   ENDIF(NOT NSIS_MAKENSIS)
 ENDIF(WIN32 AND NOT UNIX)
 ENDIF(WIN32 AND NOT UNIX)
-
 IF(UNIX AND NOT APPLE)
 IF(UNIX AND NOT APPLE)
   SET(CPACK_GENERATOR "TGZ;STGZ")
   SET(CPACK_GENERATOR "TGZ;STGZ")
   FIND_PROGRAM(found_compress
   FIND_PROGRAM(found_compress
     NAMES compress)
     NAMES compress)
   IF(found_compress)
   IF(found_compress)
-    EXECUTE_PROCESS(COMMAND file ${found_compress} OUTPUT_VARIABLE output)
+    FIND_PROGRAM(file_command NAMES file)
+    IF(NOT file_command)
+      set(file_command file)
+    ENDIF(NOT file_command)
+    EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress}
+      OUTPUT_VARIABLE output)
     if(NOT "${output}" MATCHES "script")
     if(NOT "${output}" MATCHES "script")
       message("compress found and it was not a script")
       message("compress found and it was not a script")
+      message("output from file command: [${output}]")
       SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
       SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
     else(NOT "${output}" MATCHES "script")
     else(NOT "${output}" MATCHES "script")
       message("compress found, but it was a script so dont use it")
       message("compress found, but it was a script so dont use it")
+      message("output from file command: [${output}]")
     endif(NOT "${output}" MATCHES "script")
     endif(NOT "${output}" MATCHES "script")
   ENDIF(found_compress)
   ENDIF(found_compress)
   FIND_PROGRAM(found_bz2
   FIND_PROGRAM(found_bz2

+ 8 - 2
Tests/SimpleInstallS2/CMakeLists.txt

@@ -176,18 +176,24 @@ IF(WIN32 AND NOT UNIX)
     SET(CPACK_GENERATOR TGZ)
     SET(CPACK_GENERATOR TGZ)
   ENDIF(NOT NSIS_MAKENSIS)
   ENDIF(NOT NSIS_MAKENSIS)
 ENDIF(WIN32 AND NOT UNIX)
 ENDIF(WIN32 AND NOT UNIX)
-
 IF(UNIX AND NOT APPLE)
 IF(UNIX AND NOT APPLE)
   SET(CPACK_GENERATOR "TGZ;STGZ")
   SET(CPACK_GENERATOR "TGZ;STGZ")
   FIND_PROGRAM(found_compress
   FIND_PROGRAM(found_compress
     NAMES compress)
     NAMES compress)
   IF(found_compress)
   IF(found_compress)
-    EXECUTE_PROCESS(COMMAND file ${found_compress} OUTPUT_VARIABLE output)
+    FIND_PROGRAM(file_command NAMES file)
+    IF(NOT file_command)
+      set(file_command file)
+    ENDIF(NOT file_command)
+    EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress}
+      OUTPUT_VARIABLE output)
     if(NOT "${output}" MATCHES "script")
     if(NOT "${output}" MATCHES "script")
       message("compress found and it was not a script")
       message("compress found and it was not a script")
+      message("output from file command: [${output}]")
       SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
       SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ")
     else(NOT "${output}" MATCHES "script")
     else(NOT "${output}" MATCHES "script")
       message("compress found, but it was a script so dont use it")
       message("compress found, but it was a script so dont use it")
+      message("output from file command: [${output}]")
     endif(NOT "${output}" MATCHES "script")
     endif(NOT "${output}" MATCHES "script")
   ENDIF(found_compress)
   ENDIF(found_compress)
   FIND_PROGRAM(found_bz2
   FIND_PROGRAM(found_bz2