chiark / gitweb /
Update toolhead naming
[cura.git] / package.sh
index c1403caa4d5965d8c42dd59f2251d57f568b43a7..98bed0485ce2f17f895b33baa5dc5b3eb823669b 100755 (executable)
@@ -75,7 +75,7 @@ function extract
 {
        echo "Extracting $*"
        echo "7z x -y $*" >> log.txt
-       7z x -y $* >> log.txt
+       $EXTRACT x -y $* >> log.txt
        if [ $? != 0 ]; then
         echo "Failed to extract $*"
         exit 1
@@ -118,6 +118,12 @@ else
        MAKE=make
 fi
 
+if [ -z `which 7za` ]; then
+       EXTRACT=7z
+else
+       EXTRACT=7za
+fi
+
 # Change working directory to the directory the script is in
 # http://stackoverflow.com/a/246128
 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -128,7 +134,7 @@ checkTool curl "curl: http://curl.haxx.se/"
 if [ $BUILD_TARGET = "win32" ]; then
        checkTool avr-gcc "avr-gcc: http://winavr.sourceforge.net/ "
        #Check if we have 7zip, needed to extract and packup a bunch of packages for windows.
-       checkTool 7z "7zip: http://www.7-zip.org/"
+       checkTool $EXTRACT "7zip: http://www.7-zip.org/"
        checkTool $MAKE "mingw: http://www.mingw.org/"
 fi
 #For building under MacOS we need gnutar instead of tar
@@ -433,7 +439,9 @@ function buildFedora() {
     fi
 
     mkdir -pv "$_dstRpmDir/$_mockRelease"
-    mock \
+    # Need to use /usr/bin/mock because depending on $PATH, if /usr/sbin/mock is
+    # run instead, it will give an error.
+    /usr/bin/mock \
       $_mockReleaseArg \
       --resultdir="$_dstRpmDir/$_mockRelease" \
       "$_srpmFile"