Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 106027 Details for
Bug 149745
dohtml fails silently on directories w/o recursion arg
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dohtml.patch
dohtml.patch (text/plain), 5.01 KB, created by
brad walker
on 2007-01-08 14:18:34 UTC
(
hide
)
Description:
dohtml.patch
Filename:
MIME Type:
Creator:
brad walker
Created:
2007-01-08 14:18:34 UTC
Size:
5.01 KB
patch
obsolete
>--- /usr/lib/portage/bin/dohtml.old 2007-01-07 16:11:16.000000000 -0700 >+++ /usr/lib/portage/bin/dohtml 2007-01-08 07:11:29.000000000 -0700 >@@ -12,18 +12,18 @@ > # > # > # Detailed usage: >-# dohtml <list-of-files> >-# - will install the files in the list of files (space-separated list) into >-# /usr/share/doc/${PF}/html, provided the file ends in .html, .png, .jpg >-# or .css >+# dohtml <list-of-files> >+# - will install the files in the list of files (space-separated list) into >+# /usr/share/doc/${PF}/html, provided the file ends in .css, .gif, .htm, >+# .html, .jpg, .js or .png > # dohtml -r <list-of-files-and-directories> >-# - will do as 'dohtml', but recurse into all directories, as long as the >+# - will do as 'dohtml', but recurse into all directories, as long as the > # directory name is not CVS > # dohtml -A jpe,java [-r] <list-of-files[-and-directories]> > # - will do as 'dohtml' but add .jpe,.java (default filter list is > # added to your list) > # dohtml -a png,gif,html,htm [-r] <list-of-files[-and-directories]> >-# - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter >+# - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter > # list is ignored) > # dohtml -x CVS,SCCS,RCS -r <list-of-files-and-directories> > # - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS >@@ -34,6 +34,8 @@ > import sys > import types > >+from output import EOutput >+ > def dodir(path): > os.system("install -d '%s'" % path) > >@@ -48,21 +50,30 @@ > if dirname: fullpath = dirname + "/" + fullpath > > if options.DOCDESTTREE: >- destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix >+ docdesttree = options.DOCDESTTREE > else: >- destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix >+ docdesttree = 'html' >+ destdir = options.D + '/'.join (('usr/share/doc', >+ options.PF, >+ docdesttree, >+ options.doc_prefix, >+ prefix)) > > if os.path.isfile(fullpath): > ext = os.path.splitext(basename)[1] > if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files: > dodir(destdir) > dofile(fullpath, destdir + "/" + basename) >- elif options.recurse and os.path.isdir(fullpath) and \ >- basename not in options.disallowed_dirs: >- for i in os.listdir(fullpath): >- pfx = basename >- if prefix: pfx = prefix + "/" + pfx >- install(i, dirname, options, pfx) >+ elif os.path.isdir (fullpath) and basename not in options.disallowed_dirs: >+ if options.recurse: >+ for i in os.listdir(fullpath): >+ pfx = basename >+ if prefix: pfx = prefix + "/" + pfx >+ install(i, dirname, options, pfx) >+ else: >+ # bug #149745 >+ EOutput().ewarn ('QA Notice: directory %s given to dohtml without recursion (option -r)' % fullpath) >+ return False > else: > return False > return True >@@ -73,14 +84,14 @@ > self.PF = "" > self.D = "" > self.DOCDESTTREE = "" >- >+ > if os.environ.has_key("PF"): > self.PF = os.environ["PF"] > if os.environ.has_key("D"): > self.D = os.environ["D"] > if os.environ.has_key("DOCDESTTREE"): > self.DOCDESTTREE = os.environ["DOCDESTTREE"] >- >+ > self.allowed_exts = [ 'png', 'gif', 'html', 'htm', 'jpg', 'css', 'js' ] > self.allowed_files = [] > self.disallowed_dirs = [ 'CVS' ] >@@ -92,14 +103,14 @@ > opts = OptionsClass() > > print "dohtml [-a .foo,.bar] [-A .foo,.bar] [-f foo,bar] [-x foo,bar]" >- print " [-r] [-V] <file> [file ...]" >+ print " [-r] [-V] <file> [file ...]" > print > print " -a Set the list of allowed to those that are specified." >- print " Default:", string.join(opts.allowed_exts, ",") >+ print " Default:", string.join(opts.allowed_exts, ",") > print " -A Extend the list of allowed file types." > print " -f Set list of allowed extensionless file names." > print " -x Set directories to be excluded from recursion." >- print " Default:", string.join(opts.disallowed_dirs, ",") >+ print " Default:", string.join(opts.disallowed_dirs, ",") > print " -r Install files and directories recursively." > print " -V Be verbose." > print >@@ -107,7 +118,7 @@ > def parse_args(): > options = OptionsClass() > args = [] >- >+ > x = 1 > while x < len(sys.argv): > arg = sys.argv[x] >@@ -139,7 +150,7 @@ > else: > args.append(sys.argv[x]) > x += 1 >- >+ > return (options, args) > > def main(): >@@ -151,22 +162,17 @@ > > if options.verbose: > print "Allowed extensions:", options.allowed_exts >- print "Document prefix : '" + options.doc_prefix + "'" >+ print "Document prefix : '%s'" % options.doc_prefix > print "Allowed files :", options.allowed_files > > success = True >- > for x in args: > basename = os.path.basename(x) >- dirname = os.path.dirname(x) >- success = success and install(basename, dirname, options) >- >- if success: >- retcode = 0 >- else: >- retcode = 1 >- >- sys.exit(retcode) >+ dirname = os.path.dirname(x) >+ # bug #149745, comment #1 >+ success &= install (basename, dirname, options) >+ >+ sys.exit (int (not success)) # 0 True, 1 False > > if __name__ == "__main__": > main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 149745
:
105973
|
106027
|
106478