Get parent of script call (may not be pacman)
Check for pre or post args, since no longer checking command. Update manpage.
This commit is contained in:
parent
613a1a3552
commit
c41c294dba
2 changed files with 4 additions and 4 deletions
|
|
@ -56,14 +56,14 @@ Default is "number".
|
|||
.RS 4
|
||||
snapper description used for the pacman pre snapshot.
|
||||
|
||||
Default is the pacman command that called the snapshot.
|
||||
Default is the parent program (usually pacman) that called the snapshot script.
|
||||
.RE
|
||||
|
||||
\fBPACMAN_POST_DESCRIPTION=\fR\fB\fIstring\fR\fR
|
||||
.RS 4
|
||||
snapper description used for the pacman post snapshot.
|
||||
|
||||
Default is the pacman command that called the snapshot.
|
||||
Default is the parent program (usually pacman) that called the snapshot script.
|
||||
.RE
|
||||
|
||||
The following setting can be changed in the snapper configuration file
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper
|
|||
declare -r DESC_LIMIT=48
|
||||
declare -r name="snap-pac"
|
||||
declare PACMAN_ABORT_ON_FAIL="no"
|
||||
declare -r pacman_cmd="$(sed 's./usr/bin/pacman.pacman.g' <(ps -C pacman -o args=))"
|
||||
declare -r pacman_cmd="$(ps -q $(ps -p "$$" -o ppid=) -o args=)"
|
||||
declare -i x=0
|
||||
declare -r pre_or_post=$1
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ set_defaults() {
|
|||
trap error_exit ERR
|
||||
trap kill_exit SIGTERM SIGINT
|
||||
|
||||
[[ -z "$pacman_cmd" ]] && die "snap-pac should only be called via provided pacman hooks."
|
||||
[[ "$pre_or_post" != "pre" ]] && [[ "$pre_or_post" != "post" ]] && die "First argument must be 'pre' or 'post'."
|
||||
[[ ! -d /var/run/dbus ]] && die "No dbus available. Are you in a chroot environment?"
|
||||
|
||||
source "$SNAPPER_CONFIG_FILE"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue