From: <enl...@li...> - 2001-03-30 18:40:52
|
Enlightenment CVS committal Author : cpk Project : e17 Module : apps/efsd Dir : e17/apps/efsd/tools Modified Files: magic2db.in Log Message: Introducing a generic hash facility and caching systems for stats and filetypes. I think I fixed a couple of bugs along the way, but I haven't tested this much. It's probably a good idea to look at this from a good distance ... =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/efsd/tools/magic2db.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- magic2db.in 2001/03/20 22:27:55 1.6 +++ magic2db.in 2001/03/30 18:40:50 1.7 @@ -151,10 +151,10 @@ e_db_int_set($db_file, $key, $$magic_ptr{"value"}); } } - if (defined($$magic_ptr{"mime"})) + if (defined($$magic_ptr{"filetype"})) { - $key = $s . "mimetype"; - e_db_str_set($db_file, $key, $$magic_ptr{"mime"}); + $key = $s . "filetype"; + e_db_str_set($db_file, $key, $$magic_ptr{"filetype"}); } } @@ -357,30 +357,14 @@ $item =~ s/(-+)$//; # remove any dashes at end $item = lc($item); - if ($level == 0) + if (length($item) > 0) { - if (length($item) > 0) - { - if (!($item =~ /^.*\/.*$/)) - { - $item = $item . "/"; - } - else - { - $item = $item . "-"; - } - } - } - else - { - if (length($item) > 0) - { - $item = $item . "-"; - } + $item = $item . "/"; } $item =~ s/-+/-/g; - $magic{"mime"} = $item; + $item =~ s/\/+/\//g; + $magic{"filetype"} = $item; write_magic(\@indices, $level, \%magic); } |