File dnf5-actions-snapper.actions of Package dnf5-actions-snapper

# Creates a pre snapshot before the transaction, adds a description, uses the "number" algorithm, sets userdata, and stores the snapshot number in "tmp.snapper_pre_number".
pre_transaction::::/usr/bin/sh -c echo\ "tmp.snapper_pre_number=$(snapper\ create\ -t\ pre\ -p\ -d\ 'libdnf5'\ --userdata\ 'important=yes'\ --cleanup-algorithm\ 'number')"

# If the variable "tmp.snapper_pre_number" exists, it creates a post snapshot after the transaction with similar parameters and clears the "tmp.snapper_pre_number".
post_transaction::::/usr/bin/sh -c if\ [ -n\ "${tmp.snapper_pre_number}"\ ];\ then\ snapper\ create\ -t\ post\ --pre-number\ "${tmp.snapper_pre_number}"\ -d\ 'libdnf5'\ --userdata\ 'important=yes'\ --cleanup-algorithm\ 'number';\ echo\ tmp.snapper_pre_number='';\ fi

openSUSE Build Service is sponsored by