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@leimstift.de>
This commit is contained in:
Pascal Jäger
2021-10-03 22:16:19 +02:00
parent 7177260908
commit 3d12ed1eef
4 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST timeshift-autosnap-0.9.tar.gz 2876 BLAKE2B 03063b1cedd18eee56681b9af10954f7c26a0dfdd08eb51ba0dc56c5b86eed1dac3024cd5b790ed2f00f30a9c09988d2c2785dad4041e931e3af2301f7159491 SHA512 15dbe97ef26954c33aa0a9dccb62a93da81b98d7194423111536d5ef7c832b8432c75b58b9edbbfaa669a333692bd71624a221928ca8e186cdf833d7ebd63c9c

View File

@@ -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;

View File

@@ -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.jaeger@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>

View File

@@ -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
}