From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1EHSwo-0005oy-SQ for garchives@archives.gentoo.org; Mon, 19 Sep 2005 21:13:11 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id j8JL6bY8013634; Mon, 19 Sep 2005 21:06:37 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id j8JL6awY028307 for ; Mon, 19 Sep 2005 21:06:36 GMT Received: from cpe-65-26-255-237.wi.res.rr.com ([65.26.255.237] helo=nightcrawler) by smtp.gentoo.org with esmtpa (Exim 4.43) id 1EHSvx-0000eo-90 for gentoo-portage-dev@lists.gentoo.org; Mon, 19 Sep 2005 21:12:17 +0000 Date: Mon, 19 Sep 2005 16:12:08 -0500 From: Brian Harring To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] PATCH glep31 checking Message-ID: <20050919211208.GC20892@nightcrawler> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AjmyJqqohANyBN/e" Content-Disposition: inline User-Agent: Mutt/1.5.8i X-Archives-Salt: 0c56abd6-c0ab-4490-b3e3-a2158f7b5be6 X-Archives-Hash: ce87c045cdaf82918a47a8fc6fe6e7f8 --AjmyJqqohANyBN/e Content-Type: multipart/mixed; boundary="x4pBfXISqBoDm8sr" Content-Disposition: inline --x4pBfXISqBoDm8sr Content-Type: text/plain; charset=utf8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hola. http://glep.gentoo.org/glep-0031.html <-- the details http://bugs.gentoo.org/106544 <-- the bug http://bugs.gentoo.org/attachment.cgi?=3D68828 <-- the patch Attached the patch also; one additional tweak is that file.size is now=20 a fatal check, since the tree seem's to finally be clean. ~harring --x4pBfXISqBoDm8sr Content-Type: text/plain; charset=utf8 Content-Disposition: attachment; filename="glep31.patch" Content-Transfer-Encoding: quoted-printable Index: repoman =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- repoman (revision 1992) +++ repoman (working copy) @@ -13,6 +13,13 @@ sys.path =3D ["/usr/lib/portage/pym"]+sys.path version=3D"1.2"=09 =20 +allowed_filename_chars=3D"a-zA-Z0-9._-+:" +allowed_filename_chars_set =3D {} +map(allowed_filename_chars_set.setdefault, map(chr, range(ord('a'), ord('z= ')+1))) +map(allowed_filename_chars_set.setdefault, map(chr, range(ord('A'), ord('Z= ')+1))) +map(allowed_filename_chars_set.setdefault, map(chr, range(ord('0'), ord('9= ')+1))) +map(allowed_filename_chars_set.setdefault, map(chr, map(ord, [".", "-", "_= ", "+", ":"]))) + import string,signal,re,pickle,tempfile =20 import portage @@ -21,6 +28,8 @@ import portage_dep import cvstree import time +import codecs + from output import * #bold, darkgreen, darkred, green, red, turquoise, yellow =20 @@ -85,6 +94,8 @@ "filedir.missing":"Package lacks a files directory", "file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLo= g do note need the executable bit", "file.size":"Files in the files directory must be under 20k", + "file.name":"File/dir name must be composed of only the following chars: = %s " % allowed_filename_chars, + "file.UTF8":"File is not UTF8 compliant", "KEYWORDS.missing":"Ebuilds that have a missing KEYWORDS variable", "LICENSE.missing":"Ebuilds that have a missing LICENSE variable", "DESCRIPTION.missing":"Ebuilds that have a missing DESCRIPTION variable", @@ -146,7 +157,6 @@ "IUSE.invalid", "ebuild.minorsyn", "ebuild.badheader", -"file.size", "metadata.missing", "metadata.bad", "virtual.versioned" @@ -663,6 +673,29 @@ stats["file.executable"] +=3D 1 fails["file.executable"].append(checkdir+"/"+y) digestlist=3D[] + + for y in checkdirlist: + for c in y.strip(os.path.sep): + if c not in allowed_filename_chars_set: + stats["file.name"] +=3D 1 + fails["file.name"].append("%s/%s: char '%s'" % (checkdir, y, c)) + break + + if not (y in ("ChangeLog", "metadata.xml") or y.endswith(".ebuild")): + continue + try: + line =3D 1 + for l in codecs.open(y, "r", "utf8"): + line +=3D1 + except UnicodeDecodeError, ue: + stats["file.UTF8"] +=3D 1 + s =3D ue.object[:ue.start] + l2 =3D s.count("\n") + line +=3D l2 + if l2 !=3D 0: + s =3D s[s.rfind("\n") + 1:] + fails["file.UTF8"].append("%s/%s: line %i, just after: '%s'" % (checkdi= r, y, line, s)) + if isCvs: try: mystat=3Dos.stat(checkdir+"/files")[0] @@ -799,6 +832,13 @@ stats["file.size"] +=3D 1 fails["file.size"].append("("+ str(mystat.st_size/1024) + "K) "+x+"/fi= les/"+y) =20 + for c in y.strip(os.path.sep): + if c not in allowed_filename_chars_set: + stats["file.name"] +=3D 1 + fails["file.name"].append("%s/%s: char '%s'" % (checkdir, y, c)) + break + + if "ChangeLog" not in checkdirlist: stats["changelog.missing"]+=3D1 fails["changelog.missing"].append(x+"/ChangeLog") --x4pBfXISqBoDm8sr-- --AjmyJqqohANyBN/e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDLymovdBxRoA3VU0RAio9AJ0bdeQkliAGng2Z2jYrCtjfolFiWQCfeIVW PW8P4ZI0K1shH8IERZCuKhA= =tue2 -----END PGP SIGNATURE----- --AjmyJqqohANyBN/e-- -- gentoo-portage-dev@gentoo.org mailing list