# Where should I store the entries_timestamp index file?
# IMO timestamps are metadata rather than state, but you may well not care.
# Where should I store the entries_timestamp index file?
# IMO timestamps are metadata rather than state, but you may well not care.
# What name should my entries_timestamp index file be called?
# If you want to migrate from entries_index, you can just use the original
# entries_index .entries_index.index file, or or just copy/rename it.
# What name should my entries_timestamp index file be called?
# If you want to migrate from entries_index, you can just use the original
# entries_index .entries_index.index file, or or just copy/rename it.
# Reindexing password. If entries_timestamp finds a '?reindex=$reindex_password'
# parameter it will check and resync machine timestamps to the human versions
# Reindexing password. If entries_timestamp finds a '?reindex=$reindex_password'
# parameter it will check and resync machine timestamps to the human versions
return sub {
my(%indexes, %files_ts, %files_ts_str, %files_symlinks);
return sub {
my(%indexes, %files_ts, %files_ts_str, %files_symlinks);
my $index = join '', <ENTRIES>;
close ENTRIES;
if ( $index =~ m/\$(TS_\w+|VAR1) = \{/ ) {
eval $index;
if ( $@ ) {
my $index = join '', <ENTRIES>;
close ENTRIES;
if ( $index =~ m/\$(TS_\w+|VAR1) = \{/ ) {
eval $index;
if ( $@ ) {
# If asked to reindex, check and sync machine timestamps to the human ones
if ( my $reindex = $q->param('reindex') ) {
# If asked to reindex, check and sync machine timestamps to the human ones
if ( my $reindex = $q->param('reindex') ) {
if ( my $reindex_ts = parse_ts( $files_ts_str{$File::Find::name} )) {
if ($reindex_ts != $files_ts{$File::Find::name}) {
# debug(1, "reindex: updating timestamp on '$File::Find::name'\n");
if ( my $reindex_ts = parse_ts( $files_ts_str{$File::Find::name} )) {
if ($reindex_ts != $files_ts{$File::Find::name}) {
# debug(1, "reindex: updating timestamp on '$File::Find::name'\n");
- # debug(1, "index_mods $index_mods, saving \%files to $meta_dir/$entries_index");
- if ( open ENTRIES, "> $meta_dir/$entries_index" ) {
+ # debug(1, "index_mods $index_mods, saving \%files to $config{meta_dir}/$config{entries_index}");
+ if ( open ENTRIES, "> $config{meta_dir}/$config{entries_index}" ) {
print ENTRIES Data::Dumper->Dump([ \%files_ts_str, \%files_ts, \%files_symlinks ],
[ qw(TS_HUMAN TS_MACHINE SYMLINKS) ] );
close ENTRIES;
}
else {
print ENTRIES Data::Dumper->Dump([ \%files_ts_str, \%files_ts, \%files_symlinks ],
[ qw(TS_HUMAN TS_MACHINE SYMLINKS) ] );
close ENTRIES;
}
else {