From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Sj0j8-0004vB-Px for garchives@archives.gentoo.org; Mon, 25 Jun 2012 04:16:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 98A02E0CA8; Mon, 25 Jun 2012 04:16:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6B5E6E0CA8 for ; Mon, 25 Jun 2012 04:16:16 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B7C9C1B4249 for ; Mon, 25 Jun 2012 04:16:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A7956E5432 for ; Mon, 25 Jun 2012 04:16:13 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1340597521.c92b3b0fcccd61af78b3777e863938abe9f2ac34.arfrever@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/dohtml.py X-VCS-Directories: bin/ X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: c92b3b0fcccd61af78b3777e863938abe9f2ac34 X-VCS-Branch: master Date: Mon, 25 Jun 2012 04:16:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d219e8cb-cbe4-4b52-8812-fc57545bbae4 X-Archives-Hash: e71208b0d3930503f229c3568b893765 commit: c92b3b0fcccd61af78b3777e863938abe9f2ac34 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Jun 25 04:12:01 2012 +0000 Commit: Arfrever Frehtes Taifersar Arahesis gmail = com> CommitDate: Mon Jun 25 04:12:01 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dc92b3b0f dohtml: Support PORTAGE_DOHTML_WARN_ON_SKIPPED_FILES environmental variab= le. --- bin/dohtml.py | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bin/dohtml.py b/bin/dohtml.py index ba16b46..3e80ef5 100755 --- a/bin/dohtml.py +++ b/bin/dohtml.py @@ -47,6 +47,10 @@ def eqawarn(lines): os.spawnlp(os.P_WAIT, "bash", "bash", "-c", cmd) =20 skipped_directories =3D [] +skipped_files =3D [] +warn_on_skipped_files =3D os.environ.get("PORTAGE_DOHTML_WARN_ON_SKIPPED= _FILES") is not None +unwarned_skipped_extensions =3D os.environ.get("PORTAGE_DOHTML_UNWARNED_= SKIPPED_EXTENSIONS", "").split() +unwarned_skipped_files =3D os.environ.get("PORTAGE_DOHTML_UNWARNED_SKIPP= ED_FILES", "").split() =20 def install(basename, dirname, options, prefix=3D""): fullpath =3D basename @@ -64,10 +68,12 @@ def install(basename, dirname, options, prefix=3D""): sys.stderr.write("!!! dohtml: %s does not exist\n" % fullpath) return False elif os.path.isfile(fullpath): - ext =3D os.path.splitext(basename)[1] - if (len(ext) and ext[1:] in options.allowed_exts) or basename in optio= ns.allowed_files: + ext =3D os.path.splitext(basename)[1][1:] + if ext in options.allowed_exts or basename in options.allowed_files: dodir(destdir) dofile(fullpath, destdir + "/" + basename) + elif warn_on_skipped_files and ext not in unwarned_skipped_extensions = and basename not in unwarned_skipped_files: + skipped_files.append(fullpath) elif options.recurse and os.path.isdir(fullpath) and \ basename not in options.disallowed_dirs: for i in os.listdir(fullpath): @@ -169,7 +175,7 @@ def main(): =20 if options.verbose: print("Allowed extensions:", options.allowed_exts) - print("Document prefix : '" + options.doc_prefix + "'") + print("Document prefix : '" + options.doc_prefix + "'") print("Allowed files :", options.allowed_files) =20 success =3D False @@ -179,10 +185,10 @@ def main(): dirname =3D os.path.dirname(x) success |=3D install(basename, dirname, options) =20 - global skipped_directories for x in skipped_directories: - eqawarn(["QA Notice: dohtml on directory " + \ - "'%s' without recursion option" % x]) + eqawarn(["QA Notice: dohtml on directory '%s' without recursion option= " % x]) + for x in skipped_files: + eqawarn(["dohtml: skipped file '%s'" % x]) =20 if success: retcode =3D 0