Skip to content

Commit da5b330

Browse files
ddelangeferdnyc
andauthored
Apply suggestions from code review
Co-authored-by: Frank Dana <ferdnyc@gmail.com>
1 parent f7341ce commit da5b330

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

add_libmagic.sh

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ install_source() {
66
# install from source
77
# https://www.darwinsys.com/file/
88
# https://github.com/file/file/blob/FILE5_45/INSTALL#L51
9-
version="file-5.45"
10-
(
11-
tmpfile="$(mktemp)" &&
12-
curl -sSLo "${tmpfile}" "https://astron.com/pub/file/${version}.tar.gz" &&
13-
tar xvf "${tmpfile}" &&
14-
cd "${version}" &&
15-
./configure &&
16-
make &&
17-
make install &&
18-
make installcheck &&
19-
cd .. &&
20-
rm -r "${version}"
21-
) || (cd .. && rm -r "${version}" && false)
9+
version="file-5.45" &&
10+
tmpfile="$(mktemp)" &&
11+
curl -sSLo "${tmpfile}" "https://astron.com/pub/file/${version}.tar.gz" &&
12+
tar xvf "${tmpfile}" &&
13+
cd "${version}" &&
14+
./configure &&
15+
make &&
16+
make install &&
17+
make installcheck &&
18+
cd .. &&
19+
rm -r "${version}"
2220
}
2321

2422
install_precompiled() {
@@ -34,8 +32,8 @@ install_precompiled() {
3432
apt-get install -y libmagic1
3533
elif [ -n "$(which apk)" ]; then
3634
apk add --update libmagic
37-
elif [ -n "$(which yum)" ]; then
38-
yum install file-libs
35+
elif [ -n "$(which dnf)" ]; then
36+
dnf --setopt install_weak_deps=false -y install file-libs
3937
else
4038
# windows (no install, just download into current working directory)
4139
# could also consider install using `pacman`: https://packages.msys2.org/base/mingw-w64-file

0 commit comments

Comments
 (0)