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 1Ln3dS-0002Pp-GF for garchives@archives.gentoo.org; Fri, 27 Mar 2009 04:25:38 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D53AEE08EC; Fri, 27 Mar 2009 04:25:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 62117E08EC for ; Fri, 27 Mar 2009 04:25:37 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 06D5C64ECB for ; Fri, 27 Mar 2009 04:25:37 +0000 (UTC) Received: from zmedico by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Ln3dQ-0006fu-KC for gentoo-commits@lists.gentoo.org; Fri, 27 Mar 2009 04:25:36 +0000 To: gentoo-commits@lists.gentoo.org From: "Zac Medico (zmedico)" Subject: [gentoo-commits] portage r13205 - in main/branches/2.1.6: bin man pym/_emerge pym/portage pym/portage/dbapi X-VCS-Repository: portage X-VCS-Revision: 13205 X-VCS-Files: main/branches/2.1.6/bin/ebuild main/branches/2.1.6/man/make.conf.5 main/branches/2.1.6/pym/_emerge/__init__.py main/branches/2.1.6/pym/portage/__init__.py main/branches/2.1.6/pym/portage/dbapi/porttree.py main/branches/2.1.6/pym/portage/manifest.py X-VCS-Directories: bin man pym/_emerge pym/portage pym/portage/dbapi X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico Content-Type: text/plain; charset=UTF-8 Message-Id: Sender: Zac Medico Date: Fri, 27 Mar 2009 04:25:36 +0000 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: dd6a08df-78a5-4a15-9303-742013cd4db2 X-Archives-Hash: 47447afffc4bfe02ffae631fbbf248c1 Author: zmedico Date: 2009-03-27 04:25:35 +0000 (Fri, 27 Mar 2009) New Revision: 13205 Modified: main/branches/2.1.6/bin/ebuild main/branches/2.1.6/man/make.conf.5 main/branches/2.1.6/pym/_emerge/__init__.py main/branches/2.1.6/pym/portage/__init__.py main/branches/2.1.6/pym/portage/dbapi/porttree.py main/branches/2.1.6/pym/portage/manifest.py Log: Add support for FEATURES=3Dparse-eapi-glep-55. This feature is only inten= ded for experimental purposes and should not be enabled under normal circumstance= s. (trunk r13175) Modified: main/branches/2.1.6/bin/ebuild =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 --- main/branches/2.1.6/bin/ebuild 2009-03-27 04:16:04 UTC (rev 13204) +++ main/branches/2.1.6/bin/ebuild 2009-03-27 04:25:35 UTC (rev 13205) @@ -83,7 +83,14 @@ =20 ebuild =3D pargs.pop(0) =20 -if not ebuild.endswith(".ebuild"): +pf =3D None +if 'parse-eapi-glep-55' in portage.settings.features: + pf, eapi =3D portage._split_ebuild_name_glep55( + os.path.basename(ebuild)) +elif ebuild.endswith(".ebuild"): + pf =3D os.path.basename(ebuild)[:-7] + +if pf is None: portage.writemsg("'%s' does not end with '.ebuild'.\n" % \ (ebuild,), noiselevel=3D-1) sys.exit(1) @@ -120,8 +127,7 @@ sys.exit(1) =20 ebuild_split =3D ebuild.split("/") -del ebuild_split[-2] -cpv =3D "/".join(ebuild_split[-2:])[:-7] +cpv =3D "%s/%s" % (ebuild_split[-3], pf) =20 if not portage.catpkgsplit(cpv): print "!!! %s does not follow correct package syntax." % (cpv) @@ -158,8 +164,6 @@ portage._doebuild_manifest_exempt_depend +=3D 1 pkgdir =3D os.path.dirname(myebuild) fetchlist_dict =3D portage.FetchlistDict(pkgdir, mysettings, mydbapi) - cat, pkg =3D pkgdir.split(os.sep)[-2:] - cpv =3D cat + "/" + os.path.basename(myebuild)[:-7] from portage.manifest import Manifest mf =3D Manifest(pkgdir, mysettings["DISTDIR"], fetchlist_dict=3Dfetchlist_dict, manifest1_compat=3DFalse) Modified: main/branches/2.1.6/man/make.conf.5 =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 --- main/branches/2.1.6/man/make.conf.5 2009-03-27 04:16:04 UTC (rev 1320= 4) +++ main/branches/2.1.6/man/make.conf.5 2009-03-27 04:25:35 UTC (rev 1320= 5) @@ -274,6 +274,11 @@ is only intended for experimental purposes and should not be enabled und= er normal circumstances. .TP +.B parse\-eapi\-glep\-55 +Parse \fBEAPI\fR from the file extension of the ebuild. This feature +is only intended for experimental purposes and should not be enabled und= er +normal circumstances. +.TP .B protect\-owned This is identical to the \fIcollision\-protect\fR feature except that fi= les may be overwritten if they are not explicitly listed in the contents of = a Modified: main/branches/2.1.6/pym/_emerge/__init__.py =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 --- main/branches/2.1.6/pym/_emerge/__init__.py 2009-03-27 04:16:04 UTC (= rev 13204) +++ main/branches/2.1.6/pym/_emerge/__init__.py 2009-03-27 04:25:35 UTC (= rev 13205) @@ -3018,9 +3018,16 @@ settings.setcpv(self.cpv) ebuild_path =3D self.ebuild_path =20 - if 'parse-eapi-ebuild-head' in settings.features: + eapi =3D None + if 'parse-eapi-glep-55' in settings.features: + pf, eapi =3D portage._split_ebuild_name_glep55( + os.path.basename(ebuild_path)) + if eapi is None and \ + 'parse-eapi-ebuild-head' in settings.features: eapi =3D portage._parse_eapi_ebuild_head(codecs.open(ebuild_path, mode=3D'r', encoding=3D'utf_8', errors=3D'replace')) + + if eapi is not None: if not portage.eapi_is_supported(eapi): self.metadata_callback(self.cpv, self.ebuild_path, self.repo_path, {'EAPI' : eapi}, self.ebuild_mtime) Modified: main/branches/2.1.6/pym/portage/__init__.py =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 --- main/branches/2.1.6/pym/portage/__init__.py 2009-03-27 04:16:04 UTC (= rev 13204) +++ main/branches/2.1.6/pym/portage/__init__.py 2009-03-27 04:25:35 UTC (= rev 13205) @@ -1780,9 +1780,12 @@ =20 self["FEATURES"] =3D " ".join(sorted(self.features)) self.backup_changes("FEATURES") - global _validate_cache_for_unsupported_eapis + global _glep_55_enabled, _validate_cache_for_unsupported_eapis if 'parse-eapi-ebuild-head' in self.features: _validate_cache_for_unsupported_eapis =3D False + if 'parse-eapi-glep-55' in self.features: + _validate_cache_for_unsupported_eapis =3D False + _glep_55_enabled =3D True =20 self._init_dirs() =20 @@ -4646,8 +4649,14 @@ writemsg("!!! Expected: %s\n" % e.value[3], noiselevel=3D-1) return 0 # Make sure that all of the ebuilds are actually listed in the Manifest= . + glep55 =3D 'parse-eapi-glep-55' in mysettings.features for f in os.listdir(pkgdir): - if f.endswith(".ebuild") and not mf.hasFile("EBUILD", f): + pf =3D None + if glep55: + pf, eapi =3D _split_ebuild_name_glep55(f) + elif f[-7:] =3D=3D '.ebuild': + pf =3D f[:-7] + if pf is not None and not mf.hasFile("EBUILD", f): writemsg("!!! A file is not listed in the Manifest: '%s'\n" % \ os.path.join(pkgdir, f), noiselevel=3D-1) if strict: @@ -5041,6 +5050,20 @@ break return '0' =20 +# True when FEATURES=3Dparse-eapi-glep-55 is enabled. +_glep_55_enabled =3D False + +_split_ebuild_name_glep55_re =3D re.compile(r'^(.*)\.ebuild(-([^.]+))?$'= ) + +def _split_ebuild_name_glep55(name): + """ + @returns: (pkg-ver-rev, eapi) + """ + m =3D _split_ebuild_name_glep55_re.match(name) + if m is None: + return (None, None) + return (m.group(1), m.group(3)) + def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_= cache, mydbapi): =20 ebuild_path =3D os.path.abspath(myebuild) @@ -5050,7 +5073,14 @@ cat =3D mysettings.configdict["pkg"]["CATEGORY"] else: cat =3D os.path.basename(normalize_path(os.path.join(pkg_dir, ".."))) - mypv =3D os.path.basename(ebuild_path)[:-7]=09 + + eapi =3D None + if 'parse-eapi-glep-55' in mysettings.features: + mypv, eapi =3D portage._split_ebuild_name_glep55( + os.path.basename(myebuild)) + else: + mypv =3D os.path.basename(ebuild_path)[:-7] + mycpv =3D cat+"/"+mypv mysplit=3Dpkgsplit(mypv,silent=3D0) if mysplit is None: @@ -5114,14 +5144,20 @@ mysettings["PORTAGE_QUIET"] =3D "1" =20 if mydo =3D=3D 'depend' and \ - 'EAPI' not in mysettings.configdict['pkg'] and \ - 'parse-eapi-ebuild-head' in mysettings.features: - eapi =3D _parse_eapi_ebuild_head(codecs.open(ebuild_path, - mode=3D'r', encoding=3D'utf_8', errors=3D'replace')) - if not eapi_is_supported(eapi): - raise portage.exception.UnsupportedAPIException(mycpv, eapi) - mysettings.configdict['pkg']['EAPI'] =3D eapi + 'EAPI' not in mysettings.configdict['pkg']: =20 + if eapi is not None: + # From parse-eapi-glep-55 above. + mysettings.configdict['pkg']['EAPI'] =3D eapi + elif 'parse-eapi-ebuild-head' in mysettings.features: + eapi =3D _parse_eapi_ebuild_head(codecs.open(ebuild_path, + mode=3D'r', encoding=3D'utf_8', errors=3D'replace')) + + if eapi is not None: + if not eapi_is_supported(eapi): + raise portage.exception.UnsupportedAPIException(mycpv, eapi) + mysettings.configdict['pkg']['EAPI'] =3D eapi + if mydo !=3D "depend": # Metadata vars such as EAPI and RESTRICT are # set by the above config.setcpv() call. @@ -5691,8 +5727,14 @@ =20 # Make sure that all of the ebuilds are # actually listed in the Manifest. + glep55 =3D 'parse-eapi-glep-55' in mysettings.features for f in os.listdir(pkgdir): - if f.endswith(".ebuild") and not mf.hasFile("EBUILD", f): + pf =3D None + if glep55: + pf, eapi =3D _split_ebuild_name_glep55(f) + elif f[-7:] =3D=3D '.ebuild': + pf =3D f[:-7] + if pf is not None and not mf.hasFile("EBUILD", f): f =3D os.path.join(pkgdir, f) if f not in _doebuild_broken_ebuilds: out =3D portage.output.EOutput() Modified: main/branches/2.1.6/pym/portage/dbapi/porttree.py =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 --- main/branches/2.1.6/pym/portage/dbapi/porttree.py 2009-03-27 04:16:04= UTC (rev 13204) +++ main/branches/2.1.6/pym/portage/dbapi/porttree.py 2009-03-27 04:25:35= UTC (rev 13205) @@ -279,8 +279,24 @@ else: mytrees =3D self.porttrees[:] mytrees.reverse() - if psplit: + if 'parse-eapi-glep-55' in self.doebuild_settings.features: + glep55_startswith =3D '%s.ebuild-' % mysplit[1] for x in mytrees: + filename =3D os.path.join(x, mysplit[0], psplit[0], + mysplit[1] + ".ebuild") + if os.access(filename, os.R_OK): + return (filename, x) + + pkgdir =3D os.path.join(x, mysplit[0], psplit[0]) + try: + files =3D os.listdir(pkgdir) + except OSError: + continue + for y in files: + if y.startswith(glep55_startswith): + return (os.path.join(pkgdir, y), x) + else: + for x in mytrees: file=3Dx+"/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild" if os.access(file, os.R_OK): return[file, x] @@ -421,9 +437,15 @@ mydata =3D {} eapi =3D None =20 - if 'parse-eapi-ebuild-head' in self.doebuild_settings.features: + if 'parse-eapi-glep-55' in self.doebuild_settings.features: + pf, eapi =3D portage._split_ebuild_name_glep55( + os.path.basename(myebuild)) + if eapi is None and \ + 'parse-eapi-ebuild-head' in self.doebuild_settings.features: eapi =3D portage._parse_eapi_ebuild_head(codecs.open(myebuild, mode=3D'r', encoding=3D'utf_8', errors=3D'replace')) + + if eapi is not None: self.doebuild_settings.configdict['pkg']['EAPI'] =3D eapi =20 if eapi is not None and not portage.eapi_is_supported(eapi): @@ -666,6 +688,7 @@ return cachelist[:] mysplit =3D mycp.split("/") invalid_category =3D mysplit[0] not in self._categories + glep55 =3D 'parse-eapi-glep-55' in self.doebuild_settings.features d=3D{} if mytree: mytrees =3D [mytree] @@ -677,8 +700,14 @@ except OSError: continue for x in file_list: - if x.endswith(".ebuild"): + + pf =3D None + if glep55: + pf, eapi =3D portage._split_ebuild_name_glep55(x) + elif x[-7:] =3D=3D '.ebuild': pf =3D x[:-7] + + if pf is not None: ps =3D pkgsplit(pf) if not ps: writemsg("\nInvalid ebuild name: %s\n" % \ Modified: main/branches/2.1.6/pym/portage/manifest.py =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 --- main/branches/2.1.6/pym/portage/manifest.py 2009-03-27 04:16:04 UTC (= rev 13204) +++ main/branches/2.1.6/pym/portage/manifest.py 2009-03-27 04:25:35 UTC (= rev 13205) @@ -27,6 +27,10 @@ =20 def manifest2MiscfileFilter(filename): filename =3D filename.strip(os.sep) + if portage._glep_55_enabled: + pf, eapi =3D portage._split_ebuild_name_glep55(filename) + if pf is not None: + return False return not (filename in ["CVS", ".svn", "files", "Manifest"] or filenam= e.endswith(".ebuild")) =20 def guessManifestFileType(filename): @@ -307,9 +311,13 @@ for f in pkgdir_files: if f[:1] =3D=3D ".": continue - elif f[-7:] =3D=3D ".ebuild": + pf =3D None + if portage._glep_55_enabled: + pf, eapi =3D portage._split_ebuild_name_glep55(f) + elif f[-7:] =3D=3D '.ebuild': + pf =3D f[:-7] + if pf is not None: mytype =3D "EBUILD" - pf =3D f[:-7] ps =3D portage.versions.pkgsplit(pf) cpv =3D "%s/%s" % (cat, pf) if not ps: