From 2ea7e6f088d283aa7fca2267881f705fc1d6d6b8 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 27 Oct 2011 16:08:21 +0200 Subject: [PATCH] [entropy.core] also exclude files ending with ".example" from .d/* dirs --- conf/packages/license.accept.d/README | 6 +++--- conf/packages/license.mask.d/README | 5 +++-- conf/packages/package.mask.d/README | 5 +++-- conf/packages/package.unmask.d/README | 5 +++-- conf/packages/system.mask.d/README | 5 +++-- conf/repositories.conf.d/README | 6 ++++-- lib/entropy/core/settings/base.py | 3 ++- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/conf/packages/license.accept.d/README b/conf/packages/license.accept.d/README index f98e96a56..52496422b 100644 --- a/conf/packages/license.accept.d/README +++ b/conf/packages/license.accept.d/README @@ -3,6 +3,6 @@ extending /etc/entropy/packages/license.accept content. User should rather edit /etc/entropy/packages/license.accept instead of creating files inside this directory. -Files are processed in lexical order. Filenames: ".keep", "README" and -starting with "_" are skipped and never considered. - +Files are processed in lexical order. Filenames: ".keep", "README" are +skipped and never considered. +Files ending with ".example" are never considered. diff --git a/conf/packages/license.mask.d/README b/conf/packages/license.mask.d/README index 1d8694eb5..a55f5d535 100644 --- a/conf/packages/license.mask.d/README +++ b/conf/packages/license.mask.d/README @@ -3,5 +3,6 @@ extending /etc/entropy/packages/license.mask content. User should rather edit /etc/entropy/packages/license.mask instead of creating files inside this directory. -Files are processed in lexical order. Filenames: ".keep", "README" and -starting with "_" are skipped and never considered. +Files are processed in lexical order. Filenames: ".keep", "README" are +skipped and never considered. +Files ending with ".example" are never considered. diff --git a/conf/packages/package.mask.d/README b/conf/packages/package.mask.d/README index 0297d1383..d1e289dbc 100644 --- a/conf/packages/package.mask.d/README +++ b/conf/packages/package.mask.d/README @@ -3,5 +3,6 @@ extending /etc/entropy/packages/package.mask content. User should rather edit /etc/entropy/packages/package.mask instead of creating files inside this directory. -Files are processed in lexical order. Filenames: ".keep", "README" and -starting with "_" are skipped and never considered. +Files are processed in lexical order. Filenames: ".keep", "README" are +skipped and never considered. +Files ending with ".example" are never considered. diff --git a/conf/packages/package.unmask.d/README b/conf/packages/package.unmask.d/README index 0412aac5c..ccd2e5f5b 100644 --- a/conf/packages/package.unmask.d/README +++ b/conf/packages/package.unmask.d/README @@ -3,5 +3,6 @@ extending /etc/entropy/packages/package.unmask content. User should rather edit /etc/entropy/packages/package.unmask instead of creating files inside this directory. -Files are processed in lexical order. Filenames: ".keep", "README" and -starting with "_" are skipped and never considered. +Files are processed in lexical order. Filenames: ".keep", "README" are +skipped and never considered. +Files ending with ".example" are never considered. diff --git a/conf/packages/system.mask.d/README b/conf/packages/system.mask.d/README index 0185e6a3f..becfe6b17 100644 --- a/conf/packages/system.mask.d/README +++ b/conf/packages/system.mask.d/README @@ -3,5 +3,6 @@ extending /etc/entropy/packages/system.mask content. User should rather edit /etc/entropy/packages/system.mask instead of creating files inside this directory. -Files are processed in lexical order. Filenames: ".keep", "README" and -starting with "_" are skipped and never considered. +Files are processed in lexical order. Filenames: ".keep", "README" are +skipped and never considered. +Files ending with ".example" are never considered. diff --git a/conf/repositories.conf.d/README b/conf/repositories.conf.d/README index 1d1e8b794..b196aee6a 100644 --- a/conf/repositories.conf.d/README +++ b/conf/repositories.conf.d/README @@ -2,8 +2,10 @@ This directory should contain distribution-provided configuration files extending /etc/entropy/repositories.conf content (only for "repository =" statements). -Files are processed in lexical order. Filenames: ".keep", "README" and -starting with "_" are skipped and never considered. +Files are processed in lexical order. Filenames: ".keep", "README" are +skipped and never considered. +Files starting with "_" are considered belonging to disabled repositories. +Files ending with ".example" are never considered. Files created by Entropy Client are prefixed with "entropy_". So, for example, for "sabayon-limbo" you will get: diff --git a/lib/entropy/core/settings/base.py b/lib/entropy/core/settings/base.py index 9c32a8a3d..51fc1b6a3 100644 --- a/lib/entropy/core/settings/base.py +++ b/lib/entropy/core/settings/base.py @@ -360,7 +360,8 @@ class SystemSettings(Singleton, EntropyPluginStore): conf_files = [x for x in conf_files if \ os.path.isfile(x) and os.access(x, os.R_OK) \ and not os.path.basename(x).startswith(".keep") \ - and os.path.basename(x) != "README"] + and os.path.basename(x) != "README" \ + and not os.path.basename(x).endswith(".example")] # ignore files starting with _ skipped_conf_files = [x for x in conf_files if \ os.path.basename(x).startswith("_")]