# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1312121386 -7200 # Node ID fac6d76d06e87637e2ba8d48c9999f5ad1563418 # Parent cb50d6c57439f6afb562efcda09292b2997a6676 fully done the compression part diff -r cb50d6c57439 -r fac6d76d06e8 bin/imager.check --- a/bin/imager.check Sun Jul 31 15:03:06 2011 +0200 +++ b/bin/imager.check Sun Jul 31 16:09:46 2011 +0200 @@ -135,12 +135,14 @@ unlink $_ and return if -f "$_.gz"; unlink "$_.x" and return if -f "$_.x.gz"; - # FIXME: do we need a compressed version? + # the next step we can't do, because it can happen that + # the restorer does not know about a password + #unlink "$_.gz.x" and return if -f "$_.gz"; # cut away the first part of the filename and # some optional extension (my $rn = $File::Find::name) =~ s/^$dir\/data\/(.*?)(?:\..+)?$/$1/; - exists $block{$rn} and return; + return if exists $block{$rn}; push @unused, abs_path $File::Find::name; return; diff -r cb50d6c57439 -r fac6d76d06e8 bin/imager.restore --- a/bin/imager.restore Sun Jul 31 15:03:06 2011 +0200 +++ b/bin/imager.restore Sun Jul 31 16:09:46 2011 +0200 @@ -1,11 +1,12 @@ #! /usr/bin/perl # Eigentlich geht das selbe mit: # grep '^[[:space:]]*[[:digit:]]' IDX-file | tr -d | cut -f4 -d' ' | while read f; do -# cat DATA/$f || zcat DATA/$f.gz -# done -# ODER -# perl -ne '/^\s*\d/ and print "DATA/" . (split)[2] . "\n"' IDX-File | while read f; do -# cat DATA/$f || zcat DATA/$f.gz +# if test -f DATA/$f then cat $f +# elif test -f DATA/$f.gz then zcat DATA/$f.gz +# elif test -f DATA/$f.x then openssl aes-128-cbc -d -in DATA/$f.x +# elif test -f DATA/$f.gz.x then openssl aes-128-cbc -d -in DATA/$f.gz.x | zcat +# elif test -f DATA/$f.x.gz then zcat DATA/$f.x.gz | openssl aes-128-cbs -d +# fi # done use 5.010; @@ -87,20 +88,20 @@ local $/ = undef; $buffer = <$in>; } + elsif (-f "$data/$path.gz.x") { + open($in, "openssl @{[CIPHER]} -d -pass $o{pass} -in $data/$path.gz.x|"); + binmode($in); + gunzip($in => \$buffer) + or die $GunzipError; + } elsif (-f "$data/$path.x.gz") { warn "$data/$path.x.gz: depreciated!\n"; open($in, - "gzip -d -c $data/$path.x.gz | openssl bf -d -pass $o{pass}|"); + "gzip -d -c $data/$path.x.gz | openssl @{[CIPHER]} -d -pass $o{pass}|"); binmode($in); local $/ = undef; $buffer = <$in>; } - elsif (-f "$data/$path.gz.x") { - open($in, "openssl bf -d -pass $o{pass} -in $data/$path.gz.x|"); - binmode($in); - gunzip($in => \$buffer) - or die $GunzipError; - } else { die ME . ": Can't open $data/$path: $!\n"; } diff -r cb50d6c57439 -r fac6d76d06e8 bin/imager.save --- a/bin/imager.save Sun Jul 31 15:03:06 2011 +0200 +++ b/bin/imager.save Sun Jul 31 16:09:46 2011 +0200 @@ -240,13 +240,14 @@ =over -=item B<-b> I|B<--blocksize>=I +=item B<-b> I | B<--blocksize>=I The blocksize used. (may be suffixed with K, M, G). (default: 4 MiB) =item B<-p> I | B<--pass>=I -Use symmetric encryption for writing the data blocks. +Use symmetric encryption for writing the data blocks. This option +is passed to L. =item B<-z> [I]|B<--compress>[=I]