feat(hook): Use separate hook per transaction type (#1)
This commit is contained in:
parent
f7f6d71250
commit
1113a32888
@ -53,4 +53,5 @@ The following _scopes_ are known for this project. A Conventional Commits commit
|
|||||||
- `auto`: Change how `zfs-auto-snapshot` is run
|
- `auto`: Change how `zfs-auto-snapshot` is run
|
||||||
- `conf`: How we deal with script config
|
- `conf`: How we deal with script config
|
||||||
- `script`: Any other script work that doesn't specifically fall into the above scopes
|
- `script`: Any other script work that doesn't specifically fall into the above scopes
|
||||||
|
- `hook`: Configuring the hook(s)
|
||||||
- `meta`: Affects the project's repo layout, readme content, file names etc.
|
- `meta`: Affects the project's repo layout, readme content, file names etc.
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
[Trigger]
|
[Trigger]
|
||||||
Operation = Install
|
Operation = Install
|
||||||
Operation = Upgrade
|
|
||||||
Operation = Remove
|
|
||||||
Type = Package
|
Type = Package
|
||||||
Target = *
|
Target = *
|
||||||
|
|
||||||
[Action]
|
[Action]
|
||||||
Description = Create ZFS snapshot on active system dataset
|
Description = Create ZFS snapshot on active system dataset
|
||||||
When = PreTransaction
|
When = PreTransaction
|
||||||
Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot'
|
Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot install'
|
||||||
Depends = zfs-auto-snapshot
|
Depends = zfs-auto-snapshot
|
||||||
AbortOnFail
|
AbortOnFail
|
||||||
NeedsTargets
|
NeedsTargets
|
12
pacman-zfs-snapshot-remove.hook
Normal file
12
pacman-zfs-snapshot-remove.hook
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Trigger]
|
||||||
|
Operation = Remove
|
||||||
|
Type = Package
|
||||||
|
Target = *
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Create ZFS snapshot on active system dataset
|
||||||
|
When = PreTransaction
|
||||||
|
Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot remove'
|
||||||
|
Depends = zfs-auto-snapshot
|
||||||
|
AbortOnFail
|
||||||
|
NeedsTargets
|
12
pacman-zfs-snapshot-upgrade.hook
Normal file
12
pacman-zfs-snapshot-upgrade.hook
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Trigger]
|
||||||
|
Operation = Upgrade
|
||||||
|
Type = Package
|
||||||
|
Target = *
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Create ZFS snapshot on active system dataset
|
||||||
|
When = PreTransaction
|
||||||
|
Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot upgrade'
|
||||||
|
Depends = zfs-auto-snapshot
|
||||||
|
AbortOnFail
|
||||||
|
NeedsTargets
|
Loading…
x
Reference in New Issue
Block a user