--- rpms/e-smith-devtools/sme10/e-smith-devtools-2.6.0-bz11993-backup.patch 2022/06/14 04:12:44 1.1 +++ rpms/e-smith-devtools/sme10/e-smith-devtools-2.6.0-bz11993-backup.patch 2022/07/30 04:30:09 1.3 @@ -1,7 +1,7 @@ diff -Nur --no-dereference e-smith-devtools-2.6.0.old/Backup.pm e-smith-devtools-2.6.0/Backup.pm --- e-smith-devtools-2.6.0.old/Backup.pm 1969-12-31 19:00:00.000000000 -0500 -+++ e-smith-devtools-2.6.0/Backup.pm 2022-06-14 00:05:43.785000000 -0400 -@@ -0,0 +1,136 @@ ++++ e-smith-devtools-2.6.0/Backup.pm 2022-07-30 00:28:03.796000000 -0400 +@@ -0,0 +1,116 @@ +#---------------------------------------------------------------------- +# copyright (C) 2013-2022 Koozali Foundation +# @@ -38,7 +38,7 @@ diff -Nur --no-dereference e-smith-devto + all => [ qw!backup_excludes backup_includes! ] + ); + -+our $VERSION = sprintf '%d.%03d', q$Revision: 1.0 $ =~ /: (\d+).(\d+)/; ++our $VERSION = sprintf '%d.%03d', q$Revision: 1.2 $ =~ /: (\d+).(\d+)/; + +=head1 NAME + @@ -66,30 +66,20 @@ diff -Nur --no-dereference e-smith-devto +sub backup_includes +{ + my ($name, @paths) = @_; -+ my $dir = "root/etc/e-smith/templates/etc/dar/DailyBackup.dcf"; + my $core = "root/etc/backup-data.d"; -+ my $filename = "$dir/41go-into-$name"; + my $corefilename = "$core/${name}.include"; + -+ unless (-d $dir) -+ { -+ mkpath $dir or die "Could not create dir $dir: $!"; -+ } + unless (-d $core) + { + mkpath $core or die "Could not create dir $core: $!"; + } + -+ open(FH, '>', $filename) or die $!; + open(CFH, '>', $corefilename) or die $!; + foreach my $str (@paths) + { + $str =~ s|/$||; + print CFH "$str\n"; -+ $str =~ s|^/||; -+ print FH "--go-into $str\n"; + } -+ close(FH); + close(CFH); + # add template expand to smeserver-ContribName-update + use esmith::Build::CreateLinks qw(templates2events); @@ -108,30 +98,20 @@ diff -Nur --no-dereference e-smith-devto +sub backup_excludes +{ + my ($name, @paths) = @_; -+ my $dir = "root/etc/e-smith/templates/etc/dar/DailyBackup.dcf"; + my $core = "root/etc/backup-data.d"; -+ my $filename = "$dir/46prune-$name"; + my $corefilename = "$core/${name}.exclude"; + -+ unless (-d $dir) -+ { -+ mkpath $dir or die "Could not create dir $dir: $!"; -+ } + unless (-d $core) + { + mkpath $core or die "Could not create dir $core: $!"; + } + -+ open(FH, '>', $filename) or die $!; + open(CFH, '>', $corefilename) or die $!; + foreach my $str (@paths) + { + $str =~ s|/$||; + print CFH "$str\n"; -+ $str =~ s|^/||; -+ print FH "--prune $str\n"; + } -+ close(FH); + close(CFH); + # add template expand to smeserver-ContribName-update + use esmith::Build::CreateLinks qw(templates2events);