entropy.client: deny treeupdates as user due to Portage /var/db/pkg perms

This commit is contained in:
Fabio Erculiani
2009-05-22 11:41:18 +02:00
parent d67a236394
commit ad2d8cf051
2 changed files with 4 additions and 2 deletions
@@ -174,8 +174,9 @@ class RepositoryMixin:
)
if (repoid not in etpConst['client_treeupdatescalled']) and \
(self.entropyTools.is_user_in_entropy_group()) and \
(self.entropyTools.is_root()) and \
(not repoid.endswith(etpConst['packagesext'])):
# only as root due to Portage
updated = False
try:
updated = conn.clientUpdatePackagesData(self.clientDbconn)
@@ -1027,7 +1027,8 @@ class Repository:
if self.fetchSecurity:
self.do_update_security_advisories()
# do treeupdates
if isinstance(self.Entropy.clientDbconn,LocalRepository):
if isinstance(self.Entropy.clientDbconn, LocalRepository) and \
self.entropyTools.is_root(): # only as root due to Portage
for repo in self.reponames:
dbc = self.Entropy.open_repository(repo)
dbc.clientUpdatePackagesData(self.Entropy.clientDbconn)