Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 91858 - dodoc won't work on files of 0-bytes
Summary: dodoc won't work on files of 0-bytes
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-05-07 23:42 UTC by Joshua Kinard
Modified: 2005-07-14 06:58 UTC (History)
0 users

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


Attachments
Change `-s' to `-e' (dodoc1.patch,377 bytes, patch)
2005-05-07 23:43 UTC, Joshua Kinard
Details | Diff
Make error message more clear (dodoc2.patch,321 bytes, patch)
2005-05-07 23:44 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard gentoo-dev 2005-05-07 23:42:24 UTC
Attempts to use `dodoc' on files of 0 bytes will cause it to fail.

Example Case: Package contains a NEWS file, however, there is no news to report, thus the file has nothing in it.  Ii may contain data in the future, so in the interests of this possibility, the NEWS file is run through dodoc anyways, even though it'll produce a 0 byte output file to get merged into the system.

Two solutions are illustrated here:

1) Make dodoc use the `-e ' instead of `-s' to check only if the file exists.
2) Make the error message more clear that dodoc does not operate on 0 byte files.

The first option is if it's decided to make dodoc handle 0-byte files.  The second option is if the decision is made to leave it as-is (thus necessitating the change in the error message to be more clear why the operation failed).  Patches attached for both options.
Comment 1 Joshua Kinard gentoo-dev 2005-05-07 23:43:53 UTC
Created attachment 58318 [details, diff]
Change `-s' to `-e'
Comment 2 Joshua Kinard gentoo-dev 2005-05-07 23:44:29 UTC
Created attachment 58319 [details, diff]
Make error message more clear
Comment 3 SpanKY gentoo-dev 2005-05-08 16:21:06 UTC
i already fixed cvs with -e/-s
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-05-11 05:16:06 UTC
This doesn't appear to be InCVS at all...

Personally, I'm for the better error message.
Comment 6 Jason Stubbs (RETIRED) gentoo-dev 2005-05-11 05:44:39 UTC
if [ -s "${x}" ] ; then
      ...
else
      echo "dodoc: ${x} does not exist" 1>&2
fi


^^^ This is the same in both versions but this is what the bug is about if I'm not mistaken.
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 05:48:12 UTC
Fixed on or before 2.0.51.22-r1 
Comment 8 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 06:58:50 UTC
Looking through the batch of bugs, I'm not sure that some of these are 
actually fixed in stable. Others, the requirements have possibly changed after 
the initial fix was committed. 
 
If you think this bug has been closed incorrectly, please reopen or ask that 
it be reopened.