diff options
author | Andy Shevchenko <andy@smile.org.ua> | 2006-10-06 11:54:08 +0000 |
---|---|---|
committer | Andy Shevchenko <andy@smile.org.ua> | 2006-10-06 11:54:08 +0000 |
commit | 03cc05032e79823648523bdd434d4f1b3d86a41b (patch) | |
tree | 29a13765f37f045b12b945d0a40877e76ae3aaa8 | |
parent | 32b6758f8688e0aea2210eb335bd9be6c8c79ff8 (diff) | |
download | renrot-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | Makefile.PL | 2 | ||||
-rw-r--r-- | README | 39 | ||||
-rw-r--r-- | TODO | 10 | ||||
-rw-r--r-- | etc/colors.conf | 3 | ||||
-rw-r--r-- | etc/renrot.conf | 2 | ||||
-rwxr-xr-x | renrot | 435 |
7 files changed, 263 insertions, 236 deletions
@@ -1,4 +1,11 @@ | |||
1 | $Log$ | 1 | $Log$ |
2 | Revision 1.148.2.7 2006/10/06 11:54:08 andy | ||
3 | Move main() to the end of file. Refactoring: configOptions -> cfgOpts. | ||
4 | Remove --color. Add 'use color' to configuration file ("use color = Yes" is default). | ||
5 | Processing message look tunned, now it shows '(m of n)' file processed. | ||
6 | Fix tag target in the Makefile. | ||
7 | Possible fix bug with clearing EXIFs when --no-backup is given | ||
8 | |||
2 | Revision 1.148.2.6 2006/09/02 19:03:17 andy | 9 | Revision 1.148.2.6 2006/09/02 19:03:17 andy |
3 | Release as 0.24. | 10 | Release as 0.24. |
4 | 11 | ||
@@ -617,4 +624,3 @@ Id keyword is added to renrot file. | |||
617 | 624 | ||
618 | Revision 1.1 2005/10/17 13:39:38 zeus | 625 | Revision 1.1 2005/10/17 13:39:38 zeus |
619 | ChangeLog file is added. Its the very begining. | 626 | ChangeLog 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 |
24 | tag : | 24 | tag : |
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");' |
26 | END | 26 | END |
27 | return $postamble; | 27 | return $postamble; |
28 | } | 28 | } |
@@ -96,25 +96,40 @@ the script: | |||
96 | renrot --no-mtime *.jpg | 96 | renrot --no-mtime *.jpg |
97 | 97 | ||
98 | 98 | ||
99 | RESTRICTIONS | 99 | RESTRICTIONS AND BUGS |
100 | ------------ | 100 | ------------ --- ---- |
101 | |||
102 | RenRot has some restrictions and known bugs at runtime. | ||
103 | |||
104 | 1. Script handles a whole directory without recursion and only with one | ||
105 | extension of files. | ||
106 | |||
107 | 2. Algorithm treat each file with given extension as the image. Otherwise, | ||
108 | file will be renamed to the current time stamp when --no-rename option is | ||
109 | omitted. | ||
101 | 110 | ||
102 | RenRot has some restrictions at runtime. First off, script handles a whole | 111 | 3. Rename operation is not permited between different partitions due to hard |
103 | directory without recursion and only with one extension of files. Second, | 112 | link technology used (this will be avoided in future). |
104 | algorithm treat each file with given extension as the image. Otherwise, file | ||
105 | will be renamed to the current time stamp when --no-rename option is omitted. | ||
106 | Third, rename operation is not permited between different partitions due to | ||
107 | hard link technology used (this will be avoided in future). Rotation process | ||
108 | is available only on JPEG files. | ||
109 | 113 | ||
110 | It seems that for Perl v.5.8.7 and 5.8.8, at least on FreeBSD 6 the bug, which | 114 | 4. Rotation process is available only on JPEG files. |
111 | cause crash of the renrot, exists. In case when total amount of the files size | 115 | |
112 | to process is bigger than RAM amount, the renrot falls with error: | 116 | 5. It seems that for Perl v.5.8.7 and 5.8.8, at least on FreeBSD 6 the bug, |
117 | which cause crash of the renrot, exists. In case when total amount of the | ||
118 | files 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 | ||
116 | This doesn't occure for Perl v.5.6.1. | 122 | This doesn't occure for Perl v.5.6.1. |
117 | 123 | ||
124 | 6. Still no way to set the tags with the same name but located in the | ||
125 | different groups. | ||
126 | |||
127 | 7. The colorization is started after the configuration files were parsed. | ||
128 | While that is not happened the messages will be colorized by default color | ||
129 | scheme. | ||
130 | |||
131 | 8. The colorization is not working under Windows platform. | ||
132 | |||
118 | 133 | ||
119 | DEBUGGING | 134 | DEBUGGING |
120 | --------- | 135 | --------- |
@@ -7,6 +7,13 @@ TODO SEMANTICS | |||
7 | q optional feature | 7 | q optional feature |
8 | 8 | ||
9 | 9 | ||
10 | BUGS | ||
11 | |||
12 | - fix cleaning EXIFs when --no-backup is given | ||
13 | |||
14 | - make possible to use same EXIF tags in different groups | ||
15 | |||
16 | |||
10 | EXIF tags | 17 | EXIF tags |
11 | 18 | ||
12 | q to write to some tag the options passed to renrot | 19 | q 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 | ||
49 | File naming | 59 | File 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 | ||
@@ -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 | # |
60 | my %configOptions = ( | 60 | my %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 | |||
84 | my $aggrVirtual; # flag to do links instead real file moving while aggregation | 85 | my $aggrVirtual; # flag to do links instead real file moving while aggregation |
85 | my $aggrVirtDir; # directory name for virtual aggregation | 86 | my $aggrVirtDir; # directory name for virtual aggregation |
86 | my $backup = 1; # make or not a backup of the original files | 87 | my $backup = 1; # make or not a backup of the original files |
87 | my %colorsFromCli; # colors are got from CLI | ||
88 | my $comfile; # file with commentary | 88 | my $comfile; # file with commentary |
89 | my $configFile; # configuration file | 89 | my $configFile; # configuration file |
90 | my $countFF = 1; # use fixed field for counter | 90 | my $countFF = 1; # use fixed field for counter |
@@ -186,6 +186,9 @@ my @multOpts = ( | |||
186 | 'tagfile', | 186 | 'tagfile', |
187 | ); | 187 | ); |
188 | 188 | ||
189 | my @files; # array of the sorted filenames to process | ||
190 | my %filenameshash; # hash for old file names | ||
191 | |||
189 | ######################################################################################## | 192 | ######################################################################################## |
190 | # | 193 | # |
191 | # Colors hash | 194 | # Colors hash |
@@ -203,7 +206,7 @@ my %colors = ( | |||
203 | sub printColored { | 206 | sub 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 { | |||
217 | sub procmsg { | 220 | sub 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 { | |||
289 | sub getOptions { | 292 | sub 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, |