2008-10-03 14:32:26 +02:00
|
|
|
|
#
|
|
|
|
|
# This helper is used in templates using extract_sufx=".zip".
|
|
|
|
|
# This checks if unzip is installed and installs it if it's not
|
2008-10-03 17:19:37 +02:00
|
|
|
|
# and sets the unzip_cmd/extract_cmd variables appropiately.
|
2008-10-03 14:32:26 +02:00
|
|
|
|
#
|
2008-10-06 02:51:34 +02:00
|
|
|
|
# If unzip is already installed just return immediately.
|
2008-10-12 20:05:52 +02:00
|
|
|
|
|
2008-10-13 07:32:05 +02:00
|
|
|
|
if [ ! -x "$XBPS_MASTERDIR/bin/unzip" ]; then
|
2008-10-06 02:51:34 +02:00
|
|
|
|
unzip_version="5.52"
|
2008-10-03 00:44:43 +02:00
|
|
|
|
|
2008-10-06 02:51:34 +02:00
|
|
|
|
# Save pkgname before installing unzip.
|
|
|
|
|
save_pkgname=$pkgname
|
2008-10-03 14:32:26 +02:00
|
|
|
|
|
2008-10-12 20:05:52 +02:00
|
|
|
|
check_installed_pkg unzip $unzip_version
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
|
echo "=> \`\`$pkg<EFBFBD><EFBFBD> package requires unzip for extraction."
|
|
|
|
|
#
|
|
|
|
|
# Install dependencies required by unzip.
|
|
|
|
|
#
|
|
|
|
|
install_builddeps_required_pkg unzip-$unzip_version
|
|
|
|
|
#
|
|
|
|
|
# Install the unzip package now.
|
|
|
|
|
#
|
|
|
|
|
install_pkg unzip
|
2008-10-06 02:51:34 +02:00
|
|
|
|
#
|
|
|
|
|
# Continue with previous template that called us.
|
|
|
|
|
#
|
|
|
|
|
reset_tmpl_vars
|
2008-10-12 20:05:52 +02:00
|
|
|
|
setup_tmpl $save_pkgname
|
2008-10-06 02:51:34 +02:00
|
|
|
|
fi
|
2008-10-03 00:44:43 +02:00
|
|
|
|
|
2008-10-06 02:51:34 +02:00
|
|
|
|
unset save_pkgname
|
|
|
|
|
unset unzip_version
|
|
|
|
|
fi
|
2008-10-03 17:19:37 +02:00
|
|
|
|
|
2008-10-13 07:32:05 +02:00
|
|
|
|
unzip_cmd=$XBPS_MASTERDIR/bin/unzip
|
|
|
|
|
extract_cmd="$unzip_cmd -x $dfile -d $XBPS_BUILDDIR"
|