diff options
author | Martin Dummer <martin.dummer@gmx.net> | 2018-06-26 22:11:12 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2018-07-07 23:57:14 +0200 |
commit | 2e18700253683a13e3ec5b2baf8b0180fda974d2 (patch) | |
tree | deb4f2cf812ce7c971df19c9ae79c88de7f2d77a /sys-fs/btrfsmaintenance | |
parent | dev-libs/syncdir: add EAPI7 ebuild (diff) | |
download | gentoo-2e18700253683a13e3ec5b2baf8b0180fda974d2.tar.gz gentoo-2e18700253683a13e3ec5b2baf8b0180fda974d2.tar.bz2 gentoo-2e18700253683a13e3ec5b2baf8b0180fda974d2.zip |
sys-fs/btrfsmaintenance: fix btrfs-defrag.sh
this ebuild fixes missing function is_btrfs in btrfs-defrag.sh
Closes: https://bugs.gentoo.org/657756
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Closes: https://github.com/gentoo/gentoo/pull/9077
Diffstat (limited to 'sys-fs/btrfsmaintenance')
-rw-r--r-- | sys-fs/btrfsmaintenance/btrfsmaintenance-0.4.1-r1.ebuild | 66 | ||||
-rw-r--r-- | sys-fs/btrfsmaintenance/files/fix-btrfs-defrag.patch | 12 |
2 files changed, 78 insertions, 0 deletions
diff --git a/sys-fs/btrfsmaintenance/btrfsmaintenance-0.4.1-r1.ebuild b/sys-fs/btrfsmaintenance/btrfsmaintenance-0.4.1-r1.ebuild new file mode 100644 index 000000000000..3129b367eedc --- /dev/null +++ b/sys-fs/btrfsmaintenance/btrfsmaintenance-0.4.1-r1.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit systemd + +DESCRIPTION="Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag" +HOMEPAGE="https://github.com/kdave/btrfsmaintenance" +SRC_URI="https://github.com/kdave/btrfsmaintenance/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="systemd" + +RDEPEND=" + sys-fs/btrfs-progs + virtual/cron + systemd? ( sys-apps/systemd ) +" + +PATCHES=( + "${FILESDIR}/fix-btrfs-defrag.patch" + ) + +src_prepare() { + # Fix config path into watching service + sed -i 's%/etc/sysconfig/btrfsmaintenance%/etc/default/btrfsmaintenance%g' btrfsmaintenance-refresh.* || \ + die "Unable to patch btrfsmaintenance-refresh.*" + default +} + +src_install() { + dodoc README.md CONTRIBUTING.md CHANGES.md + insinto /etc/default + newins sysconfig.btrfsmaintenance btrfsmaintenance + insinto /usr/share/btrfsmaintenance + doins btrfsmaintenance-functions + exeinto /usr/share/btrfsmaintenance + doexe btrfs*.sh + systemd_dounit *.service *.timer *.path +} + +pkg_postinst() { + elog "Installing default btrfsmaintenance scripts" + if use systemd; then + "${EROOT%/}"/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh systemd-timer || die + else + "${EROOT%/}"/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh || die + fi + elog "Now edit cron periods and mount points in /etc/default/btrfsmaintenance " + elog "then run /usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh to" + elog "update cron symlinks or run" + elog "/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh systemd-timer" + elog "to update systemd timers." + elog "You can also enable btrfsmaintenance-refresh.path service in order to" + elog "monitor the config files changes and update systemd timers accordly." +} + +pkg_prerm() { + if [[ -z ${REPLACED_BY_VERSION} ]] ; then + elog "Removing symlinks from btrfsmaintenance cron tasks" + "${EROOT%/}"/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh uninstall || die + fi +} diff --git a/sys-fs/btrfsmaintenance/files/fix-btrfs-defrag.patch b/sys-fs/btrfsmaintenance/files/fix-btrfs-defrag.patch new file mode 100644 index 000000000000..4dc5fd6b1d92 --- /dev/null +++ b/sys-fs/btrfsmaintenance/files/fix-btrfs-defrag.patch @@ -0,0 +1,12 @@ +diff --git a/btrfs-defrag.sh b/btrfs-defrag.sh +index 284abc8..5ced921 100755 +--- a/btrfs-defrag.sh ++++ b/btrfs-defrag.sh +@@ -15,6 +15,7 @@ if [ -f /etc/default/btrfsmaintenance ] ; then + fi + + LOGIDENTIFIER='btrfs-defrag' ++. $(dirname $(realpath "$0"))/btrfsmaintenance-functions + + { + OIFS="$IFS" |