From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:prefix commit in: pym/portage/package/ebuild/
Date: Sat, 10 Dec 2011 12:55:03 +0000 (UTC) [thread overview]
Message-ID: <ac3bbd986755acb020f71c1a204ebe87f219200c.grobian@gentoo> (raw)
commit: ac3bbd986755acb020f71c1a204ebe87f219200c
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 10 12:54:51 2011 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Dec 10 12:54:51 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ac3bbd98
config: remove destructive user/grpname guessing
---
pym/portage/package/ebuild/config.py | 62 ++++++++++++++++++---------------
1 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 89a2eb1..fb2167c 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -732,34 +732,40 @@ class config(object):
"PORTAGE_INST_UID": "0",
}
- if eprefix:
- # For prefix environments, default to the UID and GID of
- # the top-level EROOT directory.
- try:
- eroot_st = os.stat(eroot)
- except OSError:
- pass
- else:
- default_inst_ids["PORTAGE_INST_GID"] = str(eroot_st.st_gid)
- default_inst_ids["PORTAGE_INST_UID"] = str(eroot_st.st_uid)
-
- if "PORTAGE_USERNAME" not in self:
- try:
- pwd_struct = pwd.getpwuid(eroot_st.st_uid)
- except KeyError:
- pass
- else:
- self["PORTAGE_USERNAME"] = pwd_struct.pw_name
- self.backup_changes("PORTAGE_USERNAME")
-
- if "PORTAGE_GRPNAME" not in self:
- try:
- grp_struct = grp.getgrgid(eroot_st.st_gid)
- except KeyError:
- pass
- else:
- self["PORTAGE_GRPNAME"] = grp_struct.gr_name
- self.backup_changes("PORTAGE_GRPNAME")
+ # PREFIX LOCAL: inventing UID/GID based on a path is a very
+ # bad idea, it breaks almost everything since group ids
+ # don't have to match, when a user has many
+ # This in particularly breaks the configure-set portage
+ # group and user (in portage/data.py)
+ #if eprefix:
+ # # For prefix environments, default to the UID and GID of
+ # # the top-level EROOT directory.
+ # try:
+ # eroot_st = os.stat(eroot)
+ # except OSError:
+ # pass
+ # else:
+ # default_inst_ids["PORTAGE_INST_GID"] = str(eroot_st.st_gid)
+ # default_inst_ids["PORTAGE_INST_UID"] = str(eroot_st.st_uid)
+
+ # if "PORTAGE_USERNAME" not in self:
+ # try:
+ # pwd_struct = pwd.getpwuid(eroot_st.st_uid)
+ # except KeyError:
+ # pass
+ # else:
+ # self["PORTAGE_USERNAME"] = pwd_struct.pw_name
+ # self.backup_changes("PORTAGE_USERNAME")
+
+ # if "PORTAGE_GRPNAME" not in self:
+ # try:
+ # grp_struct = grp.getgrgid(eroot_st.st_gid)
+ # except KeyError:
+ # pass
+ # else:
+ # self["PORTAGE_GRPNAME"] = grp_struct.gr_name
+ # self.backup_changes("PORTAGE_GRPNAME")
+ # END PREFIX LOCAL
for var, default_val in default_inst_ids.items():
try:
next reply other threads:[~2011-12-10 12:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-10 12:55 Fabian Groffen [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-05-25 19:32 [gentoo-commits] proj/portage:prefix commit in: pym/portage/package/ebuild/ Fabian Groffen
2015-06-09 19:53 Fabian Groffen
2015-06-09 19:53 Fabian Groffen
2014-02-04 20:29 Fabian Groffen
2013-12-15 7:56 Fabian Groffen
2012-02-09 8:16 Fabian Groffen
2011-12-23 11:04 Fabian Groffen
2011-12-23 11:04 Fabian Groffen
2011-12-02 20:27 Fabian Groffen
2011-02-05 12:25 Fabian Groffen
2011-02-05 12:25 Fabian Groffen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac3bbd986755acb020f71c1a204ebe87f219200c.grobian@gentoo \
--to=grobian@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox