Commit 9ca91b2d authored by Xuetian Weng's avatar Xuetian Weng

improve vbox ext oracle

parent aba34017
......@@ -10,7 +10,7 @@ pkgname=('virtualbox'
'virtualbox-ext-vnc'
'virtualbox-ext-oracle')
pkgver=5.1.2
pkgrel=5
pkgrel=7
arch=('x86_64')
url='http://virtualbox.org'
license=('GPL')
......
VBOXVER=5.1.2
SRC_URL=http://download.virtualbox.org/virtualbox/${VBOXVER}/Oracle_VM_VirtualBox_Extension_Pack-${VBOXVER}.vbox-extpack
MD5SUM=7614ce90e17297f80d6a5822252c90d9
#!/bin/bash
DIR=/usr/share/virtualbox/extensions
TMP_DIR=/tmp/Oracle_VM_VirtualBox_Extension_Pack
......@@ -9,34 +7,41 @@ virtualbox-ext-oracle-installer() {
[ -d $TMP_DIR ] && rm -rf $TMP_DIR
mkdir $TMP_DIR
cd $TMP_DIR
echo "$MD5SUM $DIR/Oracle_VM_VirtualBox_Extension_Pack-${VBOXVER}.vbox-extpack" > md5sums.check
wget "https://www.virtualbox.org/download/hashes/$1/SHA256SUMS" -O SHA256SUMS
EXTPACK_FILE="Oracle_VM_VirtualBox_Extension_Pack-${1}.vbox-extpack"
if md5sum -c md5sums.check
if sha256sum -c SHA256SUMS > /dev/null 2>&1
then
echo "nothing to do, you are already using the latest VirtualBox Extension provided by Oracle"
else
wget $SRC_URL
cp -f Oracle_VM_VirtualBox_Extension_Pack-${VBOXVER}.vbox-extpack $DIR/
SRC_URL="http://download.virtualbox.org/virtualbox/${1}/${EXTPACK_FILE}"
wget "$SRC_URL" -O "${EXTPACK_FILE}"
cp -f "${EXTPACK_FILE}" $DIR/
fi
}
post_install () {
virtualbox-ext-oracle-installer
VBoxManage extpack install "${DIR}/Oracle_VM_VirtualBox_Extension_Pack-${VBOXVER}.vbox-extpack" >/dev/null
# arg 1: the new package version
post_install() {
virtualbox-ext-oracle-installer "${1%%-*}"
VBoxManage extpack install "${DIR}/Oracle_VM_VirtualBox_Extension_Pack-${1%%-*}.vbox-extpack" >/dev/null
}
# arg 1: the new package version
# arg 2: the old package version
pre_upgrade() {
post_remove
pre_remove "$2"
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install
post_install "$1"
}
post_remove() {
# arg 1: the old package version
pre_remove() {
VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack" >/dev/null
rm -rf ${DIR}/Oracle_VM_VirtualBox_Extension_Pack-${VBOXVER}.vbox-extpack >/dev/null
rm -rf ${DIR}/Oracle_VM_VirtualBox_Extension_Pack-${1%%-*}.vbox-extpack >/dev/null
}
# vim:set ts=2 sw=2 ft=sh et:
# vim:set ts=2 sw=2 ft=sh et:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment