summarylogtreecommitdiffstats
path: root/vmware-modules-dkms-git.install
blob: f69f2648079754347e9c3e57d79ed605709d4c25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Author: Matt Wilder <me@partcyb.org>
# vim: set ft=sh:

_clone() {
   git clone https://github.com/mkubecek/vmware-host-modules /usr/src/vmware-host-modules-${1//-*/}
}


pre_install() {
   _clone "$1"
}


pre_upgrade() {
   # Don't clone if this a reinstall
   # of the same version
   [[ "${1//-*/}" == "${2//-*/}" ]] || _clone "$1"
}

post_upgrade() {
   # Don't remove if this a reinstall
   # of the same version
   [[ "${1//-*/}" == "${2//-*/}" ]] || _remove "$2"
}

post_remove() {
   _remove "$1"
}


_remove() {
   rm -rf /usr/src/vmware-host-modules-${1//-*/}
}