diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/ebuild b/bin/ebuild index 82f0ff990..35cdc1453 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -1,5 +1,5 @@ #!/usr/bin/python -O -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -29,6 +29,7 @@ def debug_signal(signum, frame): signal.signal(signal.SIGUSR1, debug_signal) import imp +import io import optparse import os @@ -165,7 +166,12 @@ if not os.path.exists(ebuild): ebuild_split = ebuild.split("/") cpv = "%s/%s" % (ebuild_split[-3], pf) -if not portage.catpkgsplit(cpv): +with io.open(_unicode_encode(ebuild, encoding=_encodings['fs'], errors='strict'), + mode='r', encoding=_encodings['repo.content'], errors='replace') as f: + eapi = portage._parse_eapi_ebuild_head(f)[0] +if eapi is None: + eapi = "0" +if not portage.catpkgsplit(cpv, eapi=eapi): print("!!! %s does not follow correct package syntax." % (cpv)) sys.exit(1) |