Bug 19933 - Скрипт docbook2man всегда выводит usage
Summary: Скрипт docbook2man всегда выводит usage
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: alt-docs-xsl-manpages (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Nobody's working on this, feel free to take it
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-05 20:40 MSD by Slava Semushin
Modified: 2009-05-08 01:01 MSD (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)