Skip to content

Commit bcbe941

Browse files
committed
[update] : Supported --remove-cache
1 parent 1f99c27 commit bcbe941

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tools/fullbuild.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ work_dir="${script_path}/temp"
2525
simulation=false
2626
retry=5
2727

28+
remove_cache=false
2829
all_channel=false
2930

3031
# Show an INFO message
@@ -91,6 +92,10 @@ build() {
9192

9293
options="${share_options} --arch ${arch} --lang ${lang} ${cha}"
9394

95+
if [[ "${simulation}" = false ]] && [[ "${remove_cache}" = true ]]; then
96+
sudo pacman -Sccc --noconfirm
97+
fi
98+
9499
if [[ ! -e "${work_dir}/fullbuild.${cha}_${arch}_${lang}" ]]; then
95100
if [[ "${simulation}" = true ]]; then
96101
echo "build.sh ${share_options} --lang ${lang} --arch ${arch} ${cha}"
@@ -106,10 +111,6 @@ build() {
106111
fi
107112
fi
108113
fi
109-
110-
if [[ "${simulation}" = false ]]; then
111-
sudo pacman -Sccc --noconfirm > /dev/null 2>&1
112-
fi
113114
}
114115

115116
_help() {
@@ -128,6 +129,8 @@ _help() {
128129
echo " -s Enable simulation mode"
129130
echo " -t Build the tarball as well"
130131
echo
132+
echo " --remove-cache Clear cache for all packages on every build"
133+
echo
131134
echo " !! WARNING !!"
132135
echo " Do not set channel or architecture with -a."
133136
echo " Be sure to enclose the build.sh argument with '' to avoid mixing it with the fullbuild.sh argument."
@@ -146,7 +149,7 @@ default_options="--boot-splash --cleanup --user alter --password alter"
146149
# Parse options
147150
ARGUMENT="${@}"
148151
_opt_short="a:dghr:sctm:l:"
149-
_opt_long="help"
152+
_opt_long="help.remove-cache"
150153
OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- ${ARGUMENT})
151154
[[ ${?} != 0 ]] && exit 1
152155

@@ -200,6 +203,10 @@ while true; do
200203
_help
201204
exit 0
202205
;;
206+
--remove-cache)
207+
remove_cache=true
208+
shift 1
209+
;;
203210
--)
204211
shift 1
205212
break

0 commit comments

Comments
 (0)