Skip to content

Commit 0e0d2d7

Browse files
committed
Delete modules/optional if we need to redownload them
1 parent e2b1116 commit 0e0d2d7

1 file changed

Lines changed: 32 additions & 29 deletions

File tree

Scripts/release

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ echo
1212

1313
# Ensure we are in RosBE.
1414
if [ "$ROS_ARCH" = "" ]; then
15-
echo "Please run this script inside RosBE!"
16-
exit 1
15+
echo "Please run this script inside RosBE!"
16+
exit 1
1717
fi
1818

1919
# Ensure this is running inside a git directory.
2020
if [ ! -d "${ROOTDIR}/.git" ]; then
21-
echo "Please run this script inside a ReactOS git directory. Release aborted."
22-
exit 1
21+
echo "Please run this script inside a ReactOS git directory. Release aborted."
22+
exit 1
2323
fi
2424

2525
# Check for internet connection.
2626
wget -q --spider https://reactos.org
2727

2828
if [ $? -eq 0 ]; then
29-
internet=true
29+
internet=true
3030
else
31-
echo "Warning! No internet connection detected."
32-
echo "Optional modules cannot be downloaded and origin cannot be fetched."
33-
echo
31+
echo "Warning! No internet connection detected."
32+
echo "Optional modules cannot be downloaded and origin cannot be fetched."
33+
echo
3434
fi
3535

3636
# Get version (ex: 0.4.15-4-ge1e96bf467b5ea).
@@ -48,15 +48,15 @@ echo
4848

4949
# Ensure version and branch name are not null.
5050
if [ "$version" = "" ] || [ "$branch_name" = "" ]; then
51-
echo "Version or branch name is NULL! Release aborted."
52-
exit 1
51+
echo "Version or branch name is NULL! Release aborted."
52+
exit 1
5353
fi
5454

5555
# Clean repository, excluding the modules/optional folder and its contents.
5656
git clean -d -f -f -x --exclude="/modules/optional/*" || exit 1
5757
# Fetch changes from origin if we have an internet connection.
5858
if [ "$internet" ]; then
59-
git fetch origin || exit 1
59+
git fetch origin || exit 1
6060
fi
6161
# Reset to the head of the branch
6262
git reset --hard HEAD || exit 1
@@ -65,26 +65,29 @@ echo
6565
# Download the "optional" folder from svn.reactos.org if it isn't already downloaded.
6666
# Ensure the optional modules folder is there and contains the modules we need.
6767
if [ -d "${OPTMODDIR}" ] && [ -f "${OPTMODDIR}/DroidSansFallback.ttf" ] && compgen -G "${OPTMODDIR}/wine_gecko*.msi" > /dev/null; then
68-
echo "Optional modules already downloaded. Skipping."
69-
echo "If you have an issue with the optional modules, re-run this script after deleting the directory:"
70-
echo " ${ROOTDIR}/${OPTMODDIR}"
68+
echo "Optional modules already downloaded. Skipping."
69+
echo "If you have an issue with the optional modules, re-run this script after deleting the directory:"
70+
echo " ${ROOTDIR}/${OPTMODDIR}"
7171
elif [ "${internet}" ]; then
72-
echo "Downloading optional modules..."
73-
mkdir "${OPTMODDIR}" || exit 1
74-
cd "${OPTMODDIR}" || exit 1
75-
wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1
76-
# Check that all mandatory files were downloaded.
77-
if [ ! -f "DroidSansFallback.ttf" ]; then
78-
echo "DroidSansFallback CJK font missing!"
79-
exit 1
80-
fi
81-
if ! compgen -G "wine_gecko*.msi" > /dev/null; then
82-
echo "wine_gecko MSI package missing!"
83-
exit 1
84-
fi
72+
echo "Downloading optional modules..."
73+
if [ -d "${OPTMODDIR}" ]; then
74+
rm -rf "${OPTMODDIR}"
75+
fi
76+
mkdir "${OPTMODDIR}" || exit 1
77+
cd "${OPTMODDIR}" || exit 1
78+
wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1
79+
# Check that all mandatory files were downloaded.
80+
if [ ! -f "DroidSansFallback.ttf" ]; then
81+
echo "DroidSansFallback CJK font missing!"
82+
exit 1
83+
fi
84+
if ! compgen -G "wine_gecko*.msi" > /dev/null; then
85+
echo "wine_gecko MSI package missing!"
86+
exit 1
87+
fi
8588
else
86-
echo "Missing optional modules and no internet connection. Release aborted."
87-
exit 1
89+
echo "Missing optional modules and no internet connection. Release aborted."
90+
exit 1
8891
fi
8992
echo
9093

0 commit comments

Comments
 (0)