From be05d0f6015c7f0ed683998789e63c5cc234dbe3 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Tue, 25 Mar 2025 21:08:45 +0100 Subject: [PATCH 1/5] Consolidate release script --- Docker/Dockerfile | 2 +- Docker/README.md | 8 +-- Release_Configure | 65 ---------------------- Release_ISOs | 72 ------------------------ Release_Source | 35 ------------ Scripts/release | 138 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 143 insertions(+), 177 deletions(-) delete mode 100755 Release_Configure delete mode 100755 Release_ISOs delete mode 100755 Release_Source create mode 100644 Scripts/release diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 54d7ceb..f0382a0 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -32,7 +32,7 @@ RUN wget https://downloads.sourceforge.net/reactos/RosBE-Unix-2.2.1.tar.bz2 \ && rm -rf RosBE-Unix-2.2.1 RUN git clone https://github.com/reactos/Release_Engineering \ - && mv Release_Engineering/Release_* /usr/local/bin \ + && mv Release_Engineering/Scripts/* /usr/local/bin \ && rm -rf Release_Engineering CMD ["/usr/local/RosBE/RosBE.sh", "/work"] diff --git a/Docker/README.md b/Docker/README.md index 4e7de45..a6dae92 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -24,8 +24,8 @@ Below steps outline the process of running it locally. ## Building a release ```bash -Release_Configure -# Answer the prompts -Release_ISOs -Release_Source +git clone https://github.com/reactos/reactos.git +cd reactos +git checkout releases/0.4.15 +release ``` diff --git a/Release_Configure b/Release_Configure deleted file mode 100755 index 8aaad87..0000000 --- a/Release_Configure +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# ReactOS Release Engineering Scripts -# Release_Configure - Set up a release configuration. First script to execute! - -# Sanity checks -if [ "$ROS_ARCH" = "" ]; then - echo "Please run this script inside RosBE!" - exit 1 -fi - -# Constants -ORIGDIR="$PWD" -REPODIR="$PWD/Release_WorkDir/Repo" - -echo "*******************************************************************************" -echo "* ReactOS Release Engineering Scripts *" -echo "*******************************************************************************" -echo - -# Ask for the version -echo "What ReactOS version do you want to release? (e.g. \"0.4.12\")" -echo "This will be used as suffix for the built files." -echo "If this is an RC, just hit RETURN without entering anything to use a suffix determined by Git (e.g. \"0.4.12-RC-5-g8449527\")." -read version -echo - -# Ask for the branch name -while [ "$branch_name" = "" ]; do - echo "What is the name of the Git branch? (e.g. \"releases/0.4.12\")" - read branch_name - echo -done - -# Check out the Git repository -if [ -d "${REPODIR}/.git" ]; then - cd "${REPODIR}" || exit 1 - git clean -d -f -f -x || exit 1 - git remote set-url origin https://github.com/reactos/reactos.git || exit 1 - git fetch origin || exit 1 - git checkout "${branch_name}" || exit 1 - git reset --hard "origin/${branch_name}" || exit 1 -else - rm -rf "${REPODIR}" - git clone https://github.com/reactos/reactos.git "${REPODIR}" || exit 1 - cd "${REPODIR}" || exit 1 - git checkout "${branch_name}" || exit 1 -fi - -# Get the version from Git if none was entered. -if [ "${version}" = "" ]; then - # Output something like '0.4.15-4-ge1e96bf467b5ea' - version_with_hash=`git describe --always` - # Extract the part before the last dash to ignore the commit hash - version=${version_with_hash%-*} -fi - -# Write the config file -cd "${ORIGDIR}" -echo "REPODIR=${REPODIR}" > Release_Config -echo "version=${version}" >> Release_Config -echo "branch_name=${branch_name}" >> Release_Config - -# All done! -echo "Release configured!" -echo "Now you can use the other Release_* commands to create the packages." diff --git a/Release_ISOs b/Release_ISOs deleted file mode 100755 index 9623049..0000000 --- a/Release_ISOs +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# ReactOS Release Engineering Scripts -# Release_ISOs - Create the "-iso.zip" and "-live.zip" packages - -# Sanity checks -if ! source ./Release_Config; then - echo "Please run Release_Configure first!" - exit 1 -fi - -if [ "$ROS_ARCH" = "" ]; then - echo "Please run this script inside RosBE!" - exit 1 -fi - -if [ "$ROS_ARCH" = "i386" ]; then - ROS_PRETTY_ARCH="x86" -else - ROS_PRETTY_ARCH="$ROS_ARCH" -fi - - -# Constants -ROOTDIR="$PWD" -OUTPUTDIR="output-MinGW-i386" -BOOTCDISO="ReactOS-${version}-${ROS_PRETTY_ARCH}.iso" -BOOTCDZIP="ReactOS-${version}-${ROS_PRETTY_ARCH}-iso.zip" -LIVECDISO="ReactOS-${version}-${ROS_PRETTY_ARCH}-live.iso" -LIVECDZIP="ReactOS-${version}-${ROS_PRETTY_ARCH}-live.zip" - -# Start from a clean state -rm -f "${ROOTDIR}/${BOOTCDZIP}" -rm -f "${ROOTDIR}/${LIVECDZIP}" - -# Download the "optional" folder from svn.reactos.org -mkdir "${REPODIR}/modules/optional" || exit 1 -cd "${REPODIR}/modules/optional" || exit 1 -wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1 - -# Check that all mandatory files exist in the "optional" folder. -if ! [ -f "DroidSansFallback.ttf" ]; then - echo "DroidSansFallback CJK font missing!" - exit 1 -fi - -if ! compgen -G "wine_gecko*.msi" > /dev/null; then - echo "wine_gecko MSI package missing!" - exit 1 -fi - -# Build ReactOS -cd "${REPODIR}" || exit 1 -./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1 -cd "${REPODIR}/${OUTPUTDIR}" || exit 1 -ninja bootcd || exit 1 -ninja livecd || exit 1 - -# Create the ZIP packages -mv "bootcd.iso" "${BOOTCDISO}" || exit 1 -zip -9 "${ROOTDIR}/${BOOTCDZIP}" "${BOOTCDISO}" || exit 1 -mv "livecd.iso" "${LIVECDISO}" || exit 1 -zip -9 "${ROOTDIR}/${LIVECDZIP}" "${LIVECDISO}" || exit 1 - -# We're done! -echo -echo "*******************************************************************************" -echo "Successfully created the following packages:" -echo -echo " - ${BOOTCDZIP}" -echo " - ${LIVECDZIP}" -echo "*******************************************************************************" -echo diff --git a/Release_Source b/Release_Source deleted file mode 100755 index 52927b4..0000000 --- a/Release_Source +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# ReactOS Release Engineering Scripts -# Release_Source - Create the "-src.zip" package - -# Sanity checks -if ! source ./Release_Config; then - echo "Please run Release_Configure first!" - exit 1 -fi - -if [ "$ROS_ARCH" = "" ]; then - echo "Please run this script inside RosBE!" - exit 1 -fi - -# Constants -ROOTDIR="$PWD" -EXPORTDIR="ReactOS-${version}" -SOURCEZIP="ReactOS-${version}-src.zip" - -# Start from a clean state -rm -f "${ROOTDIR}/${SOURCEZIP}" - -# Create the ZIP package -cd "${REPODIR}" -git archive --format=zip --prefix="${EXPORTDIR}/" -9 --output="${ROOTDIR}/${SOURCEZIP}" "${branch_name}" || exit 1 - -# We're done! -echo -echo "*******************************************************************************" -echo "Successfully created the following packages:" -echo -echo " - ${SOURCEZIP}" -echo "*******************************************************************************" -echo diff --git a/Scripts/release b/Scripts/release new file mode 100644 index 0000000..baf52d0 --- /dev/null +++ b/Scripts/release @@ -0,0 +1,138 @@ +#!/bin/bash + +# Constants +ROOTDIR="$PWD" +REPODIR="$PWD/Release_WorkDir/Repo" +OPTMODULESDIR="${REPODIR}/modules/optional" +OUTPUTDIR="output-MinGW-i386" + +echo "*******************************************************************************" +echo "* ReactOS Release Script *" +echo "*******************************************************************************" +echo + +# Ensure we are in RosBE. +if [ "$ROS_ARCH" = "" ]; then + echo "Please run this script inside RosBE!" + exit 1 +fi + +# Ensure this is running inside a git directory. +if [ ! -d "${REPODIR}/.git" ]; then + echo "Please run this script inside a ReactOS git directory. Release aborted." + exit 1 +fi + +# Check for internet connection. +wget -q --spider https://reactos.org + +if [ $? -eq 0 ]; then + internet=true +else + echo "Warning! No internet connection detected." + echo "Optional modules cannot be downloaded and origin cannot be fetched." + echo +fi + +# Get version (ex: 0.4.15-4-ge1e96bf467b5ea). +version=$(git describe) +# Remove git hash at end of the version. +version=${version%-*} +# Change "release" to "rls", if it is in the version name. +version=${version/release/rls} +# Get the branch name. +branch_name=$(git rev-parse --abbrev-ref HEAD) + +echo "ReactOS version is ${version}" +echo "ReactOS branch name is ${branch_name}" +echo + +# Ensure version and branch name are not null. +if [ "$version" = "" ] || [ "$branch_name" = "" ]; then + echo "Version or branch name is NULL! Release aborted." + exit 1 +fi + +# Ensure git is in a good state. +echo "Cleaning git repository..." +cd "${REPODIR}" || exit 1 +git clean -d -f -f -x --exclude="/modules/optional/*" || exit 1 +git remote set-url origin https://github.com/reactos/reactos.git || exit 1 +if [ "$internet" ]; then + git fetch origin || exit 1 +fi +git checkout "${branch_name}" || exit 1 +git reset --hard "origin/${branch_name}" || exit 1 +echo + +# Download the "optional" folder from svn.reactos.org if it isn't already downloaded. +if [ -d "${OPTMODULESDIR}" ]; then + echo "Optional modules already downloaded. Skipping." + echo "If you have an issue with the optional modules, re-run this script after deleting the directory:" + echo " ${OPTMODULESDIR}" + cd "${OPTMODULESDIR}" || exit 1 +elif [ "${internet}" ]; then + echo "Downloading optional modules..." + mkdir "${OPTMODULESDIR}" || exit 1 + cd "${OPTMODULESDIR}" || exit 1 + wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1 +else + echo "Missing optional modules and no internet connection. Release aborted." + exit 1 +fi +echo + +# Check that all mandatory files exist in the "optional" folder. +if [ ! -f "DroidSansFallback.ttf" ]; then + echo "DroidSansFallback CJK font missing!" + exit 1 +fi + +if ! compgen -G "wine_gecko*.msi" > /dev/null; then + echo "wine_gecko MSI package missing!" + exit 1 +fi + +# BootCD and LiveCD deliverable constants +BOOTCDISO="ReactOS-${version}-${ROS_ARCH}-boot.iso" +BOOTCDZIP="ReactOS-${version}-${ROS_ARCH}-boot.zip" +LIVECDISO="ReactOS-${version}-${ROS_ARCH}-live.iso" +LIVECDZIP="ReactOS-${version}-${ROS_ARCH}-live.zip" +EXPORTDIR="ReactOS-${version}" +SOURCEZIP="ReactOS-${version}-src.zip" + +# Checks passed! Delete any reminant BootCD and LiveCD deliverables. +rm -f "${ROOTDIR}/${BOOTCDZIP}" +rm -f "${ROOTDIR}/${LIVECDZIP}" + +# Build ReactOS +cd "${REPODIR}" || exit 1 +./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1 +cd "${REPODIR}/${OUTPUTDIR}" || exit 1 +ninja bootcd || exit 1 +ninja livecd || exit 1 + +# Create the ZIP packages for BootCD and LiveCD +echo "Creating BootCD and LiveCD ZIP packages..." +mv "bootcd.iso" "${BOOTCDISO}" || exit 1 +zip -9 "${ROOTDIR}/${BOOTCDZIP}" "${BOOTCDISO}" || exit 1 +mv "livecd.iso" "${LIVECDISO}" || exit 1 +zip -9 "${ROOTDIR}/${LIVECDZIP}" "${LIVECDISO}" || exit 1 + +# Delete any reminant source deliverable +rm -f "${ROOTDIR}/${SOURCEZIP}" + +# Create the ZIP package for the source deliverable +echo "Creating source ZIP package..." +cd "${REPODIR}" +git archive --format=zip --prefix="${EXPORTDIR}/" -9 --output="${ROOTDIR}/${SOURCEZIP}" "${branch_name}" || exit 1 + +# We're done! +echo +echo "*******************************************************************************" +echo "Successfully created the following packages:" +echo +echo " - ${BOOTCDZIP}" +echo " - ${LIVECDZIP}" +echo " - ${SOURCEZIP}" +echo "*******************************************************************************" From 9d3bab48196b69e3caf6c459ee386e639dfdbc0b Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Wed, 26 Mar 2025 13:49:53 +0100 Subject: [PATCH 2/5] Work directly on the git directory, restore old release scripts. --- Docker/README.md | 9 +++++ Scripts/Release_Configure | 65 +++++++++++++++++++++++++++++++++++ Scripts/Release_ISOs | 72 +++++++++++++++++++++++++++++++++++++++ Scripts/Release_Source | 35 +++++++++++++++++++ Scripts/release | 37 +++++++------------- 5 files changed, 194 insertions(+), 24 deletions(-) create mode 100644 Scripts/Release_Configure create mode 100644 Scripts/Release_ISOs create mode 100644 Scripts/Release_Source diff --git a/Docker/README.md b/Docker/README.md index a6dae92..a8d60ea 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -23,9 +23,18 @@ Below steps outline the process of running it locally. ## Building a release +### *Using the new release script* ```bash git clone https://github.com/reactos/reactos.git cd reactos git checkout releases/0.4.15 release ``` + +### *Using the old release script* +```bash +Release_Configure +# Answer the prompts +Release_ISOs +Release_Source +``` diff --git a/Scripts/Release_Configure b/Scripts/Release_Configure new file mode 100644 index 0000000..8aaad87 --- /dev/null +++ b/Scripts/Release_Configure @@ -0,0 +1,65 @@ +#!/bin/bash +# ReactOS Release Engineering Scripts +# Release_Configure - Set up a release configuration. First script to execute! + +# Sanity checks +if [ "$ROS_ARCH" = "" ]; then + echo "Please run this script inside RosBE!" + exit 1 +fi + +# Constants +ORIGDIR="$PWD" +REPODIR="$PWD/Release_WorkDir/Repo" + +echo "*******************************************************************************" +echo "* ReactOS Release Engineering Scripts *" +echo "*******************************************************************************" +echo + +# Ask for the version +echo "What ReactOS version do you want to release? (e.g. \"0.4.12\")" +echo "This will be used as suffix for the built files." +echo "If this is an RC, just hit RETURN without entering anything to use a suffix determined by Git (e.g. \"0.4.12-RC-5-g8449527\")." +read version +echo + +# Ask for the branch name +while [ "$branch_name" = "" ]; do + echo "What is the name of the Git branch? (e.g. \"releases/0.4.12\")" + read branch_name + echo +done + +# Check out the Git repository +if [ -d "${REPODIR}/.git" ]; then + cd "${REPODIR}" || exit 1 + git clean -d -f -f -x || exit 1 + git remote set-url origin https://github.com/reactos/reactos.git || exit 1 + git fetch origin || exit 1 + git checkout "${branch_name}" || exit 1 + git reset --hard "origin/${branch_name}" || exit 1 +else + rm -rf "${REPODIR}" + git clone https://github.com/reactos/reactos.git "${REPODIR}" || exit 1 + cd "${REPODIR}" || exit 1 + git checkout "${branch_name}" || exit 1 +fi + +# Get the version from Git if none was entered. +if [ "${version}" = "" ]; then + # Output something like '0.4.15-4-ge1e96bf467b5ea' + version_with_hash=`git describe --always` + # Extract the part before the last dash to ignore the commit hash + version=${version_with_hash%-*} +fi + +# Write the config file +cd "${ORIGDIR}" +echo "REPODIR=${REPODIR}" > Release_Config +echo "version=${version}" >> Release_Config +echo "branch_name=${branch_name}" >> Release_Config + +# All done! +echo "Release configured!" +echo "Now you can use the other Release_* commands to create the packages." diff --git a/Scripts/Release_ISOs b/Scripts/Release_ISOs new file mode 100644 index 0000000..9623049 --- /dev/null +++ b/Scripts/Release_ISOs @@ -0,0 +1,72 @@ +#!/bin/bash +# ReactOS Release Engineering Scripts +# Release_ISOs - Create the "-iso.zip" and "-live.zip" packages + +# Sanity checks +if ! source ./Release_Config; then + echo "Please run Release_Configure first!" + exit 1 +fi + +if [ "$ROS_ARCH" = "" ]; then + echo "Please run this script inside RosBE!" + exit 1 +fi + +if [ "$ROS_ARCH" = "i386" ]; then + ROS_PRETTY_ARCH="x86" +else + ROS_PRETTY_ARCH="$ROS_ARCH" +fi + + +# Constants +ROOTDIR="$PWD" +OUTPUTDIR="output-MinGW-i386" +BOOTCDISO="ReactOS-${version}-${ROS_PRETTY_ARCH}.iso" +BOOTCDZIP="ReactOS-${version}-${ROS_PRETTY_ARCH}-iso.zip" +LIVECDISO="ReactOS-${version}-${ROS_PRETTY_ARCH}-live.iso" +LIVECDZIP="ReactOS-${version}-${ROS_PRETTY_ARCH}-live.zip" + +# Start from a clean state +rm -f "${ROOTDIR}/${BOOTCDZIP}" +rm -f "${ROOTDIR}/${LIVECDZIP}" + +# Download the "optional" folder from svn.reactos.org +mkdir "${REPODIR}/modules/optional" || exit 1 +cd "${REPODIR}/modules/optional" || exit 1 +wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1 + +# Check that all mandatory files exist in the "optional" folder. +if ! [ -f "DroidSansFallback.ttf" ]; then + echo "DroidSansFallback CJK font missing!" + exit 1 +fi + +if ! compgen -G "wine_gecko*.msi" > /dev/null; then + echo "wine_gecko MSI package missing!" + exit 1 +fi + +# Build ReactOS +cd "${REPODIR}" || exit 1 +./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1 +cd "${REPODIR}/${OUTPUTDIR}" || exit 1 +ninja bootcd || exit 1 +ninja livecd || exit 1 + +# Create the ZIP packages +mv "bootcd.iso" "${BOOTCDISO}" || exit 1 +zip -9 "${ROOTDIR}/${BOOTCDZIP}" "${BOOTCDISO}" || exit 1 +mv "livecd.iso" "${LIVECDISO}" || exit 1 +zip -9 "${ROOTDIR}/${LIVECDZIP}" "${LIVECDISO}" || exit 1 + +# We're done! +echo +echo "*******************************************************************************" +echo "Successfully created the following packages:" +echo +echo " - ${BOOTCDZIP}" +echo " - ${LIVECDZIP}" +echo "*******************************************************************************" +echo diff --git a/Scripts/Release_Source b/Scripts/Release_Source new file mode 100644 index 0000000..52927b4 --- /dev/null +++ b/Scripts/Release_Source @@ -0,0 +1,35 @@ +#!/bin/bash +# ReactOS Release Engineering Scripts +# Release_Source - Create the "-src.zip" package + +# Sanity checks +if ! source ./Release_Config; then + echo "Please run Release_Configure first!" + exit 1 +fi + +if [ "$ROS_ARCH" = "" ]; then + echo "Please run this script inside RosBE!" + exit 1 +fi + +# Constants +ROOTDIR="$PWD" +EXPORTDIR="ReactOS-${version}" +SOURCEZIP="ReactOS-${version}-src.zip" + +# Start from a clean state +rm -f "${ROOTDIR}/${SOURCEZIP}" + +# Create the ZIP package +cd "${REPODIR}" +git archive --format=zip --prefix="${EXPORTDIR}/" -9 --output="${ROOTDIR}/${SOURCEZIP}" "${branch_name}" || exit 1 + +# We're done! +echo +echo "*******************************************************************************" +echo "Successfully created the following packages:" +echo +echo " - ${SOURCEZIP}" +echo "*******************************************************************************" +echo diff --git a/Scripts/release b/Scripts/release index baf52d0..08c3746 100644 --- a/Scripts/release +++ b/Scripts/release @@ -2,9 +2,8 @@ # Constants ROOTDIR="$PWD" -REPODIR="$PWD/Release_WorkDir/Repo" -OPTMODULESDIR="${REPODIR}/modules/optional" -OUTPUTDIR="output-MinGW-i386" +OPTMODULESDIR="${ROOTDIR}/modules/optional" +OUTPUTDIR="${ROOTDIR}/output-MinGW-i386" echo "*******************************************************************************" echo "* ReactOS Release Script *" @@ -18,7 +17,7 @@ if [ "$ROS_ARCH" = "" ]; then fi # Ensure this is running inside a git directory. -if [ ! -d "${REPODIR}/.git" ]; then +if [ ! -d "${ROOTDIR}/.git" ]; then echo "Please run this script inside a ReactOS git directory. Release aborted." exit 1 fi @@ -53,16 +52,14 @@ if [ "$version" = "" ] || [ "$branch_name" = "" ]; then exit 1 fi -# Ensure git is in a good state. -echo "Cleaning git repository..." -cd "${REPODIR}" || exit 1 +# Clean repository, excluding the modules/optional folder and its contents. git clean -d -f -f -x --exclude="/modules/optional/*" || exit 1 -git remote set-url origin https://github.com/reactos/reactos.git || exit 1 +# Fetch changes from origin if we have an internet connection. if [ "$internet" ]; then git fetch origin || exit 1 fi -git checkout "${branch_name}" || exit 1 -git reset --hard "origin/${branch_name}" || exit 1 +# Reset to the head of the branch +git reset --hard HEAD || exit 1 echo # Download the "optional" folder from svn.reactos.org if it isn't already downloaded. @@ -101,14 +98,10 @@ LIVECDZIP="ReactOS-${version}-${ROS_ARCH}-live.zip" EXPORTDIR="ReactOS-${version}" SOURCEZIP="ReactOS-${version}-src.zip" -# Checks passed! Delete any reminant BootCD and LiveCD deliverables. -rm -f "${ROOTDIR}/${BOOTCDZIP}" -rm -f "${ROOTDIR}/${LIVECDZIP}" - # Build ReactOS -cd "${REPODIR}" || exit 1 +cd "${ROOTDIR}" || exit 1 ./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1 -cd "${REPODIR}/${OUTPUTDIR}" || exit 1 +cd "${OUTPUTDIR}" || exit 1 ninja bootcd || exit 1 ninja livecd || exit 1 @@ -119,20 +112,16 @@ zip -9 "${ROOTDIR}/${BOOTCDZIP}" "${BOOTCDISO}" || exit 1 mv "livecd.iso" "${LIVECDISO}" || exit 1 zip -9 "${ROOTDIR}/${LIVECDZIP}" "${LIVECDISO}" || exit 1 -# Delete any reminant source deliverable -rm -f "${ROOTDIR}/${SOURCEZIP}" - # Create the ZIP package for the source deliverable echo "Creating source ZIP package..." -cd "${REPODIR}" +cd "${ROOTDIR}" git archive --format=zip --prefix="${EXPORTDIR}/" -9 --output="${ROOTDIR}/${SOURCEZIP}" "${branch_name}" || exit 1 # We're done! echo echo "*******************************************************************************" echo "Successfully created the following packages:" -echo -echo " - ${BOOTCDZIP}" -echo " - ${LIVECDZIP}" -echo " - ${SOURCEZIP}" +echo " ${ROOTDIR}/${BOOTCDZIP}" +echo " ${ROOTDIR}/${LIVECDZIP}" +echo " ${ROOTDIR}/${SOURCEZIP}" echo "*******************************************************************************" From 346d89f8e010fe316e6591fedd50d34a6d058d98 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Wed, 26 Mar 2025 14:51:28 +0100 Subject: [PATCH 3/5] Make download check more robust --- Scripts/release | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Scripts/release b/Scripts/release index 08c3746..f81de32 100644 --- a/Scripts/release +++ b/Scripts/release @@ -2,8 +2,8 @@ # Constants ROOTDIR="$PWD" -OPTMODULESDIR="${ROOTDIR}/modules/optional" -OUTPUTDIR="${ROOTDIR}/output-MinGW-i386" +OPTMODDIR="modules/optional" +OUTPUTDIR="output-MinGW-i386" echo "*******************************************************************************" echo "* ReactOS Release Script *" @@ -63,33 +63,31 @@ git reset --hard HEAD || exit 1 echo # Download the "optional" folder from svn.reactos.org if it isn't already downloaded. -if [ -d "${OPTMODULESDIR}" ]; then +# Ensure the optional modules folder is there and contains the modules we need. +if [ -d "${OPTMODDIR}" ] && [ -f "${OPTMODDIR}/DroidSansFallback.ttf" ] && compgen -G "${OPTMODDIR}/wine_gecko*.msi" > /dev/null; then echo "Optional modules already downloaded. Skipping." echo "If you have an issue with the optional modules, re-run this script after deleting the directory:" - echo " ${OPTMODULESDIR}" - cd "${OPTMODULESDIR}" || exit 1 + echo " ${ROOTDIR}/${OPTMODDIR}" elif [ "${internet}" ]; then echo "Downloading optional modules..." - mkdir "${OPTMODULESDIR}" || exit 1 - cd "${OPTMODULESDIR}" || exit 1 + mkdir "${OPTMODDIR}" || exit 1 + cd "${OPTMODDIR}" || exit 1 wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1 + # Check that all mandatory files were downloaded. + if [ ! -f "DroidSansFallback.ttf" ]; then + echo "DroidSansFallback CJK font missing!" + exit 1 + fi + if ! compgen -G "wine_gecko*.msi" > /dev/null; then + echo "wine_gecko MSI package missing!" + exit 1 + fi else echo "Missing optional modules and no internet connection. Release aborted." exit 1 fi echo -# Check that all mandatory files exist in the "optional" folder. -if [ ! -f "DroidSansFallback.ttf" ]; then - echo "DroidSansFallback CJK font missing!" - exit 1 -fi - -if ! compgen -G "wine_gecko*.msi" > /dev/null; then - echo "wine_gecko MSI package missing!" - exit 1 -fi - # BootCD and LiveCD deliverable constants BOOTCDISO="ReactOS-${version}-${ROS_ARCH}-boot.iso" BOOTCDZIP="ReactOS-${version}-${ROS_ARCH}-boot.zip" From 54be25a2a0a7909c8b90ed7968a1c6d6e911d107 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Wed, 26 Mar 2025 15:10:05 +0100 Subject: [PATCH 4/5] Delete modules/optional if we need to redownload them --- Scripts/release | 61 ++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/Scripts/release b/Scripts/release index f81de32..689b321 100644 --- a/Scripts/release +++ b/Scripts/release @@ -12,25 +12,25 @@ echo # Ensure we are in RosBE. if [ "$ROS_ARCH" = "" ]; then - echo "Please run this script inside RosBE!" - exit 1 + echo "Please run this script inside RosBE!" + exit 1 fi # Ensure this is running inside a git directory. if [ ! -d "${ROOTDIR}/.git" ]; then - echo "Please run this script inside a ReactOS git directory. Release aborted." - exit 1 + echo "Please run this script inside a ReactOS git directory. Release aborted." + exit 1 fi # Check for internet connection. wget -q --spider https://reactos.org if [ $? -eq 0 ]; then - internet=true + internet=true else - echo "Warning! No internet connection detected." - echo "Optional modules cannot be downloaded and origin cannot be fetched." - echo + echo "Warning! No internet connection detected." + echo "Optional modules cannot be downloaded and origin cannot be fetched." + echo fi # Get version (ex: 0.4.15-4-ge1e96bf467b5ea). @@ -48,15 +48,15 @@ echo # Ensure version and branch name are not null. if [ "$version" = "" ] || [ "$branch_name" = "" ]; then - echo "Version or branch name is NULL! Release aborted." - exit 1 + echo "Version or branch name is NULL! Release aborted." + exit 1 fi # Clean repository, excluding the modules/optional folder and its contents. git clean -d -f -f -x --exclude="/modules/optional/*" || exit 1 # Fetch changes from origin if we have an internet connection. if [ "$internet" ]; then - git fetch origin || exit 1 + git fetch origin || exit 1 fi # Reset to the head of the branch git reset --hard HEAD || exit 1 @@ -65,26 +65,29 @@ echo # Download the "optional" folder from svn.reactos.org if it isn't already downloaded. # Ensure the optional modules folder is there and contains the modules we need. if [ -d "${OPTMODDIR}" ] && [ -f "${OPTMODDIR}/DroidSansFallback.ttf" ] && compgen -G "${OPTMODDIR}/wine_gecko*.msi" > /dev/null; then - echo "Optional modules already downloaded. Skipping." - echo "If you have an issue with the optional modules, re-run this script after deleting the directory:" - echo " ${ROOTDIR}/${OPTMODDIR}" + echo "Optional modules already downloaded. Skipping." + echo "If you have an issue with the optional modules, re-run this script after deleting the directory:" + echo " ${ROOTDIR}/${OPTMODDIR}" elif [ "${internet}" ]; then - echo "Downloading optional modules..." - mkdir "${OPTMODDIR}" || exit 1 - cd "${OPTMODDIR}" || exit 1 - wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1 - # Check that all mandatory files were downloaded. - if [ ! -f "DroidSansFallback.ttf" ]; then - echo "DroidSansFallback CJK font missing!" - exit 1 - fi - if ! compgen -G "wine_gecko*.msi" > /dev/null; then - echo "wine_gecko MSI package missing!" - exit 1 - fi + echo "Downloading optional modules..." + if [ -d "${OPTMODDIR}" ]; then + rm -rf "${OPTMODDIR}" + fi + mkdir "${OPTMODDIR}" || exit 1 + cd "${OPTMODDIR}" || exit 1 + wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1 + # Check that all mandatory files were downloaded. + if [ ! -f "DroidSansFallback.ttf" ]; then + echo "DroidSansFallback CJK font missing!" + exit 1 + fi + if ! compgen -G "wine_gecko*.msi" > /dev/null; then + echo "wine_gecko MSI package missing!" + exit 1 + fi else - echo "Missing optional modules and no internet connection. Release aborted." - exit 1 + echo "Missing optional modules and no internet connection. Release aborted." + exit 1 fi echo From da8b0846ef61aaec2816ec8b97e6453f51cf04c4 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Wed, 26 Mar 2025 15:17:09 +0100 Subject: [PATCH 5/5] Fail if deleting optional folder fails on re-download --- Scripts/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/release b/Scripts/release index 689b321..3027883 100644 --- a/Scripts/release +++ b/Scripts/release @@ -71,7 +71,7 @@ if [ -d "${OPTMODDIR}" ] && [ -f "${OPTMODDIR}/DroidSansFallback.ttf" ] && compg elif [ "${internet}" ]; then echo "Downloading optional modules..." if [ -d "${OPTMODDIR}" ]; then - rm -rf "${OPTMODDIR}" + rm -rf "${OPTMODDIR}" || exit 1 fi mkdir "${OPTMODDIR}" || exit 1 cd "${OPTMODDIR}" || exit 1