Re: [gentoo-portage-dev] [PATCH] repos.conf: support strict-misc-digests attribute (bug 600128)
On Fri, Nov 25, 2016 at 12:32:28PM -0800, Zac Medico wrote: > I question the usefulness of producing warnings that people probably > want to ignore anyway, but I suppose we could make the > Manifest.checkTypeHashes method implement this behavior internally. Ok, then I'd like to flip your default to off (not checking MISC by default). Goal being that unless specifically requested, having ChangeLog with a mismatched Manifest is not going to stop them emerging the package. -- Robin Hugh Johnson Gentoo Linux: Dev, Infra Lead, Foundation Trustee & Treasurer E-Mail : robb...@gentoo.org GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85 GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
Re: [gentoo-portage-dev] [PATCH] repos.conf: support strict-misc-digests attribute (bug 600128)
On 11/24/2016 02:24 PM, Robin H. Johnson wrote: > > On Wed, Nov 23, 2016 at 11:04:54PM -0800, Zac Medico wrote: >> The current GLEP 60 draft specifies that non-strict handling of MISC >> digests should be supported. > In my followup post about how it should work, I noted that in non-strict > mode, a non-fatal warning should be issued for the mismatch of Manifest > and existing MISC file. > > You take the approach here of just not checking the MISC files, with a > default of checking them anyway. > > The non-fatal warning variant enables keeping the check enabled without > breaking the tree. > > Do I need to codify that into a GLEP update to get traction? I question the usefulness of producing warnings that people probably want to ignore anyway, but I suppose we could make the Manifest.checkTypeHashes method implement this behavior internally. -- Thanks, Zac
Re: [gentoo-portage-dev] [PATCH] repos.conf: support strict-misc-digests attribute (bug 600128)
On Wed, Nov 23, 2016 at 11:04:54PM -0800, Zac Medico wrote: > The current GLEP 60 draft specifies that non-strict handling of MISC > digests should be supported. In my followup post about how it should work, I noted that in non-strict mode, a non-fatal warning should be issued for the mismatch of Manifest and existing MISC file. You take the approach here of just not checking the MISC files, with a default of checking them anyway. The non-fatal warning variant enables keeping the check enabled without breaking the tree. Do I need to codify that into a GLEP update to get traction? -- Robin Hugh Johnson Gentoo Linux: Dev, Infra Lead, Foundation Trustee & Treasurer E-Mail : robb...@gentoo.org GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85 GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
Re: [gentoo-portage-dev] [PATCH] repos.conf: support strict-misc-digests attribute (bug 600128)
On 11/24/2016 12:14 AM, Brian Dolbec wrote: > On Wed, 23 Nov 2016 23:04:54 -0800 > Zac Medicowrote: > >> This setting determines whether digests are checked for files declared >> in the Manifest with MISC type (includes ChangeLog and metadata.xml >> files). Defaults to true. >> >> The current GLEP 60 draft specifies that non-strict handling of MISC >> digests should be supported. >> >> X-Gentoo-Bug: 600128 >> X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=600128 >> --- >> man/portage.5 | 9 - >> pym/portage/manifest.py | 6 -- >> pym/portage/package/ebuild/digestcheck.py | 2 +- >> pym/portage/repository/config.py | 18 ++ >> 4 files changed, 27 insertions(+), 8 deletions(-) >> > > LGTM > Thanks, pushed: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8b1d840de9ffd9aa86dc8666d8915826ffa0f63 -- Thanks, Zac
Re: [gentoo-portage-dev] [PATCH] repos.conf: support strict-misc-digests attribute (bug 600128)
On Wed, 23 Nov 2016 23:04:54 -0800 Zac Medicowrote: > This setting determines whether digests are checked for files declared > in the Manifest with MISC type (includes ChangeLog and metadata.xml > files). Defaults to true. > > The current GLEP 60 draft specifies that non-strict handling of MISC > digests should be supported. > > X-Gentoo-Bug: 600128 > X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=600128 > --- > man/portage.5 | 9 - > pym/portage/manifest.py | 6 -- > pym/portage/package/ebuild/digestcheck.py | 2 +- > pym/portage/repository/config.py | 18 ++ > 4 files changed, 27 insertions(+), 8 deletions(-) > LGTM -- Brian Dolbec
[gentoo-portage-dev] [PATCH] repos.conf: support strict-misc-digests attribute (bug 600128)
This setting determines whether digests are checked for files declared in the Manifest with MISC type (includes ChangeLog and metadata.xml files). Defaults to true. The current GLEP 60 draft specifies that non-strict handling of MISC digests should be supported. X-Gentoo-Bug: 600128 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=600128 --- man/portage.5 | 9 - pym/portage/manifest.py | 6 -- pym/portage/package/ebuild/digestcheck.py | 2 +- pym/portage/repository/config.py | 18 ++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/man/portage.5 b/man/portage.5 index 963f49d..2cacafc 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -1,4 +1,4 @@ -.TH "PORTAGE" "5" "Nov 2015" "Portage VERSION" "Portage" +.TH "PORTAGE" "5" "Nov 2016" "Portage VERSION" "Portage" .SH NAME portage \- the heart of Gentoo .SH "DESCRIPTION" @@ -961,6 +961,13 @@ since operations performed by these tools are inherently .B priority Specifies priority of given repository. .TP +.B strict\-misc\-digests +This setting determines whether digests are checked for files declared +in the Manifest with MISC type (includes ChangeLog and metadata.xml +files). Defaults to true. +.br +Valid values: true, false. +.TP .B sync\-cvs\-repo Specifies CVS repository. .TP diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index fe4166c..7278e21 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -129,7 +129,7 @@ class Manifest(object): def __init__(self, pkgdir, distdir=None, fetchlist_dict=None, manifest1_compat=DeprecationWarning, from_scratch=False, thin=False, allow_missing=False, allow_create=True, hashes=None, - find_invalid_path_char=None): + find_invalid_path_char=None, strict_misc_digests=True): """ Create new Manifest instance for package in pkgdir. Do not parse Manifest file if from_scratch == True (only for internal use) The fetchlist_dict parameter is required only for generation of @@ -173,6 +173,7 @@ class Manifest(object): self.guessType = guessManifestFileType self.allow_missing = allow_missing self.allow_create = allow_create + self.strict_misc_digests = strict_misc_digests def getFullname(self): """ Returns the absolute path to the Manifest file for this instance """ @@ -461,7 +462,8 @@ class Manifest(object): fetchlist_dict=self.fetchlist_dict, from_scratch=True, thin=self.thin, allow_missing=self.allow_missing, allow_create=self.allow_create, hashes=self.hashes, - find_invalid_path_char=self._find_invalid_path_char) + find_invalid_path_char=self._find_invalid_path_char, + strict_misc_digests=self.strict_misc_digests) pn = os.path.basename(self.pkgdir.rstrip(os.path.sep)) cat = self._pkgdir_category() diff --git a/pym/portage/package/ebuild/digestcheck.py b/pym/portage/package/ebuild/digestcheck.py index e207ba8..502950f 100644 --- a/pym/portage/package/ebuild/digestcheck.py +++ b/pym/portage/package/ebuild/digestcheck.py @@ -48,7 +48,7 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None, mf=None): eout.ebegin(_("checking auxfile checksums ;-)")) mf.checkTypeHashes("AUX", hash_filter=hash_filter) eout.eend(0) - if mf.fhashdict.get("MISC"): + if mf.strict_misc_digests and mf.fhashdict.get("MISC"): eout.ebegin(_("checking miscfile checksums ;-)")) mf.checkTypeHashes("MISC", ignoreMissingFiles=True, hash_filter=hash_filter) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 0512057..67c717d 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -80,7 +80,7 @@ class RepoConfig(object): 'find_invalid_path_char', 'force', 'format', 'local_config', 'location', 'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name', 'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority', - 'profile_formats', 'sign_commit', 'sign_manifest', + 'profile_formats', 'sign_commit', 'sign_manifest', 'strict_misc_digests', 'sync_depth', 'sync_hooks_only_on_change', 'sync_type', 'sync_umask', 'sync_uri', 'sync_user', 'thin_manifest', 'update_changelog', '_eapis_banned', '_eapis_deprecated', @@ -172,6 +172,9 @@ class RepoConfig(object):