Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 149745

Summary: dohtml fails silently on directories w/o recursion arg
Product: Portage Development Reporter: brad walker <bradmwalker>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: jakub
Priority: High Keywords: InVCS
Version: 2.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 216231    
Attachments: dohtml.patch
dohtml.patch
dohtml.patch

Description brad walker 2006-10-01 09:33:33 UTC
Portage version 2.1.2_pre2

call dohtml without argument '-r' on a directory and it will fail silently when it tries to install the directory. 

IMO, skipping the directory is better behavior. try 'dohtml doc-html/*' and dohtml will install only the files before the first subdirectory, ordered alphabetically. it'd be more intuitive for dohtml to install all the files, skipping directories.

optimally dohtml could filter all files and directories into different arrays, processing files first, then directories. then dohtml could install all files, and return false when given directories without the '-r' argument. authors would have the intuitive behavior and be able to debug using lines like 'dohtml doc-html/* || die "directories need -r"'.
Comment 1 brad walker 2007-01-08 00:57:52 UTC
this line in main:/usr/lib/portage/dohtml causes the problem:
               success = success and install(basename, dirname, options)

as soon as install fails once the 'for x in args' loop never installs again. the python keyword 'and' prevents `install' execution after `success' is false. `install' returns false on a directory without options.recurse, causing the problem originally described.
Comment 2 brad walker 2007-01-08 01:05:22 UTC
Created attachment 105973 [details, diff]
dohtml.patch

Changes:
  added QA Notice for directories without recursion
  fixed main driver loop ('success &= install' instead of 'success = success & install')
  misc. cleanups
Comment 3 brad walker 2007-01-08 14:18:34 UTC
Created attachment 106027 [details, diff]
dohtml.patch

same as last with indentation fixed
Comment 4 Zac Medico gentoo-dev 2007-01-08 15:26:39 UTC
Instead of using the output module for the ewarn, I suppose we should spawn something like `bash -c 'source ${PORTAGE_BIN_PATH}/isolated-function.sh; ewarn "QA Notice:..."'` so that it works correctly with the elog framework.  Note that soon we'll have a QA elog level for bug #160075.
Comment 5 brad walker 2007-01-11 01:41:01 UTC
Created attachment 106478 [details, diff]
dohtml.patch

Changes:
  use new eqawarn function from isolated-functions.sh (tested with svn isolated-functions.sh)
Comment 6 Zac Medico gentoo-dev 2007-01-14 05:15:42 UTC
Thanks.  In svn r5642 I've fixed it so that it continues to install files even after some fail.  I'll wait until after the final release of 2.1.2 (coming soon) for the QA warning since I'm not sure how many packages it will affect and people will get upset if it produces any warnings that they see as invalid or unnecessary.
Comment 7 brad walker 2007-01-24 04:31:44 UTC
cool beans.

please (re)consider the latest proposed patch. it includes many cleanups: whitespace, expressions, and comments.

the main loop fix applied in svn r5642 is excessively verbose compared to the patch's fix. again, the misuse of keyword 'and' vs. operator '&' caused the original problem. simply substituting '&' for 'and' fixes the error; using '&=' simplifies the statement further.
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2008-02-17 21:02:52 UTC
Is this bug still even remotely relevant with current portage versions?
Comment 9 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-03-20 18:01:02 UTC
Fixed in r9476 and released in sys-apps/portage-2.2_pre5.

This bug should be RESOLVED FIXED and block bug #210077.
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 18:14:50 UTC
This is supposed to be fixed in portage-2.2_pre5 or earlier.
Comment 11 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 18:15:27 UTC
This is supposed to be fixed in portage-2.2_pre5 or earlier.