From 83175e36587d50cb8bf870dd712a094b222082cd Mon Sep 17 00:00:00 2001 From: cubiclesoft Date: Wed, 3 Oct 2018 17:58:06 -0700 Subject: [PATCH] Fixed build issue on Mac OSX. --- installers/nix-tar-gz/package.php | 3 ++- installers/osx-tar-gz/package.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/installers/nix-tar-gz/package.php b/installers/nix-tar-gz/package.php index 88fc500..2638f80 100644 --- a/installers/nix-tar-gz/package.php +++ b/installers/nix-tar-gz/package.php @@ -15,6 +15,7 @@ // Determine the OS. $os = php_uname("s"); $windows = (strtoupper(substr($os, 0, 3)) == "WIN"); + $mac = (strtoupper(substr($os, 0, 6)) == "DARWIN"); if ($windows) echo "This script might not work as expected on Windows. Running this script via a reasonable Bash port (e.g. git bash) is recommended for tar/gzip support.\n\n"; @@ -79,7 +80,7 @@ echo "Generating " . $appname . "-" . $packageinfo["app_ver"] . "-linux.tar.gz...\n"; chdir($rootpath); @unlink($appname . "-" . $packageinfo["app_ver"] . "-linux.tar.gz"); - system("tar czvf " . escapeshellarg($appname . "-" . $packageinfo["app_ver"] . "-linux.tar.gz") . " --owner=0 --group=0 " . escapeshellarg($appname . "-" . $packageinfo["app_ver"] . "/")); + system("tar czvf " . escapeshellarg($appname . "-" . $packageinfo["app_ver"] . "-linux.tar.gz") . ($mac ? " " : " --owner=0 --group=0 ") . escapeshellarg($appname . "-" . $packageinfo["app_ver"] . "/")); echo "Cleaning up...\n"; DirHelper::Delete($stagingpath); diff --git a/installers/osx-tar-gz/package.php b/installers/osx-tar-gz/package.php index c7f0985..0eac80c 100644 --- a/installers/osx-tar-gz/package.php +++ b/installers/osx-tar-gz/package.php @@ -15,6 +15,7 @@ // Determine the OS. $os = php_uname("s"); $windows = (strtoupper(substr($os, 0, 3)) == "WIN"); + $mac = (strtoupper(substr($os, 0, 6)) == "DARWIN"); if ($windows) echo "This script might not work as expected on Windows. Running this script via a reasonable Bash port (e.g. git bash) is recommended for tar/gzip support.\n\n"; @@ -164,7 +165,7 @@ echo "Generating " . $appname . "-" . $packageinfo["app_ver"] . "-osx.tar.gz...\n"; chdir($rootpath); @unlink($appname . "-" . $packageinfo["app_ver"] . "-osx.tar.gz"); - system("tar czvf " . escapeshellarg($appname . "-" . $packageinfo["app_ver"] . "-osx.tar.gz") . " --owner=0 --group=0 " . escapeshellarg($packageinfo["app_name"] . " " . $packageinfo["app_ver"] . " Installer.app/")); + system("tar czvf " . escapeshellarg($appname . "-" . $packageinfo["app_ver"] . "-osx.tar.gz") . ($mac ? " " : " --owner=0 --group=0 ") . escapeshellarg($packageinfo["app_name"] . " " . $packageinfo["app_ver"] . " Installer.app/")); echo "Cleaning up...\n"; DirHelper::Delete($stagingpath);