[gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
commit: 31923f4ee2d89d840b3bc31af774352ef626648d Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Dec 9 12:35:04 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Dec 9 12:35:04 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=31923f4e portage.package.ebuild.config.config.__init__(): Skip some warnings for Portage Python scripts called in ebuild environment. pym/portage/package/ebuild/config.py | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 50e0110..f75a0e7 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -510,12 +510,15 @@ class config(object): if make_conf.get(var) is not None: writemsg_level("!!! %s\n" % _("%s variable is set in make.conf but is no longer used. " "Use repos.conf instead.") % var, level=logging.WARNING, noiselevel=-1) - for var in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"): - if self.configdict["env"].get(var) is not None: - writemsg_level("!!! %s\n" % _("%s environmental variable is set but is no longer used. " - "Use new environmental variables instead:") % var, level=logging.WARNING, noiselevel=-1) - writemsg_level(" PORTAGE_REPOSITORIES, PORTAGE_REPOSITORY:${repository_name}:${attribute}, " - "PORTAGE_ADDED_REPOSITORIES, PORTAGE_DELETED_REPOSITORIES\n", level=logging.WARNING, noiselevel=-1) + # Skip warnings for Portage Python scripts called in ebuild environment. + # PORTDIR is exported in ebuild environment in some EAPIs. + if self.configdict["env"].get("EBUILD") is None: + for var in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"): + if self.configdict["env"].get(var) is not None: + writemsg_level("!!! %s\n" % _("%s environmental variable is set but is no longer used. " + "Use new environmental variables instead:") % var, level=logging.WARNING, noiselevel=-1) + writemsg_level(" PORTAGE_REPOSITORIES, PORTAGE_REPOSITORY:${repository_name}:${attribute}, " + "PORTAGE_ADDED_REPOSITORIES, PORTAGE_DELETED_REPOSITORIES\n", level=logging.WARNING, noiselevel=-1) self.lookuplist = [self.configdict["env"]] if repositories is None:
[gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/repository/, pym/_emerge/, man/, ...
commit: 78539500809043bba57d9f93ff379c2695c85359 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Dec 9 11:54:45 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Dec 9 11:54:45 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=78539500 Delete support for PORTDIR and PORTDIR_OVERLAY from make.conf and environment. (SYNC variable was already not used.) man/make.conf.5| 61 + pym/_emerge/actions.py | 33 - pym/portage/dbapi/porttree.py | 4 +- .../package/ebuild/_config/special_env_vars.py | 1 - pym/portage/package/ebuild/config.py | 43 ++ pym/portage/repository/config.py | 149 + 6 files changed, 24 insertions(+), 267 deletions(-) diff --git a/man/make.conf.5 b/man/make.conf.5 index 1d1cfeb..f155c8e 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -1,4 +1,4 @@ -.TH "MAKE.CONF" "5" "Jan 2015" "Portage VERSION" "Portage" +.TH "MAKE.CONF" "5" "Dec 2015" "Portage VERSION" "Portage" .SH "NAME" make.conf \- custom settings for Portage .SH "SYNOPSIS" @@ -195,9 +195,8 @@ like to selectively prune obsolete files from this directory, see Use the \fBPORTAGE_RO_DISTDIRS\fR variable to specify one or more read-only directories containing distfiles. -Note -that locations under /usr/portage are not necessarily safe for data storage. -See the \fBPORTDIR\fR documentation for more information. +Note that locations under locations of repositories are not necessarily safe +for data storage. .br Defaults to /usr/portage/distfiles. .TP @@ -773,8 +772,8 @@ to it's category. However, for backward compatibility with the layout used by older versions of portage, if the \fI${PKGDIR}/All\fR directory exists then all packages will be stored inside of it and symlinks to the packages will be created in the category subdirectories. Note -that locations under /usr/portage are not necessarily safe for data storage. -See the \fBPORTDIR\fR documentation for more information. +that locations under locations of repositories are not necessarily safe +for data storage. .br Defaults to /usr/portage/packages. .TP @@ -1001,30 +1000,6 @@ when \fBxattr\fR is in \fBFEATURES\fR. .br Defaults to "security.*" (security labels are special, see bug #461868). .TP -\fBPORTDIR\fR = \fI[path]\fR -Defines the location of main repository. This variable is deprecated in favor of -settings in \fBrepos.conf\fR. If you change this, you must update -your /etc/portage/make.profile symlink accordingly. -.br -Defaults to /usr/portage. -.br -\fB***Warning***\fR -.br -Data stored inside \fBPORTDIR\fR is in peril of being overwritten or deleted by -the emerge \-\-sync command. The default value of -\fBPORTAGE_RSYNC_OPTS\fR will protect the default locations of -\fBDISTDIR\fR and \fBPKGDIR\fR, but users are warned that any other locations -inside \fBPORTDIR\fR are not necessarily safe for data storage. You should not -put other data (such as overlays) in your \fBPORTDIR\fB. Portage will walk -directory structures and may arbitrarily add invalid categories as packages. -.TP -\fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR -Defines the locations of other repositories. This variable is deprecated in -favor of settings in \fBrepos.conf\fR. This variable is a space\-delimited list of -directories. -.br -Defaults to no value. -.TP \fBQA_STRICT_EXECSTACK = \fI"set"\fR Set this to cause portage to ignore any \fIQA_EXECSTACK\fR override settings from ebuilds. See also \fBebuild\fR(5). @@ -1072,32 +1047,6 @@ Defines the location where created RPM packages will be stored. .br Defaults to /usr/portage/rpm. .TP -\fBSYNC\fR = \fI[RSYNC]\fR -Insert your preferred rsync mirror here. This rsync server -is used to sync the local portage tree when `emerge \-\-sync` is run. - -Note that the \fBSYNC\fR variable is now deprecated, and instead the -sync\-type and sync\-uri attributes in repos.conf should be used. See -\fBportage\fR(5) for more information. - -Defaults to rsync://rsync.gentoo.org/gentoo\-portage -.RS -.TP -.B Usage: -(rsync|ssh)://[username@]hostname[:port]/(module|path) -.TP -.B Examples: -rsync://private\-mirror.com/portage\-module -.br -rsync://rsync\-user@private\-mirror.com:873/gentoo\-portage -.br -ssh://ssh\-user@192.168.0.1:22/usr/portage -.br -ssh://ssh\-user@192.168.0.1:22/\\${HOME}/portage\-storage -.TP -Note: For the ssh:// scheme, key\-based authentication might be of interest. -.RE -.TP \fBUNINSTALL_IGNORE\fR = \fI[space delimited list of fnmatch patterns]\fR This variable prevents uninstallation of files that match specific \fBfnmatch\fR(3) patterns. In order to ignore file diff --
[gentoo-commits] proj/portage:master commit in: man/, pym/portage/repository/, pym/repoman/, pym/portage/tests/sync/, ...
commit: e7d95cbf1e0f8a209ac1417ae2ae89ef331becfc Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Dec 9 08:34:26 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Dec 9 08:34:26 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e7d95cbf portage.repository.config.RepoConfig: Support location with trailing whitespace by using quoting. configparser.ConfigParser strips initial and trailing whitespace. bin/ebuild | 2 +- bin/isolated-functions.sh| 20 +--- man/portage.5| 1 + pym/portage/repository/config.py | 14 +- pym/portage/tests/dbapi/test_fakedbapi.py| 2 +- pym/portage/tests/resolver/ResolverPlayground.py | 2 +- pym/portage/tests/sync/test_sync_local.py| 2 +- pym/repoman/repos.py | 2 +- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 1afad25..a696adf 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -158,7 +158,7 @@ if repo_location != vdb_path: print("Appending repository '%s' located in '%s' to configuration of repositories" % (repo_name, repo_location)) tmp_conf_file = io.StringIO(textwrap.dedent(""" [%s] - location = %s + location = "%s" """ % (repo_name, repo_location))) repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file]) os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string() diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 5766921..a55d4a3 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1 @@ -473,17 +473,23 @@ has() { } __repo_attr() { - local appropriate_section=0 exit_status=1 line saved_extglob_shopt=$(shopt -p extglob) + local appropriate_section=0 attribute=$2 exit_status=1 line repo_name=$1 saved_extglob_shopt=$(shopt -p extglob) value shopt -s extglob while read line; do - [[ ${appropriate_section} == 0 && ${line} == "[$1]" ]] && appropriate_section=1 && continue + [[ ${appropriate_section} == 0 && ${line} == "[${repo_name}]" ]] && appropriate_section=1 && continue [[ ${appropriate_section} == 1 && ${line} == "["*"]" ]] && appropriate_section=0 && continue - # If a conditional expression like [[ ${line} == $2*( )=* ]] is used - # then bash-3.2 produces an error like the following when the file is + # If a conditional expression like [[ ${line} == ${attribute}*( )=* ]] is used + # then bash <4.1 produces an error like the following when the file is # sourced: syntax error in conditional expression: unexpected token `(' # Therefore, use a regular expression for compatibility. - if [[ ${appropriate_section} == 1 && ${line} =~ ^${2}[[:space:]]*= ]]; then - echo "${line##$2*( )=*( )}" + if [[ ${appropriate_section} == 1 && ${line} =~ ^${attribute}[[:space:]]*= ]]; then + value="${line##${attribute}*( )=*( )}" + if [[ ${attribute} =~ ^(location)$ && (${value} == "'"*"'" || ${value} == '"'*'"') ]]; then + # bash >=4.2: + # value=${value:1:-1} + value=${value:1:$((${#value} - 2))} + fi + echo "${value}" exit_status=0 break fi diff --git a/man/portage.5 b/man/portage.5 index 6c41332..aa87e8f 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -956,6 +956,7 @@ Valid values: aliases, eclass\-overrides, masters .TP .B location Specifies location of given repository. +If location of repository ends with whitespace, then value of this attribute must be quoted. .TP .B masters Specifies master repositories of given repository. diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index fff619f..54d7688 100644 --- a/pym/portage/repository
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: 80362239e1b128c710eef0ced6a190c6b8533d1e Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 22:35:45 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 22:35:45 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=80362239 _emerge.depgraph.depgraph._select_files(): Update message. pym/_emerge/depgraph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index f659b0a..fa83ae8 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3667,7 +3667,7 @@ class depgraph(object): if ebuild_path: if ebuild_path != os.path.join(os.path.realpath(tree_root), cp, os.path.basename(ebuild_path)): - writemsg(colorize("BAD", "\n*** You need to adjust PORTDIR or PORTDIR_OVERLAY to emerge this package.\n\n"), noiselevel=-1) + writemsg(colorize("BAD", "\n*** You need to adjust repos.conf to emerge this package.\n\n"), noiselevel=-1) self._dynamic_config._skip_restart = True return 0, myfavorites if mykey not in portdb.xmatch(
[gentoo-commits] proj/portage:master commit in: bin/, man/
commit: 2d40eb4b2e484efdd70f04ac237eb699ac54a98e Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 22:18:56 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 22:18:56 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2d40eb4b egencache: Delete support for deprecated --portdir and --portdir-overlay options. bin/egencache | 20 +--- man/egencache.1 | 10 +- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/bin/egencache b/bin/egencache index ab36bbe..7e3387e 100755 --- a/bin/egencache +++ b/bin/egencache @@ -1,5 +1,5 @@ #!/usr/bin/python -b -# Copyright 2009-2014 Gentoo Foundation +# Copyright 2009-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # unicode_literals for compat with TextIOWrapper in Python 2 @@ -113,12 +113,6 @@ def parse_args(args): common.add_argument("--gpg-key", help="override the PORTAGE_GPG_KEY variable", dest="gpg_key") - common.add_argument("--portdir", - help="override the PORTDIR variable (deprecated in favor of --repositories-configuration)", - dest="portdir") - common.add_argument("--portdir-overlay", - help="override the PORTDIR_OVERLAY variable (deprecated in favor of --repositories-configuration)", - dest="portdir_overlay") common.add_argument("--repositories-configuration", help="override configuration of repositories (in format of repos.conf)", dest="repositories_configuration") @@ -226,13 +220,6 @@ def parse_args(args): parser.error("Write access denied: --cache-dir='%s'" % \ (options.cache_dir,)) - if options.portdir is not None: - writemsg_level("egencache: warning: --portdir option is deprecated in favor of --repositories-configuration option\n", - level=logging.WARNING, noiselevel=-1) - if options.portdir_overlay is not None: - writemsg_level("egencache: warning: --portdir-overlay option is deprecated in favor of --repositories-configuration option\n", - level=logging.WARNING, noiselevel=-1) - for atom in args: try: atom = portage.dep.Atom(atom) @@ -949,15 +936,10 @@ def egencache_main(args): if options.repositories_configuration is not None: env['PORTAGE_REPOSITORIES'] = options.repositories_configuration - elif options.portdir_overlay is not None: - env['PORTDIR_OVERLAY'] = options.portdir_overlay if options.cache_dir is not None: env['PORTAGE_DEPCACHEDIR'] = options.cache_dir - if options.portdir is not None: - env['PORTDIR'] = options.portdir - settings = portage.config(config_root=config_root, local_config=False, env=env) diff --git a/man/egencache.1 b/man/egencache.1 index 2465ddf..7fd17c2 100644 --- a/man/egencache.1 +++ b/man/egencache.1 @@ -1,4 +1,4 @@ -.TH "EGENCACHE" "1" "Mar 2015" "Portage VERSION" "Portage" +.TH "EGENCACHE" "1" "Dec 2015" "Portage VERSION" "Portage" .SH "NAME" egencache \- generate metadata cache for ebuild repositories .SH "SYNOPSIS" @@ -71,14 +71,6 @@ Also see the related \fB\-\-load\-average\fR option. .BR \-\-load\-average=LOAD Specifies that maximum load allowed when spawning multiple jobs. .TP -.BR "\-\-portdir=PORTDIR" -Override the PORTDIR variable. This option is deprecated in favor of -\-\-repositories\-configuration option. -.TP -.BR "\-\-portdir\-overlay=PORTDIR_OVERLAY" -Override the PORTDIR_OVERLAY variable. This option is deprecated in favor of -\-\-repositories\-configuration option. -.TP .BR "\-\-preserve\-comments" Preserve the comments found in the output use.local.desc file. This requires the output file to exist before egencache is called.
[gentoo-commits] proj/portage:master commit in: pym/portage/_emirrordist/, man/
commit: 9716f8a19707f89da8e7caeb5427a16804d5b220 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 22:21:32 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 22:21:32 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9716f8a1 emirrordist: Delete support for deprecated --portdir and --portdir-overlay options. man/emirrordist.1| 10 +- pym/portage/_emirrordist/main.py | 23 +-- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/man/emirrordist.1 b/man/emirrordist.1 index 2c93830..6e6c508 100644 --- a/man/emirrordist.1 +++ b/man/emirrordist.1 @@ -1,4 +1,4 @@ -.TH "EMIRRORDIST" "1" "Jul 2013" "Portage VERSION" "Portage" +.TH "EMIRRORDIST" "1" "Dec 2015" "Portage VERSION" "Portage" .SH "NAME" emirrordist \- a fetch tool for mirroring of package distfiles .SH SYNOPSIS @@ -47,14 +47,6 @@ Name of repo to operate on. \fB\-\-config\-root\fR=\fIDIR\fR Location of portage config files. .TP -\fB\-\-portdir\fR=\fIDIR\fR -Override the PORTDIR variable. This option is deprecated in favor of -\-\-repositories\-configuration option. -.TP -\fB\-\-portdir\-overlay\fR=\fIPORTDIR_OVERLAY\fR -Override the PORTDIR_OVERLAY variable. This option is deprecated in favor of -\-\-repositories\-configuration option. -.TP \fB\-\-repositories\-configuration\fR=\fIREPOSITORIES_CONFIGURATION\fR Override configuration of repositories. The argument of this option has the same format as repos.conf (see \fBportage\fR(5)). diff --git a/pym/portage/_emirrordist/main.py b/pym/portage/_emirrordist/main.py index 7378ac7..b63837b 100644 --- a/pym/portage/_emirrordist/main.py +++ b/pym/portage/_emirrordist/main.py @@ -1,4 +1,4 @@ -# Copyright 2013-2014 Gentoo Foundation +# Copyright 2013-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import argparse @@ -74,15 +74,6 @@ common_options = ( "metavar" : "DIR" }, { - "longopt" : "--portdir", - "help" : "override the PORTDIR variable (deprecated in favor of --repositories-configuration)", - "metavar" : "DIR" - }, - { - "longopt" : "--portdir-overlay", - "help" : "override the PORTDIR_OVERLAY variable (deprecated in favor of --repositories-configuration)" - }, - { "longopt" : "--repositories-configuration", "help" : "override configuration of repositories (in format of repos.conf)" }, @@ -245,20 +236,8 @@ def emirrordist_main(args): config_root = options.config_root - if options.portdir is not None: - writemsg_level("emirrordist: warning: --portdir option is deprecated in favor of --repositories-configuration option\n", - level=logging.WARNING, noiselevel=-1) - if options.portdir_overlay is not None: - writemsg_level("emirrordist: warning: --portdir-overlay option is deprecated in favor of --repositories-configuration option\n", - level=logging.WARNING, noiselevel=-1) - if options.repositories_configuration is not None: env['PORTAGE_REPOSITORIES'] = options.repositories_configuration - elif options.portdir_overlay is not None: - env['PORTDIR_OVERLAY'] = options.portdir_overlay - - if options.portdir is not None: - env['PORTDIR'] = options.portdir settings = portage.config(config_root=config_root, local_config=False, env=env)
[gentoo-commits] proj/portage:master commit in: bin/
commit: fb4d1f4ff710c7d7c848cf5ed4a7232bc1dd1e19 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 20:56:17 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 20:56:17 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fb4d1f4f ebuild: Rename some variables. bin/ebuild | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 2c42771..1afad25 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -141,25 +141,25 @@ if not os.path.isabs(ebuild): ebuild = portage.normalize_path(ebuild) # portdbapi uses the canonical path for the base of the portage tree, but # subdirectories of the base can be built from symlinks (like crossdev does). -ebuild_portdir = os.path.realpath( +repo_location = os.path.realpath( os.path.dirname(os.path.dirname(os.path.dirname(ebuild -ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:]) +ebuild = os.path.join(repo_location, *ebuild.split(os.path.sep)[-3:]) vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH)) -myrepo = None -if ebuild_portdir != vdb_path: - myrepo = portage.repository.config._read_repo_name(ebuild_portdir) - if myrepo is None: +repo_name = None +if repo_location != vdb_path: + repo_name = portage.repository.config._read_repo_name(repo_location) + if repo_name is None: err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" % - (ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf"))) + (repo_location, os.path.join(repo_location, REPO_NAME_LOC), os.path.join(repo_location, "metadata", "layout.conf"))) # Make sure that portdb.findname() returns the correct ebuild. - if ebuild_portdir not in portage.portdb.porttrees: - print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir)) + if repo_location not in portage.portdb.porttrees: + print("Appending repository '%s' located in '%s' to configuration of repositories" % (repo_name, repo_location)) tmp_conf_file = io.StringIO(textwrap.dedent(""" [%s] location = %s - """ % (myrepo, ebuild_portdir))) + """ % (repo_name, repo_location))) repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file]) os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string() portage._reset_legacy_globals() @@ -182,7 +182,7 @@ if ebuild.startswith(vdb_path): mytree = "vartree" pkg_type = "installed" - portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo) + portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=repo_name) if os.path.realpath(portage_ebuild) != ebuild: err('Portage seems to think that %s is at %s' % (cpv, portage_ebuild)) @@ -191,7 +191,7 @@ else: mytree = "porttree" pkg_type = "ebuild" - portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo) + portage_ebuild = portage.portdb.findname(cpv, myrepo=repo_name) if not portage_ebuild or portage_ebuild != ebuild: err('%s: Invalid structure of repository' % (ebuild,)) @@ -238,7 +238,7 @@ build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile", ebuild_changed = False if mytree == "porttree" and build_dir_phases.intersection(pargs): ebuild_changed = \ - portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None + portage.portdb._pull_valid_cache(cpv, ebuild, repo_location)[0] is None tmpsettings = portage.config(clone=portage.settings) tmpsettings["PORTAGE_VERBOSE"] = "1" @@ -271,7 +271,7 @@ if "merge" in pargs and "noauto" in tmpsettings.features: try: metadata = dict(zip(Package.metadata_keys, portage.db[portage.settings['EROOT']][mytree].dbapi.aux_get( - cpv, Package.metadata_keys, myrepo=myrepo))) + cpv, Package.metadata_keys, myrepo=repo_name))) except PortageKeyError: # aux_get failure, message should have been shown on stderr. sys.exit(1)
[gentoo-commits] proj/portage:master commit in: bin/
commit: 9e104c424ef08d543546eb4ae54724af97d11c0e Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 10:28:20 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 10:28:20 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e104c42 ebuild: Set PORTAGE_REPOSITORIES instead of deprecated PORTDIR_OVERLAY. bin/ebuild | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 1f99177..2c42771 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -50,7 +50,7 @@ from portage import _encodings from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode -from portage.const import VDB_PATH +from portage.const import REPO_NAME_LOC, VDB_PATH from portage.exception import PermissionDenied, PortageKeyError, \ PortagePackageException, UnsupportedAPIException import portage.util @@ -146,27 +146,23 @@ ebuild_portdir = os.path.realpath( ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-3:]) vdb_path = os.path.realpath(os.path.join(portage.settings['EROOT'], VDB_PATH)) -# Make sure that portdb.findname() returns the correct ebuild. -if ebuild_portdir != vdb_path and \ - ebuild_portdir not in portage.portdb.porttrees: - portdir_overlay = portage.settings.get("PORTDIR_OVERLAY", "") - if sys.hexversion >= 0x300: - os.environ["PORTDIR_OVERLAY"] = \ - portdir_overlay + \ - " " + _shell_quote(ebuild_portdir) - else: - os.environ["PORTDIR_OVERLAY"] = \ - _unicode_encode(portdir_overlay, - encoding=_encodings['content'], errors='strict') + \ - " " + _unicode_encode(_shell_quote(ebuild_portdir), - encoding=_encodings['content'], errors='strict') - - print("Appending %s to PORTDIR_OVERLAY..." % ebuild_portdir) - portage._reset_legacy_globals() - myrepo = None if ebuild_portdir != vdb_path: - myrepo = portage.portdb.getRepositoryName(ebuild_portdir) + myrepo = portage.repository.config._read_repo_name(ebuild_portdir) + if myrepo is None: + err("Repository located in %r has no repository name set in %r or in 'repo-name' attribute in %r" % + (ebuild_portdir, os.path.join(ebuild_portdir, REPO_NAME_LOC), os.path.join(ebuild_portdir, "metadata", "layout.conf"))) + + # Make sure that portdb.findname() returns the correct ebuild. + if ebuild_portdir not in portage.portdb.porttrees: + print("Appending repository '%s' located in '%s' to configuration of repositories" % (myrepo, ebuild_portdir)) + tmp_conf_file = io.StringIO(textwrap.dedent(""" + [%s] + location = %s + """ % (myrepo, ebuild_portdir))) + repositories = portage.repository.config.load_repository_config(portage.settings, extra_files=[tmp_conf_file]) + os.environ["PORTAGE_REPOSITORIES"] = repositories.config_string() + portage._reset_legacy_globals() if not os.path.exists(ebuild): err('%s: does not exist' % (ebuild,)) @@ -198,7 +194,7 @@ else: portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo) if not portage_ebuild or portage_ebuild != ebuild: - err('%s: does not seem to have a valid PORTDIR structure' % (ebuild,)) + err('%s: Invalid structure of repository' % (ebuild,)) if len(pargs) > 1 and "config" in pargs: other_phases = set(pargs)
[gentoo-commits] proj/portage:master commit in: bin/
commit: 3917544bf2cc438b571effd00df8545d51736ffc Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 07:20:07 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 07:20:07 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3917544b bin/socks5-server.py: Fix DeprecationWarning with Python >=3.4.4. asyncio.async() is deprecated in favor of asyncio.ensure_future(). bin/socks5-server.py | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/socks5-server.py b/bin/socks5-server.py index 71e6b01..cfe3ece 100644 --- a/bin/socks5-server.py +++ b/bin/socks5-server.py @@ -10,6 +10,13 @@ import socket import struct import sys +if hasattr(asyncio, 'ensure_future'): + # Python >=3.4.4. + asyncio_ensure_future = asyncio.ensure_future +else: + # getattr() necessary because async is a keyword in Python >=3.7. + asyncio_ensure_future = getattr(asyncio, 'async') + class Socks5Server(object): """ @@ -141,7 +148,7 @@ class Socks5Server(object): # otherwise, start two loops: # remote -> local... - t = asyncio.async(self.handle_proxied_conn( + t = asyncio_ensure_future(self.handle_proxied_conn( proxied_reader, writer, asyncio.Task.current_task())) # and local -> remote...
[gentoo-commits] proj/portage:master commit in: pym/repoman/, pym/portage/repository/, pym/portage/dbapi/, bin/, misc/, ...
commit: 2cde1f65e9c585e78415857fdcac1fe5deaa60da Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 07:12:25 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 07:12:25 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2cde1f65 portage.repository.config: Clean reading of repository names and drop support for repositories with missing or invalid names. bin/emerge-webrsync | 4 +- bin/portageq | 4 + misc/emerge-delta-webrsync | 4 +- pym/_emerge/actions.py | 33 -- pym/portage/dbapi/porttree.py| 4 +- pym/portage/repository/config.py | 229 +-- pym/repoman/repos.py | 6 +- 7 files changed, 113 insertions(+), 171 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 9961ad8..fc5ab95 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Author: Karl Trygve Kalleberg # Rewritten from the old, Perl-based emerge-webrsync script @@ -39,7 +39,7 @@ else eecho "could not find 'portageq'; aborting" exit 1 fi -eval "$("${portageq}" envvar -v DISTDIR EPREFIX FEATURES \ +eval "$(PORTAGE_SYNC_MODE=1 "${portageq}" envvar -v DISTDIR EPREFIX FEATURES \ FETCHCOMMAND GENTOO_MIRRORS \ PORTAGE_BIN_PATH PORTAGE_CONFIGROOT PORTAGE_GPG_DIR \ PORTAGE_NICENESS PORTAGE_REPOSITORIES PORTAGE_RSYNC_EXTRA_OPTS \ diff --git a/bin/portageq b/bin/portageq index 925640b..12886f0 100755 --- a/bin/portageq +++ b/bin/portageq @@ -66,6 +66,10 @@ def uses_eroot(function): function.uses_eroot = True return function +# Workaround until emerge-webrsync and emerge-delta-webrsync are rewritten in Python. +if os.environ.get("PORTAGE_SYNC_MODE") == "1": + portage._sync_mode = True + # global to hold all function docstrings to be used for argparse help. # Avoids python compilation level 2 optimization troubles. docstrings = {} diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync index f2dc822..1cc04bd 100755 --- a/misc/emerge-delta-webrsync +++ b/misc/emerge-delta-webrsync @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Author: Brian Harring , kar...@gentoo.org originally. # Rewritten from the old, Perl-based emerge-webrsync script @@ -36,7 +36,7 @@ else eecho "could not find 'portageq'; aborting" exit 1 fi -eval "$("${portageq}" envvar -v DISTDIR EPREFIX FEATURES \ +eval "$(PORTAGE_SYNC_MODE=1 "${portageq}" envvar -v DISTDIR EPREFIX FEATURES \ FETCHCOMMAND GENTOO_MIRRORS \ PORTAGE_BIN_PATH PORTAGE_CONFIGROOT PORTAGE_GPG_DIR \ PORTAGE_NICENESS PORTAGE_REPOSITORIES PORTAGE_RSYNC_EXTRA_OPTS \ diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index c3b0b98..a080ba4 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2693,38 +2693,6 @@ def expand_set_arguments(myfiles, myaction, root_config): newargs.append(a) return (newargs, retval) -def repo_name_check(trees): - missing_repo_names = set() - for root_trees in trees.values(): - porttree = root_trees.get("porttree") - if porttree: - portdb = porttree.dbapi - missing_repo_names.update(portdb.getMissingRepoNames()) - - # Skip warnings about missing repo_name entries for - # /usr/local/portage (see bug #248603). - try: - missing_repo_names.remove('/usr/local/portage') - except KeyError: - pass - - if missing_repo_names: - msg = [] - msg.append("WARNING: One or more repositories " + \ - "have missing repo_name entries:") - msg.append("") - for p in missing_repo_names: - msg.append("\t%s/profiles/repo_name" % (p,)) - msg.append("") - msg.extend(textwrap.wrap("NOTE: Each repo_name entry " + \ - "should be a plain text file containing a unique " + \ - "name for the repository on the first line.", 70)) - msg.append("\n") - writemsg_level("".join("%s\n" % l for l in msg), - level=logging.WARNING, noiselevel=-1)
[gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/, pym/portage/package/ebuild/, pym/portage/repository/
commit: 10647652ebeff52c3dbc0419ab9030ba76d46122 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 8 06:58:36 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 8 06:58:36 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=10647652 portage.repository.config.RepoConfig: Delete user_location attribute and consistently use location attribute everywhere. pym/portage/package/ebuild/config.py| 4 ++-- pym/portage/repository/config.py| 21 ++--- pym/portage/tests/ebuild/test_config.py | 4 ++-- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 7cf5a4c..b6217e7 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -539,13 +539,13 @@ class config(object): #filling PORTDIR and PORTDIR_OVERLAY variable for compatibility main_repo = self.repositories.mainRepo() if main_repo is not None: - self["PORTDIR"] = main_repo.user_location + self["PORTDIR"] = main_repo.location self.backup_changes("PORTDIR") expand_map["PORTDIR"] = self["PORTDIR"] # repoman controls PORTDIR_OVERLAY via the environment, so no # special cases are needed here. - portdir_overlay = list(self.repositories.repoUserLocationList()) + portdir_overlay = list(self.repositories.repoLocationList()) if portdir_overlay and portdir_overlay[0] == self["PORTDIR"]: portdir_overlay = portdir_overlay[1:] diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index b987b56..b792d78 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -91,8 +91,8 @@ class RepoConfig(object): 'profile_formats', 'sign_commit', 'sign_manifest', 'sync_depth', 'sync_hooks_only_on_change', 'sync_type', 'sync_umask', 'sync_uri', 'sync_user', 'thin_manifest', - 'update_changelog', 'user_location', '_eapis_banned', - '_eapis_deprecated', '_masters_orig', 'module_specific_options', + 'update_changelog', '_eapis_banned', '_eapis_deprecated', + '_masters_orig', 'module_specific_options', ) def __init__(self, name, repo_opts, local_config=True): @@ -189,7 +189,6 @@ class RepoConfig(object): self.format = format location = repo_opts.get('location') - self.user_location = location if location is not None and location.strip(): if os.path.isdir(location) or portage._sync_mode: location = os.path.realpath(location) @@ -410,8 +409,8 @@ class RepoConfig(object): repo_msg.append(self.name) if self.format: repo_msg.append(indent + "format: " + self.format) - if self.user_location: - repo_msg.append(indent + "location: " + self.user_location) + if self.location: + repo_msg.append(indent + "location: " + self.location) if self.sync_type: repo_msg.append(indent + "sync-type: " + self.sync_type) if self.sync_umask: @@ -527,7 +526,7 @@ class RepoConfigLoader(object): old_location == default_portdir): ignored_map.setdefault(repo.name, []).append(old_location) if old_location == portdir: - portdir = repo.user_location + portdir = repo.location if repo.priority is None: if base_priority == 0 and ov == portdir_orig: @@ -826,7 +825,7 @@ class RepoConfigLoader(object): master_repos = [] for master_name in repo.masters: if master_name not in prepos: -
[gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/, pym/portage/package/ebuild/_config/, ...
commit: 48c2af4538d581fb2225c0ac9620b7fcfe4eae2e Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Dec 2 01:16:34 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Dec 2 01:16:34 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=48c2af45 Respect PYTHONDONTWRITEBYTECODE in test suite. pym/portage/package/ebuild/_config/special_env_vars.py | 2 +- pym/portage/tests/dbapi/test_portdb_cache.py | 3 ++- pym/portage/tests/ebuild/test_doebuild_fd_pipes.py | 3 ++- pym/portage/tests/ebuild/test_doebuild_spawn.py| 3 ++- pym/portage/tests/ebuild/test_ipc_daemon.py| 3 ++- pym/portage/tests/emerge/test_config_protect.py| 3 ++- pym/portage/tests/emerge/test_emerge_slot_abi.py | 3 ++- pym/portage/tests/emerge/test_simple.py| 3 ++- pym/portage/tests/repoman/test_simple.py | 3 ++- pym/portage/tests/sync/test_sync_local.py | 3 ++- 10 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py index 8479cf5..9ae53c1 100644 --- a/pym/portage/package/ebuild/_config/special_env_vars.py +++ b/pym/portage/package/ebuild/_config/special_env_vars.py @@ -77,7 +77,7 @@ environ_whitelist += [ "PORTAGE_SIGPIPE_STATUS", "PORTAGE_SOCKS5_PROXY", "PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_USERNAME", "PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE", "PORTAGE_XATTR_EXCLUDE", - "PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", + "PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PYTHONDONTWRITEBYTECODE", "REPLACING_VERSIONS", "REPLACED_BY_VERSION", "ROOT", "ROOTPATH", "T", "TMP", "TMPDIR", "USE_EXPAND", "USE_ORDER", "WORKDIR", diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py index 5ac9b03..bd93446 100644 --- a/pym/portage/tests/dbapi/test_portdb_cache.py +++ b/pym/portage/tests/dbapi/test_portdb_cache.py @@ -1,4 +1,4 @@ -# Copyright 2012-2014 Gentoo Foundation +# Copyright 2012-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import subprocess @@ -134,6 +134,7 @@ class PortdbCacheTestCase(TestCase): "PORTAGE_OVERRIDE_EPREFIX" : eprefix, "PORTAGE_PYTHON" : portage_python, "PORTAGE_REPOSITORIES" : settings.repositories.config_string(), + "PYTHONDONTWRITEBYTECODE" : os.environ.get("PYTHONDONTWRITEBYTECODE", ""), "PYTHONPATH" : pythonpath, } diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py index 61392dd..2a65537 100644 --- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py +++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py @@ -1,4 +1,4 @@ -# Copyright 2013 Gentoo Foundation +# Copyright 2013-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import textwrap @@ -75,6 +75,7 @@ class DoebuildFdPipesTestCase(TestCase): settings.features.add("test") settings['PORTAGE_PYTHON'] = portage._python_interpreter settings['PORTAGE_QUIET'] = "1" + settings['PYTHONDONTWRITEBYTECODE'] = os.environ.get("PYTHONDONTWRITEBYTECODE", "") fake_bin = os.path.join(settings["EPREFIX"], "bin") portage.util.ensure_dirs(fake_bin) diff --git a/pym/portage/tests/ebuild/test_doebuild_spawn.py b/pym/portage/tests/ebuild/test_doebuild_spawn.py index ae9a5c5..6b34465 100644 --- a/pym/portage/tests/ebuild/test_doebuild_spawn.py +++ b/pym/portage/tests/ebuild/test_doebuild_spawn.py @@ -1,4 +1,4 @@ -# Copyright 2010-2012 Gentoo Foundation +# Copyright 2010-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import textwrap @@ -65,6 +65,7 @@ class DoebuildSpawnTestCase(TestCase): settings['PORTAGE_PYTHON'] = _python_interpreter settings['PORTAGE_BUILDDIR'] = os.path.join( settings['PORTAGE_TMPDIR'], cpv) + settings['PYTHONDONTWRITEBYTECODE'] = os.environ.get('PYTHONDONTWRITEBYTECODE', '')
[gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
commit: 528dc7cfa2856c1467759e81c99e35322fbffcce Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 1 17:54:17 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 1 17:54:17 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=528dc7cf portage.package.ebuild.fetch.fetch(): Clean setting of variables. pym/portage/package/ebuild/fetch.py | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pym/portage/package/ebuild/fetch.py b/pym/portage/package/ebuild/fetch.py index 7e4e6fe..1be2800 100644 --- a/pym/portage/package/ebuild/fetch.py +++ b/pym/portage/package/ebuild/fetch.py @@ -1,4 +1,4 @@ -# Copyright 2010-2014 Gentoo Foundation +# Copyright 2010-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -987,10 +987,9 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, } for k in ("DISTDIR", "PORTAGE_SSH_OPTS"): - try: - variables[k] = mysettings[k] - except KeyError: - pass + v = mysettings.get(k) + if v is not None: + variables[k] = v myfetch = shlex_split(locfetch) myfetch = [varexpand(x, mydict=variables) for x in myfetch]
[gentoo-commits] proj/portage:master commit in: pym/portage/repository/, pym/portage/package/ebuild/_config/, man/, ...
commit: 10cccf7e0a1423f77a0962bcd7bf9658d2a15343 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 1 06:49:05 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 1 06:49:05 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=10cccf7e Support environmental variables overriding parts of configuration of repositories. PORTAGE_REPOSITORY:${repository_name}:${attribute} overrides value of given attribute. PORTAGE_ADDED_REPOSITORIES specifies names of repositories added to configuration. PORTAGE_DELETED_REPOSITORIES specifies names of repositories deleted from configuration. man/portage.5 | 19 .../package/ebuild/_config/special_env_vars.py | 13 --- pym/portage/package/ebuild/config.py | 5 +++-- pym/portage/repository/config.py | 25 -- 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/man/portage.5 b/man/portage.5 index c9e70a0..6c41332 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -1,4 +1,4 @@ -.TH "PORTAGE" "5" "Nov 2015" "Portage VERSION" "Portage" +.TH "PORTAGE" "5" "Dec 2015" "Portage VERSION" "Portage" .SH NAME portage \- the heart of Gentoo .SH "DESCRIPTION" @@ -862,9 +862,6 @@ only. .TP .BR repos.conf Specifies \fIsite\-specific\fR repository configuration information. -.br -Configuration specified in \fBrepos.conf\fR can be overriden by \fBPORTAGE_REPOSITORIES\fR -environmental variable, which has the same format as \fBrepos.conf\fR. .I Format: .nf @@ -874,6 +871,20 @@ environmental variable, which has the same format as \fBrepos.conf\fR. \- attributes are specified in "${attribute} = ${value}" format .fi +.I Environmental variables overriding configuration: +.nf +\- \fBPORTAGE_REPOSITORIES\fR overrides full configuration. + Format: Format of repos.conf + Environmental variables described below are ignored when PORTAGE_REPOSITORIES is set. +\- \fBPORTAGE_REPOSITORY:${repository_name}:${attribute}\fR overrides value of given attribute. + Usage of \fBenv\fR(1) tool is needed if ":" character is not supported in names of shell variables. + Example: env PORTAGE_REPOSITORY:gentoo:location=/var/repositories/gentoo emerge ... +\- \fBPORTAGE_ADDED_REPOSITORIES\fR specifies names of repositories added to configuration. + Format: Whitespace\-separated list of names of repositories +\- \fBPORTAGE_DELETED_REPOSITORIES\fR specifies names of repositories deleted from configuration. + Format: Whitespace\-separated list of names of repositories +.fi + .I Attributes supported in DEFAULT section: .RS .RS diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py index 905d5e7..8479cf5 100644 --- a/pym/portage/package/ebuild/_config/special_env_vars.py +++ b/pym/portage/package/ebuild/_config/special_env_vars.py @@ -1,15 +1,18 @@ -# Copyright 2010-2014 Gentoo Foundation +# Copyright 2010-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals __all__ = ( - 'case_insensitive_vars', 'default_globals', 'env_blacklist', \ - 'environ_filter', 'environ_whitelist', 'environ_whitelist_re', + 'case_insensitive_vars', 'default_globals', 'env_blacklist', + 'environ_filter', 'environ_filter_re', 'environ_whitelist', + 'environ_whitelist_re', 'global_only_vars', 'validate_commands' ) import re +from portage.repository.config import _repo_attr_override_var_re + # Blacklisted variables are internal variables that are never allowed # to enter the config instance from the external environment or # configuration files. @@ -157,10 +160,12 @@ environ_filter += [ "FETCHCOMMAND_HTTP", "FETCHCOMMAND_HTTPS", "FETCHCOMMAND_RSYNC", "FETCHCOMMAND_SFTP", "GENTOO_MIRRORS", "NOCONFMEM", "O", + "PORTAGE_ADDED_REPOSITORIES", "PORTAGE_BACKGROUND", "PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BINHOST", "PORTAGE_BINPKG_FORMAT", "PORTAGE_BUILDDIR_LOCKED", "PORTAGE_CHECKSUM_FILTER", + "PORTAGE_DELETED_REPOSITORIES", "PORTAGE_ELOG_CLASSES", "PORTAGE_ELOG_MAILFROM", "PORTAGE_ELOG_MAILSUBJECT", "PORTAGE_ELOG_MAILURI", "PORTAGE_ELOG_SYSTEM", @@ -190,6 +195,8 @@ environ_filter += [ environ_filter = frozenset(e
[gentoo-commits] proj/portage:master commit in: pym/_emerge/, pym/portage/package/ebuild/, pym/portage/dep/
commit: 39d81c514c33733209963110d90ae88020ffcf7d Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 1 02:36:48 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 1 02:36:48 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=39d81c51 portage.package.ebuild.config.config.__getitem__(): Partially drop backward compatibility for nonexistent keys. For nonexistent keys: - When called by Portage scripts, raise KeyError. - When called by third-party code, print deprecation warning and continue returning "". pym/_emerge/actions.py | 6 +++--- pym/portage/dep/dep_check.py | 6 -- pym/portage/package/ebuild/config.py | 29 - 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 54e99c1..c3b0b98 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1580,7 +1580,7 @@ def action_info(settings, trees, myopts, myfiles): chost = settings.get("CHOST") append(getportageversion(settings["PORTDIR"], None, - settings.profile_path, settings["CHOST"], + settings.profile_path, chost, trees[settings['EROOT']]["vartree"].dbapi)) header_width = 65 @@ -2810,7 +2810,7 @@ def run_action(emerge_config): adjust_configs(emerge_config.opts, emerge_config.trees) apply_priorities(emerge_config.target_config.settings) - for fmt in emerge_config.target_config.settings["PORTAGE_BINPKG_FORMAT"].split(): + for fmt in emerge_config.target_config.settings.get("PORTAGE_BINPKG_FORMAT", "").split(): if not fmt in portage.const.SUPPORTED_BINPKG_FORMATS: if "--pkg-format" in emerge_config.opts: problematic="--pkg-format" @@ -2827,7 +2827,7 @@ def run_action(emerge_config): emerge_config.target_config.settings["PORTDIR"], None, emerge_config.target_config.settings.profile_path, - emerge_config.target_config.settings["CHOST"], + emerge_config.target_config.settings.get("CHOST"), emerge_config.target_config.trees['vartree'].dbapi) + '\n', noiselevel=-1) return 0 diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index 69b358c..9af4e65 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -653,10 +653,12 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, # matchall behavior to account for profile use.mask/force. The # ARCH/archlist code here may be redundant, since the profile # really should be handling ARCH masking/forcing itself. + arch = mysettings.get("ARCH") mymasks.update(mysettings.usemask) mymasks.update(mysettings.archlist()) - mymasks.discard(mysettings["ARCH"]) - useforce.add(mysettings["ARCH"]) + if arch: + mymasks.discard(arch) + useforce.add(arch) useforce.update(mysettings.useforce) useforce.difference_update(mymasks) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 1827043..da9a936 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1,4 +1,4 @@ -# Copyright 2010-2014 Gentoo Foundation +# Copyright 2010-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -15,6 +15,7 @@ import platform import pwd import re import sys +import traceback import warnings from _emerge.Package import Package @@ -1257,13 +1258,13 @@ class config(object): use = frozenset(settings['PORTAGE_USE'].split()) values['ACCEPT_LICENSE'] = settings._license_manager.get_prunned_accept_license( \ - settings.mycpv, use, settings['LICENSE'], settings['SLOT'], settings.get('PORTAGE_REPO_NAME')) + settings.mycpv, use, settings.get('LICENSE', ''), settings.get('SLOT'), settings.get('PORTAGE_REPO_NAME')) values['PORTAGE_RESTRICT'] = self._restrict(use, settings) return values def _restrict(self, use, sett
[gentoo-commits] proj/portage:master commit in: bin/
commit: 4f25fa69e4a57785163345b1f4cace62daad5fea Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Dec 1 00:27:04 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Dec 1 00:27:04 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4f25fa69 ebuild: Move imports to the top. bin/ebuild | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index ed1231f..1f99177 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -8,6 +8,8 @@ import argparse import platform import signal import sys +import textwrap + # This block ensures that ^C interrupts are handled quietly. try: @@ -49,7 +51,9 @@ from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode from portage.const import VDB_PATH -from portage.exception import PortageKeyError +from portage.exception import PermissionDenied, PortageKeyError, \ + PortagePackageException, UnsupportedAPIException +import portage.util from _emerge.Package import Package from _emerge.RootConfig import RootConfig @@ -96,8 +100,6 @@ if not opts.ignore_default_opts: debug = opts.debug force = opts.force -import portage.util, portage.const - # do this _after_ 'import portage' to prevent unnecessary tracing if debug and "python-trace" in portage.features: import portage.debug @@ -305,8 +307,7 @@ def stale_env_warning(): msg = ("Existing ${T}/environment for '%s' will be sourced. " + \ "Run 'clean' to start with a fresh environment.") % \ (tmpsettings["PF"], ) - from textwrap import wrap - msg = wrap(msg, 70) + msg = textwrap.wrap(msg, 70) for x in msg: portage.writemsg(">>> %s\n" % x) @@ -314,9 +315,6 @@ def stale_env_warning(): open(os.path.join(tmpsettings['PORTAGE_BUILDDIR'], '.ebuild_changed'), 'w').close() -from portage.exception import PermissionDenied, \ - PortagePackageException, UnsupportedAPIException - if 'digest' in tmpsettings.features: if pargs and pargs[0] not in ("digest", "manifest"): pargs = ['digest'] + pargs @@ -345,8 +343,7 @@ for arg in pargs: # aux_get error a = 1 except UnsupportedAPIException as e: - from textwrap import wrap - msg = wrap(str(e), 70) + msg = textwrap.wrap(str(e), 70) del e for x in msg: portage.writemsg("!!! %s\n" % x, noiselevel=-1)
[gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_config/
commit: 5ea789a0e740303858f8f8a72dc538eb87d6df1c Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Nov 30 23:25:42 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Nov 30 23:25:42 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ea789a0 portage.package.ebuild._config.LicenseManager.LicenseManager._getPkgAcceptLicense(): Fix typo in call to hasattr(). pym/portage/package/ebuild/_config/LicenseManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/package/ebuild/_config/LicenseManager.py b/pym/portage/package/ebuild/_config/LicenseManager.py index f76e7e2..1d4e082 100644 --- a/pym/portage/package/ebuild/_config/LicenseManager.py +++ b/pym/portage/package/ebuild/_config/LicenseManager.py @@ -1,4 +1,4 @@ -# Copyright 201-2012 Gentoo Foundation +# Copyright 2010-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ( @@ -119,7 +119,7 @@ class LicenseManager(object): cp = cpv_getkey(cpv) cpdict = self._plicensedict.get(cp) if cpdict: - if not hasattr(cpv, slot): + if not hasattr(cpv, "slot"): cpv = _pkg_str(cpv, slot=slot, repo=repo) plicence_list = ordered_by_atom_specificity(cpdict, cpv) if plicence_list:
[gentoo-commits] proj/portage:master commit in: pym/portage/, bin/, pym/portage/dbapi/
commit: 3ffdbbe06fab5f3c60d03a77f5a2d08cb94b1869 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Nov 30 23:06:18 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Nov 30 23:06:18 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3ffdbbe0 ebuild: Do not catch unexpected KeyErrors from aux_get(). bin/ebuild| 5 +++-- pym/portage/dbapi/porttree.py | 20 ++-- pym/portage/exception.py | 5 - 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/bin/ebuild b/bin/ebuild index 59fced0..ed1231f 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -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 from __future__ import print_function @@ -49,6 +49,7 @@ from portage import _shell_quote from portage import _unicode_decode from portage import _unicode_encode from portage.const import VDB_PATH +from portage.exception import PortageKeyError from _emerge.Package import Package from _emerge.RootConfig import RootConfig @@ -273,7 +274,7 @@ try: metadata = dict(zip(Package.metadata_keys, portage.db[portage.settings['EROOT']][mytree].dbapi.aux_get( cpv, Package.metadata_keys, myrepo=myrepo))) -except KeyError: +except PortageKeyError: # aux_get failure, message should have been shown on stderr. sys.exit(1) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index a954de5..23f3169 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -1,4 +1,4 @@ -# Copyright 1998-2014 Gentoo Foundation +# Copyright 1998-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -23,7 +23,7 @@ from portage.cache import volatile from portage.cache.cache_errors import CacheError from portage.cache.mappings import Mapping from portage.dbapi import dbapi -from portage.exception import PortageException, \ +from portage.exception import PortageException, PortageKeyError, \ FileNotFound, InvalidAtom, InvalidData, \ InvalidDependString, InvalidPackageName from portage.localization import _ @@ -435,7 +435,7 @@ class portdbapi(dbapi): writemsg(_("!!! aux_get(): ebuild for " \ "'%s' does not exist at:\n") % (cpv,), noiselevel=-1) writemsg("!!!%s\n" % ebuild_path, noiselevel=-1) - raise KeyError(cpv) + raise PortageKeyError(cpv) # Pull pre-generated metadata from the metadata/cache/ # directory if it exists and is valid, otherwise fall @@ -481,12 +481,12 @@ class portdbapi(dbapi): def aux_get(self, mycpv, mylist, mytree=None, myrepo=None): "stub code for returning auxilliary db information, such as SLOT, DEPEND, etc." 'input: "sys-apps/foo-1.0",["SLOT","DEPEND","HOMEPAGE"]' - 'return: ["0",">=sys-libs/bar-1.0","http://www.foo.com";] or raise KeyError if error' + 'return: ["0",">=sys-libs/bar-1.0","http://www.foo.com";] or raise PortageKeyError if error' cache_me = False if myrepo is not None: mytree = self.treemap.get(myrepo) if mytree is None: - raise KeyError(myrepo) + raise PortageKeyError(myrepo) if mytree is not None and len(self.porttrees) == 1 \ and mytree == self.porttrees[0]: @@ -507,22 +507,22 @@ class portdbapi(dbapi): try: cat, pkg = mycpv.split("/", 1) except ValueError: - # Missing slash. Can't find ebuild so raise KeyError. - raise KeyError(mycpv) + # Missing slash. Can't find ebuild so raise PortageKeyError. + raise PortageKeyError(mycpv) myebuild, mylocation = self.findname2(mycpv, mytree) if not myebuild: writemsg("!!! aux_get(): %s\n" % \ _("ebuild not found for '%s'") % mycpv, noiselevel=1) - raise KeyError(mycpv) + raise PortageKeyError(mycpv) mydata, ebuild_hash = self._pull_valid_cache(mycpv, myebuild, mylocation) doregen = mydata is None
[gentoo-commits] proj/portage:master commit in: bin/
commit: b8da04b86fdde6e2137dad51dc5917ef49c91a4a Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Nov 25 12:49:19 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Nov 25 12:49:19 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b8da04b8 portageq envvar: Return 1 for any nonexistent variable. bin/portageq | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/portageq b/bin/portageq index 548d090..925640b 100755 --- a/bin/portageq +++ b/bin/portageq @@ -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 from __future__ import print_function, unicode_literals @@ -800,15 +800,25 @@ def envvar(argv): print("ERROR: insufficient parameters!") return 2 + exit_status = 0 + for arg in argv: if arg in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"): print("WARNING: 'portageq envvar %s' is deprecated. Use any of " "'get_repos, get_repo_path, repos_config' instead." % arg, file=sys.stderr) + + value = portage.settings.get(arg) + if value is None: + value = "" + exit_status = 1 + if verbose: - print(arg + "=" + portage._shell_quote(portage.settings[arg])) + print(arg + "=" + portage._shell_quote(value)) else: - print(portage.settings[arg]) + print(value) + + return exit_status docstrings['envvar'] = """+ Returns a specific environment variable as exists prior to ebuild.sh.
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: 53a0b6369d7dc7aaaece82ee1d4a7cb9bcd37658 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Nov 25 12:40:26 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Nov 25 12:40:26 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=53a0b636 _emerge.actions.getgccversion(): Work with chost=None and with no explicit chost. chost="" was already sometimes passed to this function. pym/_emerge/actions.py | 51 +- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index e03e8d4..54e99c1 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1,4 +1,4 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import division, print_function, unicode_literals @@ -2393,7 +2393,7 @@ def load_emerge_config(emerge_config=None, **kargs): return emerge_config -def getgccversion(chost): +def getgccversion(chost=None): """ rtype: C{str} return: the current in-use gcc version @@ -2408,30 +2408,31 @@ def getgccversion(chost): "!!! other terminals also.\n" ) - try: - proc = subprocess.Popen(["gcc-config", "-c"], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - except OSError: - myoutput = None - mystatus = 1 - else: - myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n") - mystatus = proc.wait() - if mystatus == os.EX_OK and myoutput.startswith(chost + "-"): - return myoutput.replace(chost + "-", gcc_ver_prefix, 1) + if chost: + try: + proc = subprocess.Popen(["gcc-config", "-c"], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + except OSError: + myoutput = None + mystatus = 1 + else: + myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n") + mystatus = proc.wait() + if mystatus == os.EX_OK and myoutput.startswith(chost + "-"): + return myoutput.replace(chost + "-", gcc_ver_prefix, 1) - try: - proc = subprocess.Popen( - [chost + "-" + gcc_ver_command[0]] + gcc_ver_command[1:], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - except OSError: - myoutput = None - mystatus = 1 - else: - myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n") - mystatus = proc.wait() - if mystatus == os.EX_OK: - return gcc_ver_prefix + myoutput + try: + proc = subprocess.Popen( + [chost + "-" + gcc_ver_command[0]] + gcc_ver_command[1:], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + except OSError: + myoutput = None + mystatus = 1 + else: + myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n") + mystatus = proc.wait() + if mystatus == os.EX_OK: + return gcc_ver_prefix + myoutput try: proc = subprocess.Popen(gcc_ver_command,
[gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/cvs/
commit: 628aa100a480dfcb5fe0edeb1fcd6ea6f4b933a2 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Tue Nov 24 02:43:28 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Tue Nov 24 02:43:28 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=628aa100 portage.sync.modules.cvs.CheckCVSConfig.check_cvs_repo(): Fix "KeyError: 'sync-cvs-repo'". pym/portage/sync/modules/cvs/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/sync/modules/cvs/__init__.py b/pym/portage/sync/modules/cvs/__init__.py index 952053a..0cf6067 100644 --- a/pym/portage/sync/modules/cvs/__init__.py +++ b/pym/portage/sync/modules/cvs/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2014 Gentoo Foundation +# Copyright 2014-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 doc = """CVS plug-in module for portage. @@ -18,7 +18,7 @@ class CheckCVSConfig(CheckSyncConfig): def check_cvs_repo(self): - if self.repo.module_specific_options['sync-cvs-repo'] is None: + if self.repo.module_specific_options.get('sync-cvs-repo') is None: writemsg_level("!!! %s\n" % _("Repository '%s' has sync-type=cvs, but is missing sync-cvs-repo attribute") % self.repo.name, level=self.logger.ERROR, noiselevel=-1)
[gentoo-commits] proj/portage:master commit in: pym/portage/repository/
commit: f05056c147fef34531632bbfca908a4a71efb3f7 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Nov 23 21:09:21 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Nov 23 21:09:21 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f05056c1 portage.repository.config.RepoConfigLoader._parse(): Delete unused portdir parametre. pym/portage/repository/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 977bb43..a21c891 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -546,7 +546,7 @@ class RepoConfigLoader(object): return portdir @staticmethod - def _parse(paths, prepos, local_config, portdir, default_opts): + def _parse(paths, prepos, local_config, default_opts): """Parse files in paths to load config""" parser = SafeConfigParser(defaults=default_opts) @@ -642,7 +642,7 @@ class RepoConfigLoader(object): settings.get("PORTAGE_RSYNC_EXTRA_OPTS", None) try: - self._parse(paths, prepos, settings.local_config, portdir, default_opts) + self._parse(paths, prepos, settings.local_config, default_opts) except ConfigParserError as e: writemsg( _("!!! Error while reading repo config file: %s\n") % e,
[gentoo-commits] proj/portage:master commit in: pym/portage/repository/
commit: 041fc702c296a80a1eb60b4ae34e18030feafe8e Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Nov 23 20:47:06 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Nov 23 20:47:06 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=041fc702 portage.repository.config.RepoConfigLoader._add_repositories(): Delete unused ignored_location_map parametre. pym/portage/repository/config.py | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 2ba03f0..977bb43 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -454,7 +454,7 @@ class RepoConfigLoader(object): @staticmethod def _add_repositories(portdir, portdir_overlay, prepos, - ignored_map, ignored_location_map, local_config, default_portdir): + ignored_map, local_config, default_portdir): """Add overlays in PORTDIR_OVERLAY as repositories""" overlays = [] portdir_orig = None @@ -524,7 +524,6 @@ class RepoConfigLoader(object): not (base_priority == 0 and old_location == default_portdir): ignored_map.setdefault(repo.name, []).append(old_location) - ignored_location_map[old_location] = repo.name if old_location == portdir: portdir = repo.user_location @@ -621,7 +620,6 @@ class RepoConfigLoader(object): location_map = {} treemap = {} ignored_map = {} - ignored_location_map = {} default_opts = { "EPREFIX" : settings["EPREFIX"], "EROOT" : settings["EROOT"], @@ -664,7 +662,7 @@ class RepoConfigLoader(object): # If PORTDIR_OVERLAY contains a repo with the same repo_name as # PORTDIR, then PORTDIR is overridden. portdir = self._add_repositories(portdir, portdir_overlay, prepos, - ignored_map, ignored_location_map, settings.local_config, + ignored_map, settings.local_config, default_portdir) if portdir and portdir.strip(): portdir = os.path.realpath(portdir)
[gentoo-commits] proj/portage:master commit in: pym/portage/repository/
commit: c1a2714c5e5d6d3fdda5594c6e5997e769552185 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Nov 23 20:37:55 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Nov 23 20:37:55 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c1a2714c portage.repository.config.RepoConfigLoader._parse(): Delete unused ignored_map and ignored_location_map parametres. pym/portage/repository/config.py | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index ffb4544..2ba03f0 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -547,7 +547,7 @@ class RepoConfigLoader(object): return portdir @staticmethod - def _parse(paths, prepos, ignored_map, ignored_location_map, local_config, portdir, default_opts): + def _parse(paths, prepos, local_config, portdir, default_opts): """Parse files in paths to load config""" parser = SafeConfigParser(defaults=default_opts) @@ -644,9 +644,7 @@ class RepoConfigLoader(object): settings.get("PORTAGE_RSYNC_EXTRA_OPTS", None) try: - self._parse(paths, prepos, ignored_map, - ignored_location_map, settings.local_config, - portdir, default_opts) + self._parse(paths, prepos, settings.local_config, portdir, default_opts) except ConfigParserError as e: writemsg( _("!!! Error while reading repo config file: %s\n") % e, @@ -659,8 +657,6 @@ class RepoConfigLoader(object): {}, local_config=settings.local_config) location_map.clear() treemap.clear() - ignored_map.clear() - ignored_location_map.clear() default_portdir = os.path.join(os.sep, settings['EPREFIX'].lstrip(os.sep), 'usr', 'portage')
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: ccb1377a18ce8addb21000b0009e360c2641aa8c Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Fri Nov 13 21:50:22 2015 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Fri Nov 13 21:50:22 2015 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ccb1377a _emerge.main.emerge_main(): Make locale variables from configuration files affect locale of emerge process. pym/_emerge/main.py | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index e75bb0a..5a8b93c 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1072,7 +1072,7 @@ def emerge_main(args=None): # Use system locale. try: - locale.setlocale(locale.LC_ALL, '') + locale.setlocale(locale.LC_ALL, "") except locale.Error as e: writemsg_level("setlocale: %s\n" % e, level=logging.WARN) @@ -1144,6 +1144,19 @@ def emerge_main(args=None): os.umask(0o22) emerge_config = load_emerge_config( action=myaction, args=myfiles, opts=myopts) + + # Make locale variables from configuration files (make.defaults, make.conf) affect locale of emerge process. + for locale_var_name in ("LANGUAGE", "LC_ALL", "LC_ADDRESS", "LC_COLLATE", "LC_CTYPE", + "LC_IDENTIFICATION", "LC_MEASUREMENT", "LC_MESSAGES", "LC_MONETARY", + "LC_NAME", "LC_NUMERIC", "LC_PAPER", "LC_TELEPHONE", "LC_TIME", "LANG"): + locale_var_value = emerge_config.running_config.settings.get(locale_var_name) + if locale_var_value is not None: + os.environ.setdefault(locale_var_name, locale_var_value) + try: + locale.setlocale(locale.LC_ALL, "") + except locale.Error as e: + writemsg_level("setlocale: %s\n" % e, level=logging.WARN) + rval = profile_check(emerge_config.trees, emerge_config.action) if rval != os.EX_OK: return rval
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: 6370873af5844fa7e76ddb603a3cad17cff99eae Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Dec 21 23:09:54 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sun Dec 21 23:09:54 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6370873a Fix "TabError: inconsistent use of tabs and spaces in indentation" with Python 3. Regression was introduced in commit 17bc89c5db424c3f04af28a1da5bf90a943ac368. --- pym/_emerge/depgraph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 67e4b4e..28abea4 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -9059,7 +9059,7 @@ def show_mask_docs(): def show_blocker_docs_link(): writemsg("\nFor more information about " + bad("Blocked Packages") + ", please refer to the following\n", noiselevel=-1) writemsg("section of the Gentoo Linux x86 Handbook (architecture is irrelevant):\n\n", noiselevel=-1) - writemsg("https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage#Blocked_packages\n\n";, noiselevel=-1) + writemsg("https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage#Blocked_packages\n\n";, noiselevel=-1) def get_masking_status(pkg, pkgsettings, root_config, myrepo=None, use=None): return [mreason.message for \
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: d7c0bd69cc7d4ac9b1b45f1b30e07019bd716bd6 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Dec 15 16:28:16 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Dec 15 16:28:16 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d7c0bd69 emerge --info: Check metadata/timestamp.chk in all repositories. 1 use of deprecated PORTDIR has been deleted. --- pym/_emerge/actions.py | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 8050f61..d393c78 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1452,6 +1452,7 @@ def action_info(settings, trees, myopts, myfiles): vardb = trees[eroot]["vartree"].dbapi portdb = trees[eroot]['porttree'].dbapi bindb = trees[eroot]["bintree"].dbapi + repos = portdb.settings.repositories for x in myfiles: any_match = False cp_exists = bool(vardb.match(x.cp)) @@ -1554,13 +1555,10 @@ def action_info(settings, trees, myopts, myfiles): line += ",%10d free" % (vm_info["swap.free"] // 1024,) append(line) - lastSync = portage.grabfile(os.path.join( - settings["PORTDIR"], "metadata", "timestamp.chk")) - if lastSync: - lastSync = lastSync[0] - else: - lastSync = "Unknown" - append("Timestamp of tree: %s" % (lastSync,)) + for repo in repos: + last_sync = portage.grabfile(os.path.join(repo.location, "metadata", "timestamp.chk")) + if last_sync: + append("Timestamp of repository %s: %s" % (repo.name, last_sync[0])) # Searching contents for the /bin/sh provider is somewhat # slow. Therefore, use the basename of the symlink target @@ -1707,7 +1705,6 @@ def action_info(settings, trees, myopts, myfiles): append("%s %s" % \ ((cp + ":").ljust(cp_max_len + 1), versions)) - repos = portdb.settings.repositories append("Repositories:\n") for repo in repos: append(repo.info_string())
[gentoo-commits] proj/portage:master commit in: pym/portage/tests/dbapi/
commit: c953151486b3cf92d931affc7fd3bb0b4fbe1a43 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Dec 15 16:26:23 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Dec 15 16:26:23 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c9531514 portage.tests.dbapi.test_portdb_cache: Delete deprecated code. 9 calls to deprecated portage.repository.config.RepoConfigLoader.mainRepoLocation() function have been deleted. --- pym/portage/tests/dbapi/test_portdb_cache.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py index f08d0f8..5ac9b03 100644 --- a/pym/portage/tests/dbapi/test_portdb_cache.py +++ b/pym/portage/tests/dbapi/test_portdb_cache.py @@ -47,7 +47,7 @@ class PortdbCacheTestCase(TestCase): (lambda: not os.path.exists(md5_cache_dir),), python_cmd + (textwrap.dedent(""" import os, sys, portage - if portage.portdb.repositories.mainRepoLocation() in portage.portdb._pregen_auxdb: + if portage.portdb.repositories['test_repo'].location in portage.portdb._pregen_auxdb: sys.exit(1) """),), @@ -56,13 +56,13 @@ class PortdbCacheTestCase(TestCase): (lambda: os.path.exists(md5_cache_dir),), python_cmd + (textwrap.dedent(""" import os, sys, portage - if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb: + if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb: sys.exit(1) """),), python_cmd + (textwrap.dedent(""" import os, sys, portage from portage.cache.flat_hash import md5_database - if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories.mainRepoLocation()], md5_database): + if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories['test_repo'].location], md5_database): sys.exit(1) """),), @@ -73,13 +73,13 @@ class PortdbCacheTestCase(TestCase): (lambda: os.path.exists(md5_cache_dir),), python_cmd + (textwrap.dedent(""" import os, sys, portage - if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb: + if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb: sys.exit(1) """),), python_cmd + (textwrap.dedent(""" import os, sys, portage from portage.cache.flat_hash import md5_database - if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories.mainRepoLocation()], md5_database): + if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories['test_repo'].location], md5_database): sys.exit(1) """),), @@ -90,13 +90,13 @@ class PortdbCacheTestCase(TestCase): ("cache-formats = pms md5-dict", layout_conf_path,, (portage_python, "-b", "-Wd", "-Wi::DeprecationWarning", "-c") + (textwrap.dedent(""" import os, sys, portage - if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb: + if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb: sys.exit(1) """),), (portage_python, "-b", "-Wd", "-Wi::DeprecationWarning", "-c") + (textwrap.dedent(""" import os, sys, portage from portage.cache.metadata import database as pms_d
[gentoo-commits] proj/portage:master commit in: bin/
commit: 57bae253674a5e0ed215f94e10eb3cc0061ae53a Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Dec 15 16:23:03 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Dec 15 16:23:03 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=57bae253 portageq pquery: Search ebuilds in all repositories be default. --all-repos option is no longer supported. 1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() function has been deleted. --- bin/portageq | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/bin/portageq b/bin/portageq index 2c4f548..8deeb8a 100755 --- a/bin/portageq +++ b/bin/portageq @@ -1075,14 +1075,10 @@ def pquery(parser, opts, args): herds.extend(x.split(",")) xml_matchers.append(HerdMatcher(herds)) - repos = [] - if opts.all_repos: - repos.extend(portdb.repositories.get_repo_for_location(location) - for location in portdb.porttrees) - elif opts.repo is not None: - repos.append(portdb.repositories[opts.repo]) + if opts.repo is not None: + repos = [portdb.repositories[opts.repo]] else: - repos.append(portdb.repositories.mainRepo()) + repos = list(portdb.repositories) if not atoms: names = None @@ -1220,12 +1216,8 @@ def add_pquery_arguments(parser): }, { "longopt": "--repo", - "help": "repo to use (default is PORTDIR if omitted)" + "help": "repository to use (all repositories are used by default)" }, - { - "longopt": "--all-repos", - "help": "search all repos" - } ) ), (
[gentoo-commits] proj/portage:master commit in: pym/portage/tests/glsa/
commit: cd0ca6c558cbe6bdada311f4302f28c2dbec1f0f Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Dec 15 16:27:13 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Dec 15 16:27:13 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cd0ca6c5 portage.tests.glsa.test_security_set: Delete deprecated code. 1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepoLocation() function has been deleted. --- pym/portage/tests/glsa/test_security_set.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pym/portage/tests/glsa/test_security_set.py b/pym/portage/tests/glsa/test_security_set.py index bf1f82b..e73deab 100644 --- a/pym/portage/tests/glsa/test_security_set.py +++ b/pym/portage/tests/glsa/test_security_set.py @@ -1,4 +1,4 @@ -# Copyright 2013 Gentoo Foundation +# Copyright 2013-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -129,8 +129,7 @@ class SecuritySetTestCase(TestCase): try: portdb = playground.trees[playground.eroot]["porttree"].dbapi - glsa_dir = os.path.join( - portdb.repositories.mainRepoLocation(), 'metadata', 'glsa') + glsa_dir = os.path.join(portdb.repositories['test_repo'].location, 'metadata', 'glsa') portage.util.ensure_dirs(glsa_dir) for glsa in glsas: with io.open(os.path.join(glsa_dir,
[gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/
commit: f63db9a4598b5a49a989b9176a5c86fa4a70c3c2 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Dec 15 16:24:01 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Dec 15 16:24:01 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f63db9a4 portage.dbapi.bintree.binarytree: Delete main-repository-reliant microoptimization in index of binary packages. This microoptimization cannot work when no main repository exists. 1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() function has been deleted. --- pym/portage/dbapi/bintree.py | 10 -- 1 file changed, 10 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index b56c8c1..d7c7f95 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -360,16 +360,6 @@ class binarytree(object): "repository" : "", } - # It is especially important to populate keys like - # "repository" that save space when entries can - # inherit them from the header. If an existing - # pkgindex header already defines these keys, then - # they will appropriately override our defaults. - main_repo = self.settings.repositories.mainRepo() - if main_repo is not None and not main_repo.missing_repo_name: - self._pkgindex_default_header_data["repository"] = \ - main_repo.name - self._pkgindex_translated_keys = ( ("DESCRIPTION" , "DESC"), ("repository", "REPO"),
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: 39450d061e7de0756449466ba3d601b16ab6aae6 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sat Dec 13 14:48:41 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sat Dec 13 14:48:41 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=39450d06 emerge --info: Always print ::repository. 1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() function has been deleted. --- pym/_emerge/actions.py | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 28a69ee..8050f61 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -42,7 +42,7 @@ from portage.const import GLOBAL_CONFIG_PATH, VCS_DIRS, _DEPCLEAN_LIB_CHECK_DEFA from portage.const import SUPPORTED_BINPKG_FORMATS, TIMESTAMP_FORMAT from portage.dbapi.dep_expand import dep_expand from portage.dbapi._expand_new_virt import expand_new_virt -from portage.dep import Atom +from portage.dep import Atom, _repo_separator, _slot_separator from portage.eclass_cache import hashed_path from portage.exception import InvalidAtom, InvalidData, ParseError from portage.output import blue, colorize, create_color_func, darkgreen, \ @@ -1668,9 +1668,6 @@ def action_info(settings, trees, myopts, myfiles): myvars = sorted(set(atoms)) - main_repo = portdb.repositories.mainRepo() - if main_repo is not None: - main_repo = main_repo.name cp_map = {} cp_max_len = 0 @@ -1692,12 +1689,10 @@ def action_info(settings, trees, myopts, myfiles): if len(matched_cp) > cp_max_len: cp_max_len = len(matched_cp) repo = vardb.aux_get(cpv, ["repository"])[0] - if repo == main_repo: - repo_suffix = "" - elif not repo: - repo_suffix = "::" + if repo: + repo_suffix = _repo_separator + repo else: - repo_suffix = "::" + repo + repo_suffix = _repo_separator + "" if matched_cp == orig_atom.cp: provide_suffix = "" @@ -1826,13 +1821,13 @@ def action_info(settings, trees, myopts, myfiles): if pkg_type == "installed": append("\n%s was built with the following:" % \ - colorize("INFORM", str(pkg.cpv))) + colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo))) elif pkg_type == "ebuild": - append("\n%s would be build with the following:" % \ - colorize("INFORM", str(pkg.cpv))) + append("\n%s would be built with the following:" % \ + colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo))) elif pkg_type == "binary": append("\n%s (non-installed binary) was built with the following:" % \ - colorize("INFORM", str(pkg.cpv))) + colorize("INFORM", str(pkg.cpv + _repo_separator + pkg.repo))) append('%s' % pkg_use_display(pkg, myopts)) if pkg_type == "installed": @@ -2015,10 +2010,10 @@ def action_uninstall(settings, trees, ldpath_mtimes, atom = "=" + atom + "-" + \ portage.versions.cpv_getversion(cpv) if ext_atom.slot: - atom += ":" + ext_atom.slot + atom += _slot_separator + ext_atom.slot require_metadata = True if ext_atom.repo: - atom += "::" + ext_atom.repo + atom += _repo_separator + ext_atom.repo require_metadata = True atom = Atom(atom, allow_repo=True)
[gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/
commit: c2577dc8d625fae4a573b2d89a58951498fbd0f6 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sat Dec 13 14:49:39 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sat Dec 13 14:49:39 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2577dc8 emerge --verbose --quiet-repo-display: Delete deprecated code. Use portage.repository.config.RepoConfigLoader.__iter__() instead of deprecated PORTDIR and PORTDIR_OVERLAY. 1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepoLocation() function has been deleted. --- pym/_emerge/resolver/output_helpers.py | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/pym/_emerge/resolver/output_helpers.py b/pym/_emerge/resolver/output_helpers.py index eb8d97d..70f7bc0 100644 --- a/pym/_emerge/resolver/output_helpers.py +++ b/pym/_emerge/resolver/output_helpers.py @@ -21,7 +21,7 @@ from portage.localization import localized_size from portage.output import (blue, bold, colorize, create_color_func, green, red, teal, turquoise, yellow) bad = create_color_func("BAD") -from portage.util import shlex_split, writemsg +from portage.util import writemsg from portage.util.SlotObject import SlotObject from portage.versions import catpkgsplit @@ -39,24 +39,13 @@ class _RepoDisplay(object): self._unknown_repo = False repo_paths = set() for root_config in roots.values(): - portdir = root_config.settings.get("PORTDIR") - if portdir: - repo_paths.add(portdir) - overlays = root_config.settings.get("PORTDIR_OVERLAY") - if overlays: - repo_paths.update(shlex_split(overlays)) + for repo in root_config.settings.repositories: + repo_paths.add(repo.location) repo_paths = list(repo_paths) self._repo_paths = repo_paths self._repo_paths_real = [ os.path.realpath(repo_path) \ for repo_path in repo_paths ] - # pre-allocate index for PORTDIR so that it always has index 0. - for root_config in roots.values(): - portdb = root_config.trees["porttree"].dbapi - portdir = portdb.repositories.mainRepoLocation() - if portdir: - self.repoStr(portdir) - def repoStr(self, repo_path_real): real_index = -1 if repo_path_real: @@ -80,7 +69,7 @@ class _RepoDisplay(object): shown_repos = self._shown_repos unknown_repo = self._unknown_repo if shown_repos or self._unknown_repo: - output.append("Portage tree and overlays:\n") + output.append("Repositories:\n") show_repo_paths = list(shown_repos) for repo_path, repo_index in shown_repos.items(): show_repo_paths[repo_index] = repo_path
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: a34a05bd5dbbdb3e37682089c2cbb183db9bcb8a Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sat Dec 13 07:03:57 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sat Dec 13 07:03:57 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a34a05bd emerge --info: Modernize output of configuration of repositories. - Always print detailed configuration of repositories. - Always skip PORTAGE_REPOSITORIES variable. - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables. --- pym/_emerge/actions.py | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 0ae2c16..28a69ee 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -1713,13 +1713,9 @@ def action_info(settings, trees, myopts, myfiles): ((cp + ":").ljust(cp_max_len + 1), versions)) repos = portdb.settings.repositories - if "--verbose" in myopts: - append("Repositories:\n") - for repo in repos: - append(repo.info_string()) - else: - append("Repositories: %s" % \ - " ".join(repo.name for repo in repos)) + append("Repositories:\n") + for repo in repos: + append(repo.info_string()) installed_sets = sorted(s for s in root_config.sets['selected'].getNonAtoms() if s.startswith(SETPREFIX)) @@ -1732,8 +1728,8 @@ def action_info(settings, trees, myopts, myfiles): myvars = list(settings) else: myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK', - 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', - 'PORTDIR_OVERLAY', 'PORTAGE_BUNZIP2_COMMAND', + 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', + 'PORTAGE_BUNZIP2_COMMAND', 'PORTAGE_BZIP2_COMMAND', 'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS', 'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'FEATURES', @@ -1745,11 +1741,18 @@ def action_info(settings, trees, myopts, myfiles): 'PORTAGE_BZIP2_COMMAND' : 'bzip2', } - myvars = portage.util.unique_array(myvars) + skipped_vars = ['PORTAGE_REPOSITORIES'] + # Deprecated variables + skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC')) + + myvars = set(myvars) + myvars.difference_update(skipped_vars) + myvars = sorted(myvars) + use_expand = settings.get('USE_EXPAND', '').split() use_expand.sort() unset_vars = [] - myvars.sort() + for k in myvars: v = settings.get(k) if v is not None:
[gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_config/
commit: 10d19623c5a3aabe00d502029a454f49f72983d1 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sat Dec 13 06:34:29 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sat Dec 13 06:34:29 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=10d19623 Blacklist _ variable. --- pym/portage/package/ebuild/_config/special_env_vars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py index 387f4ae..6bb3c95 100644 --- a/pym/portage/package/ebuild/_config/special_env_vars.py +++ b/pym/portage/package/ebuild/_config/special_env_vars.py @@ -1,4 +1,4 @@ -# Copyright 2010-2013 Gentoo Foundation +# Copyright 2010-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -27,7 +27,7 @@ env_blacklist = frozenset(( "PORTAGE_INTERNAL_CALLER", "PORTAGE_IUSE", "PORTAGE_NONFATAL", "PORTAGE_PIPE_FD", "PORTAGE_REPO_NAME", "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "REPOSITORY", - "RESTRICT", "ROOT", "SLOT", "SRC_URI" + "RESTRICT", "ROOT", "SLOT", "SRC_URI", "_" )) environ_whitelist = []
[gentoo-commits] proj/portage:master commit in: pym/_emerge/resolver/, pym/_emerge/, man/
commit: 751104acb0f14124ef44ba55a336dacca9474ae2 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sat Dec 13 06:16:31 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sat Dec 13 06:16:31 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=751104ac When using --verbose, always print ::repository in list of packages for installation. --verbose-main-repo-display option is no longer supported. 3 calls to deprecated portage.repository.config.RepoConfigLoader.mainRepo() function have been deleted. --- man/emerge.1 | 3 --- pym/_emerge/depgraph.py| 7 +-- pym/_emerge/main.py| 1 - pym/_emerge/resolver/output.py | 9 ++--- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/man/emerge.1 b/man/emerge.1 index b36f59c..faa1f33 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -899,9 +899,6 @@ Symbol LocationMeaning Make slot conflicts more verbose. Note that this may in some cases output hundreds of packages for slot conflicts. .TP -.BR "\-\-verbose\-main\-repo\-display" -In the package merge list display, print ::repository even for main repository. -.TP .BR "\-\-verbose\-slot\-rebuilds [ y | n ]" Turns on/off the extra emerge output to list which packages are causing rebuilds. The default is set to "y" (on). diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index df1e266..4a42ed5 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4293,14 +4293,9 @@ class depgraph(object): child = None all_parents = self._dynamic_config._parent_atoms graph = self._dynamic_config.digraph - verbose_main_repo_display = "--verbose-main-repo-display" in \ - self._frozen_config.myopts def format_pkg(pkg): - pkg_name = "%s" % (pkg.cpv,) - if verbose_main_repo_display or pkg.repo != \ - pkg.root_config.settings.repositories.mainRepo().name: - pkg_name += _repo_separator + pkg.repo + pkg_name = "%s%s%s" % (pkg.cpv, _repo_separator, pkg.repo) return pkg_name if target_atom is not None and isinstance(node, Package): diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 66d4891..7c707f9 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -50,7 +50,6 @@ options=[ "--tree", "--unordered-display", "--update", -"--verbose-main-repo-display", ] shortmapping={ diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index aefc3f4..14d1b28 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -387,9 +387,7 @@ class Display(object): if old_pkg.slot != old_pkg.sub_slot or \ old_pkg.slot == pkg.slot and old_pkg.sub_slot != pkg.sub_slot: key += "/" + old_pkg.sub_slot - if not self.quiet_repo_display and (self.verbose_main_repo_display or - self.portdb.repositories.mainRepo() is None or - any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])): + if not self.quiet_repo_display: key += _repo_separator + old_pkg.repo versions.append(key) myoldbest_str = blue("["+", ".join(versions)+"]") @@ -422,9 +420,7 @@ class Display(object): @param pkg_info: dictionary @rtype string """ - if not self.quiet_repo_display and (self.verbose_main_repo_display or - self.portdb.repositories.mainRepo() is None or - any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])): + if not self.quiet_repo_display: pkg_str += _repo_separator + pkg.repo return pkg_str @@ -819,7 +815,6 @@ class Display(object): # and disable the entire repo display in this case. repoadd_set = set() - self.verbose_main_repo_display = "--verbose-main-repo-display" in depgraph._frozen_config.myopts self.restrict_fetch_list = {} for mylist_index in range(len(mylist)):
[gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
commit: 280f10f3326af7a07ae383a127e3bea56b66bacb Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Dec 10 20:23:46 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Dec 10 20:23:46 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=280f10f3 Sort PORTAGE_ARCHLIST. --- pym/portage/package/ebuild/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 59e239b..c5c727b 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -779,7 +779,7 @@ class config(object): archlist = [grabfile(os.path.join(x, "arch.list")) \ for x in locations_manager.profile_and_user_locations] - archlist = stack_lists(archlist, incremental=1) + archlist = sorted(stack_lists(archlist, incremental=1)) self.configdict["conf"]["PORTAGE_ARCHLIST"] = " ".join(archlist) pkgprovidedlines = [grabfile(
[gentoo-commits] proj/portage:master commit in: pym/portage/_sets/
commit: 9e7fda6c40a3588d56aae74c6b769d5c651fe890 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Wed Dec 10 20:06:54 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Wed Dec 10 20:06:54 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e7fda6c Update loading of configuration of sets. - Ignore VCS directories. - Ignore directories and files whose names start with "." or end with "~". - Fix "BytesWarning: Comparison between bytes and string", which was occurring when any directory in /etc/portage/sets exists. --- pym/portage/_sets/__init__.py | 9 +++-- pym/portage/_sets/files.py| 9 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pym/portage/_sets/__init__.py b/pym/portage/_sets/__init__.py index a652227..5e4a9dc 100644 --- a/pym/portage/_sets/__init__.py +++ b/pym/portage/_sets/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2007-2012 Gentoo Foundation +# Copyright 2007-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -24,6 +24,7 @@ from portage import _unicode_decode from portage import _unicode_encode from portage import _encodings from portage.const import USER_CONFIG_PATH, GLOBAL_CONFIG_PATH +from portage.const import VCS_DIRS from portage.const import _ENABLE_SET_CONFIG from portage.exception import PackageSetNotFound from portage.localization import _ @@ -307,10 +308,14 @@ def load_default_config(settings, trees): if portage.const.EPREFIX: global_config_path = os.path.join(portage.const.EPREFIX, GLOBAL_CONFIG_PATH.lstrip(os.sep)) + vcs_dirs = [_unicode_encode(x, encoding=_encodings['fs']) for x in VCS_DIRS] def _getfiles(): for path, dirs, files in os.walk(os.path.join(global_config_path, "sets")): + for d in dirs: + if d in vcs_dirs or d.startswith(b".") or d.endswith(b"~"): + dirs.remove(d) for f in files: - if not f.startswith(b'.'): + if not f.startswith(b".") and not f.endswith(b"~"): yield os.path.join(path, f) dbapi = trees["porttree"].dbapi diff --git a/pym/portage/_sets/files.py b/pym/portage/_sets/files.py index 379ca30..9d25280 100644 --- a/pym/portage/_sets/files.py +++ b/pym/portage/_sets/files.py @@ -1,4 +1,4 @@ -# Copyright 2007-2013 Gentoo Foundation +# Copyright 2007-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import errno @@ -10,7 +10,7 @@ from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode from portage.util import grabfile, write_atomic, ensure_dirs, normalize_path -from portage.const import USER_CONFIG_PATH, WORLD_FILE, WORLD_SETS_FILE +from portage.const import USER_CONFIG_PATH, VCS_DIRS, WORLD_FILE, WORLD_SETS_FILE from portage.localization import _ from portage.locks import lockfile, unlockfile from portage import portage_gid @@ -142,6 +142,7 @@ class StaticFileSet(EditablePackageSet): _("Directory path contains invalid character(s) for encoding '%s': '%s'") \ % (_encodings['fs'], directory)) + vcs_dirs = [_unicode_encode(x, encoding=_encodings['fs']) for x in VCS_DIRS] if os.path.isdir(directory): directory = normalize_path(directory) @@ -152,7 +153,7 @@ class StaticFileSet(EditablePackageSet): except UnicodeDecodeError: continue for d in dirs[:]: - if d[:1] == '.': + if d in vcs_dirs or d.startswith(b".") or d.endswith(b"~"): dirs.remove(d) for filename in files: try: @@ -160,7 +161,7 @@ class StaticFileSet(EditablePackageSet): encoding=_encodings['fs'], errors='strict') except UnicodeDecodeError: continue - if filename[:1] == '.': + if filename.startswith(".") or filename.endswith("~"): continue if filename.endswith(".metadata"): continue
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: 269f2f610057266e25304e731631d95cf77322d3 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Nov 30 19:48:34 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sun Nov 30 19:48:34 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=269f2f61 Fix TypeError when using `emerge -C` without package name. --- pym/_emerge/unmerge.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index 03ce0a2..8923e20 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -94,9 +94,8 @@ def _unmerge_display(root_config, myopts, unmerge_action, if not unmerge_files: if unmerge_action in ["rage-clean", "unmerge"]: print() - print(bold("emerge %s") + - " can only be used with specific package names" % - unmerge_action) + print(bold("emerge %s" % unmerge_action) + + " can only be used with specific package names") print() return 1, {} else:
[gentoo-commits] proj/portage:master commit in: bin/
commit: 5e3e84b4fc4dc75d520b8e0e894811e3e2c88f56 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sat Sep 20 03:48:23 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sat Sep 20 03:48:23 2014 + URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5e3e84b4 Update sys.path in scripts only when using not installed instance of Portage. Modules of installed instance of Portage are now placed in standard location, which is included in default sys.path. --- bin/archive-conf | 4 ++-- bin/binhost-snapshot | 4 ++-- bin/clean_locks | 4 ++-- bin/dispatch-conf| 4 ++-- bin/ebuild | 4 ++-- bin/ebuild-ipc.py| 20 +--- bin/egencache| 4 ++-- bin/emaint | 4 ++-- bin/emerge | 5 ++--- bin/env-update | 4 ++-- bin/fixpackages | 4 ++-- bin/glsa-check | 4 ++-- bin/portageq | 22 +- bin/quickpkg | 4 ++-- bin/regenworld | 4 ++-- bin/repoman | 4 ++-- 16 files changed, 54 insertions(+), 45 deletions(-) diff --git a/bin/archive-conf b/bin/archive-conf index f73ca42..59350a0 100755 --- a/bin/archive-conf +++ b/bin/archive-conf @@ -14,8 +14,8 @@ from __future__ import print_function import sys from os import path as osp -pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") -sys.path.insert(0, pym_path) +if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._internal_caller = True diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot index c2204f0..3a34643 100755 --- a/bin/binhost-snapshot +++ b/bin/binhost-snapshot @@ -13,8 +13,8 @@ except ImportError: from urlparse import urlparse from os import path as osp -pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") -sys.path.insert(0, pym_path) +if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._internal_caller = True from portage.util._argparse import ArgumentParser diff --git a/bin/clean_locks b/bin/clean_locks index 3e969f2..13af061 100755 --- a/bin/clean_locks +++ b/bin/clean_locks @@ -6,8 +6,8 @@ from __future__ import print_function import sys, errno from os import path as osp -pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") -sys.path.insert(0, pym_path) +if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._internal_caller = True diff --git a/bin/dispatch-conf b/bin/dispatch-conf index 4b0c0ac..fb0a8af 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -17,8 +17,8 @@ from stat import ST_GID, ST_MODE, ST_UID from random import random import atexit, re, shutil, stat, sys from os import path as osp -pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") -sys.path.insert(0, pym_path) +if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._internal_caller = True from portage import os diff --git a/bin/ebuild b/bin/ebuild index 8f4b103..02ee022 100755 --- a/bin/ebuild +++ b/bin/ebuild @@ -38,8 +38,8 @@ signal.signal(debug_signum, debug_signal) import io import os from os import path as osp -pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym") -sys.path.insert(0, pym_path) +if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")): + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) import portage portage._internal_caller = True from portage import os diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py index 00337ee..3e6d90c 100755 --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@ -24,15 +24,21 @@ else: signal.signal(debug_signum, debug_signal) -# Avoid sandbox violations after python upgrade. -pym_path = os.path.join(os.path.dirname( - os.path.dirname(os.path.realpath(__file__))), "pym") +if os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), ".portage_not_installed")): + pym_paths = [os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym")] +
[gentoo-commits] proj/portage:master commit in: bin/
commit: bbb34efebd0bfc0b231073d00b863b3e3ebd918a Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Aug 10 10:31:29 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sun Aug 10 10:31:29 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbb34efe repoman: Do not report DESCRIPTION.punctuation warning for "etc.". --- bin/repoman | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/repoman b/bin/repoman index 71fc7f0..bd9ad15 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1895,7 +1895,11 @@ for x in effective_scanlist: stats[myqakey] += 1 fails[myqakey].append(relative_path) - if myaux['DESCRIPTION'][-1:] in ['.']: + # Abbreviations usable at the end of sentence. + abbreviations = ( + 'etc.', + ) + if myaux['DESCRIPTION'][-1:] == '.' and not myaux['DESCRIPTION'].split()[-1] in abbreviations: stats['DESCRIPTION.punctuation'] += 1 fails['DESCRIPTION.punctuation'].append( "%s: DESCRIPTION ends with a '%s' character"
[gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/
commit: 3e4b7a5128689697e87416293d9c45d4fa2fbf76 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Aug 4 21:40:44 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Aug 4 21:40:44 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3e4b7a51 Follow-up to commit 96ded9cff423d773ee31a696a691dd6610c315b7: Restore "/" characters. --- pym/portage/const.py | 2 +- pym/portage/dbapi/__init__.py | 4 ++-- pym/portage/dbapi/vartree.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pym/portage/const.py b/pym/portage/const.py index 50f0719..aab6e8a 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -1,5 +1,5 @@ # portage: Constants -# Copyright 1998-2013 Gentoo Foundation +# Copyright 1998-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index 6638352..34dfaa7 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -1,4 +1,4 @@ -# Copyright 1998-2013 Gentoo Foundation +# Copyright 1998-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import unicode_literals @@ -280,7 +280,7 @@ class dbapi(object): return True def invalidentry(self, mypath): - if MERGING_IDENTIFIER in mypath: + if "/" + MERGING_IDENTIFIER in mypath: if os.path.exists(mypath): writemsg(colorize("BAD", _("INCOMPLETE MERGE:"))+" %s\n" % mypath, noiselevel=-1) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 1984a66..2086d4c 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -446,7 +446,7 @@ class vardbapi(dbapi): if self._excluded_dirs.match(y) is not None: continue subpath = x + "/" + y - # MERGING_IDENTIFIER should never be a cpv, nor should files. + # -MERGING- should never be a cpv, nor should files. try: if catpkgsplit(subpath) is None: self.invalidentry(self.getpath(subpath)) @@ -1504,7 +1504,7 @@ class dblink(object): self.dbroot = normalize_path(os.path.join(self._eroot, VDB_PATH)) self.dbcatdir = self.dbroot+"/"+cat self.dbpkgdir = self.dbcatdir+"/"+pkg - self.dbtmpdir = self.dbcatdir+MERGING_IDENTIFIER+pkg + self.dbtmpdir = self.dbcatdir+"/"+MERGING_IDENTIFIER+pkg self.dbdir = self.dbpkgdir self.settings = mysettings self._verbose = self.settings.get("PORTAGE_VERBOSE") == "1"
[gentoo-commits] proj/portage:master commit in: bin/
commit: 213335d85286cd7a188d9f83b59ce0d6c2da7146 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Aug 4 12:11:24 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Mon Aug 4 12:11:24 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=213335d8 Revert incorrect commit 9351edad48523bb38b1bf651506786bdc8814f62, which broke file type detection in chpathtool.py with Python 3 and magic module present. >>> import magic >>> m = magic.open(magic.MIME_TYPE) >>> m.load() 0 >>> m.file(b"/etc/fstab") 'text/plain' >>> m.file(str(b"/etc/fstab")) "cannot open `b'/etc/fstab'' (No such file or directory)" --- bin/chpathtool.py | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/chpathtool.py b/bin/chpathtool.py index 6ddf329..6460662 100755 --- a/bin/chpathtool.py +++ b/bin/chpathtool.py @@ -51,12 +51,9 @@ class IsTextFile(object): return self._call(filename) def _is_text_magic(self, filename): - # regression in sys-apps/file causes - # py 3.2 & 3.3 magic module to not handle bytes properly - if isinstance(filename, bytes): - mime_type = self._m.file(str(filename)) - else: - mime_type = self._m.file(filename) + mime_type = self._m.file(filename) + if isinstance(mime_type, bytes): + mime_type = mime_type.decode('ascii', 'replace') return mime_type.startswith('text/') def _is_text_encoding(self, filename):
[gentoo-commits] proj/portage:master commit in: pym/_emerge/
commit: 3f110090e50207d4ae3f6031ce6b1beafc80de46 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun May 18 08:00:50 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sun May 18 08:00:50 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3f110090 Bug #510538: Include "::repository" in more messages. --- pym/_emerge/PackageMerge.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/PackageMerge.py b/pym/_emerge/PackageMerge.py index ef298ca..fa2102f 100644 --- a/pym/_emerge/PackageMerge.py +++ b/pym/_emerge/PackageMerge.py @@ -1,7 +1,8 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.CompositeTask import CompositeTask +from portage.dep import _repo_separator from portage.output import colorize class PackageMerge(CompositeTask): __slots__ = ("merge",) @@ -29,7 +30,7 @@ class PackageMerge(CompositeTask): msg = "%s %s%s" % \ (action_desc, counter_str, - colorize(pkg_color, pkg.cpv)) + colorize(pkg_color, pkg.cpv + _repo_separator + pkg.repo)) if pkg.root_config.settings["ROOT"] != "/": msg += " %s %s" % (preposition, pkg.root)
[gentoo-commits] proj/portage:master commit in: man/
commit: 73f08e1840269c14879a523f7f39375bc6cc2ba0 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Fri Apr 18 21:15:13 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Fri Apr 18 21:15:13 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=73f08e18 make.conf.5: Fix order of some paragraphs. --- man/make.conf.5 | 127 1 file changed, 63 insertions(+), 64 deletions(-) diff --git a/man/make.conf.5 b/man/make.conf.5 index 2281014..84e894b 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -1,4 +1,4 @@ -.TH "MAKE.CONF" "5" "Jan 2014" "Portage VERSION" "Portage" +.TH "MAKE.CONF" "5" "Apr 2014" "Portage VERSION" "Portage" .SH "NAME" make.conf \- custom settings for Portage .SH "SYNOPSIS" @@ -178,6 +178,10 @@ of \fBemerge\fR(1) for more information. This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR as \fI\-\-target=${CTARGET}\fR only if it is defined. .TP +.B DCO_SIGNED_OFF_BY +This variable may contain a name and email address which will be used by +\fBrepoman\fR(1) to add a Signed\-off\-by line to each commit message. +.TP \fBDISTDIR\fR = \fI[path]\fR Defines the location of your local source file repository. After packages are built, it is safe to remove any and all files from this directory since @@ -194,10 +198,6 @@ See the \fBPORTDIR\fR documentation for more information. .br Defaults to /usr/portage/distfiles. .TP -.B DCO_SIGNED_OFF_BY -This variable may contain a name and email address which will be used by -\fBrepoman\fR(1) to add a Signed\-off\-by line to each commit message. -.TP .B DOC_SYMLINKS_DIR If this variable contains a directory then symlinks to html documentation will be installed into it. @@ -298,12 +298,6 @@ Log file names have an extension that is appropriate for the compression type. Currently, only \fBgzip\fR(1) compression is supported, so build logs will have a '.gz' extension when this feature is enabled. .TP -.B compressdebug -Compress the debug sections in the split debug files with zlib to save -space. Make sure you have built both binutils and gdb with USE=zlib -support for this to work. See \fBsplitdebug\fR for general split debug -information (upon which this feature depends). -.TP .B compress\-index If set then a compressed copy of 'Packages' index file will be written. This feature is intended for Gentoo binhosts using certain webservers @@ -311,6 +305,12 @@ This feature is intended for Gentoo binhosts using certain webservers redundant on\-the\-fly compression. The resulting file will be called \[aq]Packages.gz' and its modification time will match that of 'Packages'. .TP +.B compressdebug +Compress the debug sections in the split debug files with zlib to save +space. Make sure you have built both binutils and gdb with USE=zlib +support for this to work. See \fBsplitdebug\fR for general split debug +information (upon which this feature depends). +.TP .B config\-protect\-if\-modified This causes the \fBCONFIG_PROTECT\fR behavior to be skipped for files that have not been modified since they were installed. This feature is @@ -346,10 +346,6 @@ exist). Also see the related \fIunmerge\-backup\fR feature. Use locks to ensure that unsandboxed ebuild phases never execute concurrently. Also see \fIparallel\-install\fR. .TP -.B fakeroot -Enable fakeroot for the install and package phases when a non-root user runs -the \fBebuild\fR(1) command. -.TP .B fail\-clean Clean up temporary files after a build failure. This is particularly useful if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this feature is enabled, you @@ -357,24 +353,9 @@ probably also want to enable \fBPORT_LOGDIR\fR in order to save the build log. Both the \fBebuild\fR(1) command and the \fInoclean\fR feature cause the \fIfail\-clean\fR feature to be automatically disabled. .TP -.B getbinpkg -Force emerges to always try to fetch files from the \fIPORTAGE_BINHOST\fR. See -\fBmake.conf\fR(5) for more information. -.TP -.B installsources -Install source code into /usr/src/debug/${CATEGORY}/${PF} (also see -\fBsplitdebug\fR). This feature works only if debugedit is installed and CFLAGS -is set to include debug information (such as with the \-ggdb flag). -.TP -.B keeptemp -Do not delete the ${T} directory after the merge process. -.TP -.B keepwork -Do not delete the ${WORKDIR} directory after the merge process. ${WORKDIR} can -then be reused since this feature disables most of the clean phase that runs -prior to each build. Due to lack of proper cleanup, this feature can -interfere with normal emerge operation and therefore it should not be left -enabled for more than a short period of time. +.B fakeroot +Enable fakeroot for the install
[gentoo-commits] proj/portage:master commit in: /
commit: 6daffecda308f916ad2d7da7607be2fcfccf7e9d Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Mar 23 15:56:27 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sun Mar 23 15:56:27 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6daffecd runtests.sh: Add 3.4 to PYTHON_SUPPORTED_VERSIONS and 3.5 to PYTHON_VERSIONS. --- runtests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtests.sh b/runtests.sh index 86d34b6..7999220 100755 --- a/runtests.sh +++ b/runtests.sh @@ -3,8 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # These are the versions we care about. The rest are just "nice to have". -PYTHON_SUPPORTED_VERSIONS="2.6 2.7 3.2 3.3" -PYTHON_VERSIONS="2.6 2.7 2.7-pypy-1.8 2.7-pypy-1.9 2.7-pypy-2.0 3.1 3.2 3.3 3.4" +PYTHON_SUPPORTED_VERSIONS="2.6 2.7 3.2 3.3 3.4" +PYTHON_VERSIONS="2.6 2.7 2.7-pypy-1.8 2.7-pypy-1.9 2.7-pypy-2.0 3.1 3.2 3.3 3.4 3.5" # has to be run from portage root dir cd "${0%/*}" || exit 1
[gentoo-commits] proj/portage:master commit in: /
commit: 7b4b80d445d4dd626e8fefb7b28e48a0c936ea30 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Mar 23 13:58:20 2014 + Commit: Arfrever Frehtes Taifersar Arahesis apache org> CommitDate: Sun Mar 23 13:58:20 2014 + URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7b4b80d4 mkrelease.sh: Update sed command to work after commit b1197c9964a7122477e94cf26a6f63b20f636d31. --- mkrelease.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkrelease.sh b/mkrelease.sh index 2410b02..f9f7564 100755 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -97,7 +97,7 @@ fi rm -rf "${SOURCE_DIR}" || die "directory cleanup failed" echo ">>> Setting portage.VERSION" -sed -e "s/^VERSION=.*/VERSION=\"${VERSION}\"/" \ +sed -e "s/^VERSION = .*/VERSION = \"${VERSION}\"/" \ -i "${RELEASE_DIR}/pym/portage/__init__.py" || \ die "Failed to patch portage.VERSION"