commit:     be4a8b7e8023688a31e931b46fc3ef8651a290a5
Author:     John Helmert III <ajak <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  5 20:27:13 2021 +0000
Commit:     John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Mon Jul  5 20:28:01 2021 +0000
URL:        https://gitweb.gentoo.org/proj/security.git/commit/?id=be4a8b7e

glsatool: drop, accidentally added, not ready yet

Signed-off-by: John Helmert III <ajak <AT> gentoo.org>

 bin/glsatool | 74 ------------------------------------------------------------
 1 file changed, 74 deletions(-)

diff --git a/bin/glsatool b/bin/glsatool
deleted file mode 100755
index 4582a40..0000000
--- a/bin/glsatool
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-
-import argparse
-import os
-import re
-import typing
-
-import bugzilla
-import bracex
-import pkgcore.config
-from pkgcore.ebuild import atom
-import requests
-
-from cvetool import CVETool
-
-PKG_SEPARATORS = re.compile(r':\s|[\s,;(){}[\]]')
-GLSAMAKER_URI = 'https://glsamaker.gentoo.org'
-bgo = bugzilla.Bugzilla('https://bugs.gentoo.org')
-repo = pkgcore.config.load_config().repo['gentoo']
-
-
-class GLSATool:
-    """ Utility to ease GLSA handling in GLSAMaker """
-
-    def __init__(self, auth):
-        self.auth = auth
-
-    # https://github.com/mgorny/kuroneko/blob/master/kuroneko/scraper.py#L80
-    def find_package_specs(s: str) -> typing.Iterable[atom.atom]:
-        """Find potentially valid package specifications in given string."""
-        words = set()
-        # consider all possible expansions
-        for exp in bracex.iexpand(s):
-            words.update(PKG_SEPARATORS.split(exp))
-        for w in words:
-            # skip anything that couldn't be cat/pkg early
-            if '/' not in w:
-                continue
-            try:
-                yield atom.atom(w)
-            except MalformedAtom:
-                continue
-
-    def new_glsa(auth, title, bugs):
-        post = requests.post(GLSAMAKER_URI + '/glsas',
-                             data={'title': title + ' [DRAFT]',
-                                   'bugs': ','.join(bugs),
-                                   'access': 'public',
-                                   'import_references': '1',
-                                   'what': 'request',  # ???
-                                   'authenticity_token': 
'k75YYdGlcL+dlZS7RKXSVxKaKl2tiiMvwWlReFtKzt3NCKDE2AeskkrZ851xJB7uCBRUTpstV+/aqUTEx3MfIQ=='},
-                             headers={'Authorization': 'Basic ' + auth})
-        if not post.ok:
-            import pdb; pdb.set_trace()
-
-
-def get_auth():
-    authpath = os.path.join(os.path.expanduser('~'), '.config', 'cvetool_auth')
-    if 'CVETOOL_AUTH' in os.environ:
-        return os.environ['CVETOOL_AUTH']
-    elif os.path.isfile(authpath):
-        with open(authpath, 'r') as authfile:
-            return authfile.readlines()[0]
-
-
-if __name__ == '__main__':
-    parser = argparse.ArgumentParser()
-    parser.add_argument('-b', '--bugs', required=True, nargs='+')
-    parser.add_argument('-t', '--title', required=True)
-    args = parser.parse_args()
-    auth = get_auth()
-    for bug in args.bugs:
-        CVETool(auth, 'dobug', [bug])
-    new_glsa(auth, args.title, args.bugs)

Reply via email to