Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
56fc3949
Commit
56fc3949
authored
May 13, 2021
by
Andrew Murray
Browse files
Ensure xz is installed when needed in fetch_unpack
parent
468e6bf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
common_utils.sh
common_utils.sh
+9
-0
No files found.
common_utils.sh
View file @
56fc3949
...
@@ -203,6 +203,9 @@ function untar {
...
@@ -203,6 +203,9 @@ function untar {
xz) if [ -n "
$IS_MACOS
" ]; then
xz) if [ -n "
$IS_MACOS
" ]; then
tar -xf
$in_fname
tar -xf
$in_fname
else
else
if [[ !
$(
type
-P
"unxz"
)
]]; then
echo xz must be installed to uncompress file; exit 1
fi
unxz -c
$in_fname
| tar -xf -
unxz -c
$in_fname
| tar -xf -
fi ;;
fi ;;
*) echo Did not recognize extension
$extension
; exit 1 ;;
*) echo Did not recognize extension
$extension
; exit 1 ;;
...
@@ -237,6 +240,12 @@ function fetch_unpack {
...
@@ -237,6 +240,12 @@ function fetch_unpack {
if [ -z "
$url
" ];then echo "
url not defined
"; exit 1; fi
if [ -z "
$url
" ];then echo "
url not defined
"; exit 1; fi
local archive_fname=
${
2
:-
$(
basename
$url
)
}
local archive_fname=
${
2
:-
$(
basename
$url
)
}
local arch_sdir="
${
ARCHIVE_SDIR
:-
archives
}
"
local arch_sdir="
${
ARCHIVE_SDIR
:-
archives
}
"
if [ -z "
$IS_MACOS
" ]; then
local extension=
${
archive_fname
##*.
}
if [ "
$extension
" == "
xz
" ]; then
ensure_xz
fi
fi
# Make the archive directory in case it doesn't exist
# Make the archive directory in case it doesn't exist
mkdir -p
$arch_sdir
mkdir -p
$arch_sdir
local out_archive="
${
arch_sdir
}
/
${
archive_fname
}
"
local out_archive="
${
arch_sdir
}
/
${
archive_fname
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment