summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2023-01-04 01:46:54 -0800
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2023-01-04 01:59:11 -0800
commit578e0fcd9c0fa170e7106997c07bac71b9ab0239 (patch)
tree5fa976c5ac93a00f28dd0ca5ab57bff965ceaa08 /sys-apps
parentnet-p2p/bitcoind: drop 0.21.1, 21.2 (diff)
downloadgentoo-578e0fcd9c0fa170e7106997c07bac71b9ab0239.tar.gz
gentoo-578e0fcd9c0fa170e7106997c07bac71b9ab0239.tar.bz2
gentoo-578e0fcd9c0fa170e7106997c07bac71b9ab0239.zip
sys-apps/etckeeper: add 1.18.19
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/etckeeper/Manifest1
-rw-r--r--sys-apps/etckeeper/etckeeper-1.18.19.ebuild104
-rw-r--r--sys-apps/etckeeper/files/etckeeper-1.18.19-backticks-EOF.patch37
3 files changed, 142 insertions, 0 deletions
diff --git a/sys-apps/etckeeper/Manifest b/sys-apps/etckeeper/Manifest
index df174c8a9e2d..012bc415a070 100644
--- a/sys-apps/etckeeper/Manifest
+++ b/sys-apps/etckeeper/Manifest
@@ -1 +1,2 @@
DIST etckeeper-1.18.18.tar.gz 101845 BLAKE2B 2072b54db4023211e85fcbed82bd93412eb02707d5447b297bf98e65f1d534e02e790612d9771ae433a07aa6a462dd9b5c5528207d2bcfd4059232417e3186e1 SHA512 57b2f7297c0b71e3d39a7838dd3e6599bb3f1275d86200be9d7986f46f0392aa0ba130cb38ba7a5757fcb5d6fa33b4d32233237dba15e8ce9fb8c52565cf251b
+DIST etckeeper-1.18.19.tar.gz 110687 BLAKE2B fe0b1a7cc108b81e15d03fad6f2e10538a4ff991fcbac132bd18930501ea3681786f5e20a942b32c621b6a595bb61d2dc99e33ef4f040e2958a6d8cafa7e4763 SHA512 8b4776f04c98996f0dd1c68694d026cc61e8b8c3b1163a18b98bce37eea95a4676c31bde172996b392fa48e160515a61ddd466798d9e70f4b3dd56615046df16
diff --git a/sys-apps/etckeeper/etckeeper-1.18.19.ebuild b/sys-apps/etckeeper/etckeeper-1.18.19.ebuild
new file mode 100644
index 000000000000..0174a070e7e3
--- /dev/null
+++ b/sys-apps/etckeeper/etckeeper-1.18.19.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 prefix systemd tmpfiles
+
+DESCRIPTION="A collection of tools to let /etc be stored in a repository"
+HOMEPAGE="https://etckeeper.branchable.com/"
+SRC_URI="https://git.joeyh.name/index.cgi/etckeeper.git/snapshot/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
+SLOT="0"
+IUSE="cron test"
+
+BDEPEND="test? (
+ dev-util/bats
+ dev-vcs/git
+)"
+
+RDEPEND="app-portage/portage-utils
+ cron? ( virtual/cron )
+ || (
+ dev-vcs/git
+ dev-vcs/mercurial
+ dev-vcs/darcs
+ )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ "${FILESDIR}/etckeeper-1.18.19-backticks-EOF.patch" # sent upstream
+)
+
+src_prepare() {
+ default
+ hprefixify *.d/* etckeeper
+ local systemdunitdir="$(systemd_get_systemunitdir)"
+ systemdunitdir="${systemdunitdir#${EPREFIX}}"
+ sed -i \
+ -e s'@zsh/vendor-completions@zsh/site-functions@' \
+ -e s"@/lib/systemd/system@"${systemdunitdir}"@" \
+ -e '/etckeeper-bzr\/__init__\.py/d' \
+ Makefile || die
+
+ # pre-configure for portage.
+ sed -i \
+ -e 's/^HIGHLEVEL_PACKAGE_MANAGER=apt/HIGHLEVEL_PACKAGE_MANAGER=emerge/' \
+ -e 's/^LOWLEVEL_PACKAGE_MANAGER=dpkg/LOWLEVEL_PACKAGE_MANAGER=qlist/' \
+ etckeeper.conf || die
+
+ rm -v init.d/60darcs-deleted-symlinks || die
+}
+
+src_compile() {
+ :
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+
+ doenvd "$(prefixify_ro "${FILESDIR}"/99${PN})"
+
+ newbashcomp bash_completion ${PN}
+ dodoc doc/README.mdwn
+ newdoc "${FILESDIR}"/bashrc-r1 bashrc.example
+
+ rm -rv "${ED}/var/cache" || die
+ newtmpfiles "${FILESDIR}/${PN}".tmpfilesd "${PN}".conf
+
+ if use cron ; then
+ exeinto /etc/cron.daily
+ newexe - etckeeper <<'_EOF_'
+#!/bin/sh
+set -e
+if [ -e /etc/etckeeper/daily ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
+ . /etc/etckeeper/etckeeper.conf
+ if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
+ /etc/etckeeper/daily
+ fi
+fi
+_EOF_
+ fi
+
+ local conf_update_dir="/etc/portage/conf-update.d"
+ insinto "${conf_update_dir}"
+ newins "${FILESDIR}/${PN}-conf-update-hook" "${PN}"
+ fperms 755 "${conf_update_dir}/${PN}"
+}
+
+pkg_postinst() {
+ tmpfiles_process "${PN}.conf"
+
+ elog "${PN} supports git, mercurial and darcs"
+ elog "This ebuild just ensures at least one is installed!"
+ elog
+ elog "You may want to adjust your /etc/portage/bashrc"
+ elog "see the example file in /usr/share/doc/${PF}"
+ elog
+ elog "To initialise your etc-dir as a repository run:"
+ elog "${PN} init -d /etc"
+}
diff --git a/sys-apps/etckeeper/files/etckeeper-1.18.19-backticks-EOF.patch b/sys-apps/etckeeper/files/etckeeper-1.18.19-backticks-EOF.patch
new file mode 100644
index 000000000000..cf47e8108bef
--- /dev/null
+++ b/sys-apps/etckeeper/files/etckeeper-1.18.19-backticks-EOF.patch
@@ -0,0 +1,37 @@
+From 88cc70458f1dd902d001b63148b0df534b1ebdf6 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Wed, 4 Jan 2023 01:29:09 -0800
+Subject: [PATCH] init.d/50vcs-pre-commit-hook: replace backticks
+
+it's in EOF block, so bash tries to execute backticked commands despite
+being commented out.
+
+Initialized empty Git repository in /etc/.git/
+/etc/etckeeper/init.d/50vcs-pre-commit-hook: line 11: rev-parse: command not found
+Usage: grep [OPTION]... PATTERNS [FILE]...
+Try 'grep --help' for more information.
+/etc/etckeeper/init.d/50vcs-pre-commit-hook: line 11: worktree: command not found
+
+Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
+---
+ init.d/50vcs-pre-commit-hook | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/init.d/50vcs-pre-commit-hook b/init.d/50vcs-pre-commit-hook
+index 6e0669c..166540d 100755
+--- a/init.d/50vcs-pre-commit-hook
++++ b/init.d/50vcs-pre-commit-hook
+@@ -34,8 +34,8 @@ set -e
+ #
+ ################################################################################
+
+-# Using `rev-parse` + `grep` rather than for instance parsing output from
+-# `worktree list` since the worktree command is not present in older git version
++# Using 'rev-parse' + 'grep' rather than for instance parsing output from
++# 'worktree list' since the worktree command is not present in older git version
+ # and parsing it would be slightly more complex.
+ if git rev-parse --git-dir | grep -q /.git/worktrees
+ then
+--
+2.39.0
+