public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/btrfsmaintenance/, sys-fs/btrfsmaintenance/files/
Date: Sat,  7 Jul 2018 21:58:55 +0000 (UTC)	[thread overview]
Message-ID: <1531000634.2e18700253683a13e3ec5b2baf8b0180fda974d2.asturm@gentoo> (raw)

commit:     2e18700253683a13e3ec5b2baf8b0180fda974d2
Author:     Martin Dummer <martin.dummer <AT> gmx <DOT> net>
AuthorDate: Tue Jun 26 20:11:12 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jul  7 21:57:14 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e187002

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

 .../btrfsmaintenance-0.4.1-r1.ebuild               | 66 ++++++++++++++++++++++
 .../btrfsmaintenance/files/fix-btrfs-defrag.patch  | 12 ++++
 2 files changed, 78 insertions(+)

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 00000000000..3129b367eed
--- /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 00000000000..4dc5fd6b1d9
--- /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"


             reply	other threads:[~2018-07-07 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-07 21:58 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-25  2:09 [gentoo-commits] repo/gentoo:master commit in: sys-fs/btrfsmaintenance/, sys-fs/btrfsmaintenance/files/ Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531000634.2e18700253683a13e3ec5b2baf8b0180fda974d2.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox