Re: [gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-07 Thread Michał Górny
Dnia 2014-12-07, o godz. 10:33:44
Zac Medico  napisał(a):

> On 12/07/2014 01:06 AM, Michał Górny wrote:
> > Dnia 2014-12-07, o godz. 01:04:19
> > Zac Medico  napisał(a):
> > 
> >> On 12/07/2014 12:22 AM, Michał Górny wrote:
> >>> Dnia 2014-12-06, o godz. 23:15:09
> >>> Zac Medico  napisał(a):
> >>>
>  On 12/05/2014 04:03 PM, Michał Górny wrote:
> > Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
> > Portage, as fallbacks to sync-umask and sync-user repo keys.
> > ---
> >  pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
> >  pym/portage/package/ebuild/config.py   | 12 
> > 
> >  pym/portage/repository/config.py   | 13 
> > +
> >  3 files changed, 26 insertions(+), 1 deletion(-)
> 
>  Why should we add backward compatibility code for something that was
>  never supported in the master branch?
> >>>
> >>> I just thought it wouldn't hurt if we're backporting features.
> >>
> >> Adding extra code for new redundant variables seems undesirable. Are
> >> they somehow better than using equivalent repos.conf [DEFAULT] settings
> >> for sync-user and sync-mask?
> > 
> > They're easier to set in env than the fancy PORTAGE_REPOSITORIES.
> 
> Do these settings commonly need to be overridden in the env?

I have no clue. I just don't want users to lose functionality when it
doesn't require much effort (anymore, consider I've lost over an hour
to figure out why settings are incomplete...).

-- 
Best regards,
Michał Górny


pgpETAjEAguB6.pgp
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-07 Thread Zac Medico
On 12/07/2014 01:06 AM, Michał Górny wrote:
> Dnia 2014-12-07, o godz. 01:04:19
> Zac Medico  napisał(a):
> 
>> On 12/07/2014 12:22 AM, Michał Górny wrote:
>>> Dnia 2014-12-06, o godz. 23:15:09
>>> Zac Medico  napisał(a):
>>>
 On 12/05/2014 04:03 PM, Michał Górny wrote:
> Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
> Portage, as fallbacks to sync-umask and sync-user repo keys.
> ---
>  pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
>  pym/portage/package/ebuild/config.py   | 12 
>  pym/portage/repository/config.py   | 13 +
>  3 files changed, 26 insertions(+), 1 deletion(-)

 Why should we add backward compatibility code for something that was
 never supported in the master branch?
>>>
>>> I just thought it wouldn't hurt if we're backporting features.
>>
>> Adding extra code for new redundant variables seems undesirable. Are
>> they somehow better than using equivalent repos.conf [DEFAULT] settings
>> for sync-user and sync-mask?
> 
> They're easier to set in env than the fancy PORTAGE_REPOSITORIES.

Do these settings commonly need to be overridden in the env?
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-07 Thread Michał Górny
Dnia 2014-12-07, o godz. 01:04:19
Zac Medico  napisał(a):

> On 12/07/2014 12:22 AM, Michał Górny wrote:
> > Dnia 2014-12-06, o godz. 23:15:09
> > Zac Medico  napisał(a):
> > 
> >> On 12/05/2014 04:03 PM, Michał Górny wrote:
> >>> Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
> >>> Portage, as fallbacks to sync-umask and sync-user repo keys.
> >>> ---
> >>>  pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
> >>>  pym/portage/package/ebuild/config.py   | 12 
> >>>  pym/portage/repository/config.py   | 13 +
> >>>  3 files changed, 26 insertions(+), 1 deletion(-)
> >>
> >> Why should we add backward compatibility code for something that was
> >> never supported in the master branch?
> > 
> > I just thought it wouldn't hurt if we're backporting features.
> 
> Adding extra code for new redundant variables seems undesirable. Are
> they somehow better than using equivalent repos.conf [DEFAULT] settings
> for sync-user and sync-mask?

They're easier to set in env than the fancy PORTAGE_REPOSITORIES.

-- 
Best regards,
Michał Górny


pgpFJSwEfzAJM.pgp
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-07 Thread Zac Medico
On 12/07/2014 12:22 AM, Michał Górny wrote:
> Dnia 2014-12-06, o godz. 23:15:09
> Zac Medico  napisał(a):
> 
>> On 12/05/2014 04:03 PM, Michał Górny wrote:
>>> Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
>>> Portage, as fallbacks to sync-umask and sync-user repo keys.
>>> ---
>>>  pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
>>>  pym/portage/package/ebuild/config.py   | 12 
>>>  pym/portage/repository/config.py   | 13 +
>>>  3 files changed, 26 insertions(+), 1 deletion(-)
>>
>> Why should we add backward compatibility code for something that was
>> never supported in the master branch?
> 
> I just thought it wouldn't hurt if we're backporting features.

Adding extra code for new redundant variables seems undesirable. Are
they somehow better than using equivalent repos.conf [DEFAULT] settings
for sync-user and sync-mask?
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-07 Thread Michał Górny
Dnia 2014-12-06, o godz. 23:15:09
Zac Medico  napisał(a):

> On 12/05/2014 04:03 PM, Michał Górny wrote:
> > Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
> > Portage, as fallbacks to sync-umask and sync-user repo keys.
> > ---
> >  pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
> >  pym/portage/package/ebuild/config.py   | 12 
> >  pym/portage/repository/config.py   | 13 +
> >  3 files changed, 26 insertions(+), 1 deletion(-)
> 
> Why should we add backward compatibility code for something that was
> never supported in the master branch?

I just thought it wouldn't hurt if we're backporting features.

-- 
Best regards,
Michał Górny


pgpj1pzH8Pmeh.pgp
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-06 Thread Zac Medico
On 12/05/2014 04:03 PM, Michał Górny wrote:
> Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
> Portage, as fallbacks to sync-umask and sync-user repo keys.
> ---
>  pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
>  pym/portage/package/ebuild/config.py   | 12 
>  pym/portage/repository/config.py   | 13 +
>  3 files changed, 26 insertions(+), 1 deletion(-)

Why should we add backward compatibility code for something that was
never supported in the master branch?

Wouldn't it make more sense to have the Funtoo ebuild run some code that
generates a config update for repos.conf?
-- 
Thanks,
Zac



[gentoo-portage-dev] [PATCH 4/4] sync: Add backwards compat with SYNC_{UMASK,USER} variables

2014-12-05 Thread Michał Górny
Support SYNC_UMASK and SYNC_USER variables that were used in Funtoo
Portage, as fallbacks to sync-umask and sync-user repo keys.
---
 pym/portage/package/ebuild/_config/special_env_vars.py |  2 +-
 pym/portage/package/ebuild/config.py   | 12 
 pym/portage/repository/config.py   | 13 +
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py 
b/pym/portage/package/ebuild/_config/special_env_vars.py
index 387f4ae..5c13e5b 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -180,7 +180,7 @@ environ_filter += [
"RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTPS",
"RESUMECOMMAND_RSYNC", "RESUMECOMMAND_SFTP",
"UNINSTALL_IGNORE", "USE_EXPAND_HIDDEN", "USE_ORDER",
-   "__PORTAGE_HELPER"
+   "__PORTAGE_HELPER", "SYNC_UMASK", "SYNC_USER",
 ]
 
 # No longer supported variables
diff --git a/pym/portage/package/ebuild/config.py 
b/pym/portage/package/ebuild/config.py
index 59e239b..0ca2bfd 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -499,6 +499,8 @@ class config(object):
portdir = ""
portdir_overlay = ""
portdir_sync = None
+   sync_umask = None
+   sync_user = None
for confs in [make_globals, make_conf, 
self.configdict["env"]]:
v = confs.get("PORTDIR")
if v is not None:
@@ -511,12 +513,22 @@ class config(object):
v = confs.get("SYNC")
if v is not None:
portdir_sync = v
+   v = confs.get("SYNC_UMASK")
+   if v is not None:
+   sync_umask = v
+   v = confs.get("SYNC_USER")
+   if v is not None:
+   sync_user = v
 
known_repos = frozenset(known_repos)
self["PORTDIR"] = portdir
self["PORTDIR_OVERLAY"] = portdir_overlay
if portdir_sync:
self["SYNC"] = portdir_sync
+   if sync_umask:
+   self["SYNC_UMASK"] = sync_umask
+   if sync_user:
+   self["SYNC_USER"] = sync_user
self.lookuplist = [self.configdict["env"]]
if repositories is None:
self.repositories = load_repository_config(self)
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index f45684b..9b7bfa9 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -827,6 +827,19 @@ class RepoConfigLoader(object):
"!!! %s\n" % _("Set 'masters = %s' in 
this file for future compatibility") %
self.mainRepo().name, 
level=logging.WARNING, noiselevel=-1)
 
+   # respect SYNC_UMASK and SYNC_USER whenever not overriden
+   fallback_umask = settings.get('SYNC_UMASK')
+   fallback_user = settings.get('SYNC_USER')
+   if fallback_umask is not None or fallback_user is not None:
+   for repo_name, repo in prepos.items():
+   if repo_name == "DEFAULT":
+   continue
+
+   if repo.sync_umask is None and fallback_umask 
is not None:
+   repo.sync_umask = fallback_umask
+   if repo.sync_user is None and fallback_user is 
not None:
+   repo.sync_user = fallback_user
+
self._prepos_changed = True
self._repo_location_list = []
 
-- 
2.2.0