Ticket #1113: mythtv-mythrename-verbose.patch
File mythtv-mythrename-verbose.patch, 2.0 KB (added by , 18 years ago) |
---|
-
contrib/mythrename.pl
22 22 use File::Path; 23 23 use File::Basename; 24 24 use File::Find; 25 use File::Spec; 25 26 26 27 # Some variables we'll use here 27 28 our ($dest, $format, $usage, $underscores, $live); … … 159 160 exit; 160 161 } 161 162 163 # For quiet (non-verbose) output, redirect STDOUT to devnull() 164 unless (defined($verbose)) { open(STDOUT, "> ".File::Spec->devnull()); } 165 162 166 # Check the separator and replacement characters for illegal characters 163 167 if ($separator =~ /(?:[\/\\:*?<>|"])/) { 164 168 die "The separator cannot contain any of the following characters: /\\:*?<>|\"\n"; … … 241 245 if (defined($dest)) { 242 246 # Double-check the destination 243 247 $dest ||= "$video_dir/show_names"; 244 # Alert the user 245 if (defined($verbose)) { 246 print "Link destination directory: $dest\n"; 247 } 248 print "Link destination directory: $dest\n"; 248 249 # Create nonexistent paths 249 250 unless (-e $dest) { 250 251 mkpath($dest, 0, 0755) or die "Failed to create $dest: $!\n"; … … 402 403 } 403 404 symlink "$video_dir/".$info{'basename'}, "$dest/$name" 404 405 or die "Can't create symlink $dest/$name: $!\n"; 405 if (defined($verbose)) { 406 print "$dest/$name\n"; 407 } 406 print "$dest/$name\n"; 408 407 } 409 408 # Rename the file 410 409 else { … … 427 426 $rows = $sh2->execute($info{'basename'}, $info{'chanid'}, $info{'starttime'}); 428 427 die "Couldn't restore original basename in database for ".$info{'basename'}.": ($q2)\n" unless ($rows == 1); 429 428 } 430 if (defined($verbose)) { 431 print $info{'basename'}."\t-> $name\n"; 432 } 429 print $info{'basename'}."\t-> $name\n"; 433 430 } 434 431 } 435 432 }