public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:dev commit in: app-backup/timeshift-autosnap/, app-backup/timeshift-autosnap/files/
@ 2021-10-03 20:20 Pascal Jäger
  0 siblings, 0 replies; 2+ messages in thread
From: Pascal Jäger @ 2021-10-03 20:20 UTC (permalink / raw
  To: gentoo-commits

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

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/proj/guru:dev commit in: app-backup/timeshift-autosnap/, app-backup/timeshift-autosnap/files/
@ 2024-06-06 12:55 Lucio Sauer
  0 siblings, 0 replies; 2+ messages in thread
From: Lucio Sauer @ 2024-06-06 12:55 UTC (permalink / raw
  To: gentoo-commits

commit:     5edf4429c3ac157826349eab9a9333ab67cfa171
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Thu Jun  6 12:50:55 2024 +0000
Commit:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Thu Jun  6 12:54:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=5edf4429

app-backup/timeshift-autosnap: Fix dependencies

No build-time deps needed
Fix patch that erroneously removed optional runtime dep detection
altogether
Fix runtime deps

Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>

 .../timeshift-autosnap-remove-arch-specific.patch   | 21 +++++++++++++++++----
 ...-0.9.ebuild => timeshift-autosnap-0.9-r1.ebuild} |  9 +++------
 2 files changed, 20 insertions(+), 10 deletions(-)

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
index a778006bf..127f880bb 100644
--- a/app-backup/timeshift-autosnap/files/timeshift-autosnap-remove-arch-specific.patch
+++ b/app-backup/timeshift-autosnap/files/timeshift-autosnap-remove-arch-specific.patch
@@ -1,10 +1,23 @@
+Partially backport 0f933eb5966848d96477b5148e40ac1c3e750e22 for distro-agnostic
+detection of grub-btrfs snapshot functionality.
+
+Author: Lucio Sauer <watermanpaint@posteo.net>
 --- a/timeshift-autosnap
 +++ b/timeshift-autosnap
-@@ -53,7 +53,7 @@ if $(get_property "deleteSnapshots" "boolean" "true") ; then
+@@ -53,8 +53,12 @@ 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;
+-    grub-mkconfig -o /boot/grub/grub.cfg
+-fi;
+-
++if $(get_property "updateGrub" "boolean" "true") && [ -f /etc/grub.d/41_snapshots-btrfs ]; then
++	. /etc/default/grub-btrfs/config
++	if [ -s "${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub-btrfs.cfg" ]; then
++		/etc/grub.d/41_snapshots-btrfs
++	else
++		${GRUB_BTRFS_MKCONFIG:-grub-mkconfig} -o ${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub.cfg
++	fi
++fi
+ exit 0

diff --git a/app-backup/timeshift-autosnap/timeshift-autosnap-0.9.ebuild b/app-backup/timeshift-autosnap/timeshift-autosnap-0.9-r1.ebuild
similarity index 88%
rename from app-backup/timeshift-autosnap/timeshift-autosnap-0.9.ebuild
rename to app-backup/timeshift-autosnap/timeshift-autosnap-0.9-r1.ebuild
index 4209aebe5..36a6cbead 100644
--- a/app-backup/timeshift-autosnap/timeshift-autosnap-0.9.ebuild
+++ b/app-backup/timeshift-autosnap/timeshift-autosnap-0.9-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit readme.gentoo-r1
+inherit optfeature readme.gentoo-r1
 
 DESCRIPTION="Automatically creates a timeshift-snapshot when executed"
 HOMEPAGE="https://gitlab.com/gobonja/timeshift-autosnap"
@@ -13,11 +13,7 @@ LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-DEPEND="
-	app-backup/timeshift
-	>=sys-apps/portage-2.1
-"
-RDEPEND="${DEPEND}"
+RDEPEND="app-backup/timeshift"
 
 PATCHES=( "${FILESDIR}/${PN}-remove-arch-specific.patch" )
 
@@ -36,4 +32,5 @@ src_install(){
 
 pkg_postinst() {
 	readme.gentoo_print_elog
+	optfeature "grub-btrfs snapshot support" app-backup/grub-btrfs
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-06 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-03 20:20 [gentoo-commits] repo/proj/guru:dev commit in: app-backup/timeshift-autosnap/, app-backup/timeshift-autosnap/files/ Pascal Jäger
  -- strict thread matches above, loose matches on Subject: below --
2024-06-06 12:55 Lucio Sauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox