FreeBSD Bugzilla – Attachment 214039 Details for
Bug 246132
sysutils/zetaback: Resurrect deprecate state, fix PERL warning, add some options
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch against sysutils/zetaback port to resurrect it from DEPRECATED
patch-port-sysutils-zetaback.txt (text/plain), 7.07 KB, created by
Armin Gruner
on 2020-05-02 22:27:26 UTC
(
hide
)
Description:
patch against sysutils/zetaback port to resurrect it from DEPRECATED
Filename:
MIME Type:
Creator:
Armin Gruner
Created:
2020-05-02 22:27:26 UTC
Size:
7.07 KB
patch
obsolete
>diff -rbwuN ../zetaback.orig/Makefile ./Makefile >--- ../zetaback.orig/Makefile 2020-04-04 22:51:40.000000000 +0200 >+++ ./Makefile 2020-05-03 00:21:52.452869000 +0200 >@@ -1,20 +1,26 @@ >-# Created by: Cy Schubert <cy@FreeBSD.org> > # $FreeBSD: head/sysutils/zetaback/Makefile 530719 2020-04-04 20:51:40Z antoine $ > > PORTNAME= zetaback > PORTVERSION= 1.0.7 > CATEGORIES= sysutils >-MASTER_SITES= http://mirrors.omniti.com/zetaback/ >+USE_GITHUB= yes >+GH_ACCOUNT= omniti-labs >+GH_PROJECT= zetaback >+GH_TAGNAME= 78d1d08 > >-MAINTAINER= cy@FreeBSD.org >+MAINTAINER= ag-freebsd@muc.de > COMMENT= Zetaback ZFS backup and recovery management system > >-BROKEN= unfetchable >-DEPRECATED= Broken for more than 6 months >-EXPIRATION_DATE= 2020-05-05 >- > LICENSE= BSD3CLAUSE > LICENSE_FILE= ${WRKSRC}/LICENSE >+ >+OPTIONS_DEFINE= LOCAL BETTER_COMPRESSION >+ >+LOCAL_DESC= Shortcut backup of localhost and don't use SSH >+BETTER_COMPRESSION_DESC= Allow different compressions for snapshots >+ >+LOCAL_EXTRA_PATCHES= ${PATCHDIR}/localhost-patch-zetaback.in >+BETTER_COMPRESSION_EXTRA_PATCHES= ${PATCHDIR}/compression-patch-zetaback.in > > USES= autoreconf perl5 > USE_PERL5= run >diff -rbwuN ../zetaback.orig/distinfo ./distinfo >--- ../zetaback.orig/distinfo 2015-02-20 01:23:25.000000000 +0100 >+++ ./distinfo 2020-05-02 22:56:10.281607000 +0200 >@@ -1,2 +1,3 @@ >-SHA256 (zetaback-1.0.7.tar.gz) = e4bad4bb4a0149d44e5ae6022519b2927e4c0b5a0da465d47b4e66d707270270 >-SIZE (zetaback-1.0.7.tar.gz) = 49934 >+TIMESTAMP = 1588452970 >+SHA256 (omniti-labs-zetaback-1.0.7-78d1d08_GH0.tar.gz) = 9aa8a5dbbd64f7a35853a58a27764ad4c97d365703ecdfb7079366bb48f24e28 >+SIZE (omniti-labs-zetaback-1.0.7-78d1d08_GH0.tar.gz) = 26527 >diff -rbwuN ../zetaback.orig/files/compression-patch-zetaback.in ./files/compression-patch-zetaback.in >--- ../zetaback.orig/files/compression-patch-zetaback.in 1970-01-01 01:00:00.000000000 +0100 >+++ ./files/compression-patch-zetaback.in 2020-05-03 00:13:01.885004000 +0200 >@@ -0,0 +1,66 @@ >+--- zetaback.in.orig 2019-01-31 22:04:38 UTC >++++ zetaback.in >+@@ -434,11 +434,15 @@ of how old it is. >+ >+ This value defaults to (14 * 86400), or two weeks. >+ >++=item compressionprogram >++ >++Compress files using gzip or bzip2. Defaults to gzip. >++ >+ =item compressionlevel >+ >+-Compress files using gzip at the specified compression level. 0 means no >+-compression. Accepted values are 1-9. Defaults to 1 (fastest/minimal >+-compression.) >++Compress files using gzip or bzip2 at the specified compression level. >++0 means no compression. Accepted values are 1-9. Defaults to 1 >++(fastest/minimal compression.) >+ >+ =item ssh_config >+ >+@@ -781,9 +785,18 @@ sub zfs_do_backup($$$$$$;$) { >+ >+ # compression is meaningless for dataset backups >+ if ($type ne "s") { >++ my $cp = config_get($host, 'compressionprogram'); >++ if ($cp ne "bzip2" && $cp ne "gzip" && $cp ne "") { >++ die "zfs_full_backup: unsupported compression program specified\n"; >++ } elsif ($cp eq "") { >++ $cp = "gzip"; >++ my $cl = 1; >++ } else { >++ my $cl = 1; >++ } >+ my $cl = config_get($host, 'compressionlevel'); >+ if ($cl >= 1 && $cl <= 9) { >+- open(LBACKUP, "|gzip -$cl >$store/.$dumpname") || >++ open(LBACKUP, "|$cp -$cl >$store/.$dumpname") || >+ die "zfs_do_backup $host:$fs $type: cannot create dump\n"; >+ } else { >+ open(LBACKUP, ">$store/.$dumpname") || >+@@ -1319,16 +1332,22 @@ sub zfs_restore_part($$$$;$) { >+ else { >+ $command = "__ZFS__ recv $fs"; >+ } >++ my $cp = config_get($host, 'compressionprogram'); >++ if ($cp ne "bzip2" && $cp ne "gzip" && $cp ne "") { >++ die "zfs_full_backup: unsupported compression program specified\n"; >++ } elsif ($cp eq "") { >++ $cp = "gzip"; >++ } >+ if ($file) { >+ print " => piping $file to $command\n" if($DEBUG); >+- print "gzip -dfc $file | ssh $ssh_config $host $command\n" if ($DEBUG && $NEUTERED); >++ print "$cp -dfc $file | ssh $ssh_config $host $command\n" if ($DEBUG); >+ } elsif ($dataset) { >+ print " => piping $dataset to $command using zfs send\n" if ($DEBUG); >+ print "zfs send $dataset | ssh $ssh_config $host $command\n" if ($DEBUG && $NEUTERED); >+ } >+ unless($NEUTERED) { >+ if ($file) { >+- open(DUMP, "gzip -dfc $file |"); >++ open(DUMP, "$cp -dfc $file |"); >+ } elsif ($dataset) { >+ open(DUMP, "__ZFS__ send $dataset |"); >+ } >diff -rbwuN ../zetaback.orig/files/localhost-patch-zetaback.in ./files/localhost-patch-zetaback.in >--- ../zetaback.orig/files/localhost-patch-zetaback.in 1970-01-01 01:00:00.000000000 +0100 >+++ ./files/localhost-patch-zetaback.in 2020-05-03 00:15:06.037827000 +0200 >@@ -0,0 +1,56 @@ >+--- zetaback.in.orig 2020-05-02 21:18:03 UTC >++++ zetaback.in >+@@ -769,7 +769,11 @@ sub zfs_remove_snap($$$) { >+ } >+ return unless($snap); >+ print "Dropping $snap on $fs\n" if($DEBUG); >+- `ssh $ssh_config $host $agent -z $fs -d $snap`; >++ if ($host eq "localhost") { >++ `$agent -z $fs -d $snap`; >++ } else { >++ `ssh $ssh_config $host $agent -z $fs -d $snap`; >++ } >+ } >+ >+ # Lots of args.. internally called. >+@@ -832,7 +836,12 @@ sub zfs_do_backup($$$$$$;$) { >+ die "Child exit value: $ev" if ($ev); >+ } >+ else { >+- my @cmd = ('ssh', split(/ /, $ssh_config), $host, $agent, '-z', $fs); >++ my @cmd; >++ if ($host eq "localhost") { >++ @cmd = ($agent, '-z', $fs); >++ } else { >++ @cmd = ('ssh', split(/ /, $ssh_config), $host, $agent, '-z', $fs); >++ } >+ if ($type eq "i" || ($type eq "s" && $base)) { >+ push @cmd, ("-i", $base); >+ } >+@@ -1346,7 +1359,11 @@ sub zfs_restore_part($$$$;$) { >+ open(DUMP, "__ZFS__ send $dataset |"); >+ } >+ eval { >+- open(RECEIVER, "| ssh $ssh_config $host $command"); >++ if ($host eq "localhost") { >++ open(RECEIVER, "| $command"); >++ } else { >++ open(RECEIVER, "| ssh $ssh_config $host $command"); >++ } >+ my $buffer; >+ while(my $len = sysread(DUMP, $buffer, $BLOCKSIZE)) { >+ if(syswrite(RECEIVER, $buffer, $len) != $len) { >+@@ -1573,7 +1590,12 @@ sub plan_and_run($$) { >+ # Get list of zfs filesystems from the agent >+ open(SILENT, ">&", \*STDERR); >+ close(STDERR); >+- my $rv = open(ZFSLIST, "ssh $ssh_config $host $agent -l |"); >++ my $rv; >++ if ($host eq "localhost") { >++ $rv = open(ZFSLIST, "$agent -l |"); >++ } else { >++ $rv = open(ZFSLIST, "ssh $ssh_config $host $agent -l |"); >++ } >+ open(STDERR, ">&", \*SILENT); >+ close(SILENT); >+ next unless $rv; >diff -rbwuN ../zetaback.orig/files/patch-zetaback.in ./files/patch-zetaback.in >--- ../zetaback.orig/files/patch-zetaback.in 1970-01-01 01:00:00.000000000 +0100 >+++ ./files/patch-zetaback.in 2020-05-02 23:04:11.957173000 +0200 >@@ -0,0 +1,11 @@ >+--- zetaback.in.orig 2019-01-31 22:04:38 UTC >++++ zetaback.in >+@@ -1585,7 +1585,7 @@ sub plan_and_run($$) { >+ >+ foreach my $diskline (@disklist) { >+ chomp($diskline); >+- next unless($diskline =~ /^(\S+) \[([^\]]*)\](?: {([^}]*)})?/); >++ next unless($diskline =~ /^(\S+) \[([^\]]*)\](?: \{([^}]*)\})?/); >+ my $diskname = $1; >+ my %snaps; >+ map { $snaps{$_} = 1 } (split(/,/, $2));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 246132
: 214039 |
214042
|
214043
|
214044
|
214049