summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-05-15 01:15:23 +0000
committerSam James <sam@gentoo.org>2022-05-15 01:15:23 +0000
commit10a7350da6cb404487231e8bbc88bedf627f2685 (patch)
treec969f3ae402b657172b5504cbef0a0c93823dd57 /sys-apps
parentdev-db/mariadb: egrep -> grep -E (diff)
downloadgentoo-10a7350da6cb404487231e8bbc88bedf627f2685.tar.gz
gentoo-10a7350da6cb404487231e8bbc88bedf627f2685.tar.bz2
gentoo-10a7350da6cb404487231e8bbc88bedf627f2685.zip
sys-apps/etckeeper: add 1.18.17
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/etckeeper/Manifest1
-rw-r--r--sys-apps/etckeeper/etckeeper-1.18.17.ebuild97
-rw-r--r--sys-apps/etckeeper/files/etckeeper-1.18.17-egrep-deprecated.patch85
3 files changed, 183 insertions, 0 deletions
diff --git a/sys-apps/etckeeper/Manifest b/sys-apps/etckeeper/Manifest
index 538b9972d7a1..5786d8857e91 100644
--- a/sys-apps/etckeeper/Manifest
+++ b/sys-apps/etckeeper/Manifest
@@ -1 +1,2 @@
DIST etckeeper-1.18.16.tar.gz 93638 BLAKE2B 0cc91bd23d4d8ceeddcd18c9b6a93fbebdd5146296d565195b38432aa015b9317931e25e741e4639cdf15d7cb8235eaf9cb824f8afaf1c5fc13c954b8c3c294d SHA512 48a9f0089f72d62d68467b17a5a441dbf219c6b5b817b8ef2160b5f50eef6492257393c482a658ce11a97983ed037caa80b92e289049987bde5f8fbb22c98f07
+DIST etckeeper-1.18.17.tar.gz 100705 BLAKE2B afbd800d0d808997d1f618d81abf5b9c756384db4f4e0a9984349e9c512fc03ab04c04e9d968f99b5ff0eaf59727e4673fd107a0f6e04f14a0327c9247a39124 SHA512 6e75d0f38c8d27ba290ab6e1a51d50ca7a736c958da7a1edb792a5c7f1eedd4848adbb43571425f127bf2c5fe39d5b7887968b09178ca5385ec0abeaeb6cfa00
diff --git a/sys-apps/etckeeper/etckeeper-1.18.17.ebuild b/sys-apps/etckeeper/etckeeper-1.18.17.ebuild
new file mode 100644
index 000000000000..6c678d1e6e34
--- /dev/null
+++ b/sys-apps/etckeeper/etckeeper-1.18.17.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2022 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}"/${PN}-1.18.14-gentoo.patch
+
+ # Sent upstream
+ "${FILESDIR}"/${P}-egrep-deprecated.patch
+)
+
+src_prepare() {
+ default
+ hprefixify *.d/* etckeeper
+ sed -i \
+ -e s'@zsh/vendor-completions@zsh/site-functions@' \
+ -e s"@/lib/systemd/system@"$(systemd_get_systemunitdir)"@" \
+ Makefile || 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.17-egrep-deprecated.patch b/sys-apps/etckeeper/files/etckeeper-1.18.17-egrep-deprecated.patch
new file mode 100644
index 000000000000..c329deb0f5c4
--- /dev/null
+++ b/sys-apps/etckeeper/files/etckeeper-1.18.17-egrep-deprecated.patch
@@ -0,0 +1,85 @@
+From 0338d14862cdf5c50be451809af94232d8ca60a8 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 15 May 2022 01:12:05 +0000
+Subject: [PATCH] Replace obsolete usage of 'egrep' with 'grep -E'
+
+egrep is considered deprecated (and is an alias to grep -E),
+so replace it with grep -E.
+--- a/doc/todo/regex_in_20-warn-problem-files.mdwn
++++ b/doc/todo/regex_in_20-warn-problem-files.mdwn
+@@ -1,11 +1,11 @@
+ exclude_internal () {
+- egrep -v '(^|/)(.git|.hg|.bzr|_darcs)/'
++ grep -E -v '(^|/)(.git|.hg|.bzr|_darcs)/'
+ }
+
+ should probably escape the `.`s.
+
+ exclude_internal () {
+- egrep -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/'
++ grep -E -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/'
+ }
+
+ > [[fixed|done]] --[[Joey]]
+--- a/etckeeper
++++ b/etckeeper
+@@ -84,7 +84,7 @@ elif [ "$command" = "pre-apt" ]; then
+ command=pre-install
+ fi
+
+-if echo "$command" | LANG=C egrep -q '[^-a-z_]'; then
++if echo "$command" | LANG=C grep -E -q '[^-a-z_]'; then
+ echo "etckeeper: invalid command $command" >&2
+ exit 1
+ fi
+@@ -142,7 +142,7 @@ else
+ # fallback if perl isn't present
+ for script in $ETCKEEPER_CONF_DIR/$command.d/*; do
+ if [ ! -d "$script" -a -x "$script" ]; then
+- echo "$script" | egrep -q "/[-a-zA-Z0-9]+$"
++ echo "$script" | grep -E -q "/[-a-zA-Z0-9]+$"
+ [ $? -eq 0 ] && "$script" "$@"
+ fi
+ done
+--- a/list-installed.d/50list-installed
++++ b/list-installed.d/50list-installed
+@@ -17,7 +17,7 @@ else
+ # format "package version\n" (or something similar).
+ if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
+ dpkg-query -W -f '${Status}\t${Package} ${Version} ${Architecture}\n' | \
+- egrep '(ok installed|ok config-files)' | cut -f2,3
++ grep -E '(ok installed|ok config-files)' | cut -f2,3
+ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
+ rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
+ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
+--- a/post-install.d/50vcs-commit
++++ b/post-install.d/50vcs-commit
+@@ -66,7 +66,7 @@ if etckeeper unclean; then
+ get_changed_packages | sort | uniq > $pl.found-pkgs
+ if [ -s $pl.found-pkgs ]; then
+ sed -i 's/^/^[-+]/;s/$/ /' $pl.found-pkgs
+- etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]' | grep -f $pl.found-pkgs > $pl.found-packages
++ etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | grep -E '^[-+]' | grep -f $pl.found-pkgs > $pl.found-packages
+ if [ -s $pl.found-packages ]; then
+ echo "Packages with configuration changes:"
+ cat $pl.found-packages || true
+@@ -74,7 +74,7 @@ if etckeeper unclean; then
+ fi
+ fi
+ echo "Package changes:"
+- etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]' || true
++ etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | grep -E '^[-+]' || true
+ ) | etckeeper commit --stdin
+ else
+ etckeeper commit "$(printf "$message")"
+--- a/pre-commit.d/20warn-problem-files
++++ b/pre-commit.d/20warn-problem-files
+@@ -2,7 +2,7 @@
+ set -e
+
+ exclude_internal () {
+- egrep -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/'
++ grep -E -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/'
+ }
+
+ if [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then