* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/
@ 2011-09-13 5:49 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-09-13 5:49 UTC (permalink / raw
To: gentoo-commits
commit: 9cb089047e10b300100e7bbdc4274ecf8866b0bb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 13 05:48:36 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 13 05:48:36 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9cb08904
metadata/layout.conf: "sign-manifests = false"
This allows repos to disable manifest signatures, which is useful if
they want to prevent merge conflicts like those that thin-manifests is
designed to prevent.
---
bin/repoman | 10 ++++++----
pym/portage/repository/config.py | 6 +++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/bin/repoman b/bin/repoman
index 38b3273..e0cdf6e 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -592,11 +592,13 @@ repo_info = portdb._repo_info[portdir_overlay]
portdb.porttrees = list(repo_info.eclass_db.porttrees)
portdir = portdb.porttrees[0]
-# Thin manifests imply reliance on the VCS for file integrity,
-# which implies that manifest signatures are not needed.
-sign_manifests = "sign" in repoman_settings.features and not \
+# In order to disable manifest signatures, repos may set
+# "sign-manifests = false" in metadata/layout.conf. This
+# can be used to prevent merge conflicts like those that
+# thin-manifests is designed to prevent.
+sign_manifests = "sign" in repoman_settings.features and \
repoman_settings.repositories.get_repo_for_location(
- portdir_overlay).thin_manifest
+ portdir_overlay).sign_manifest
# Generate an appropriate PORTDIR_OVERLAY value for passing into the
# profile-specific config constructor calls.
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 17839d7..5cfe82f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -42,7 +42,7 @@ class RepoConfig(object):
"""Stores config of one repository"""
__slots__ = ['aliases', 'eclass_overrides', 'eclass_locations', 'location', 'user_location', 'masters', 'main_repo',
- 'missing_repo_name', 'name', 'priority', 'sync', 'format', 'thin_manifest']
+ 'missing_repo_name', 'name', 'priority', 'sync', 'format', 'sign_manifest', 'thin_manifest']
def __init__(self, name, repo_opts):
"""Build a RepoConfig with options in repo_opts
@@ -111,6 +111,7 @@ class RepoConfig(object):
missing = False
self.name = name
self.missing_repo_name = missing
+ self.sign_manifest = True
self.thin_manifest = False
def load_manifest(self, *args, **kwds):
@@ -331,6 +332,9 @@ class RepoConfigLoader(object):
aliases.extend(repo.aliases)
repo.aliases = tuple(sorted(set(aliases)))
+ if layout_data.get('sign-manifests', '').lower() == 'false':
+ repo.sign_manifest = False
+
if layout_data.get('thin-manifests', '').lower() == 'true':
repo.thin_manifest = True
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/
@ 2011-10-20 17:05 Fabian Groffen
0 siblings, 0 replies; 6+ messages in thread
From: Fabian Groffen @ 2011-10-20 17:05 UTC (permalink / raw
To: gentoo-commits
commit: 7f9e716d4198f90032d91e8e8adfbc6d7673883c
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 16:58:04 2011 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 16:58:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7f9e716d
repoman: get default to update changelog from layout.conf
Updating the ChangeLog file may be desirable in more repos than just the
one named 'gentoo', like e.g. the Prefix one. Hence, make this default
configurable though metadata/layout.conf.
This commit must go accompanied by a commit to
gentoo-x86/metadata/layout.conf that adds the following bit:
# Bug #337853 - gentoo's council says to enable
# --echangelog by default for the "gentoo" repo
update-changelog = true
---
bin/repoman | 5 +----
pym/portage/repository/config.py | 6 +++++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/bin/repoman b/bin/repoman
index 4966d22..bec3b1e 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -637,10 +637,7 @@ if "commit" == options.mode and \
print(prefix + line)
sys.exit(1)
-if options.echangelog is None and \
- repo_config.name == "gentoo":
- # Bug #337853 - gentoo's council says to enable
- # --echangelog by default for the "gentoo" repo
+if options.echangelog is None and repo_config.update_changelog:
options.echangelog = 'y'
if vcs is None:
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 12829c3..fddba6c 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -48,7 +48,7 @@ class RepoConfig(object):
'eclass_overrides', 'eclass_locations', 'format', 'location',
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
- 'user_location')
+ 'update_changelog', 'user_location')
def __init__(self, name, repo_opts):
"""Build a RepoConfig with options in repo_opts
@@ -126,6 +126,7 @@ class RepoConfig(object):
self.create_manifest = True
self.disable_manifest = False
self.manifest_hashes = None
+ self.update_changelog = False
self.cache_format = None
def get_pregenerated_cache(self, auxdbkeys, readonly=True, force=False):
@@ -431,6 +432,9 @@ class RepoConfigLoader(object):
DeprecationWarning)
repo.manifest_hashes = manifest_hashes
+ if layout_data.get('update-changelog', '').lower() == 'true':
+ repo.update_changelog = True
+
#Take aliases into account.
new_prepos = {}
for repo_name, repo in prepos.items():
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/
@ 2011-10-25 22:55 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-10-25 22:55 UTC (permalink / raw
To: gentoo-commits
commit: 2843806fad6d0aa07ad4ce97290ebe1d03b00104
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 25 22:52:59 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 22:52:59 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2843806f
layout.conf: rename cache_format to cache_formats
We read layout.conf cache-formats from left to right and use the first
supported type that's found. This will allow support for multiple
formats in parallel, providing for smooth transitions between formats.
---
bin/egencache | 3 +-
pym/portage/repository/config.py | 44 ++++++++++++++++++++++++-------------
2 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/bin/egencache b/bin/egencache
index 0d07cdb..dec10b1 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -218,7 +218,8 @@ class GenCache(object):
self._trg_cache = conf.get_pregenerated_cache(portage.auxdbkeys[:],
force=True, readonly=False)
if self._trg_cache is None:
- raise Exception("cache format %s isn't supported" % (conf.cache_format,))
+ raise Exception("cache formats '%s' aren't supported" %
+ (" ".join(conf.cache_formats),))
if rsync:
self._trg_cache.raise_stat_collision = True
try:
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 377ba47..9b4a76f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -44,7 +44,7 @@ class RepoConfig(object):
"""Stores config of one repository"""
__slots__ = ('aliases', 'allow_missing_manifest',
- 'cache_format', 'create_manifest', 'disable_manifest',
+ 'cache_formats', 'create_manifest', 'disable_manifest',
'eclass_overrides', 'eclass_locations', 'format', 'location',
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
@@ -128,22 +128,32 @@ class RepoConfig(object):
self.disable_manifest = False
self.manifest_hashes = None
self.update_changelog = False
- self.cache_format = None
+ self.cache_formats = None
self.portage1_profiles = True
self.portage1_profiles_compat = False
def get_pregenerated_cache(self, auxdbkeys, readonly=True, force=False):
- format = self.cache_format
- if format is None:
+ """
+ Reads layout.conf cache-formats from left to right and returns a
+ cache instance for the first supported type that's found. If no
+ cache-formats are specified in layout.conf, 'pms' type is assumed
+ if the metadata/cache directory exists or force is True.
+ """
+ formats = self.cache_formats
+ if not formats:
if not force:
return None
- format = 'pms'
- if format == 'pms':
- from portage.cache.metadata import database
- name = 'metadata/cache'
- elif format == 'md5-dict':
- from portage.cache.flat_hash import md5_database as database
- name = 'metadata/md5-cache'
+ formats = ('pms',)
+
+ for fmt in formats:
+ if fmt == 'pms':
+ from portage.cache.metadata import database
+ name = 'metadata/cache'
+ break
+ elif fmt == 'md5-dict':
+ from portage.cache.flat_hash import md5_database as database
+ name = 'metadata/md5-cache'
+ break
else:
return None
return database(self.location, name,
@@ -379,7 +389,7 @@ class RepoConfigLoader(object):
repo.aliases = tuple(aliases) + layout_data['aliases']
for value in ('sign-manifest', 'thin-manifest', 'allow-missing-manifest',
- 'create-manifest', 'disable-manifest', 'cache-format', 'manifest-hashes',
+ 'create-manifest', 'disable-manifest', 'cache-formats', 'manifest-hashes',
'update-changelog'):
setattr(repo, value.lower().replace("-", "_"), layout_data[value])
@@ -387,6 +397,8 @@ class RepoConfigLoader(object):
for x in layout_data['profile-formats'])
repo.portage1_profiles_compat = layout_data['profile-formats'] == ('portage-1-compat',)
+ repo.cache_formats = layout_data['cache-formats']
+
#Take aliases into account.
new_prepos = {}
for repo_name, repo in prepos.items():
@@ -608,11 +620,11 @@ def parse_layout_conf(repo_location, repo_name=None):
# for compatibility w/ PMS, fallback to pms; but also check if the
# cache exists or not.
- cache_format = layout_data.get('cache-format', 'pms').lower()
- if cache_format == 'pms' and not os.path.isdir(
+ cache_formats = layout_data.get('cache-formats', 'pms').lower().split()
+ if 'pms' in cache_formats and not os.path.isdir(
os.path.join(repo_location, 'metadata', 'cache')):
- cache_format = None
- data['cache-format'] = cache_format
+ cache_formats.remove('pms')
+ data['cache-formats'] = tuple(cache_formats)
manifest_hashes = layout_data.get('manifest-hashes')
if manifest_hashes is not None:
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/
@ 2011-10-27 5:52 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-10-27 5:52 UTC (permalink / raw
To: gentoo-commits
commit: 5c216774ac90ef5d1cba6fc000baa546e7834945
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 05:52:04 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 05:52:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5c216774
repoman: add opts and repo config debug output
---
bin/repoman | 3 +++
pym/portage/repository/config.py | 14 ++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/bin/repoman b/bin/repoman
index bf91b85..8adccc7 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -654,6 +654,9 @@ if vcs is None:
# TODO: shouldn't this just be switched on the repo, iso the VCS?
check_changelog = options.echangelog not in ('y', 'force') and vcs in ('cvs', 'svn')
+logging.debug("repo config: %s" % (repo_config,))
+logging.debug("options: %s" % (options,))
+
# Generate an appropriate PORTDIR_OVERLAY value for passing into the
# profile-specific config constructor calls.
env = os.environ.copy()
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5659b14..ab679f6 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -21,6 +21,7 @@ from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
from portage.env.loaders import KeyValuePairFileLoader
from portage.util import normalize_path, writemsg, writemsg_level, shlex_split
from portage.localization import _
+from portage import _unicode_decode
from portage import _unicode_encode
from portage import _encodings
from portage import manifest
@@ -234,6 +235,19 @@ class RepoConfig(object):
repo_msg.append("")
return "\n".join(repo_msg)
+ def __str__(self):
+ d = {}
+ for k in self.__slots__:
+ d[k] = getattr(self, k, None)
+ return _unicode_decode(str(d))
+
+ if sys.hexversion < 0x3000000:
+
+ __unicode__ = __str__
+
+ def __str__(self):
+ return _unicode_encode(self.__unicode__())
+
class RepoConfigLoader(object):
"""Loads and store config of several repositories, loaded from PORTDIR_OVERLAY or repos.conf"""
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/
@ 2015-05-06 6:51 Ulrich Müller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Müller @ 2015-05-06 6:51 UTC (permalink / raw
To: gentoo-commits
commit: bae954e2f69ee76d74570e30d6ddd1482ebad49b
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue May 5 13:13:52 2015 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed May 6 06:36:53 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=bae954e2
Use consistent rules for filenames of ebuils and misc files.
So far non-ebuild filenames were allowed to contain a : (colon).
This is a problematic character as it is illegal in both Mac OS and
MS-Windows (and there are Prefix profiles for these). Also it has a
special meaning as path separator and as remote host indicator in scp
and other programs.
This limits the allowed characters in filenames to [A-Za-z0-9._+-]
which is the same as IEEE Std 1003.1-2013, section 3.278, with the
addition of the plus character. See also bug 411127.
bin/repoman | 4 ++--
pym/portage/repository/config.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/repoman b/bin/repoman
index e9c89c2..37e11b2 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
#!/usr/bin/python -bO
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Next to do: dep syntax checking in mask files
@@ -88,7 +88,7 @@ util.initialize_logger()
# 14 is the length of DESCRIPTION=""
max_desc_len = 100
-allowed_filename_chars="a-zA-Z0-9._-+:"
+allowed_filename_chars="a-zA-Z0-9._+-"
pv_toolong_re = re.compile(r'[0-9]{19,}')
GPG_KEY_ID_REGEX = r'(0x)?([0-9a-fA-F]{8}|[0-9a-fA-F]{16}|[0-9a-fA-F]{24}|[0-9a-fA-F]{32}|[0-9a-fA-F]{40})!?'
bad = create_color_func("BAD")
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5da1810..e44b619 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -38,7 +38,7 @@ if sys.hexversion >= 0x3000000:
basestring = str
# Characters prohibited by repoman's file.name check.
-_invalid_path_char_re = re.compile(r'[^a-zA-Z0-9._\-+:/]')
+_invalid_path_char_re = re.compile(r'[^a-zA-Z0-9._\-+/]')
_valid_profile_formats = frozenset(
['pms', 'portage-1', 'portage-2', 'profile-bashrcs', 'profile-set',
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/
@ 2015-05-16 22:37 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2015-05-16 22:37 UTC (permalink / raw
To: gentoo-commits
commit: 28d5b7e78e0fdad2479685ec257ab5b858195007
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 16 20:57:11 2015 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 16 22:36:02 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=28d5b7e7
egencache --update-pkg-desc-index: handle read-only repo (bug 549616)
If the repo is read-only, write the cache to /var/cache/edb/dep
where IndexedPortdb searches for it.
X-Gentoo-Bug: 549616
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=549616
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
bin/egencache | 17 ++++++++++++++++-
pym/portage/repository/config.py | 12 ++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/bin/egencache b/bin/egencache
index f97432f..6075ccf 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1086,8 +1086,23 @@ def egencache_main(args):
ret.append(scheduler.returncode)
if options.update_pkg_desc_index:
+ if repo_config.writable:
+ writable_location = repo_config.location
+ else:
+ writable_location = os.path.join(portdb.depcachedir,
+ repo_config.location.lstrip(os.sep))
+ msg = [
+ "WARNING: Repository is not writable: %s" % (
+ repo_config.location,),
+ " Using cache directory instead: %s" % (
+ writable_location,)
+ ]
+ msg = "".join(line + '\n' for line in msg)
+ writemsg_level(msg,
+ level=logging.WARNING, noiselevel=-1)
+
gen_index = GenPkgDescIndex(portdb, os.path.join(
- repo_config.location, "metadata", "pkg_desc_index"))
+ writable_location, "metadata", "pkg_desc_index"))
gen_index.run()
ret.append(gen_index.returncode)
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index e44b619..05eedbe 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -26,6 +26,7 @@ from portage.env.loaders import KeyValuePairFileLoader
from portage.util import (normalize_path, read_corresponding_eapi_file, shlex_split,
stack_lists, writemsg, writemsg_level, _recursive_file_list)
from portage.util._path import exists_raise_eaccess, isdir_raise_eaccess
+from portage.util.path import first_existing
from portage.localization import _
from portage import _unicode_decode
from portage import _unicode_encode
@@ -346,6 +347,17 @@ class RepoConfig(object):
if new_repo.name is not None:
self.missing_repo_name = new_repo.missing_repo_name
+ @property
+ def writable(self):
+ """
+ Check if self.location is writable, or permissions are sufficient
+ to create it if it does not exist yet.
+ @rtype: bool
+ @return: True if self.location is writable or can be created,
+ False otherwise
+ """
+ return os.access(first_existing(self.location), os.W_OK)
+
@staticmethod
def _read_valid_repo_name(repo_path):
name, missing = RepoConfig._read_repo_name(repo_path)
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-05-16 22:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25 22:55 [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/repository/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2015-05-16 22:37 Zac Medico
2015-05-06 6:51 Ulrich Müller
2011-10-27 5:52 Zac Medico
2011-10-20 17:05 Fabian Groffen
2011-09-13 5:49 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox