All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] support/scripts/pkg-stats: add --disable option
@ 2022-01-09 16:31 Thomas Petazzoni
  2022-01-27 16:48 ` Peter Korsgaard
  2022-01-27 16:48 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2022-01-09 16:31 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=b102352b62917b053cae1f5d0591fe6507d81522
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

When debugging pkg-stats, it's quite useful to be able to disable some
features that are quite long (checking upstream URL, checking latest
version, checking CVE). This commit adds a --disable option, which can
take a comma-separated list of features to disable, such as:

     ./support/scripts/pkg-stats --disable url,upstream

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 support/scripts/pkg-stats | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
index 00ca5647ee..7e20ccc0da 100755
--- a/support/scripts/pkg-stats
+++ b/support/scripts/pkg-stats
@@ -1099,6 +1099,10 @@ def resolvepath(path):
     return os.path.abspath(os.path.expanduser(path))
 
 
+def list_str(values):
+    return values.split(',')
+
+
 def parse_args():
     parser = argparse.ArgumentParser()
     output = parser.add_argument_group('output', 'Output file(s)')
@@ -1115,6 +1119,9 @@ def parse_args():
                           help='List of packages (comma separated)')
     parser.add_argument('--nvd-path', dest='nvd_path',
                         help='Path to the local NVD database', type=resolvepath)
+    parser.add_argument('--disable', type=list_str,
+                        help='Features to disable, comma-separated (cve, upstream, url)',
+                        default=[])
     args = parser.parse_args()
     if not args.html and not args.json:
         parser.error('at least one of --html or --json (or both) is required')
@@ -1161,13 +1168,15 @@ def __main__():
         pkg.set_url()
         pkg.set_ignored_cves()
         pkg.set_developers(developers)
-    print("Checking URL status")
-    loop = asyncio.get_event_loop()
-    loop.run_until_complete(check_package_urls(packages))
-    print("Getting latest versions ...")
-    loop = asyncio.get_event_loop()
-    loop.run_until_complete(check_package_latest_version(packages))
-    if args.nvd_path:
+    if not "url" in args.disable:
+        print("Checking URL status")
+        loop = asyncio.get_event_loop()
+        loop.run_until_complete(check_package_urls(packages))
+    if not "upstream" in args.disable:
+        print("Getting latest versions ...")
+        loop = asyncio.get_event_loop()
+        loop.run_until_complete(check_package_latest_version(packages))
+    if not "cve" in args.disable and args.nvd_path:
         print("Checking packages CVEs")
         check_package_cves(args.nvd_path, packages)
         check_package_cpes(args.nvd_path, packages)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [git commit] support/scripts/pkg-stats: add --disable option
  2022-01-09 16:31 [Buildroot] [git commit] support/scripts/pkg-stats: add --disable option Thomas Petazzoni
@ 2022-01-27 16:48 ` Peter Korsgaard
  2022-01-27 16:48 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-01-27 16:48 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > commit: https://git.buildroot.net/buildroot/commit/?id=b102352b62917b053cae1f5d0591fe6507d81522
 > branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

 > When debugging pkg-stats, it's quite useful to be able to disable some
 > features that are quite long (checking upstream URL, checking latest
 > version, checking CVE). This commit adds a --disable option, which can
 > take a comma-separated list of features to disable, such as:

 >      ./support/scripts/pkg-stats --disable url,upstream

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2021.02.x and 2021.11.x, thanks.

Committed to 2021.11.x, thanks.

 > ---
 >  support/scripts/pkg-stats | 23 ++++++++++++++++-------
 >  1 file changed, 16 insertions(+), 7 deletions(-)

 > diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
 > index 00ca5647ee..7e20ccc0da 100755
 > --- a/support/scripts/pkg-stats
 > +++ b/support/scripts/pkg-stats
 > @@ -1099,6 +1099,10 @@ def resolvepath(path):
 >      return os.path.abspath(os.path.expanduser(path))
 
 
 > +def list_str(values):
 > +    return values.split(',')
 > +
 > +
 >  def parse_args():
 >      parser = argparse.ArgumentParser()
 >      output = parser.add_argument_group('output', 'Output file(s)')
 > @@ -1115,6 +1119,9 @@ def parse_args():
 >                            help='List of packages (comma separated)')
 >      parser.add_argument('--nvd-path', dest='nvd_path',
 >                          help='Path to the local NVD database', type=resolvepath)
 > +    parser.add_argument('--disable', type=list_str,
 > +                        help='Features to disable, comma-separated (cve, upstream, url)',
 > +                        default=[])
 >      args = parser.parse_args()
 >      if not args.html and not args.json:
 >          parser.error('at least one of --html or --json (or both) is required')
 > @@ -1161,13 +1168,15 @@ def __main__():
 >          pkg.set_url()
 >          pkg.set_ignored_cves()
 >          pkg.set_developers(developers)
 > -    print("Checking URL status")
 > -    loop = asyncio.get_event_loop()
 > -    loop.run_until_complete(check_package_urls(packages))
 > -    print("Getting latest versions ...")
 > -    loop = asyncio.get_event_loop()
 > -    loop.run_until_complete(check_package_latest_version(packages))
 > -    if args.nvd_path:
 > +    if not "url" in args.disable:
 > +        print("Checking URL status")
 > +        loop = asyncio.get_event_loop()
 > +        loop.run_until_complete(check_package_urls(packages))
 > +    if not "upstream" in args.disable:
 > +        print("Getting latest versions ...")
 > +        loop = asyncio.get_event_loop()
 > +        loop.run_until_complete(check_package_latest_version(packages))
 > +    if not "cve" in args.disable and args.nvd_path:
 >          print("Checking packages CVEs")
 >          check_package_cves(args.nvd_path, packages)
 >          check_package_cpes(args.nvd_path, packages)
 > _______________________________________________
 > buildroot mailing list
 > buildroot@buildroot.org
 > https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [git commit] support/scripts/pkg-stats: add --disable option
  2022-01-09 16:31 [Buildroot] [git commit] support/scripts/pkg-stats: add --disable option Thomas Petazzoni
  2022-01-27 16:48 ` Peter Korsgaard
@ 2022-01-27 16:48 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-01-27 16:48 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > commit: https://git.buildroot.net/buildroot/commit/?id=b102352b62917b053cae1f5d0591fe6507d81522
 > branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

 > When debugging pkg-stats, it's quite useful to be able to disable some
 > features that are quite long (checking upstream URL, checking latest
 > version, checking CVE). This commit adds a --disable option, which can
 > take a comma-separated list of features to disable, such as:

 >      ./support/scripts/pkg-stats --disable url,upstream

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2021.02.x and 2021.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-27 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-09 16:31 [Buildroot] [git commit] support/scripts/pkg-stats: add --disable option Thomas Petazzoni
2022-01-27 16:48 ` Peter Korsgaard
2022-01-27 16:48 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.