diff -Nru btrfsmaintenance-0.5/debian/btrfsmaintenance.lintian-overrides btrfsmaintenance-0.5/debian/btrfsmaintenance.lintian-overrides --- btrfsmaintenance-0.5/debian/btrfsmaintenance.lintian-overrides 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/btrfsmaintenance.lintian-overrides 2022-03-14 00:00:44.000000000 +0000 @@ -1 +1,6 @@ -btrfsmaintenance: script-not-executable usr/share/btrfsmaintenance/btrfsmaintenance-functions +# This script is sourced and should not be directly executed +# usr/share/btrfsmaintenance/btrfsmaintenance-functions +btrfsmaintenance: script-not-executable + +# Man page is provided for the systemd services' Documentation key +btrfsmaintenance: spare-manual-page usr/share/man/man8/btrfsmaintenance.8.gz diff -Nru btrfsmaintenance-0.5/debian/changelog btrfsmaintenance-0.5/debian/changelog --- btrfsmaintenance-0.5/debian/changelog 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/changelog 2022-03-14 00:00:44.000000000 +0000 @@ -1,3 +1,31 @@ +btrfsmaintenance (0.5-3) unstable; urgency=medium + + [ Vagrant Cascadian ] + * debian/create-man-page.sh: Use UTC timezone and a locale-idependent date + string. Without this, the locale may output a translated month, or + building in a different timezone may result in a different day or month. + (Closes: #1007185) + + -- Nicholas D Steeves Sun, 13 Mar 2022 20:00:44 -0400 + +btrfsmaintenance (0.5-2) unstable; urgency=medium + + * Update my email address in control, copyright, and patches. + * Rename use-default-not-sysconfig.patch + -> 0001-use-default-not-sysconfig.patch + * 0001-use-default-not-sysconfig.patch: + + Fix each remaining instance of /etc/sysconfig. + + Also remove instructions that are not pertinent to the Debian package + and that may confuse users. + * Build man page from README.md. + * Update 0002-Add-doc-key-to-btrfsmaintenance-refresh.service.patch to + use the new man page as documentation. + * Update and document lintian override for script-not-executable, and add + override for spare-manual-page. + * Declare Standards-Version: 4.6.0. (No additional changes needed) + + -- Nicholas D Steeves Sat, 12 Mar 2022 08:20:00 -0500 + btrfsmaintenance (0.5-1) unstable; urgency=medium * New upstream release. (Closes: #970732) diff -Nru btrfsmaintenance-0.5/debian/control btrfsmaintenance-0.5/debian/control --- btrfsmaintenance-0.5/debian/control 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/control 2022-03-14 00:00:44.000000000 +0000 @@ -1,10 +1,11 @@ Source: btrfsmaintenance Section: admin Priority: optional -Maintainer: Nicholas D Steeves +Maintainer: Nicholas D Steeves Build-Depends: debhelper-compat (= 13), dh-exec (>= 0.14) + , go-md2man Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.6.0 Homepage: https://github.com/kdave/btrfsmaintenance Vcs-Git: https://salsa.debian.org/sten-guest/btrfsmaintenance.git Vcs-Browser: https://salsa.debian.org/sten-guest/btrfsmaintenance diff -Nru btrfsmaintenance-0.5/debian/copyright btrfsmaintenance-0.5/debian/copyright --- btrfsmaintenance-0.5/debian/copyright 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/copyright 2022-03-14 00:00:44.000000000 +0000 @@ -9,7 +9,7 @@ License: GPL-2 Files: debian/* -Copyright: 2017 Nicholas D Steeves +Copyright: 2017 Nicholas D Steeves License: GPL-2 License: GPL-2 diff -Nru btrfsmaintenance-0.5/debian/create-man-page.sh btrfsmaintenance-0.5/debian/create-man-page.sh --- btrfsmaintenance-0.5/debian/create-man-page.sh 1970-01-01 00:00:00.000000000 +0000 +++ btrfsmaintenance-0.5/debian/create-man-page.sh 2022-03-14 00:00:44.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh + +man_date=$(date --utc -d "@$(dpkg-parsechangelog -STimestamp)" +"%Y-%m-%d") + +cat << EOF > debian/tmp/btrfsmaintenance.md +% BTRFSMAINTENANCE 8 "$man_date" v$DEB_VERSION_UPSTREAM + +NAME +==== + +**btrfsmaintenance** - automate btrfs maintenance tasks + +NOTE +==== + +Refer to /usr/share/doc/btrfsmaintenance/README.Debian in addition to +this man page. + +DESCRIPTION +=========== +EOF + +sed '1,8d' README.md >> debian/tmp/btrfsmaintenance.md +go-md2man -in=debian/tmp/btrfsmaintenance.md -out=debian/tmp/btrfsmaintenance.8 diff -Nru btrfsmaintenance-0.5/debian/manpages btrfsmaintenance-0.5/debian/manpages --- btrfsmaintenance-0.5/debian/manpages 1970-01-01 00:00:00.000000000 +0000 +++ btrfsmaintenance-0.5/debian/manpages 2022-03-14 00:00:44.000000000 +0000 @@ -0,0 +1 @@ +btrfsmaintenance.8 diff -Nru btrfsmaintenance-0.5/debian/not-installed btrfsmaintenance-0.5/debian/not-installed --- btrfsmaintenance-0.5/debian/not-installed 1970-01-01 00:00:00.000000000 +0000 +++ btrfsmaintenance-0.5/debian/not-installed 2022-03-14 00:00:44.000000000 +0000 @@ -0,0 +1 @@ +debian/tmp/btrfsmaintenance.md diff -Nru btrfsmaintenance-0.5/debian/patches/0001-use-default-not-sysconfig.patch btrfsmaintenance-0.5/debian/patches/0001-use-default-not-sysconfig.patch --- btrfsmaintenance-0.5/debian/patches/0001-use-default-not-sysconfig.patch 1970-01-01 00:00:00.000000000 +0000 +++ btrfsmaintenance-0.5/debian/patches/0001-use-default-not-sysconfig.patch 2022-03-14 00:00:44.000000000 +0000 @@ -0,0 +1,253 @@ +From: Nicholas D Steeves +Date: Fri, 18 Jun 2021 20:03:21 -0400 +Subject: Use /etc/default not /etc/sysconfig + +Last-Update: 2022-03-12 +Forwarded: not-needed + +Debian does not use /etc/sysconfig. This patch replaces every +instance of /etc/sysconfig with /etc/default, and also removes +instructions that are not pertinent to the Debian package and that may +confuse users. +--- + README.md | 78 +++++----------------------------------- + btrfs-balance.sh | 4 +-- + btrfs-defrag.sh | 4 +-- + btrfs-scrub.sh | 4 +-- + btrfs-trim.sh | 4 +-- + btrfsmaintenance-refresh-cron.sh | 4 +-- + btrfsmaintenance-refresh.path | 4 +-- + update-balance-usage-defaults.sh | 4 +-- + 8 files changed, 22 insertions(+), 84 deletions(-) + +diff --git a/README.md b/README.md +index 42b2f52..e7948cb 100644 +--- a/README.md ++++ b/README.md +@@ -113,9 +113,6 @@ Metadata consumption follows a different pattern and reclaiming only the almost + unused chunks makes more sense, otherwise there's enough reserved metadata + space for operations like reflink or snapshotting. + +-A convenience script is provided to update the unchanged defaults, +-`/usr/share/btrfsmaintenance/update-balance-usage-defaults.sh` . +- + ### trim ### + + __Description:__ The TRIM operation (aka. *discard*) can instruct the underlying device to +@@ -148,16 +145,6 @@ enumerated in the respective config variable. The command utilizes `find + -xdev`, you can use that to verify in advance which paths will the + defragmentation affect. + +-__Special case:__ +- +-There's a separate defragmentation task that happens automatically and +-defragments only the RPM database files. This is done via a *zypper* plugin +-and the defrag pass triggers at the end of the installation. +- +-This improves reading the RPM databases later, but the installation process +-fragments the files very quickly so it's not likely to bring a significant +-speedup here. +- + + ## Periodic scheduling ## + +@@ -169,7 +156,7 @@ at the installation time. + + Cron takes care of periodic execution of the scripts, but they can be run any + time directly from `/usr/share/btrfsmaintenance/`, respecting the configured +-values in `/etc/sysconfig/btrfsmaintenance`. ++values in `/etc/defaul/btrfsmaintenance`. + + The changes to configuration file need to be reflected in the `/etc/cron` + directories where the scripts are linked for the given period. +@@ -177,48 +164,19 @@ directories where the scripts are linked for the given period. + If the period is changed, the cron symlinks have to be refreshed: + + * manually -- use `systemctl restart btrfsmaintenance-refresh` (or the `rcbtrfsmaintenance-refresh` shortcut) +-* in *yast2* -- sysconfig editor triggers the refresh automatically +-* using a file watcher -- if you install `btrfsmaintenance-refresh.path`, this will utilize the file monitor to detect changes and will run the refresh ++* using a file watcher -- if `btrfsmaintenance-refresh.path` is enabled, this will utilize the file monitor to detect changes and will run the refresh + + ### Systemd timers ### + +-There's a set of timer units that run the respective task script. The periods +-are configured in the `/etc/sysconfig/btrfsmaintenance` file as well. The +-timers have to be installed using a similar way as cron. Please note that the +-'*.timer' and respective '*.service' files have to be installed so the timers +-work properly. ++There's a set of timer units that run the respective task script. The ++periods are configured in the `/etc/default/btrfsmaintenance` file as ++well. Please note that the '*.timer' and respective '*.service' files ++must be manually enabled before the timers will work properly. + + + ## Quick start ## + +-The tasks' periods and other parameters should fit most use cases and do not +-need to be touched. Review the mount points (variables ending with +-`_MOUNTPOINTS`) whether you want to run the tasks there or not. +- +-## Distro integration ## +- +-Currently the support for widely used distros is present. More distros can be +-added. This section describes how the pieces are put together and should give +-some overview. +- +-### Installation ### +- +-For debian based systems, run `dist-install.sh` as root. +- +-For non-debian based systems, check for distro provided package or +-do manual installation of files as described below. +- +-* `btrfs-*.sh` task scripts are expected at `/usr/share/btrfsmaintenance` +-* `sysconfig.btrfsmaintenance` configuration template is put to: +- * `/etc/sysconfig/btrfsmaintenance` on SUSE and RedHat based systems or derivatives +- * `/etc/default/btrfsmaintenance` on Debian and derivatives +-* `/usr/lib/zypp/plugins/commit/btrfs-defrag-plugin.sh` or +- `/usr/lib/zypp/plugins/commit/btrfs-defrag-plugin.py` post-update script for +- zypper (the package manager), applies to SUSE-based distros for now +-* cron refresh scripts are installed (see bellow) +- +-The defrag plugin has a shell and python implementation, choose what suits the +-installation better. ++Refer to /usr/share/doc/btrfsmaintenance/README.Debian for instructions to enable the Systemd timers. + + ### cron jobs ### + +@@ -232,29 +190,9 @@ configuration tool if it's capable of running post-change scripts or services. + In that case there's `btrfsmaintenance-refresh.service` systemd service. + + This service can also be automatically started upon any modification of the +-configuration file in `/etc/sysconfig/btrfsmaintenance` by installing the ++configuration file in `/etc/default/btrfsmaintenance` by enabling the + `btrfsmaintenance-refresh.path` systemd watcher. + +-### Post-update defragmentation ### +- +-The package database files tend to be updated in a random way and get +-fragmented, which particularly hurts on btrfs. For rpm-based distros this means files +-in `/var/lib/rpm`. The script or plugin simply runs a defragmentation on the affected files. +-See `btrfs-defrag-plugin.sh` or `btrfs-defrag-plugin.py` for more details. +- +-At the moment the 'zypper' package manager plugin exists. As the package +-managers differ significantly, there's no single plugin/script to do that. +- +-### Settings ### +- +-The settings are copied to the expected system location from the template +-(`sysconfig.btrfsmaintenance`). This is a shell script and can be sourced to obtain +-values of the variables. +- +-The template contains descriptions of the variables, default and possible +-values and can be deployed without changes (expecting the root filesystem to be +-btrfs). +- + ## Tuning periodic snapshotting ## + + There are various tools and handwritten scripts to manage periodic snapshots +diff --git a/btrfs-balance.sh b/btrfs-balance.sh +index 2a55df5..6541fd9 100644 +--- a/btrfs-balance.sh ++++ b/btrfs-balance.sh +@@ -6,8 +6,8 @@ umask 022 + PATH=/sbin:/bin:/usr/sbin:/usr/bin + export PATH + +-if [ -f /etc/sysconfig/btrfsmaintenance ] ; then +- . /etc/sysconfig/btrfsmaintenance ++if [ -f /etc/default/btrfsmaintenance ] ; then ++ . /etc/default/btrfsmaintenance + fi + + if [ -f /etc/default/btrfsmaintenance ] ; then +diff --git a/btrfs-defrag.sh b/btrfs-defrag.sh +index 5511833..be64593 100755 +--- a/btrfs-defrag.sh ++++ b/btrfs-defrag.sh +@@ -6,8 +6,8 @@ umask 022 + PATH=/sbin:/bin:/usr/sbin:/usr/bin + export PATH + +-if [ -f /etc/sysconfig/btrfsmaintenance ] ; then +- . /etc/sysconfig/btrfsmaintenance ++if [ -f /etc/default/btrfsmaintenance ] ; then ++ . /etc/default/btrfsmaintenance + fi + + if [ -f /etc/default/btrfsmaintenance ] ; then +diff --git a/btrfs-scrub.sh b/btrfs-scrub.sh +index a04716a..14a72b7 100644 +--- a/btrfs-scrub.sh ++++ b/btrfs-scrub.sh +@@ -6,8 +6,8 @@ umask 022 + PATH=/sbin:/bin:/usr/sbin:/usr/bin + export PATH + +-if [ -f /etc/sysconfig/btrfsmaintenance ] ; then +- . /etc/sysconfig/btrfsmaintenance ++if [ -f /etc/default/btrfsmaintenance ] ; then ++ . /etc/default/btrfsmaintenance + fi + + if [ -f /etc/default/btrfsmaintenance ] ; then +diff --git a/btrfs-trim.sh b/btrfs-trim.sh +index 194e566..ad2d854 100644 +--- a/btrfs-trim.sh ++++ b/btrfs-trim.sh +@@ -6,8 +6,8 @@ umask 022 + PATH=/sbin:/bin:/usr/sbin:/usr/bin + export PATH + +-if [ -f /etc/sysconfig/btrfsmaintenance ] ; then +- . /etc/sysconfig/btrfsmaintenance ++if [ -f /etc/default/btrfsmaintenance ] ; then ++ . /etc/default/btrfsmaintenance + fi + + if [ -f /etc/default/btrfsmaintenance ] ; then +diff --git a/btrfsmaintenance-refresh-cron.sh b/btrfsmaintenance-refresh-cron.sh +index e852b48..7aaa5c8 100755 +--- a/btrfsmaintenance-refresh-cron.sh ++++ b/btrfsmaintenance-refresh-cron.sh +@@ -11,8 +11,8 @@ export PATH + + SCRIPTS=/usr/share/btrfsmaintenance + +-if [ -f /etc/sysconfig/btrfsmaintenance ]; then +- . /etc/sysconfig/btrfsmaintenance ++if [ -f /etc/default/btrfsmaintenance ]; then ++ . /etc/default/btrfsmaintenance + fi + + if [ -f /etc/default/btrfsmaintenance ]; then +diff --git a/btrfsmaintenance-refresh.path b/btrfsmaintenance-refresh.path +index d56ad11..f0b4132 100644 +--- a/btrfsmaintenance-refresh.path ++++ b/btrfsmaintenance-refresh.path +@@ -1,8 +1,8 @@ + [Unit] +-Description=Watch /etc/sysconfig/btrfsmaintenance ++Description=Watch /etc/default/btrfsmaintenance + + [Path] +-PathChanged=/etc/sysconfig/btrfsmaintenance ++PathChanged=/etc/default/btrfsmaintenance + + [Install] + WantedBy=multi-user.target +diff --git a/update-balance-usage-defaults.sh b/update-balance-usage-defaults.sh +index cc4baf7..3ad3676 100755 +--- a/update-balance-usage-defaults.sh ++++ b/update-balance-usage-defaults.sh +@@ -6,8 +6,8 @@ + file= + dryrun=false + +-if [ -f /etc/sysconfig/btrfsmaintenance ] ; then +- file=/etc/sysconfig/btrfsmaintenance ++if [ -f /etc/default/btrfsmaintenance ] ; then ++ file=/etc/default/btrfsmaintenance + fi + + if [ -f /etc/default/btrfsmaintenance ] ; then diff -Nru btrfsmaintenance-0.5/debian/patches/0002-Add-doc-key-to-btrfsmaintenance-refresh.service.patch btrfsmaintenance-0.5/debian/patches/0002-Add-doc-key-to-btrfsmaintenance-refresh.service.patch --- btrfsmaintenance-0.5/debian/patches/0002-Add-doc-key-to-btrfsmaintenance-refresh.service.patch 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/patches/0002-Add-doc-key-to-btrfsmaintenance-refresh.service.patch 2022-03-14 00:00:44.000000000 +0000 @@ -2,22 +2,25 @@ Date: Tue, 11 Aug 2020 23:02:48 -0400 Subject: Add doc key to btrfsmaintenance-refresh.service -This enables `systemctl help servicename` to function correctly by -displaying the documentation associated with the service. +Last-Update: 2021-11-29 +Bug: https://github.com/kdave/btrfsmaintenance/issues/83 +Forwarded: https://github.com/kdave/btrfsmaintenance/pull/92 -Closes #83 +This enables correct functioning of `systemctl help servicename`, +which should display the documentation associated with the service. --- - btrfsmaintenance-refresh.service | 1 + - 1 file changed, 1 insertion(+) + btrfsmaintenance-refresh.service | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btrfsmaintenance-refresh.service b/btrfsmaintenance-refresh.service -index 4ed1eb4..14e8e90 100644 +index 4ed1eb4..e82a855 100644 --- a/btrfsmaintenance-refresh.service +++ b/btrfsmaintenance-refresh.service @@ -1,5 +1,6 @@ [Unit] - Description=Update cron periods from /etc/sysconfig/btrfsmaintenance -+Documentation="file:/usr/share/doc/btrfsmaintenance/README.md.gz" +-Description=Update cron periods from /etc/sysconfig/btrfsmaintenance ++Description=Update cron periods from /etc/default/btrfsmaintenance ++Documentation=man:btrfsmaintenance(8) [Service] ExecStart=/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh systemd-timer diff -Nru btrfsmaintenance-0.5/debian/patches/series btrfsmaintenance-0.5/debian/patches/series --- btrfsmaintenance-0.5/debian/patches/series 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/patches/series 2022-03-14 00:00:44.000000000 +0000 @@ -1,2 +1,2 @@ -use-default-not-sysconfig.patch +0001-use-default-not-sysconfig.patch 0002-Add-doc-key-to-btrfsmaintenance-refresh.service.patch diff -Nru btrfsmaintenance-0.5/debian/patches/use-default-not-sysconfig.patch btrfsmaintenance-0.5/debian/patches/use-default-not-sysconfig.patch --- btrfsmaintenance-0.5/debian/patches/use-default-not-sysconfig.patch 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/patches/use-default-not-sysconfig.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Description: Use /etc/default not /etc/sysconfig - Debian does not use /etc/sysconfig. The watch file should watch - /etc/default/btrfsmaintenance for changes in configuration. -Author: Nicholas D Steeves -Forwarded: not-needed -Last-Update: 2018-02-02 - ---- btrfsmaintenance-0.4.orig/btrfsmaintenance-refresh.path -+++ btrfsmaintenance-0.4/btrfsmaintenance-refresh.path -@@ -1,8 +1,8 @@ - [Unit] --Description=Watch /etc/sysconfig/btrfsmaintenance -+Description=Watch /etc/default/btrfsmaintenance - - [Path] --PathChanged=/etc/sysconfig/btrfsmaintenance -+PathChanged=/etc/default/btrfsmaintenance - - [Install] - WantedBy=multi-user.target diff -Nru btrfsmaintenance-0.5/debian/rules btrfsmaintenance-0.5/debian/rules --- btrfsmaintenance-0.5/debian/rules 2020-10-03 01:47:48.000000000 +0000 +++ btrfsmaintenance-0.5/debian/rules 2022-03-14 00:00:44.000000000 +0000 @@ -1,5 +1,8 @@ #!/usr/bin/make -f +include /usr/share/dpkg/pkg-info.mk +export DEB_VERSION_UPSTREAM + %: dh $@ @@ -7,6 +10,11 @@ dh_installdeb chmod +x debian/btrfsmaintenance/usr/share/btrfsmaintenance/*.sh +override_dh_auto_install: + dh_auto_install + mkdir -p debian/tmp + debian/create-man-page.sh + override_dh_installsystemd: dh_installsystemd --no-enable --no-start btrfs-balance.timer dh_installsystemd --no-enable --no-start btrfs-defrag.timer