commit:     3d12ed1eefcd3243728d7ad24b4b3f4a6d6c1266
Author:     Pascal Jäger <pascal.jaeger <AT> leimstift <DOT> de>
AuthorDate: Sun Oct  3 20:16:19 2021 +0000
Commit:     Pascal Jäger <pascal.jaeger <AT> leimstift <DOT> de>
CommitDate: Sun Oct  3 20:16:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3d12ed1e

app-backup/timeshift-autosnap: new package

Automatically make timeshift snapshots every time emerge
installs a package

Package-Manager: Portage-3.0.23, Repoman-3.0.3
Signed-off-by: Pascal Jäger <pascal.jaeger <AT> leimstift.de>

 app-backup/timeshift-autosnap/Manifest             |  1 +
 .../timeshift-autosnap-remove-arch-specific.patch  | 10 +++++
 app-backup/timeshift-autosnap/metadata.xml         | 17 +++++++++
 .../timeshift-autosnap-0.9.ebuild                  | 43 ++++++++++++++++++++++
 4 files changed, 71 insertions(+)

diff --git a/app-backup/timeshift-autosnap/Manifest 
b/app-backup/timeshift-autosnap/Manifest
new file mode 100644
index 000000000..632a41ef2
--- /dev/null
+++ b/app-backup/timeshift-autosnap/Manifest
@@ -0,0 +1 @@
+DIST timeshift-autosnap-0.9.tar.gz 2876 BLAKE2B 
03063b1cedd18eee56681b9af10954f7c26a0dfdd08eb51ba0dc56c5b86eed1dac3024cd5b790ed2f00f30a9c09988d2c2785dad4041e931e3af2301f7159491
 SHA512 
15dbe97ef26954c33aa0a9dccb62a93da81b98d7194423111536d5ef7c832b8432c75b58b9edbbfaa669a333692bd71624a221928ca8e186cdf833d7ebd63c9c

diff --git 
a/app-backup/timeshift-autosnap/files/timeshift-autosnap-remove-arch-specific.patch
 
b/app-backup/timeshift-autosnap/files/timeshift-autosnap-remove-arch-specific.patch
new file mode 100644
index 000000000..a778006bf
--- /dev/null
+++ 
b/app-backup/timeshift-autosnap/files/timeshift-autosnap-remove-arch-specific.patch
@@ -0,0 +1,10 @@
+--- a/timeshift-autosnap
++++ b/timeshift-autosnap
+@@ -53,7 +53,7 @@ if $(get_property "deleteSnapshots" "boolean" "true") ; then
+     fi
+ fi;
+ 
+-if $(get_property "updateGrub" "boolean" "true") && [ "$(pacman -Qs 
^grub-btrfs$)" ]; then
++if $(get_property "updateGrub" "boolean" "true") ; then
+     grub-mkconfig -o /boot/grub/grub.cfg
+ fi;

diff --git a/app-backup/timeshift-autosnap/metadata.xml 
b/app-backup/timeshift-autosnap/metadata.xml
new file mode 100644
index 000000000..bccd8dadb
--- /dev/null
+++ b/app-backup/timeshift-autosnap/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>pascal.jae...@leimstift.de</email>
+               <name>Pascal Jäger</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">Antynea/grub-btrfs</remote-id>
+       </upstream>
+       <longdescription lang="en">
+               Improves Grub by adding "btrfs snapshots" to the Grub menu.
+
+               You can boot your system on a "snapshot" from the Grub menu.
+               Supports manual snapshots, snapper, timeshift ...
+       </longdescription>
+</pkgmetadata>

diff --git a/app-backup/timeshift-autosnap/timeshift-autosnap-0.9.ebuild 
b/app-backup/timeshift-autosnap/timeshift-autosnap-0.9.ebuild
new file mode 100644
index 000000000..2f2de478e
--- /dev/null
+++ b/app-backup/timeshift-autosnap/timeshift-autosnap-0.9.ebuild
@@ -0,0 +1,43 @@
+# Copyright 2019-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Automatically creats a snapshot everytime before portage installs 
a package"
+HOMEPAGE="https://gitlab.com/gobonja/timeshift-autosnap";
+SRC_URI="https://gitlab.com/gobonja/timeshift-autosnap/-/archive/${PV}/{$P}.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+        app-backup/timeshift
+        >=sys-apps/portage-2.1
+"
+RDEPEND="${DEPEND}"
+BDEPEND=""
+
+PATCHES=( "${FILESDIR}/${PN}-remove-arch-specific.patch" )
+
+src_unpack() {
+        default
+       mv ${WORKDIR}/timeshift-autosnap-${PV}* 
${WORKDIR}/timeshift-autosnap-${PV}
+}
+
+src_compile(){
+       true
+}
+
+src_install(){
+       dobin timeshift-autosnap
+       insinto /etc
+       doins timeshift-autosnap.conf
+}
+
+pkg_postinst() {
+       touch /etc/portage/bashrc
+        grep -q  '#!/bin/' /etc/portage/bashrc || awk -i inplace 
'BEGINFILE{print "#!/bin/sh"}{print}' /etc/portage/bashrc
+        grep -q 'timeshift-autosnap' /etc/portage/bashrc || echo 'function 
pre_pkg_setup() { /usr/bin/timeshift-autosnap ; }' >> /etc/portage/bashrc
+}

Reply via email to