From 12e193d48ec3f79c5f3a28e365faab1ffb278e97 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 25 Mar 2024 20:31:58 +0100 Subject: [PATCH] clean up and put to one file --- all.sh | 13 ------------ build.sh | 3 --- builder.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ clean.sh | 7 ------- 4 files changed, 59 insertions(+), 23 deletions(-) delete mode 100644 all.sh delete mode 100644 build.sh create mode 100644 builder.sh delete mode 100644 clean.sh diff --git a/all.sh b/all.sh deleted file mode 100644 index 573e124..0000000 --- a/all.sh +++ /dev/null @@ -1,13 +0,0 @@ -#Discard uncommited changes -hg revert --all --no-backup -#Clean build -./mach clobber -#Update Mozilla repo -hg pull -u -./mach update -#Update patches -git clone https://weforgecode.xyz/Spitfire/Branding.git -#Configure and Build -./mach configure -./mach build - diff --git a/build.sh b/build.sh deleted file mode 100644 index 352b0d0..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#Configure and Build -./mach configure -./mach build diff --git a/builder.sh b/builder.sh new file mode 100644 index 0000000..35c2419 --- /dev/null +++ b/builder.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Define source paths +SOURCE_PATH="/home/user/mozilla-central" +SOURCE_REPO="https://hg.mozilla.org/mozilla-central" + +# Function to download Firefox source if not present +download_source() { + if [ ! -d "$SOURCE_PATH" ]; then + echo "Firefox source not found. Cloning from repository..." + hg clone $SOURCE_REPO $SOURCE_PATH || { echo "Failed to clone Firefox repository. Exiting."; exit 1; } + else + echo "Firefox source already exists." + fi +} + +# Function to discard uncommitted changes +discard_changes() { + echo "Discarding uncommitted changes..." + hg revert --all --no-backup +} + +# Function to clean build +clean_build() { + echo "Cleaning build..." + ./mach clobber +} + +# Function to update Mozilla repository +update_repo() { + echo "Updating Mozilla repository..." + hg pull -u || { echo "Failed to update Mozilla repository. Exiting."; exit 1; } + ./mach update || { echo "Failed to update Mozilla repository. Exiting."; exit 1; } +} + +# Function to update patches +update_patches() { + echo "Updating patches..." + git clone https://weforgecode.xyz/Spitfire/Branding.git || { echo "Failed to clone patches repository. Exiting."; exit 1; } +} + +# Function to configure and build Spitfire +configure_and_build() { + echo "Configuring Spitfire..." + ./mach configure || { echo "Configuration failed. Exiting."; exit 1; } + + echo "Building Spitfire..." + ./mach build || { echo "Build failed. Exiting."; exit 1; } +} + +# Main script execution +download_source +discard_changes +clean_build +update_repo +update_patches +configure_and_build + +echo "Spitfire build completed successfully." diff --git a/clean.sh b/clean.sh deleted file mode 100644 index 2f9f4b4..0000000 --- a/clean.sh +++ /dev/null @@ -1,7 +0,0 @@ -#Discard uncommited changes -hg revert --all --no-backup -#Clean build -./mach clobber -#Update Mozilla repo -hg pull -u -./mach update