Bug 19933

Summary: Скрипт docbook2man всегда выводит usage
Product: Sisyphus Reporter: Slava Semushin <php-coder>
Component: alt-docs-xsl-manpagesAssignee: Nobody's working on this, feel free to take it <nobody>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P3    
Version: unstable   
Hardware: all   
OS: Linux   

Description Slava Semushin 2009-05-05 20:40:00 MSD
[c0der@rock ~]$ rpm -qf /usr/share/doc/manpages-xsl-0.2/docbook2man
alt-docs-xsl-manpages-0.2-alt1
[c0der@rock ~]$ cat /usr/share/doc/manpages-xsl-0.2/docbook2man
#!/bin/sh

if [ 0 = 0 ]; then
    echo Usage: docbook2man file.xml...
else
    xsltproc --xinclude --stringparam chunker.output.encoding "KOI8-R" \
        "/usr/share/xml/alt-docs-xsl/manpages/man.xsl" "$@"
fi

## EOF ##

Проверка 0 = 0 всегда даёт истину и вторая часть НИКОГДА не выполняется:

[c0der@rock ~]$ sh /usr/share/doc/manpages-xsl-0.2/docbook2man
Usage: docbook2man file.xml...
[c0der@rock ~]$ sh /usr/share/doc/manpages-xsl-0.2/docbook2man 1 2 3
Usage: docbook2man file.xml...

Исправляется тривиально:

- if [ 0 = 0 ]; then
+ if [ $# = 0 ]; then
Comment 1 Slava Semushin 2009-05-05 20:43:18 MSD
Круто. Сам тогда исправлю.
Comment 2 Repository Robot 2009-05-08 01:01:20 MSD
manpages-xsl-0.2-alt2 -> sisyphus:

* Wed May 06 2009 Slava Semushin <php-coder@altlinux> 0.2-alt2

- NMU
- docbook2man: make it work (Closes: #19933)