* [sisyphus] Perl content: почему dict перестал видеть словари ? @ 2006-01-16 15:03 Arioch 2006-01-16 20:11 ` Dmitry Marochko ` (2 more replies) 0 siblings, 3 replies; 17+ messages in thread From: Arioch @ 2006-01-16 15:03 UTC (permalink / raw) To: sisyphus По идее скрипт /usr/sbin/dictdconfig должен перечислять все базы и записывать из в список, однако.... zsh 642 % cat /var/lib/dictd/db.list - - - SKIP - - - # See dictdconfig(8) for details. - - - SKIP - - - database engcom { data /usr/share/dictd/engcom.dict.dz index /usr/share/dictd/engcom.index } database foldoc { data /usr/share/dictd/foldoc.dict.dz index /usr/share/dictd/foldoc.index } database vera { data /usr/share/dictd/vera.dict.dz index /usr/share/dictd/vera.index } database jargon { data /usr/share/dictd/jargon.dict.dz index /usr/share/dictd/jargon.index } Чем они отличаюся от других??? zsh 643 % ll /usr/share/dictd итого 38052 drwxr-xr-x 377 root root 11064 Янв 14 18:10 ../ drwxr-xr-x 2 root root 656 Янв 6 00:11 ./ -rw-r--r-- 1 root root 209247 Янв 6 00:11 engcom.dict.dz -rw-r--r-- 1 root root 35725 Янв 6 00:11 engcom.index -rw-r--r-- 1 root root 3952339 Ноя 27 22:08 gcide.index -rw-r--r-- 1 root root 13527757 Ноя 27 22:08 gcide.dict.dz -rw-r--r-- 1 root root 2105578 Сен 14 15:00 foldoc.dict.dz -rw-r--r-- 1 root root 281456 Сен 14 15:00 foldoc.index -rw-r--r-- 1 root root 164177 Май 24 2005 vera.dict.dz -rw-r--r-- 1 root root 120783 Май 24 2005 vera.index -rw-r--r-- 1 root root 832116 Мар 4 2005 slovnyk_ru-en.dict.dz -rw-r--r-- 1 root root 1486899 Мар 4 2005 slovnyk_ru-en.index -rw-r--r-- 1 root root 972387 Мар 4 2005 slovnyk_en-ru.dict.dz -rw-r--r-- 1 root root 977100 Мар 4 2005 slovnyk_en-ru.index -rw-r--r-- 1 root root 2767389 Мар 4 2005 mueller7.dict.dz -rw-r--r-- 1 root root 786401 Мар 4 2005 mueller7.index -rw-r--r-- 1 root root 636409 Мар 4 2005 jargon.dict.dz -rw-r--r-- 1 root root 43202 Мар 4 2005 jargon.index -rw-r--r-- 1 root root 8808006 Мар 4 2005 dalf.dict.dz -rw-r--r-- 1 root root 1175086 Мар 4 2005 dalf.index Вот по идее фнукция, котораядолжна проверять наличие пар файлов, но видимо она на Словнике затыкается. Не любит дефисы/подчеркиваия ? sub CheckDatabase { my ( $base_name ) = @_; my $name; my $datafile; my $indexfile; if ( $base_name =~ m#.*/(.*)# ) { $name = $1 } else { $name = $base_name } if ( $base_name =~ m#^/# ) { $datafile = $indexfile = $base_name } else { $datafile = $indexfile = "$db_dir/$base_name" } $datafile .= ".dict.dz"; $datafile =~ s/\.dz$// unless -f $datafile; $indexfile .= ".index"; if ( ! $db_entered{ $name } && -f $datafile && -f $indexfile ) { AddEntry( $name, $datafile, $indexfile ); } } sub CheckDirectory { my ( $dir ) = @_; $dir = "$db_dir/$dir" unless $dir =~ m#^/#; opendir DIR, $dir; for (readdir DIR) { if ( /(^.*)\.index$/ ) { CheckDatabase( "$dir$1" ) } } closedir DIR; } Я в Перле ни бум-бум, о м.б. кто подскажет чего поправить ? Кстати, нет man page для dictdconfig, а в вывод скрипта идет ссылка на man :) PS: удалил slovnyk - ничего не изменилось, видит только первые 4 словаря, и всё тут :( ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Perl content: почему dict перестал видеть словари ? 2006-01-16 15:03 [sisyphus] Perl content: почему dict перестал видеть словари ? Arioch @ 2006-01-16 20:11 ` Dmitry Marochko 2006-01-17 7:41 ` Epiphanov Sergei 2006-01-17 9:54 ` [sisyphus] Perl content: почему dict перестал видеть словари ? Epiphanov Sergei 2 siblings, 0 replies; 17+ messages in thread From: Dmitry Marochko @ 2006-01-16 20:11 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list [-- Attachment #1: Type: text/plain, Size: 1118 bytes --] И правда, в чем дело? $ dict -D Databases available: engcom jargon Jargon File (4.3.1, 29 Jun 2001) $ l /usr/share/dictd итого 18376 drwxr-xr-x 252 root root 8192 Янв 13 22:21 ../ -rw-r--r-- 1 root root 206843 Ноя 30 18:57 engcom.dict.dz -rw-r--r-- 1 root root 35443 Ноя 30 18:57 engcom.index drwxr-xr-x 2 root root 4096 Сен 22 18:02 ./ -rw-r--r-- 1 root root 2767389 Фев 2 2004 mueller7.dict.dz -rw-r--r-- 1 root root 786401 Фев 2 2004 mueller7.index -rw-r--r-- 1 root root 8808006 Июл 27 2003 dalf.dict.dz -rw-r--r-- 1 root root 1175086 Июл 27 2003 dalf.index -rw-r--r-- 1 root root 636409 Янв 31 2003 jargon.dict.dz -rw-r--r-- 1 root root 43202 Янв 31 2003 jargon.index -rw-r--r-- 1 root root 1486899 Янв 15 2003 slovnyk_ru-en.index -rw-r--r-- 1 root root 832116 Янв 15 2003 slovnyk_ru-en.dict.dz -rw-r--r-- 1 root root 977100 Янв 15 2003 slovnyk_en-ru.index -rw-r--r-- 1 root root 972387 Янв 15 2003 slovnyk_en-ru.dict.dz Остальные не видит. До обновления все работало. -- With best wishes, Dmitry Marochko aka Mothlike [-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Perl content: почему dict перестал видеть словари ? 2006-01-16 15:03 [sisyphus] Perl content: почему dict перестал видеть словари ? Arioch 2006-01-16 20:11 ` Dmitry Marochko @ 2006-01-17 7:41 ` Epiphanov Sergei 2006-01-17 9:24 ` [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? Arioch 2006-01-17 9:54 ` [sisyphus] Perl content: почему dict перестал видеть словари ? Epiphanov Sergei 2 siblings, 1 reply; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-17 7:41 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Monday 16 January 2006 18:03 Arioch написал(a): > По идее скрипт /usr/sbin/dictdconfig должен перечислять все базы и > записывать из в список, однако.... > > zsh 642 % cat /var/lib/dictd/db.list > - - - SKIP - - - > # See dictdconfig(8) for details. > - - - SKIP - - - > database engcom { > data /usr/share/dictd/engcom.dict.dz > index /usr/share/dictd/engcom.index > } > database foldoc { > data /usr/share/dictd/foldoc.dict.dz > index /usr/share/dictd/foldoc.index > } > database vera { > data /usr/share/dictd/vera.dict.dz > index /usr/share/dictd/vera.index > } > database jargon { > data /usr/share/dictd/jargon.dict.dz > index /usr/share/dictd/jargon.index > } > > > > Чем они отличаюся от других??? Тем, что они прописаны в файле /etc/dictd.order. Есть такой файл /etc/dictd.order. Вот почему-то при генерации списка словарей dictdconfig не лезет в каталог /usr/share/dictd, как там указано в файле, а перечисляет только явно указанные. Когда туда вписал все имеющиеся у меня словари и скомандовал 'dictdconfig -w', то они все появились. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-17 7:41 ` Epiphanov Sergei @ 2006-01-17 9:24 ` Arioch 2006-01-17 9:59 ` Epiphanov Sergei 0 siblings, 1 reply; 17+ messages in thread From: Arioch @ 2006-01-17 9:24 UTC (permalink / raw) To: sisyphus > Тем, что они прописаны в файле /etc/dictd.order. Была у меня такая мысль, но вроде в скрипте он лезет именно в папку. Или мне так показалось, Перл я, повторюсь, не знаю У кого етс mgfhjkm от багзиллы под руками - киньте туда plz, и упомяните, кстати, что не хватает man dictdconfig ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-17 9:24 ` [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? Arioch @ 2006-01-17 9:59 ` Epiphanov Sergei 2006-01-17 10:09 ` Epiphanov Sergei 2006-01-17 14:57 ` Arioch 0 siblings, 2 replies; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-17 9:59 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Tuesday 17 January 2006 12:24 Arioch написал(a): > > Тем, что они прописаны в файле /etc/dictd.order. > > Была у меня такая мысль, но вроде в скрипте он лезет именно в папку. Или > мне так показалось, Перл я, повторюсь, не знаю > > У кого етс mgfhjkm от багзиллы под руками - киньте туда plz, и упомяните, > кстати, что не хватает man dictdconfig Вот где глюк: for (@db_order) { if ( m#/$# ) { CheckDirectory( $_ ) } else { CheckDatabase( $_ ) } } Поэтому необходимо, чтобы в /etc/dictd.order вместо /usr/share/dictd надо вписать /usr/share/dictd/ со слешем на конце. Тогда всё работает. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-17 9:59 ` Epiphanov Sergei @ 2006-01-17 10:09 ` Epiphanov Sergei 2006-01-17 14:57 ` Arioch 1 sibling, 0 replies; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-17 10:09 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Tuesday 17 January 2006 12:59 Epiphanov Sergei написал(a): > Вот где глюк: > > for (@db_order) { > if ( m#/$# ) { CheckDirectory( $_ ) } > else { CheckDatabase( $_ ) } > } > > Поэтому необходимо, чтобы в /etc/dictd.order вместо > > /usr/share/dictd > > надо вписать > > /usr/share/dictd/ > > со слешем на конце. Тогда всё работает. В bugzilla #8859. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-17 9:59 ` Epiphanov Sergei 2006-01-17 10:09 ` Epiphanov Sergei @ 2006-01-17 14:57 ` Arioch 2006-01-18 10:02 ` Epiphanov Sergei 1 sibling, 1 reply; 17+ messages in thread From: Arioch @ 2006-01-17 14:57 UTC (permalink / raw) To: sisyphus > Поэтому необходимо, чтобы в /etc/dictd.order вместо Требовать наличие слэша - логично, хотя и не обязательно. Но, по-моему, баг в первую очередь в том, что dictd.order стал замещать dictd.conf .order - это порядок словарей, их приоритеты, но никак не замена списку. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-17 14:57 ` Arioch @ 2006-01-18 10:02 ` Epiphanov Sergei 2006-01-18 10:23 ` Arioch 0 siblings, 1 reply; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-18 10:02 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Tuesday 17 January 2006 17:57 Arioch написал(a): > > Поэтому необходимо, чтобы в /etc/dictd.order вместо > > Требовать наличие слэша - логично, хотя и не обязательно. Это требует программа dictdconfig. В противном случае она считает, что строка описывает одну базу данных. > Но, по-моему, баг в первую очередь в том, что dictd.order стал замещать > dictd.conf > > .order - это порядок словарей, их приоритеты, но никак не замена списку. Не замещает. dictd.order нужен для dictdconfig только для создания описания словарей в /var/lib/dictd/db.list. А dictd.conf (и созданный файл /var/lib/dictd/db.list) используется программой dictd. Всё правильно. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-18 10:02 ` Epiphanov Sergei @ 2006-01-18 10:23 ` Arioch 2006-01-18 11:16 ` Epiphanov Sergei 0 siblings, 1 reply; 17+ messages in thread From: Arioch @ 2006-01-18 10:23 UTC (permalink / raw) To: sisyphus > > Требовать наличие слэша - логично, хотя и не обязательно. > > Это требует программа dictdconfig. Я знаю. И это - не обязательно, проверить всегда можно :) А если обязательно - должна была вылезать ошибка. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-18 10:23 ` Arioch @ 2006-01-18 11:16 ` Epiphanov Sergei 2006-01-18 13:01 ` Arioch 0 siblings, 1 reply; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-18 11:16 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Wednesday 18 January 2006 13:23 Arioch написал(a): > > > Требовать наличие слэша - логично, хотя и не обязательно. > > > > Это требует программа dictdconfig. > > Я знаю. И это - не обязательно, проверить всегда можно :) > А если обязательно - должна была вылезать ошибка. Не должна вылезать, ибо есть определение: если на конце слеш, то строка - каталог и надо его просмотреть, если нет слеша на конце, то строка - отдельный словарь, который может быть расположен где угодно. Наберите dictdconfig --help -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? 2006-01-18 11:16 ` Epiphanov Sergei @ 2006-01-18 13:01 ` Arioch 2006-01-18 13:52 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei 2006-01-18 14:01 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei 0 siblings, 2 replies; 17+ messages in thread From: Arioch @ 2006-01-18 13:01 UTC (permalink / raw) To: sisyphus Epiphanov Sergei <serpiph@...> writes: > то строка - > отдельный словарь, который может быть расположен > где угодно. Где написано, что словарь может отсутствовать и это штатная ситуация ? программа пытается открыть файл. Файл не открывается. Например его нету, или это не файл, а директория, или я вытащил дискету, на которой лежал файл - все, файл не читается, ошибка. В любой программе практически - это ошибка. И только в некоторых случаях - это нормально. Была бы выведена ошибка, или хотя бы warning - и эта проблема была бы найдена еще при сборке пакета наверняка! ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Почему dict перестал видеть словари? 2006-01-18 13:01 ` Arioch @ 2006-01-18 13:52 ` Epiphanov Sergei 2006-01-18 14:05 ` [sisyphus] Re: Почему dict пересталвидетьсловари? Arioch 2006-01-18 14:01 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei 1 sibling, 1 reply; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-18 13:52 UTC (permalink / raw) To: sisyphus; +Cc: Arioch В сообщении от Wednesday 18 January 2006 16:01 Arioch написал(a): > Epiphanov Sergei <serpiph@...> writes: > > то строка - > > отдельный словарь, который может быть расположен > > где угодно. > > Где написано, что словарь может отсутствовать и это штатная ситуация ? А где написано, что это нештатная ситуация? Как решил автор dictdconfig, так и будет. Не нравится - переписывайте программу. И программ, не выдающих ничего при ошибке, тьма-тьмущая. Если Вы думаете так, то это не значит, что так думают все. > программа пытается открыть файл. Файл не открывается. Например его нету, > или это не файл, а директория, или я вытащил дискету, на которой лежал > файл - все, файл не читается, ошибка. Если на момент сканирования словарей какой-то словарь недоступен, то он и не попадает в список словарей. А вот если на момент сканирования он был доступен, попал в список, а при запуске dictd он недоступен, то dictd будет орать об этом. Кстати, в /etc/dictd.order прописан каталог, который частью floppy так просто не станет, каталог по-умолчанию /usr/share/dictd, плюс dictdconfig доступна только root. Я думаю, root должен понимать что делает. Ваши слова из разряда "А если вместо гвоздя палец положить, то что будет с молотком?" > В любой программе практически - это ошибка. И только в некоторых случаях - > это нормально. Была бы выведена ошибка, или хотя бы warning - и эта > проблема была бы найдена еще при сборке пакета наверняка! Всё может быть. Так, программа может быть запакована с минимальным набором словарей или каждый словарь может идти отдельно. Один хочет только engcom, другой mueller7, а программа будет и тому, и другому ломать жизнь, не создавая список словарей? Кстати, dictdconfig вызывается ТОЛЬКО после установки ГОТОВОГО пакета в систему, поэтому при сборке НИЧЕГО Вы не найдёте. Единственный ляп - нет толковой документации на dictdconfig. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* [sisyphus] Re: Почему dict пересталвидетьсловари? 2006-01-18 13:52 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei @ 2006-01-18 14:05 ` Arioch 2006-01-18 14:48 ` Epiphanov Sergei 0 siblings, 1 reply; 17+ messages in thread From: Arioch @ 2006-01-18 14:05 UTC (permalink / raw) To: sisyphus > > Где написано, что словарь может отсутствовать и это > штатная ситуация ? > > А где написано, что это нештатная ситуация? Как решил > автор dictdconfig, так и будет. А результаты свидетельствуют. ;) > Не нравится - переписывайте программу. А для этого нужна дока, мало ли что имел ввиду автор, вот такие умолчания сбивают. Но я переписываю для себя (вот бы еще iconv от ejabberd оторвать :) ), но в дистр это не пойдет, скрипты на Эрланге - этого вроде люди уже не перенесут :) Но судя по отсутствию следов этой проги на dict.org - она похоже специфично Альтовая ? Тогда в принципе можно извращаться :) > И > программ, не выдающих > ничего при ошибке, тьма-тьмущая. Либо они обрабатывают ошибку, восстанавливаются. Либо предупреждают. > Если на момент сканирования словарей какой-то > словарь недоступен, то он и не > попадает в список словарей. А вот если на момент > сканирования он был > доступен, попал в список, а при запуске dictd он > недоступен, то dictd будет > орать об этом. Лучше бы это все же в init-скрипте было. Впрочем и правда слишком далеко зашло. > Ваши слова из разряда "А если вместо гвоздя палец > положить, то что будет с > молотком?" Угу, только пальцы опложил не я а мантейнер, и пальцы в том чисkе мои. Cомнительное изящество (лаконичность) файла настройки - и грабли разлаженные на миллиметр в сторону от тропинки. > > Была бы выведена ошибка, или хотя бы > > warning - и эта > > проблема была бы найдена еще при сборке пакета наверняка! > Один хочет только engcom, > другой mueller7, а программа будет и тому, и другому ломать > жизнь, не > создавая список словарей? Если он создаст *директорию* mueller7, то можно и сломать. Уж создавая доноименные папки человек точно знает куда кладет пальцы. :) Но на самом деле это к тому же, приоритет (order) - это одно, а список - другое. Объединили - получили неустойчивую конструкцию. > Кстати, dictdconfig вызывается > ТОЛЬКО после > установки ГОТОВОГО пакета в систему, поэтому при > сборке НИЧЕГО Вы не > найдёте. Хашер проверяет пакеты на установку ? Зазвенел бы при установке первого из словарей. Я имел ввиду hasher. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Re: Почему dict пересталвидетьсловари? 2006-01-18 14:05 ` [sisyphus] Re: Почему dict пересталвидетьсловари? Arioch @ 2006-01-18 14:48 ` Epiphanov Sergei 2006-01-18 15:10 ` Arioch 0 siblings, 1 reply; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-18 14:48 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Wednesday 18 January 2006 17:05 Arioch написал(a): > > > Где написано, что словарь может отсутствовать и это > > > > штатная ситуация ? > > > > А где написано, что это нештатная ситуация? Как решил > > автор dictdconfig, так и будет. > > А результаты свидетельствуют. ;) Кому? :) В любом конфиге могут быть ошибки. > > Не нравится - переписывайте программу. > > А для этого нужна дока, мало ли что имел ввиду автор, вот такие умолчания > сбивают. > Но я переписываю для себя (вот бы еще iconv от ejabberd оторвать :) ), но > в дистр это не пойдет, скрипты на Эрланге - этого вроде люди уже не > перенесут :) > > Но судя по отсутствию следов этой проги на dict.org - она похоже > специфично Альтовая ? Тогда в принципе можно извращаться :) Да над любой под GPL можно извращаться. Вот только всё равно в пакете на ftp.altlinux.org ничего не изменится. > > И > > программ, не выдающих > > ничего при ошибке, тьма-тьмущая. > > Либо они обрабатывают ошибку, восстанавливаются. Либо предупреждают. Есть которые не делают ни того, ни другого, ни третьего, а просто тихо завершаются. Уже натыкался. > > Если на момент сканирования словарей какой-то > > словарь недоступен, то он и не > > попадает в список словарей. А вот если на момент > > сканирования он был > > доступен, попал в список, а при запуске dictd он > > недоступен, то dictd будет > > орать об этом. > > Лучше бы это все же в init-скрипте было. А зачем каждый тратить время на бесполезное дело? У Вас случайно могут измениться в системном каталоге словари в процессе работы системы? > Впрочем и правда слишком далеко зашло. > > > Ваши слова из разряда "А если вместо гвоздя палец > > положить, то что будет с > > молотком?" > > Угу, только пальцы опложил не я а мантейнер, и пальцы в том чисkе мои. > Cомнительное изящество (лаконичность) файла настройки - и грабли > разлаженные на миллиметр в сторону от тропинки. А уж сколько граблей на самой тропинке в других программах - "и не сосчитаешь!" :) Я нашёл грабли и отложил в сторону, повесив знак "осторожно, bugzilla #8859". Вот этот знак и теребите. > > > Была бы выведена ошибка, или хотя бы > > > warning - и эта > > > проблема была бы найдена еще при сборке пакета наверняка! > > > > Один хочет только engcom, > > другой mueller7, а программа будет и тому, и другому ломать > > жизнь, не > > создавая список словарей? > > Если он создаст *директорию* mueller7, то можно и сломать. Уж создавая > доноименные папки человек точно знает куда кладет пальцы. :) Но это уже вопрос к мантейнеру словарей, а не к dictdconfig. Она так и делает, только молчит при этом. > Но на самом деле это к тому же, приоритет (order) - это одно, а список - > другое. Объединили - получили неустойчивую конструкцию. Ну, дали файлу суффикс order, а на самом деле файл - список желаемых словарей (чтобы чего лишнего не попало). > > Кстати, dictdconfig вызывается > > ТОЛЬКО после > > установки ГОТОВОГО пакета в систему, поэтому при > > сборке НИЧЕГО Вы не > > найдёте. > > Хашер проверяет пакеты на установку ? Зазвенел бы при установке первого из > словарей. Я имел ввиду hasher. Нет, это выявляется только в момент реальной установки. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* [sisyphus] Re: Почему dict пересталвидетьсловари? 2006-01-18 14:48 ` Epiphanov Sergei @ 2006-01-18 15:10 ` Arioch 0 siblings, 0 replies; 17+ messages in thread From: Arioch @ 2006-01-18 15:10 UTC (permalink / raw) To: sisyphus Epiphanov Sergei <serpiph@...> writes: > > А результаты свидетельствуют. ;) > > Кому? :) В любом конфиге могут быть ошибки. Чем больше ошибок будет ловиться - тем лучше. Чем меньше - тем больше вероятность словить нежданчик. > > > Не нравится - переписывайте программу. ... > все равно ... ничего не изменится. :-( > Есть которые не делают ни того, ни другого, ни > третьего, а просто тихо > завершаются. Уже натыкался. Говорящее слово "натыкался". Натыкаются на что-то неприятное. :) > > > Если на момент сканирования словарей какой-то > > > словарь недоступен, то он и не > > > попадает в список словарей. А вот если на момент > > > сканирования он был > > > доступен, попал в список, а при запуске dictd он > > > недоступен, то dictd будет > > > орать об этом. > > > > Лучше бы это все же в init-скрипте было. > > А зачем каждый тратить время на бесполезное дело? Не понял. > Вас случайно могут > измениться в системном каталоге словари в процессе > работы системы? В процессе - нет. Но, вы же говорили, что dictdconfig не сообщает про ошибки, поскольку это полезно на случай что словари то есть, то нету. Типа сетевых подключений или дискет. На этот случай подойдет init-script. :-) Это даже более логично. Проверять нужно непосредственно при старте сервера ,мало ли что могло смениться с посл. запуска config. Наоборот, если измениться может только через rpm/apt - то config должен отсутствующие файлы считать ошибкой. Случай когда я в обход rpm/apt руками что-то копирую и правлю - в этом случае config сообщая об ошибке помог бы мне в случае опечатки. Я просто пытаюсь конкретно в случае dictdconfig представить случай когда полезно именно проглатывать ошибки. > > Cомнительное изящество (лаконичность) файла > настройки - и грабли > > разлаженные на миллиметр в сторону от тропинки. > > А уж сколько граблей на самой тропинке в других > программах - "и не > сосчитаешь!" :) И в любых - это плохо :) > bugzilla #8859". Вот этот знак и теребите. А посмотрим, где мантейнер раньше откликнется, там и потеребим. > Но это уже вопрос к мантейнеру словарей, а не к dictdconfig. мантейнеры - тоже люди и тоже делают очепятки. :( > > приоритеты выбора - это одно, а список - > > другое. Объединили - получили неустойчивую конструкцию. > > Ну, дали файлу суффикс order, а на самом деле файл - список > желаемых словарей ...и описание в справке. Нет, это не суффикс, а как раз чтобы самому задавть порядок словарей, в котором перебор выполняется. Отсюда и молчание - для приоритетов не важно ,есть ли словарь или нету. Для базы данных - важно. > Нет, это выявляется только в момент реальной установки. Жаль. А ведь наверное это было бы быстрее компиляции. Впрочем пока на этом поалуй ловятся только относительно небольшие баги. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Почему dict перестал видеть словари? 2006-01-18 13:01 ` Arioch 2006-01-18 13:52 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei @ 2006-01-18 14:01 ` Epiphanov Sergei 1 sibling, 0 replies; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-18 14:01 UTC (permalink / raw) To: sisyphus В сообщении от Wednesday 18 January 2006 16:01 Arioch написал(a): > Epiphanov Sergei <serpiph@...> writes: > > то строка - > > отдельный словарь, который может быть расположен > > где угодно. > > Где написано, что словарь может отсутствовать и это штатная ситуация ? А где написано, что это нештатная ситуация? Как решил автор dictdconfig, так и будет. Не нравится - переписывайте программу. И программ, не выдающих ничего при ошибке, тьма-тьмущая. Если Вы думаете так, то это не значит, что так думают все. > программа пытается открыть файл. Файл не открывается. Например его нету, > или это не файл, а директория, или я вытащил дискету, на которой лежал > файл - все, файл не читается, ошибка. Какая программа? Если на момент сканирования словарей какой-то словарь недоступен, то он и не попадает в список словарей. А вот если на момент сканирования он был доступен, попал в список, а при запуске dictd он недоступен, то dictd будет орать об этом. Кстати, в /etc/dictd.order прописан каталог, который частью floppy так просто не станет, каталог по-умолчанию /usr/share/dictd, плюс dictdconfig доступна только root. Я думаю, root должен понимать что делает. А Ваши слова из разряда "А если вместо гвоздя палец положить, то что будет с молотком?" - "Отскочит и даст по лбу." > В любой программе практически - это ошибка. И только в некоторых случаях - > это нормально. Была бы выведена ошибка, или хотя бы warning - и эта > проблема была бы найдена еще при сборке пакета наверняка! Всё может быть. Так, программа dictd может быть запакована с минимальным набором словарей или каждый словарь может идти отдельно. Один хочет только engcom, другой mueller7, а программа будет и тому, и другому ломать жизнь, не создавая список словарей? Кстати, dictdconfig вызывается ТОЛЬКО после установки ГОТОВОГО пакета в систему (%postin или %postun), поэтому при сборке НИЧЕГО Вы не найдёте. По-моему, проще оставить как есть (исправив строку с каталогом), нежели каждый раз ковырять файл /etc/dictd.order при установке или удалении пакета (и не факт, что сразу получится). Единственный ляп - нет толковой документации на dictdconfig. -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [sisyphus] Perl content: почему dict перестал видеть словари ? 2006-01-16 15:03 [sisyphus] Perl content: почему dict перестал видеть словари ? Arioch 2006-01-16 20:11 ` Dmitry Marochko 2006-01-17 7:41 ` Epiphanov Sergei @ 2006-01-17 9:54 ` Epiphanov Sergei 2 siblings, 0 replies; 17+ messages in thread From: Epiphanov Sergei @ 2006-01-17 9:54 UTC (permalink / raw) To: ALT Linux Sisyphus discussion list В сообщении от Monday 16 January 2006 18:03 Arioch написал(a): > if ( /(^.*)\.index$/ ) { CheckDatabase( "$dir$1" ) } Возможно, так: if ( /(^.*)\.index$/ ) { CheckDatabase( "$dir/$1" ) } -- С уважением, Епифанов Сергей ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2006-01-18 15:10 UTC | newest] Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-01-16 15:03 [sisyphus] Perl content: почему dict перестал видеть словари ? Arioch 2006-01-16 20:11 ` Dmitry Marochko 2006-01-17 7:41 ` Epiphanov Sergei 2006-01-17 9:24 ` [sisyphus] Re: Perl contest: почему dict пересталвидетьсловари ? Arioch 2006-01-17 9:59 ` Epiphanov Sergei 2006-01-17 10:09 ` Epiphanov Sergei 2006-01-17 14:57 ` Arioch 2006-01-18 10:02 ` Epiphanov Sergei 2006-01-18 10:23 ` Arioch 2006-01-18 11:16 ` Epiphanov Sergei 2006-01-18 13:01 ` Arioch 2006-01-18 13:52 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei 2006-01-18 14:05 ` [sisyphus] Re: Почему dict пересталвидетьсловари? Arioch 2006-01-18 14:48 ` Epiphanov Sergei 2006-01-18 15:10 ` Arioch 2006-01-18 14:01 ` [sisyphus] Почему dict перестал видеть словари? Epiphanov Sergei 2006-01-17 9:54 ` [sisyphus] Perl content: почему dict перестал видеть словари ? Epiphanov Sergei
ALT Linux Sisyphus discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \ sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru public-inbox-index sisyphus Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.sisyphus AGPL code for this site: git clone https://public-inbox.org/public-inbox.git