#!/bin/sh BINOC_MACH=real-mach BINOC_TARGET_OS=`uname | tr [:upper:] [:lower:]` BINOC_CONFIG_GUESS=`./build/autoconf/config.guess 2>/dev/null` BINOC_PYTHON=`which python2.7 2>/dev/null` BINOC_GIT=`which git 2>/dev/null` BINOC_CURL=`which curl 2>/dev/null` # ===================================================================================================================== if [ -z "$BINOC_PYTHON" ]; then printf "We could not find Python 2.7 which is required for just about everything!\n" exit 1 fi # ===================================================================================================================== # Determine the current OS # This will also be exported so it can be picked up by .mozconfig if [[ "$BINOC_TARGET_OS" == "mingw32_nt-"* ]]; then BINOC_TARGET_OS=windows if [[ "$BINOC_CONFIG_GUESS" == "x86_64-pc-mingw32" ]]; then BINOC_CONFIG_GUESS=win64 else BINOC_CONFIG_GUESS=win32 fi fi export BINOC_TARGET_OS=$BINOC_TARGET_OS export BINOC_CONFIG_GUESS=$BINOC_CONFIG_GUESS # ===================================================================================================================== if [[ "$1" == "build-release" ]]; then $BINOC_MACH build && $BINOC_MACH package && $BINOC_MACH mar --bz2 && $BINOC_MACH langpack && $BINOC_MACH theme if [[ "$BINOC_TARGET_OS" == "windows" ]]; then $BINOC_MACH installer fi elif [[ "$1" == "webpatch" ]] && [[ -n "$BINOC_GIT" ]] && [[ -n "$BINOC_CURL" ]]; then if [ -z "$2" ]; then printf "Patch with what?" exit 1 else if [[ "$2" == *"github.com"* ]] || [[ "$2" == *"code.binaryoutcast.com"* ]] || [[ "$2" == *"repo.palemoon.org"* ]]; then echo ${2}.patch $BINOC_CURL -L ${2}.patch | "$BINOC_GIT" apply --reject else $BINOC_CURL -L ${2} | "$BINOC_GIT" apply --reject fi fi elif [[ "$1" == "amend-author" ]]; then if [[ -z "$2" ]]; then printf "Amend author on commit with what? (First Last " exit 1 fi "$BINOC_GIT" commit --amend --no-edit --author "$(echo ${@:2})" else # We don't know what the command is but real-mach might so just pass # all the args to it ./$BINOC_MACH $@ fi # =====================================================================================================================