Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/
Date: Sun, 13 Dec 2015 12:58:07
Message-Id: 1449992009.a696a7f98c4945bc9d70313484b39d2e67cd2ba4.mgorny@gentoo
1 commit: a696a7f98c4945bc9d70313484b39d2e67cd2ba4
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 12 15:30:36 2015 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 13 07:33:29 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a696a7f9
7
8 Revert "ebuild: Rename some variables."
9
10 This reverts commit fb4d1f4ff710c7d7c848cf5ed4a7232bc1dd1e19. The revert
11 is necessary to make it possible to sanely revert 9e104c4 ("ebuild: Set
12 PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY.")
13
14 bin/ebuild | 28 ++++++++++++++--------------
15 1 file changed, 14 insertions(+), 14 deletions(-)
16
17 diff --git a/bin/ebuild b/bin/ebuild
18 index 1afad25..2c42771 100755
19 --- a/bin/ebuild
20 +++ b/bin/ebuild
21 @@ -141,25 +141,25 @@ if not os.path.isabs(ebuild):
22 ebuild = portage.normalize_path(ebuild)
23 # portdbapi uses the canonical path for the base of the portage tree, but
24 # subdirectories of the base can be built from symlinks (like crossdev does).
25 -repo_location = os.path.realpath(
26 +ebuild_portdir = os.path.realpath(
27 os.path.dirname(os.path.dirname(os.path.dirname(ebuild))))
28 -ebuild = os.path.join(repo_location, *ebuild.split(os.path.sep)[-3:])
29 +ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:])
30 vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH))
31
32 -repo_name = None
33 -if repo_location != vdb_path:
34 - repo_name = portage.repository.config._read_repo_name(repo_location)
35 - if repo_name is None:
36 +myrepo = None
37 +if ebuild_portdir != vdb_path:
38 + myrepo = portage.repository.config._read_repo_name(ebuild_portdir)
39 + if myrepo is None:
40 err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" %
41 - (repo_location, os.path.join(repo_location, REPO_NAME_LOC), os.path.join(repo_location, "metadata", "layout.conf")))
42 + (ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf")))
43
44 # Make sure that portdb.findname() returns the correct ebuild.
45 - if repo_location not in portage.portdb.porttrees:
46 - print("Appending repository '%s' located in '%s' to configuration of repositories" % (repo_name, repo_location))
47 + if ebuild_portdir not in portage.portdb.porttrees:
48 + print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir))
49 tmp_conf_file = io.StringIO(textwrap.dedent("""
50 [%s]
51 location = %s
52 - """ % (repo_name, repo_location)))
53 + """ % (myrepo, ebuild_portdir)))
54 repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file])
55 os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string()
56 portage._reset_legacy_globals()
57 @@ -182,7 +182,7 @@ if ebuild.startswith(vdb_path):
58 mytree = "vartree"
59 pkg_type = "installed"
60
61 - portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=repo_name)
62 + portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo)
63
64 if os.path.realpath(portage_ebuild) != ebuild:
65 err('Portage seems to think that %s is at %s' % (cpv, portage_ebuild))
66 @@ -191,7 +191,7 @@ else:
67 mytree = "porttree"
68 pkg_type = "ebuild"
69
70 - portage_ebuild = portage.portdb.findname(cpv, myrepo=repo_name)
71 + portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo)
72
73 if not portage_ebuild or portage_ebuild != ebuild:
74 err('%s: Invalid structure of repository' % (ebuild,))
75 @@ -238,7 +238,7 @@ build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
76 ebuild_changed = False
77 if mytree == "porttree" and build_dir_phases.intersection(pargs):
78 ebuild_changed = \
79 - portage.portdb._pull_valid_cache(cpv, ebuild, repo_location)[0] is None
80 + portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None
81
82 tmpsettings = portage.config(clone=portage.settings)
83 tmpsettings["PORTAGE_VERBOSE"] = "1"
84 @@ -271,7 +271,7 @@ if "merge" in pargs and "noauto" in tmpsettings.features:
85 try:
86 metadata = dict(zip(Package.metadata_keys,
87 portage.db[portage.settings['EROOT']][mytree].dbapi.aux_get(
88 - cpv, Package.metadata_keys, myrepo=repo_name)))
89 + cpv, Package.metadata_keys, myrepo=myrepo)))
90 except PortageKeyError:
91 # aux_get failure, message should have been shown on stderr.
92 sys.exit(1)