projects
/
matthijs
/
upstream
/
blosxom-plugins.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4610fd0
)
Update entries_timestamp to use meaningful variable names in index.
author
Gavin Carr
<gonzai@users.sourceforge.net>
Tue, 30 Oct 2007 09:35:48 +0000
(09:35 +0000)
committer
Gavin Carr
<gonzai@users.sourceforge.net>
Tue, 30 Oct 2007 09:35:48 +0000
(09:35 +0000)
gavinc/entries_timestamp
patch
|
blob
|
history
diff --git
a/gavinc/entries_timestamp
b/gavinc/entries_timestamp
index e32f0c5ce6ddf9ca06b8727d7075d18f8cf3619a..be6ddb555c19ab517407cea83898f84431f93567 100644
(file)
--- a/
gavinc/entries_timestamp
+++ b/
gavinc/entries_timestamp
@@
-1,6
+1,6
@@
# Blosxom Plugin: entries_timestamp
# Author(s): Gavin Carr <gavin@openfusion.com.au>
# Blosxom Plugin: entries_timestamp
# Author(s): Gavin Carr <gavin@openfusion.com.au>
-# Version: 0.00
1
000
+# Version: 0.00
2
000
# Documentation: See the bottom of this file or type: perldoc entries_timestamp
package entries_timestamp;
# Documentation: See the bottom of this file or type: perldoc entries_timestamp
package entries_timestamp;
@@
-12,7
+12,7
@@
use Data::Dumper;
use Time::Local;
use CGI ();
use Time::Local;
use CGI ();
-#use Blosxom::Debug debug_level =>
1
;
+#use Blosxom::Debug debug_level =>
2
;
# --- Configurable variables -----
# --- Configurable variables -----
@@
-35,7
+35,7
@@
my $reindex_password = 'abracad'; # CHANGEME!
my $q = CGI->new;
my $q = CGI->new;
-use vars qw($VAR1 $VAR2 $VAR3);
+use vars qw($
TS_MACHINE $TS_HUMAN $SYMLINKS $
VAR1 $VAR2 $VAR3);
sub start { 1 }
sub start { 1 }
@@
-47,16
+47,28
@@
sub entries {
if ( open ENTRIES, "$meta_dir/$entries_index" ) {
my $index = join '', <ENTRIES>;
close ENTRIES;
if ( open ENTRIES, "$meta_dir/$entries_index" ) {
my $index = join '', <ENTRIES>;
close ENTRIES;
- if ( $index =~ m/\$
VAR1
= \{/ ) {
+ if ( $index =~ m/\$
(TS_\w+|VAR1)
= \{/ ) {
eval $index;
if ( $@ ) {
warn "(entries_timestamp) eval of $entries_index failed: $@";
return;
}
else {
eval $index;
if ( $@ ) {
warn "(entries_timestamp) eval of $entries_index failed: $@";
return;
}
else {
- %files_ts = %$VAR1;
- %files_ts_str = %$VAR2 if keys %$VAR2;
- %files_symlinks = %$VAR3 if keys %$VAR3;
+ if ($TS_MACHINE && keys %$TS_MACHINE) {
+ %files_ts = %$TS_MACHINE;
+ } elsif ($VAR1 && keys %$VAR1) {
+ %files_ts = %$VAR1;
+ }
+ if ($TS_HUMAN && keys %$TS_HUMAN) {
+ %files_ts_str = %$TS_HUMAN;
+ } elsif ($VAR2 && keys %$VAR2) {
+ %files_ts_str = %$VAR2;
+ }
+ if ($SYMLINKS && keys %$SYMLINKS) {
+ %files_symlinks = %$SYMLINKS;
+ } elsif ($VAR3 && keys %$VAR3) {
+ %files_symlinks = %$VAR3;
+ }
}
}
}
}
}
}
@@
-176,7
+188,8
@@
sub entries {
if ( $index_mods ) {
# debug(1, "index_mods $index_mods, saving \%files to $meta_dir/$entries_index");
if ( open ENTRIES, "> $meta_dir/$entries_index" ) {
if ( $index_mods ) {
# debug(1, "index_mods $index_mods, saving \%files to $meta_dir/$entries_index");
if ( open ENTRIES, "> $meta_dir/$entries_index" ) {
- print ENTRIES Dumper \%files_ts, \%files_ts_str, \%files_symlinks;
+ print ENTRIES Data::Dumper->Dump([ \%files_ts_str, \%files_ts, \%files_symlinks ],
+ [ qw(TS_HUMAN TS_MACHINE SYMLINKS) ] );
close ENTRIES;
}
else {
close ENTRIES;
}
else {