Package Details: btrfsmaintenance 0.5-2

Git Clone URL: https://aur.archlinux.org/btrfsmaintenance.git (read-only, click to copy)
Package Base: btrfsmaintenance
Description: btrfs maintenance scripts
Upstream URL: https://github.com/kdave/btrfsmaintenance
Licenses: GPL2
Conflicts: btrfsmaintenance-git
Submitter: ImNtReal
Maintainer: calebmckay
Last Packager: calebmckay
Votes: 27
Popularity: 0.33
First Submitted: 2016-05-26 14:10 (UTC)
Last Updated: 2021-11-10 04:25 (UTC)

Latest Comments

1 2 Next › Last »

willemw commented on 2022-04-07 07:18 (UTC)

The conflicts=("${pkgname}-git") is still there. Maybe someone forgot to remove it?

calebmckay commented on 2021-11-10 04:27 (UTC)

@qubidt, I have published the changes from your diff. Thank you for the feedback and help.

willemw commented on 2021-11-09 13:35 (UTC)

It was a comment for the current package. Installing the .path for as non-executable is just cleaner.

qubidt commented on 2021-11-09 13:23 (UTC)

In the diff I posted the .path file is not executable (although I don't think this matters much either way as far as systemd is concerned). It's installed with 644 permissions like the .service and .timer files

willemw commented on 2021-11-09 12:59 (UTC)

The .path file should not be executable.

qubidt commented on 2021-11-09 12:11 (UTC)

@willemw no, path units need to be enabled/started just like service/timer units, it won't be enabled unless done so explicitly by the user (as per the Arch standard). see:

https://www.redhat.com/sysadmin/introduction-path-units

willemw commented on 2021-11-09 11:57 (UTC)

@qubidt: Yes, it removes the config file. Thanks.

Have not checked it (yet), but putting the .path file in /usr/lib/systemd/system, wouldn't that enable the auto-refresh feature by default (i.e. trigger the corresponding btrfsmaintenance-refresh.service)? Shouldn't it be up to the user to decide how and when to refresh?

qubidt commented on 2021-11-09 11:21 (UTC)

@willemw that paragraph applies only to files in the backup= array. You can test this by creating a new package with a modified sysconfig.btrfsmaintenance and installing it. Your changes in /etc/default/btrfsmaintenance will be overwritten.

Also, that wouldn't address the case where you remove the package without --nosave. /etc/default/btrfsmaintenance will be incorrectly removed along with the package files

Another issue is the .path systemd unit file isn't being installed to the correct place. Diff with my changes to address both:

diff --git a/PKGBUILD b/PKGBUILD
index c4f77c0..32316e6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,22 +5,28 @@

 pkgname=btrfsmaintenance
 pkgver=0.5
-pkgrel=1
+pkgrel=2
 pkgdesc='btrfs maintenance scripts'
 arch=('any')
 url='https://github.com/kdave/btrfsmaintenance'
 license=('GPL2')
 depends=('bash')
 conflicts=("${pkgname}-git")
+backup=(etc/default/btrfsmaintenance)
 source=("https://github.com/kdave/btrfsmaintenance/archive/v${pkgver}.tar.gz")
 sha256sums=('0de747e630155ecbc438dfac23ffee00cb3f2ee4d01bb67724ef81826709cacb')

+prepare() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  sed -E -i 's|/etc/sysconfig/|/etc/default/|' btrfsmaintenance-refresh.path
+}
+
 package() {
-   cd "${srcdir}/${pkgname}-${pkgver}"
+  cd "${srcdir}/${pkgname}-${pkgver}"
   install -Dm644 sysconfig.btrfsmaintenance "$pkgdir/etc/default/btrfsmaintenance"
   install -dm755 "$pkgdir/"{usr/lib/systemd/system,usr/share/btrfsmaintenance}
-  install -Dm755 btrfs-*.sh btrfsmaintenance-{functions,refresh-cron.sh,refresh.path} README.md "$pkgdir/usr/share/btrfsmaintenance"
-  install -Dm644 *.service *.timer "$pkgdir/usr/lib/systemd/system"
+  install -Dm755 btrfs-*.sh btrfsmaintenance-{functions,refresh-cron.sh} README.md "$pkgdir/usr/share/btrfsmaintenance"
+  install -Dm644 *.service *.timer *.path "$pkgdir/usr/lib/systemd/system"
 }

 # vim:set ts=2 sw=2 et:

willemw commented on 2021-11-09 10:00 (UTC)

Even without backup= the config file won't be overwritten. See "original = X, current = Y, new = Z" in https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave#Types_explained

qubidt commented on 2021-11-09 09:44 (UTC)

should have a backup line so the config doesn't get overwritten:

backup=(etc/default/btrfsmaintenance)