Gentoo Archives: gentoo-commits

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