my $ext = defined $f->{'extension'} ? $f->{'extension'} : "";
$ext = "" if $ext =~ /^\s*$/;
$ext = "." . $ext if $ext ne "" and $ext !~ /^\./;
+ my $ext_ohne = $ext;
- my ( $i, $pair, $t, $t_new );
+ # Compress-Endung hinten dran bammeln ...
+ if ( $f->{'compress'} ) {
+ my $ce = $self->{'c'}->compressext();
+ if ( not defined($ce) or $ce =~ /^\s*$/ ) {
+ $ce = ".gz";
+ }
+ $ce = "." . $ce if $ce ne "" and $ce !~ /^\./;
+ $ext .= $ce;
+ }
+
+ my ( $i, $pair, $t, $t_ohne, $t_new, $t_new_ohne );
$t = $target . $ext;
+ $t_ohne = $target . $ext_ohne;
$i = 0;
my $res = {
# Ziel der eigentlichen Rotation festlegen
if ( $file eq $t ) {
$t = $target . ".0" . $ext;
+ $t_ohne = $target . ".0" . $ext_ohne;
$i = 1;
}
$res->{'rotate'}{'from'} = $file;
- $res->{'rotate'}{'to'} = $t;
+ $res->{'rotate'}{'to'} = $t_ohne;
# Rotationsziel gibt's nicht, okay, raus hier
- return $res unless -f $t;
+ return $res unless -f $t or -f $t_ohne;
- print $p . "Rotationsziel '$t' gibt's schon, ermittle zyklische Rotationen ...\n" if verbose() > 2;
+ print $p . "Rotationsziel '$t_ohne' gibt's schon, ermittle zyklische Rotationen ...\n" if verbose() > 2;
# restliche Rotationen festlegen ...
- while ( -f $t ) {
+ while ( -f $t or -f $t_ohne ) {
$t_new = $target . "." . $i . $ext;
- print $p . "Zyklische Rotation '$t' -> '$t_new'.\n" if verbose() > 3;
- $pair = { 'from' => $t,
- 'to' => $t_new,
+ $t_new_ohne = $target . "." . $i . $ext_ohne;
+ print $p . "Zyklische Rotation '$t_ohne' -> '$t_new_ohne'.\n" if verbose() > 3;
+ $pair = { 'from' => $t_ohne,
+ 'to' => $t_new_ohne,
};
unshift @{$res->{'move'}}, $pair;
$t = $t_new;
+ $t_ohne = $t_new_ohne;
$i++;
}