diff --git a/app-backup/timeshift-autosnap/Manifest b/app-backup/timeshift-autosnap/Manifest new file mode 100644 index 0000000000..632a41ef2b --- /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 0000000000..a778006bf2 --- /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 0000000000..bccd8dadbf --- /dev/null +++ b/app-backup/timeshift-autosnap/metadata.xml @@ -0,0 +1,17 @@ + + + + + pascal.jaeger@leimstift.de + Pascal Jäger + + + Antynea/grub-btrfs + + + 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 ... + + 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 0000000000..2f2de478e5 --- /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 +}