2008-10-03 12:32:26 +00: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 15:19:37 +00:00
|
|
|
|
# and sets the unzip_cmd/extract_cmd variables appropiately.
|
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
|
|
|
|
|
|
|
|
|
if [ ! -x "$PKGFS_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
|
|
|
|
|
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 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
|
2008-10-03 15:19:37 +00:00
|
|
|
|
|
2008-10-02 22:44:43 +00:00
|
|
|
|
unzip_cmd=$PKGFS_MASTERDIR/bin/unzip
|
2008-10-03 15:19:37 +00:00
|
|
|
|
extract_cmd="$unzip_cmd -x $dfile -d $PKGFS_BUILDDIR"
|