Skip to content

Commit

Permalink
- Minor fix.
Browse files Browse the repository at this point in the history
- Store `__GTKRC_MTIME__` in the cache_db when cache has just been cleaned due to the a change in config.pl or schema.pl.
  • Loading branch information
trizen committed Oct 4, 2017
1 parent 861accb commit 75f08d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions obmenu-generator
Expand Up @@ -453,11 +453,13 @@ require GDBM_File;
tie my %cache_db, 'GDBM_File', $cache_db, &GDBM_File::GDBM_WRCREAT, 0640;

# Regenerate the icon db if the GTKRC file has been modified
if ($with_icons and !$db_clean) {
if ($with_icons) {
my $gtkrc_mtime = (stat $CONFIG{gtk_rc_filename})[9];

if (!exists($cache_db{__GTKRC_MTIME__})
or $cache_db{__GTKRC_MTIME__} != $gtkrc_mtime) {
if ($db_clean) {
$cache_db{__GTKRC_MTIME__} = $gtkrc_mtime;
}
elsif (!exists($cache_db{__GTKRC_MTIME__}) or $cache_db{__GTKRC_MTIME__} != $gtkrc_mtime) {
print STDERR "** Regenerating the cache DB...\n";
untie %cache_db;
unlink $cache_db;
Expand Down

0 comments on commit 75f08d0

Please sign in to comment.