2008-10-03 12:32:26 +00:00
|
|
|
|
#
|
|
|
|
|
# This helper is used in templates using extract_sufx=".zip".
|
2008-10-14 05:52:29 +00:00
|
|
|
|
# This checks if unzip is installed and installs it if it's not.
|
2008-10-03 12:32:26 +00:00
|
|
|
|
#
|
2008-10-06 00:51:34 +00:00
|
|
|
|
# If unzip is already installed just return immediately.
|
2008-10-12 18:05:52 +00:00
|
|
|
|
|
2008-10-14 05:52:29 +00:00
|
|
|
|
extract_unzip()
|
|
|
|
|
{
|
|
|
|
|
local file="$1"
|
|
|
|
|
local dest="$2"
|
|
|
|
|
|
|
|
|
|
[ ! -f $file ] && exit 1
|
|
|
|
|
|
|
|
|
|
$XBPS_MASTERDIR/bin/unzip -q -x $file -d $dest
|
|
|
|
|
return $?
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-13 05:32:05 +00:00
|
|
|
|
if [ ! -x "$XBPS_MASTERDIR/bin/unzip" ]; then
|
2008-10-06 00:51:34 +00:00
|
|
|
|
unzip_version="5.52"
|
2008-10-02 22:44:43 +00:00
|
|
|
|
|
2008-10-06 00:51:34 +00:00
|
|
|
|
# Save pkgname before installing unzip.
|
|
|
|
|
save_pkgname=$pkgname
|
2008-10-03 12:32:26 +00:00
|
|
|
|
|
2008-10-12 18:05:52 +00:00
|
|
|
|
check_installed_pkg unzip $unzip_version
|
|
|
|
|
if [ $? -ne 0 ]; then
|
2008-10-14 05:52:29 +00:00
|
|
|
|
echo "=> \`\`$save_pkgname<EFBFBD><EFBFBD> package requires unzip for extraction."
|
2008-10-12 18:05:52 +00:00
|
|
|
|
#
|
|
|
|
|
# Install dependencies required by unzip.
|
|
|
|
|
#
|
|
|
|
|
install_builddeps_required_pkg unzip-$unzip_version
|
|
|
|
|
#
|
|
|
|
|
# Install the unzip package now.
|
|
|
|
|
#
|
|
|
|
|
install_pkg unzip
|
2008-10-06 00:51:34 +00:00
|
|
|
|
#
|
|
|
|
|
# Continue with previous template that called us.
|
|
|
|
|
#
|
|
|
|
|
reset_tmpl_vars
|
2008-10-12 18:05:52 +00:00
|
|
|
|
setup_tmpl $save_pkgname
|
2008-10-06 00:51:34 +00:00
|
|
|
|
fi
|
2008-10-02 22:44:43 +00:00
|
|
|
|
|
2008-10-06 00:51:34 +00:00
|
|
|
|
unset save_pkgname
|
|
|
|
|
unset unzip_version
|
|
|
|
|
fi
|