Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 6544 - doman confused when passed a gzip'd argument
Summary: doman confused when passed a gzip'd argument
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Kevyn Shortell (RETIRED)
URL:
Whiteboard:
Keywords:
: 6770 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-15 14:29 UTC by Paul Thompson
Modified: 2011-10-30 22:18 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Thompson 2002-08-15 14:29:30 UTC
In replacing this construct:
insinto /usr/share/man/man5 ; doins ${FILESDIR}/foo.5.gz
with
doman ${FILESDIR}/foo.5.gz
I note that it installed the man page in /usr/share/man/mang/
Perhaps doman can be just a tad smarter. I hope to look into
this when I can, but here is a report anyway.

Paul
Comment 1 Maurizio Disimino 2002-08-16 06:22:37 UTC
Ximian bin # sh -x script
+ x=nslookup.8.gz
+ md=gz
+ mandir=mang
+ echo mang
mang

Ximian bin # pico script
Ximian bin # sh -x script
+ x=nslookup.8.gz
+ md=8.gz
+ mandir=man8
+ echo man8
man8

Ximian bin # more script
x="nslookup.8.gz"
md=${x#*.}
mandir=man${md:0:1}
echo $mandir

md=${x#*.} in /usr/lib/portage/doman solves this problem.
btw, we need a check

<snip>

md=${x##*.}
[ -z `echo ${md:0:1} | sed -n '/[0-9]/p'` ] && echo "wrong file name" && exit 1
        mandir=man${md:0:1}
        if [ -e ${x} ]

</snip>
Comment 2 Maurizio Disimino 2002-08-16 08:39:25 UTC
typo. 'md=${x##*.}' in the <snip> should have been 'md=${x#*.}'
btw, I think manpages are not supposed to be already gzipped.
If not we can implement a check and so on ..
Comment 3 Daniel Robbins (RETIRED) gentoo-dev 2002-08-16 23:03:29 UTC
Will be fixed in 2.0.28.
Comment 4 Maurizio Disimino 2002-08-17 01:55:57 UTC
New code for 'doman' @
http://www.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-src/portage/bin/doman?rev=1.4&content-type=text/vnd.viewcvs-markup
will not work with manpages such as 'issue.net.5'

Ximian bin # more script_old
basename $0
x="issue.net.5"
md=${x#*.}
suf=${x##*.}
mandir=man${md:0:1}
echo $mandir

Ximian bin # sh -x script_old
+ basename script_old
script_old
+ x=issue.net.5
+ md=net.5
+ suf=5
+ mandir=mann
+ echo mann
mann

I've wrote this:
Ximian bin # more script
basename $0
x="issue.net.5"
os_1="-2"
os_2="-4"
os_3="-1"
md=${x:os_1}
if [ $md == gz ]; then
        suf="gz"
        md=${x:os_2:1}
else
        md=${x:os_3}
fi

mandir=man${md}
if [ "$suf" != "gz" ]; then
                gzip -f -9 ./${mandir}/${x##*/}
fi

Ximian bin # sh -x script
+ basename script
script
+ x=issue.net.5
+ os_1=-2
+ os_2=-4
+ os_3=-1
+ md=.5
+ '[' .5 == gz ']'
+ md=5
+ mandir=man5
+ '[' '' '!=' gz ']'
+ gzip -f -9 ./man5/issue.net.5
gzip: ./man5/issue.net.5: No such file or directory

Comment 5 Daniel Robbins (RETIRED) gentoo-dev 2002-08-26 16:51:39 UTC
Should be fixed in Portage 2.0.30 for handling both "issue.5", "issue.5.gz"
"issue.foo.5" and "issue.foo.5.gz".  Assigning to trance for QA verification.
Comment 6 Daniel Robbins (RETIRED) gentoo-dev 2002-08-26 16:54:49 UTC
*** Bug 6770 has been marked as a duplicate of this bug. ***
Comment 7 Maurizio Disimino 2002-09-04 03:29:07 UTC
I think this bug can be safely closed ..
The fixes are already in portage.