summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schanz2018-08-01 23:51:52 +0200
committerMarkus Schanz2018-08-01 23:51:52 +0200
commit69d68ec88cc8ed8df8ab2dba74edff2b3a3537a1 (patch)
treedadeeeef3978f8e7cc3ae791e0d59ccd6e28bfa8
parent4dfd994b36168053696c67edfabb713627886360 (diff)
downloadaur-69d68ec88cc8ed8df8ab2dba74edff2b3a3537a1.tar.gz
Removed rsync dependency. Always backup /boot (removed configuration option)
-rw-r--r--.SRCINFO12
-rw-r--r--50_bootbackup.hook1
-rw-r--r--CHANGELOG6
-rw-r--r--PKGBUILD15
-rw-r--r--backup-boot-partition6
-rw-r--r--pacman-boot-backup-hook.install20
-rw-r--r--pacman-boot-backup.conf3
7 files changed, 43 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b5c6b228513f..3498b1f31d40 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pacman-boot-backup-hook
- pkgdesc = Pacman hook that uses rsync to backup the /boot directory prior and post to upgrades of the linux or systemd package.
- pkgver = 1.3
- pkgrel = 2
+ pkgdesc = Pacman hook that creates a copy of the /boot directory prior and post to upgrades of the systemd package or when mkinitcpio is triggered.
+ pkgver = 1.4
+ pkgrel = 1
changelog = CHANGELOG
arch = any
license = MIT
@@ -12,10 +12,10 @@ pkgbase = pacman-boot-backup-hook
source = uu_bootbackup.hook
source = pacman-boot-backup.conf
md5sums = ac9ac34b11dd5a53d096a734ab677479
- md5sums = 3cd8131ceb4563164ab12cc7b7d61ed6
- md5sums = c5cca1a979e913f87e859436919c016c
+ md5sums = b9dcf01f081c8a2aa10b53e46b2add06
+ md5sums = a38b6feb83944ea401e871b2c2fa704d
md5sums = f041fe352b3f48f08a1afad132312b94
- md5sums = c5d37420cddc494cba64930ea54518b1
+ md5sums = 24b9fcd221dce61036831f9a6e2b49bb
pkgname = pacman-boot-backup-hook
diff --git a/50_bootbackup.hook b/50_bootbackup.hook
index 906875dcb52c..97ddabc5bdde 100644
--- a/50_bootbackup.hook
+++ b/50_bootbackup.hook
@@ -15,6 +15,5 @@ Target = usr/lib/initcpio/*
[Action]
Description = Backup boot partition...
When = PreTransaction
-Depends = rsync
Exec = /usr/share/libalpm/scripts/backup-boot-partition pre
AbortOnFail
diff --git a/CHANGELOG b/CHANGELOG
index 5c2dc8086c9f..b2bf38f82045 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+v1.4 (2018/08/01):
+- Simplified package by dropping rsync dependency
+ - cp is now used in favor of rsync
+- Removed possibility to customize backup source directory (always backup /boot)
+
v1.3 (2018/01/14):
- The hook trigger has been modified to match that of 90-linux.hook
- The hook names were changed in order to execute not too early/late
@@ -12,4 +17,3 @@ v1.1 (2018/01/05):
v1.0 (2017/12/31):
- Initial release
-
diff --git a/PKGBUILD b/PKGBUILD
index b10c34b1c434..b49b1d0fd7e4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,9 @@
# Maintainer: Markus Schanz <coksnuss@googlemail.com>
pkgname=pacman-boot-backup-hook
-pkgver=1.3
-pkgrel=2
-pkgdesc="Pacman hook that uses rsync to backup the /boot directory prior and post to upgrades of the linux or systemd package."
+pkgver=1.4
+pkgrel=1
+pkgdesc="Pacman hook that creates a copy of the /boot directory prior and post to upgrades of the systemd package or when mkinitcpio is triggered."
+install=$pkgname.install
arch=('any')
license=('MIT')
changelog=CHANGELOG
@@ -12,12 +13,12 @@ source=('LICENSE'
'backup-boot-partition'
'50_bootbackup.hook'
'uu_bootbackup.hook'
- 'pacman-boot-backup.conf')
+ 'pacman-boot-backup.conf')
md5sums=('ac9ac34b11dd5a53d096a734ab677479'
- '3cd8131ceb4563164ab12cc7b7d61ed6'
- 'c5cca1a979e913f87e859436919c016c'
+ 'b9dcf01f081c8a2aa10b53e46b2add06'
+ 'a38b6feb83944ea401e871b2c2fa704d'
'f041fe352b3f48f08a1afad132312b94'
- 'c5d37420cddc494cba64930ea54518b1')
+ '24b9fcd221dce61036831f9a6e2b49bb')
package() {
install -m 0755 -d $pkgdir/usr/share/licenses/$pkgname
diff --git a/backup-boot-partition b/backup-boot-partition
index bd7bf6cf6f86..958ae8219a3d 100644
--- a/backup-boot-partition
+++ b/backup-boot-partition
@@ -3,8 +3,8 @@
[[ "$1" != "pre" && "$1" != "post" ]] && exit 1
[[ -f /etc/pacman-boot-backup.conf ]] && . /etc/pacman-boot-backup.conf
-BACKUP_PATH_SRC=$(echo ${BACKUP_PATH_SRC:-/boot} | sed 's#/$##')
-BACKUP_PATH_DEST=$(echo ${BACKUP_PATH_DEST:-/.bootbackup} | sed 's#/$##')/$1
+BACKUP_PATH_DEST=${BACKUP_PATH_DEST:-/.bootbackup}/$1
+rm -rf "${BACKUP_PATH_DEST}"
mkdir -p "${BACKUP_PATH_DEST}"
-/usr/bin/rsync -azq --delete "${BACKUP_PATH_SRC}/" "${BACKUP_PATH_DEST}"
+cp -aT /boot "${BACKUP_PATH_DEST}"
diff --git a/pacman-boot-backup-hook.install b/pacman-boot-backup-hook.install
new file mode 100644
index 000000000000..b99b665c18b1
--- /dev/null
+++ b/pacman-boot-backup-hook.install
@@ -0,0 +1,20 @@
+all_off="$(tput sgr0)"
+bold="${all_off}$(tput bold)"
+blue="${bold}$(tput setaf 4)"
+yellow="${bold}$(tput setaf 3)"
+
+msg() {
+ printf "${blue}==>${bold} $1${all_off}\n"
+}
+
+warning() {
+ printf "${blue}==>${yellow} WARNING$2:${bold} $1${all_off}\n"
+}
+
+post_upgrade() {
+ if [[ $1 == 1.4-* && $2 == 1.3-* ]]; then
+ warning "Variable \$BACKUP_PATH_SRC in pacman-boot-backup.conf is no longer effective!"
+ msg "In case /etc/pacman-boot-backup.conf wasn't modified, no actions are required!"
+ msg "From now on, only files within /boot will be backed up!"
+ fi
+}
diff --git a/pacman-boot-backup.conf b/pacman-boot-backup.conf
index 4836ecf4adb1..9cacd3edcc8d 100644
--- a/pacman-boot-backup.conf
+++ b/pacman-boot-backup.conf
@@ -1,5 +1,5 @@
# Configuration of pacman-boot-backup-hook
-#
+#
# Use this configuration to override the default directories from/to which
# backups are created/stored when the linux or systemd package is upgraded.
# By default the contents of /boot will be backed up to /.bootbackup
@@ -8,5 +8,4 @@
# destination path. These directories will contain the backup of the source
# directory prior and after the package upgrade, respectively.
-#BACKUP_PATH_SRC=/boot/
#BACKUP_PATH_DEST=/.bootbackup