Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 474502 - app-admin/zfsnap-1.11.1 - Creates rolling zfs snapshots
Summary: app-admin/zfsnap-1.11.1 - Creates rolling zfs snapshots
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL: https://github.com/graudeejs/zfSnap
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2013-06-23 16:39 UTC by henning.f
Modified: 2013-06-24 03:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
zfsnap-1.11.1.ebuild (zfsnap-1.11.1.ebuild,1.43 KB, text/plain)
2013-06-23 16:41 UTC, henning.f
Details

Note You need to log in before you can comment on or make changes to this bug.
Description henning.f 2013-06-23 16:39:49 UTC
Please find the attached zfsnap-1.11.1.ebuild. zfsnap is a script for creating rolling zfs snapshots with cron. I suggest app-admin/zfsnap.

I have not being able to test this on linux x86 as I had some issues building the spl.

I noticed that the /usr/portage/licence/BEER-WARE file references some Poul-Henning Kamp. 

Reproducible: Always
Comment 1 henning.f 2013-06-23 16:41:44 UTC
Created attachment 351754 [details]
zfsnap-1.11.1.ebuild
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-06-23 18:09:29 UTC
Comment on attachment 351754 [details]
zfsnap-1.11.1.ebuild

>EAPI=5
>
>inherit eutils toolchain-funcs flag-o-matic
>
>DESCRIPTION="Creates rolling zfs snapshots"
>HOMEPAGE="https://github.com/graudeejs/zfSnap"
>SRC_URI="https://github.com/graudeejs/zfSnap/archive/v${PV}.zip"
>
>LICENSE="BEER-WARE"
>SLOT="0"
>KEYWORDS="~amd64-fbsd"
>IUSE=""
>
>RDEPEND=">=sys-apps/sed-4

It needs sed as a runtime dependency?

>	>=sys-freebsd/freebsd-cddl-9.0
>	sys-devel/bc"
>DEPEND=">=sys-apps/sed-4
>	app-arch/unzip"

Try using variables set earlier to append more dependencies to later variables.

>src_unpack() {
>	unpack ${A}
>}

This is the default. It should be removed

>src_prepare() {
>	for period in hourly daily weekly monthly; do
>		cp xPERIODICx_zfSnap.sh ${period}_zfSnap.sh
>
>		sed -i -e "s/xPERIODICx/${period}/g" -e "s|xPREFIXx|${EPREFIX}/usr/sbin|g" ${period}_zfSnap.sh || die "Failed to sed ${period} file"

You could role these into one command:

               sed -e [sed expressions] xPERIODICx_zfSnap.sh > ${period}_zfSnap.sh \
                   || die "Failed to sed ${period} file"

>		cp xPERIODICx_zfSnap_delete.sh ${period}_zfSnap_delete.sh
>		sed -i -e "s/xPERIODICx/${period}/g" -e "s|xPREFIXx|${EPREFIX}/usr/sbin|g" ${period}_zfSnap_delete.sh || die "Failed to sed ${period} delete file"

Same here.

>pkg_postinst() {
>	elog "Add configuration to /etc/defaults/periodic.conf"

Gentoo has no /etc/defaults. It does have /etc/default/.
Comment 3 henning.f 2013-06-24 03:03:37 UTC
(In reply to Jeroen Roovers from comment #2)
> It needs sed as a runtime dependency?

Yes.

> Try using variables set earlier to append more dependencies to later
> variables.

Shall I introduce a new variable CDEPEND which contains the common dependency and include this when declaring the depenencies?

> This is the default. It should be removed

Agreed.

> You could role these into one command:

Ok.

> Gentoo has no /etc/defaults. It does have /etc/default/.

Ok, so what is common here, look for the file in /etc/default? Perhaps it should be a /etc/zsnap.conf instead?

Also, perhaps we have to look into the the manual page for periodic.conf which would seem to imply that the file is in /etc/defaults. It might just be something that came with some freebsd man-page though.