Skip to content

Commit 1c7cfae

Browse files
committed
Don't warn repeatedly about an existing LLVM dir
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 48ab973 commit 1c7cfae

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

build/llvm/LLVM.lua

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -187,34 +187,32 @@ function download_llvm()
187187
-- check if we already have the file downloaded
188188
if os.isfile(archive) then
189189
print("Archive " .. archive .. " already exists.")
190+
return
190191
elseif os.isdir(pkg_name) then
191192
print("Directory " .. pkg_name .. " already exists.")
192-
else
193-
msg, code = download(base .. archive, archive, true)
194-
195-
if msg ~= "OK" then
196-
if code == 404 then
197-
print("Error: " .. archive .. " is unavailable.")
198-
print("Please create your own LLVM package by executing the following commands:")
199-
print("./build.sh clone_llvm")
200-
print("./build.sh build_llvm")
201-
print("./build.sh package_llvm")
202-
os.exit(1)
203-
end
204-
205-
error(msg)
193+
return
194+
end
195+
196+
msg, code = download(base .. archive, archive, true)
197+
198+
if msg ~= "OK" then
199+
if code == 404 then
200+
print("Error: " .. archive .. " is unavailable.")
201+
print("Please create your own LLVM package by executing the following commands:")
202+
print("./build.sh clone_llvm")
203+
print("./build.sh build_llvm")
204+
print("./build.sh package_llvm")
205+
os.exit(1)
206206
end
207+
208+
error(msg)
207209
end
208210

209211
-- extract the package
210-
if os.isdir(pkg_name) then
211-
print("Directory " .. pkg_name .. " already exists.")
212+
if use_7zip then
213+
extract_7z(archive, pkg_name)
212214
else
213-
if use_7zip then
214-
extract_7z(archive, pkg_name)
215-
else
216-
extract_tar_xz(archive, pkg_name)
217-
end
215+
extract_tar_xz(archive, pkg_name)
218216
end
219217
end
220218

0 commit comments

Comments
 (0)