From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D1621138334 for ; Tue, 17 Sep 2019 06:01:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 10123E092B; Tue, 17 Sep 2019 06:01:02 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DD824E092B for ; Tue, 17 Sep 2019 06:01:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D423B34B286 for ; Tue, 17 Sep 2019 06:00:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5B2A276A for ; Tue, 17 Sep 2019 06:00:58 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1568700038.4e45c5e9c03cda84ee6ab456ef69ed3b2a75ae43.mgorny@gentoo> Subject: [gentoo-commits] proj/qa-scripts:master commit in: / X-VCS-Repository: proj/qa-scripts X-VCS-Files: pkg-newest-commit.py X-VCS-Directories: / X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 4e45c5e9c03cda84ee6ab456ef69ed3b2a75ae43 X-VCS-Branch: master Date: Tue, 17 Sep 2019 06:00:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 49349511-bda0-456d-88a0-a903d6e29c61 X-Archives-Hash: 8e1d490fed18e8a296a93fb9ed602067 commit: 4e45c5e9c03cda84ee6ab456ef69ed3b2a75ae43 Author: Michał Górny gentoo org> AuthorDate: Tue Sep 17 06:00:38 2019 +0000 Commit: Michał Górny gentoo org> CommitDate: Tue Sep 17 06:00:38 2019 +0000 URL: https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=4e45c5e9 Add a script to print newest commits for each package Signed-off-by: Michał Górny gentoo.org> pkg-newest-commit.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/pkg-newest-commit.py b/pkg-newest-commit.py new file mode 100755 index 0000000..52372d4 --- /dev/null +++ b/pkg-newest-commit.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +import argparse +import glob +import os +import subprocess +import sys + + +def main(argv): + argp = argparse.ArgumentParser(prog=argv[0]) + argp.add_argument('package', nargs='*', + help='List of packages to find (defaults to all)') + args = argp.parse_args(argv[1:]) + + packages = set(args.package) + if not packages: + with open('profiles/categories') as f: + for cat in f: + packages.update(x.rstrip('/') + for x in glob.glob('{}/*/'.format(cat.strip()))) + + excludes = frozenset([ + # specify EAPI=0 explicitly + '4a409a1ecd75d064e8b471f6131bb1feb83c37a8', + # drop $id + '61b861acd7b49083dab687e133f30f3331cb7480', + # initial git commit + '56bd759df1d0c750a065b8c845e93d5dfa6b549d', + ]) + + os.environ['TZ'] = 'UTC' + s = subprocess.Popen(['git', 'log', '--date=iso-local', '--name-only', + '--diff-filter=AM', '--no-renames', + '--pretty=COMMIT|%H|%cd', '**.ebuild'], + stdout=subprocess.PIPE) + for l in s.stdout: + l = l.decode('utf8').strip() + if l.startswith('COMMIT|'): + commit_data = l[7:] + elif l: + pkg = '/'.join(l.split('/', 2)[:2]) + if pkg in packages: + commit, date = commit_data.split('|') + if commit in excludes: + continue + print('{:.<65} {} {}'.format(pkg + ' ', date, commit)) + packages.remove(pkg) + if not packages: + break + + +if __name__ == '__main__': + sys.exit(main(sys.argv))