aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andy@smile.org.ua>2006-10-06 11:54:08 +0000
committerAndy Shevchenko <andy@smile.org.ua>2006-10-06 11:54:08 +0000
commit03cc05032e79823648523bdd434d4f1b3d86a41b (patch)
tree29a13765f37f045b12b945d0a40877e76ae3aaa8
parent32b6758f8688e0aea2210eb335bd9be6c8c79ff8 (diff)
downloadrenrot-03cc05032e79823648523bdd434d4f1b3d86a41b.tar.gz
renrot-03cc05032e79823648523bdd434d4f1b3d86a41b.tar.bz2
Move main() to the end of file. Refactoring: configOptions -> cfgOpts.
Remove --color. Add 'use color' to configuration file ("use color = Yes" is default). Processing message look tunned, now it shows '(m of n)' file processed. Fix tag target in the Makefile. Possible fix bug with clearing EXIFs when --no-backup is given git-svn-id: file:///svnroot/renrot/branches/RENROT_STABLE@268 fe2816f4-e837-0410-b10a-f608c9d244a1
-rw-r--r--ChangeLog8
-rw-r--r--Makefile.PL2
-rw-r--r--README39
-rw-r--r--TODO10
-rw-r--r--etc/colors.conf3
-rw-r--r--etc/renrot.conf2
-rwxr-xr-xrenrot435
7 files changed, 263 insertions, 236 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c46ef5..f8cb281 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
1$Log$ 1$Log$
2Revision 1.148.2.7 2006/10/06 11:54:08 andy
3Move main() to the end of file. Refactoring: configOptions -> cfgOpts.
4Remove --color. Add 'use color' to configuration file ("use color = Yes" is default).
5Processing message look tunned, now it shows '(m of n)' file processed.
6Fix tag target in the Makefile.
7Possible fix bug with clearing EXIFs when --no-backup is given
8
2Revision 1.148.2.6 2006/09/02 19:03:17 andy 9Revision 1.148.2.6 2006/09/02 19:03:17 andy
3Release as 0.24. 10Release as 0.24.
4 11
@@ -617,4 +624,3 @@ Id keyword is added to renrot file.
617 624
618Revision 1.1 2005/10/17 13:39:38 zeus 625Revision 1.1 2005/10/17 13:39:38 zeus
619ChangeLog file is added. Its the very begining. 626ChangeLog file is added. Its the very begining.
620
diff --git a/Makefile.PL b/Makefile.PL
index 4579c16..9e3262e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -22,7 +22,7 @@ rpm : tardist
22 22
23# CVS tagging 23# CVS tagging
24tag : 24tag :
25 cvs tag "renrot_$(shell date +'%Y%m%d%H%M%S')" 25 $(PERLRUN) -e 'use POSIX qw(strftime); $$date = strftime("%Y%m%d%H%M%S", localtime()); system("cvs tag $(NAME)_$$date");'
26END 26END
27 return $postamble; 27 return $postamble;
28} 28}
diff --git a/README b/README
index a8d985f..05daca3 100644
--- a/README
+++ b/README
@@ -96,25 +96,40 @@ the script:
96 renrot --no-mtime *.jpg 96 renrot --no-mtime *.jpg
97 97
98 98
99RESTRICTIONS 99RESTRICTIONS AND BUGS
100------------ 100------------ --- ----
101
102RenRot has some restrictions and known bugs at runtime.
103
1041. Script handles a whole directory without recursion and only with one
105extension of files.
106
1072. Algorithm treat each file with given extension as the image. Otherwise,
108file will be renamed to the current time stamp when --no-rename option is
109omitted.
101 110
102RenRot has some restrictions at runtime. First off, script handles a whole 1113. Rename operation is not permited between different partitions due to hard
103directory without recursion and only with one extension of files. Second, 112link technology used (this will be avoided in future).
104algorithm treat each file with given extension as the image. Otherwise, file
105will be renamed to the current time stamp when --no-rename option is omitted.
106Third, rename operation is not permited between different partitions due to
107hard link technology used (this will be avoided in future). Rotation process
108is available only on JPEG files.
109 113
110It seems that for Perl v.5.8.7 and 5.8.8, at least on FreeBSD 6 the bug, which 1144. Rotation process is available only on JPEG files.
111cause crash of the renrot, exists. In case when total amount of the files size 115
112to process is bigger than RAM amount, the renrot falls with error: 1165. It seems that for Perl v.5.8.7 and 5.8.8, at least on FreeBSD 6 the bug,
117which cause crash of the renrot, exists. In case when total amount of the
118files size to process is bigger than RAM amount, the renrot falls with error:
113 119
114 Out of memory during "large" request for XXXX bytes ... 120 Out of memory during "large" request for XXXX bytes ...
115 121
116This doesn't occure for Perl v.5.6.1. 122This doesn't occure for Perl v.5.6.1.
117 123
1246. Still no way to set the tags with the same name but located in the
125different groups.
126
1277. The colorization is started after the configuration files were parsed.
128While that is not happened the messages will be colorized by default color
129scheme.
130
1318. The colorization is not working under Windows platform.
132
118 133
119DEBUGGING 134DEBUGGING
120--------- 135---------
diff --git a/TODO b/TODO
index 29b68b0..c96e996 100644
--- a/TODO
+++ b/TODO
@@ -7,6 +7,13 @@ TODO SEMANTICS
7q optional feature 7q optional feature
8 8
9 9
10BUGS
11
12- fix cleaning EXIFs when --no-backup is given
13
14- make possible to use same EXIF tags in different groups
15
16
10EXIF tags 17EXIF tags
11 18
12q to write to some tag the options passed to renrot 19q to write to some tag the options passed to renrot
@@ -45,6 +52,9 @@ User interface
45- GUI on PerlTk (due to WinCE hasn't real console) with some additional 52- GUI on PerlTk (due to WinCE hasn't real console) with some additional
46 functions such as keywordizer 53 functions such as keywordizer
47 54
55- to implement help output by topics (sole -h outputs list of topics like
56 rename,rotate,keyword e.t.c. and -h keyword outputs help for keyword related
57
48 58
49File naming 59File naming
50 60
diff --git a/etc/colors.conf b/etc/colors.conf
index 73297ce..2ac6e60 100644
--- a/etc/colors.conf
+++ b/etc/colors.conf
@@ -3,6 +3,9 @@
3# 3#
4# Note: These variables can be overriden by command line options. 4# Note: These variables can be overriden by command line options.
5 5
6# Use colorized output. This NOT works under Win32.
7#Use color = No
8
6# Setup colors for different facilities 9# Setup colors for different facilities
7 10
8#Color = debug: 'green' 11#Color = debug: 'green'
diff --git a/etc/renrot.conf b/etc/renrot.conf
index 3b564e7..9c478c0 100644
--- a/etc/renrot.conf
+++ b/etc/renrot.conf
@@ -75,3 +75,5 @@
75# Use IPC for execution external command 75# Use IPC for execution external command
76#use IPC = No 76#use IPC = No
77 77
78# Use colorized output (not works under MS Windows)
79#use color = Yes
diff --git a/renrot b/renrot
index 67f12f8..dab4ccc 100755
--- a/renrot
+++ b/renrot
@@ -57,7 +57,7 @@ if (defined %Image::ExifTool::UserDefined::RenRot) {
57# 57#
58# Parsed configuration file in hash 58# Parsed configuration file in hash
59# 59#
60my %configOptions = ( 60my %cfgOpts = (
61 'aggregation delta' => 900, 61 'aggregation delta' => 900,
62 'aggregation directory' => 'Images', 62 'aggregation directory' => 'Images',
63 'aggregation mode' => 'none', 63 'aggregation mode' => 'none',
@@ -70,8 +70,9 @@ my %configOptions = (
70 'mtime' => 1, 70 'mtime' => 1,
71 'name template' => '%Y%m%d%H%M%S', 71 'name template' => '%Y%m%d%H%M%S',
72 'trim' => 1, 72 'trim' => 1,
73 'use color' => 1,
73 'use ipc' => 0, 74 'use ipc' => 0,
74 ); 75 );
75 76
76######################################################################################## 77########################################################################################
77# 78#
@@ -84,7 +85,6 @@ my $aggrTemplate; # template for the files aggregation taken from CLI
84my $aggrVirtual; # flag to do links instead real file moving while aggregation 85my $aggrVirtual; # flag to do links instead real file moving while aggregation
85my $aggrVirtDir; # directory name for virtual aggregation 86my $aggrVirtDir; # directory name for virtual aggregation
86my $backup = 1; # make or not a backup of the original files 87my $backup = 1; # make or not a backup of the original files
87my %colorsFromCli; # colors are got from CLI
88my $comfile; # file with commentary 88my $comfile; # file with commentary
89my $configFile; # configuration file 89my $configFile; # configuration file
90my $countFF = 1; # use fixed field for counter 90my $countFF = 1; # use fixed field for counter
@@ -186,6 +186,9 @@ my @multOpts = (
186 'tagfile', 186 'tagfile',
187 ); 187 );
188 188
189my @files; # array of the sorted filenames to process
190my %filenameshash; # hash for old file names
191
189######################################################################################## 192########################################################################################
190# 193#
191# Colors hash 194# Colors hash
@@ -203,7 +206,7 @@ my %colors = (
203sub printColored { 206sub printColored {
204 my $facility = shift; 207 my $facility = shift;
205 208
206 if (defined $useColor and $useColor != 0) { 209 if ($cfgOpts{'use color'} != 0) {
207 if (defined $facility and defined $colors{$facility}) { 210 if (defined $facility and defined $colors{$facility}) {
208 print STDERR colored [$colors{$facility}{value}], @_; 211 print STDERR colored [$colors{$facility}{value}], @_;
209 return; 212 return;
@@ -217,7 +220,7 @@ sub printColored {
217sub procmsg { 220sub procmsg {
218 return if ($quiet != 0); 221 return if ($quiet != 0);
219 222
220 if (defined $useColor and $useColor != 0) { 223 if ($cfgOpts{'use color'} != 0) {
221 if (defined $colors{'process'}) { 224 if (defined $colors{'process'}) {
222 print colored [$colors{'process'}{value}], @_; 225 print colored [$colors{'process'}{value}], @_;
223 return; 226 return;
@@ -289,7 +292,6 @@ sub boolConverter {
289sub getOptions { 292sub getOptions {
290 my $showVersion = 0; # need version 293 my $showVersion = 0; # need version
291 my $showHelp = 0; # need help 294 my $showHelp = 0; # need help
292 my @tmpColors;
293 my @tmpTags; 295 my @tmpTags;
294 my $getOptions = GetOptions ( 296 my $getOptions = GetOptions (
295 "aggr-delta=i" => \$aggrDelta, 297 "aggr-delta=i" => \$aggrDelta,
@@ -299,7 +301,6 @@ sub getOptions {
299 "aggr-virtual!" => \$aggrVirtual, 301 "aggr-virtual!" => \$aggrVirtual,
300 "aggr-virtual-directory=s" => \$aggrVirtDir, 302 "aggr-virtual-directory=s" => \$aggrVirtDir,
301 "backup!" => \$backup, 303 "backup!" => \$backup,
302 "color=s" => \@tmpColors,
303 "comment-file=s" => \$comfile,