summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schiffbauer <mschiff@gentoo.org>2018-02-02 01:07:13 +0100
committerMarc Schiffbauer <mschiff@gentoo.org>2018-02-02 02:18:30 +0100
commit84f352d07fee751f00dc1492d939eb3559b9015a (patch)
treefdbcd910291c5cea5de01f45f1bad781d0485d75 /app-admin/restart-services
parenteclass/toolchain.eclass: die early in case of EAPI < 5 (diff)
downloadgentoo-84f352d07fee751f00dc1492d939eb3559b9015a.tar.gz
gentoo-84f352d07fee751f00dc1492d939eb3559b9015a.tar.bz2
gentoo-84f352d07fee751f00dc1492d939eb3559b9015a.zip
app-admin/restart_services: moved, bumped
Diffstat (limited to 'app-admin/restart-services')
-rw-r--r--app-admin/restart-services/Manifest1
-rw-r--r--app-admin/restart-services/metadata.xml8
-rw-r--r--app-admin/restart-services/restart-services-0.14.0.ebuild83
3 files changed, 92 insertions, 0 deletions
diff --git a/app-admin/restart-services/Manifest b/app-admin/restart-services/Manifest
new file mode 100644
index 00000000000..db36b3b4aa7
--- /dev/null
+++ b/app-admin/restart-services/Manifest
@@ -0,0 +1 @@
+DIST restart-services-0.14.0.tgz 20896 BLAKE2B e5f2d425659d81d75d7e030e42b582275595cbf9cd35dc85d8d1656792088b27156a2b5f44959966cc034242e03f20a79df6837a30d426b630410987762c97ab SHA512 20fe1750682bdd1e1566b60e80bd099351ae2ff49fb74f138879a7035078dd9b2ddfd79f6c16c3822f8e7eb702d4ab98719e7ca79a3e007b8b547243f9d1a364
diff --git a/app-admin/restart-services/metadata.xml b/app-admin/restart-services/metadata.xml
new file mode 100644
index 00000000000..ea6b59e7902
--- /dev/null
+++ b/app-admin/restart-services/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mschiff@gentoo.org</email>
+ <name>Marc Schiffbauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-admin/restart-services/restart-services-0.14.0.ebuild b/app-admin/restart-services/restart-services-0.14.0.ebuild
new file mode 100644
index 00000000000..3f78f2850aa
--- /dev/null
+++ b/app-admin/restart-services/restart-services-0.14.0.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="Tool to manage OpenRC services that need to be restarted"
+HOMEPAGE="https://dev.gentoo.org/~mschiff/restart-services/"
+SRC_URI="https://dev.gentoo.org/~mschiff/src/${PN}/${P}.tgz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="
+ app-admin/lib_users
+ sys-apps/openrc
+"
+
+src_install() {
+ dosbin restart-services
+ doman restart-services.1
+ keepdir /etc/restart-services.d
+ insinto /etc
+ doins restart-services.conf
+ dodoc README CHANGES
+
+ # remove after 2018/07/01
+ dosym restart-services /usr/sbin/restart_services
+
+ sed -i 's/^#include/include/' "${D}"/etc/restart-services.conf
+ cat>"${D}"/etc/restart-services.d/00-local.conf<<-EOF
+ # You may put your local changes here or in any other *.conf file
+ # in this directory so you can leave /etc/restart-services.conf as is.
+ # Example:
+ # *extend* SV_ALWAYS to match 'myservice'
+ # SV_ALWAYS+=( myservice )
+ EOF
+}
+
+pkg_postinst() {
+ local MAJOR MINOR
+ # migrate config data for versions < 0.13.2
+ if [[ $REPLACING_VERSIONS ]]; then
+ MAJOR=${REPLACING_VERSIONS%%.*}
+ MINOR=${REPLACING_VERSIONS%.*}
+ MINOR=${MINOR#*.}
+
+ if [[ $MAJOR -eq 0 && $MINOR -lt 14 ]]; then
+ einfo "Migrating config"
+ if [[ -e /etc/restart-services.d ]]; then
+ error "/etc/restart-services.d alrayd exists?!"
+ die
+ fi
+ if [[ -e /etc/restart-services.conf ]]; then
+ error "/etc/restart-services.conf alrayd exists?!"
+ die
+ fi
+
+ if [[ -f /etc/restart_services.d/00-local.conf ]]; then
+ sed -i 's/restart_services/restart-services/g' \
+ /etc/restart_services.d/00-local.conf
+ fi
+ if [[ $(ls /etc/restart_services.d/) ]]; then
+ mv -v /etc/restart_services.d/* /etc/restart-services.d/
+ fi
+ if [[ -f /etc/restart_services.d/.keep_app-admin_restart_services-0 ]]; then
+ rm -v /etc/restart_services.d/.keep_app-admin_restart_services-0
+ fi
+ if [[ -d /etc/restart_services.d ]]; then
+ rmdir -v /etc/restart_services.d
+ fi
+
+ if [[ -f /etc/restart_services.conf ]]; then
+ sed -i 's/restart_services/restart-services/g' \
+ /etc/restart_services.conf
+ mv /etc/restart_services.conf /etc/restart-services.conf
+ fi
+ einfo "done"
+ fi
+ fi
+}