Re: [gentoo-portage-dev] [PATCH] lib/_emerge/resolver/slot_collision.py: fix redefined-builtin W0622
On 8/2/20 7:53 PM, Aaron Bauman wrote: > * This fixes the referenced warning by renaming the 'id' variable to > 'name' and the 'type' variable to 'atype' > * Additional cosmetic/style changes found along the way. > > Signed-off-by: Aaron Bauman Thanks, merged with s/atype/ctype/ and s/name/idx/: https://gitweb.gentoo.org/proj/portage.git/commit/?id=602d2cd487bb48788e9654a7b7fd5a3be34150d9 -- Thanks, Zac signature.asc Description: OpenPGP digital signature
Re: [gentoo-portage-dev] [PATCH] doc/api/conf.py: silence redefined-builtin for copyright
On 8/2/20 7:21 PM, Aaron Bauman wrote: > * This locally silences the W0622 warning for the override of the > copyright which is required. > > Signed-off-by: Aaron Bauman > --- > doc/api/conf.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/doc/api/conf.py b/doc/api/conf.py > index f318ca25d..9522960c8 100644 > --- a/doc/api/conf.py > +++ b/doc/api/conf.py > @@ -24,9 +24,9 @@ import portage > > # -- Project information > - > > -project = 'portage' > -copyright = '2020, Gentoo Authors' > -author = 'Gentoo Authors' > +project = 'portage' # pylint: disable=redefined-builtin > +copyright = '2020, Gentoo Authors' # pylint: disable=redefined-builtin > +author = 'Gentoo Authors' # pylint: disable=redefined-builtin > > # The full version, including alpha/beta/rc tags > release = str(portage.VERSION) > Thanks, merged the copyright line as discussed in #gentoo-portage: https://gitweb.gentoo.org/proj/portage.git/commit/?id=099e575a4cc132e01534023585cf73b7ff806b95 -- Thanks, Zac signature.asc Description: OpenPGP digital signature
[gentoo-portage-dev] [PATCH] lib/_emerge/resolver/slot_collision.py: fix redefined-builtin W0622
* This fixes the referenced warning by renaming the 'id' variable to 'name' and the 'type' variable to 'atype' * Additional cosmetic/style changes found along the way. Signed-off-by: Aaron Bauman --- lib/_emerge/resolver/slot_collision.py | 74 +- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py index cc16287de..b29d68f2a 100644 --- a/lib/_emerge/resolver/slot_collision.py +++ b/lib/_emerge/resolver/slot_collision.py @@ -591,14 +591,14 @@ class slot_conflict_handler: version_violated = False slot_violated = False use = [] - for (type, sub_type), parents in collision_reasons.items(): + for (atype, sub_type), parents in collision_reasons.items(): for x in parents: if parent == x[0] and atom == x[1]: - if type == "version": + if atype == "version": version_violated = True - elif type == "slot": + elif atype == "slot": slot_violated = True - elif type == "use": + elif atype == "use": use.append(sub_type) break @@ -934,64 +934,64 @@ class slot_conflict_handler: msg += "}" msg += "]\n" writemsg(msg, noiselevel=-1) - + required_changes = {} - for id, pkg in enumerate(config): + for name, pkg in enumerate(config): if not pkg.installed: - #We can't change the USE of installed packages. - for flag in all_involved_flags[id]: + # We can't change the USE of installed packages. + for flag in all_involved_flags[name]: if not pkg.iuse.is_valid_flag(flag): continue - state = all_involved_flags[id][flag] + state = all_involved_flags[name][flag] self._force_flag_for_package(required_changes, pkg, flag, state) - #Go through all (parent, atom) pairs for the current slot conflict. - for ppkg, atom in all_conflict_atoms_by_slotatom[id]: + # Go through all (parent, atom) pairs for the current slot conflict. + for ppkg, atom in all_conflict_atoms_by_slotatom[name]: if not atom.package: continue use = atom.unevaluated_atom.use if not use: - #No need to force something for an atom without USE conditionals. - #These atoms are already satisfied. + # No need to force something for an atom without USE conditionals. + # These atoms are already satisfied. continue - for flag in all_involved_flags[id]: - state = all_involved_flags[id][flag] + for flag in all_involved_flags[name]: + state = all_involved_flags[name][flag] if flag not in use.required or not use.conditional: continue if flag in use.conditional.enabled: - #[flag?] +
[gentoo-portage-dev] [PATCH] doc/api/conf.py: silence redefined-builtin for copyright
* This locally silences the W0622 warning for the override of the copyright which is required. Signed-off-by: Aaron Bauman --- doc/api/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/conf.py b/doc/api/conf.py index f318ca25d..9522960c8 100644 --- a/doc/api/conf.py +++ b/doc/api/conf.py @@ -24,9 +24,9 @@ import portage # -- Project information - -project = 'portage' -copyright = '2020, Gentoo Authors' -author = 'Gentoo Authors' +project = 'portage' # pylint: disable=redefined-builtin +copyright = '2020, Gentoo Authors' # pylint: disable=redefined-builtin +author = 'Gentoo Authors' # pylint: disable=redefined-builtin # The full version, including alpha/beta/rc tags release = str(portage.VERSION) -- 2.28.0
Re: [gentoo-portage-dev] [PATCH] cnf/repo.postsync.d/example: add egencache --update-pkg-desc-index (bug 735626)
On Sun, 2 Aug 2020 16:38:06 -0700 Zac Medico wrote: > Add an egencache --update-pkg-desc-index example for users > of app-portage/esearch to migrate to. > > Bug: https://bugs.gentoo.org/735626 > Signed-off-by: Zac Medico > --- > cnf/repo.postsync.d/example | 15 ++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/cnf/repo.postsync.d/example b/cnf/repo.postsync.d/example > index 533bf719c..6c349ab3c 100644 > --- a/cnf/repo.postsync.d/example > +++ b/cnf/repo.postsync.d/example > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > # Example /etc/portage/repo.postsync.d script. Make it executable > (chmod +x) for # Portage to process it. > # > @@ -45,6 +45,19 @@ if [ -n "${repository_name}" ]; then > ret=1 > fi > fi > + > + # Regenerate the metadata/pkg_desc_index file if needed. > It's not > + # needed for https://gitweb.gentoo.org/repo/sync/gentoo.git > which > + # provides a freshly generated copy. > + if [[ ! -e ${repository_path}/metadata/pkg_desc_index || ( > + -d ${repository_path}/metadata/md5-cache && > + -n "$(find "${repository_path}/metadata/md5-cache" > -type f -newer "${repository_path}/metadata/pkg_desc_index" -print > -quit)" ) ]]; then > + if ! egencache --update-pkg-desc-index > --repo="${repository_name}" > + then > + echo "!!! egencache failed!" > + ret=1 > + fi > + fi > fi > > # Return explicit status. is good with me, but my bash skills suck... so if there is a mistake I wouldn't know ;)
[gentoo-portage-dev] [PATCH] cnf/repo.postsync.d/example: add egencache --update-pkg-desc-index (bug 735626)
Add an egencache --update-pkg-desc-index example for users of app-portage/esearch to migrate to. Bug: https://bugs.gentoo.org/735626 Signed-off-by: Zac Medico --- cnf/repo.postsync.d/example | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cnf/repo.postsync.d/example b/cnf/repo.postsync.d/example index 533bf719c..6c349ab3c 100644 --- a/cnf/repo.postsync.d/example +++ b/cnf/repo.postsync.d/example @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Example /etc/portage/repo.postsync.d script. Make it executable (chmod +x) for # Portage to process it. # @@ -45,6 +45,19 @@ if [ -n "${repository_name}" ]; then ret=1 fi fi + + # Regenerate the metadata/pkg_desc_index file if needed. It's not + # needed for https://gitweb.gentoo.org/repo/sync/gentoo.git which + # provides a freshly generated copy. + if [[ ! -e ${repository_path}/metadata/pkg_desc_index || ( + -d ${repository_path}/metadata/md5-cache && + -n "$(find "${repository_path}/metadata/md5-cache" -type f -newer "${repository_path}/metadata/pkg_desc_index" -print -quit)" ) ]]; then + if ! egencache --update-pkg-desc-index --repo="${repository_name}" + then + echo "!!! egencache failed!" + ret=1 + fi + fi fi # Return explicit status. -- 2.25.3