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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EA77C158090 for ; Tue, 3 May 2022 16:54:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0EA7EE076B; Tue, 3 May 2022 16:54:45 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D7119E070D for ; Tue, 3 May 2022 16:54:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0F0E2341780 for ; Tue, 3 May 2022 16:54:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A5577287 for ; Tue, 3 May 2022 16:54:42 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1651596812.681e72c7924ed57d7b73183fb07e28f4fb524919.floppym@gentoo> Subject: [gentoo-commits] proj/chromium-tools:master commit in: / X-VCS-Repository: proj/chromium-tools X-VCS-Files: chrome-bump X-VCS-Directories: / X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 681e72c7924ed57d7b73183fb07e28f4fb524919 X-VCS-Branch: master Date: Tue, 3 May 2022 16:54:42 +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: 1faa2aee-1055-4d0c-b751-d8bd9f8d82c6 X-Archives-Hash: 291341b572209100d5c3a13495030278 commit: 681e72c7924ed57d7b73183fb07e28f4fb524919 Author: Mike Gilbert gentoo org> AuthorDate: Tue May 3 16:53:01 2022 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Tue May 3 16:53:32 2022 +0000 URL: https://gitweb.gentoo.org/proj/chromium-tools.git/commit/?id=681e72c7 Remove old chrome-bump script Signed-off-by: Mike Gilbert gentoo.org> chrome-bump | 148 ------------------------------------------------------------ 1 file changed, 148 deletions(-) diff --git a/chrome-bump b/chrome-bump deleted file mode 100755 index 1b138e5..0000000 --- a/chrome-bump +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import argparse -from contextlib import closing -from debian import deb822 -from glob import glob -import os -import os.path -import portage -import shutil -import subprocess -import sys -try: - from urllib.request import urlopen -except ImportError: - from urllib2 import urlopen - -ARCHIVE = 'https://dl.google.com/linux/chrome/deb' -DIST = 'stable' -COMP = 'main' -ARCH = 'amd64' - -PORTDIR = portage.settings.repositories['gentoo'].location - -PKGMAP = { - 'www-client/google-chrome': { - '*.ebuild': ('', 'google-chrome-stable'), - }, - 'www-client/google-chrome-beta': { - '*.ebuild': ('', 'google-chrome-beta'), - }, - 'www-client/google-chrome-unstable': { - '*.ebuild': ('', 'google-chrome-unstable'), - }, - 'www-plugins/chrome-binary-plugins': { - '*[0123456789].ebuild': ('', 'google-chrome-stable'), - '*_beta*.ebuild': ('_beta', 'google-chrome-beta'), - '*_alpha*.ebuild': ('_alpha', 'google-chrome-unstable'), - }, -} - -ARGS = None - -def get_deb_release(archive, dist): - url = '%s/dists/%s/Release' % (archive, dist) - with closing(urlopen(url)) as fp: - return deb822.Release(fp) - -def get_deb_packages(archive, dist, comp, arch): - url = '%s/dists/%s/%s/binary-%s/Packages' % (archive, dist, comp, arch) - with closing(urlopen(url)) as fp: - return list(deb822.Packages.iter_paragraphs(fp, use_apt_pkg=False)) - -def ebuild_pvr(pn, ebuild): - return ebuild[len(pn) + 1 : -7] - -def ebuild_pv(pn, ebuild): - return ebuild_pvr(pn, ebuild).split('-r')[0] - -def ebuild_version(pn, ebuild): - return ebuild_pv(pn, ebuild).split('_')[0] - -def new_ebuild(pn, version, sep, revision): - return pn + '-' + version + sep + revision + '.ebuild' - -def copy_ebuild(src, dest): - print('cp ' + src + ' ' + dest) - if not ARGS.dry_run: - shutil.copyfile(src, dest) - print('git add ' + dest) - if not ARGS.dry_run: - subprocess.check_call(['git', 'add', dest]) - -def remove_ebuild(ebuild): - print('git rm ' + ebuild) - if not ARGS.dry_run: - subprocess.check_call(['git', 'rm', ebuild]) - -def sync_ebuilds(pkg, debs): - os.chdir(os.path.join(PORTDIR, pkg)) - pn = pkg.split('/')[1] - changed = False - new_versions = [] - - for pattern in PKGMAP[pkg]: - (sep, name) = PKGMAP[pkg][pattern] - ebuilds = sorted(glob(pattern), reverse=True) - - if not ebuilds: - continue - - for deb in debs: - if deb['Package'] != name: - continue - - (version, revision) = deb['Version'].split('-') - found = False - for ebuild in ebuilds: - if version == ebuild_version(pn, ebuild): - found = True - break - if not found: - copy_ebuild(ebuilds[0], new_ebuild(pn, version, sep, '')) - new_versions.append(version) - changed = True - - for ebuild in ebuilds: - found = False - for deb in debs: - if deb['Package'] != name: - continue - - (version, revision) = deb['Version'].split('-') - if version == ebuild_version(pn, ebuild): - found = True - break - if not found: - remove_ebuild(ebuild) - changed = True - - if changed: - if ARGS.commit: - print('repoman commit') - if not ARGS.dry_run: - message = '%s: automated update (%s)' % (pkg, ', '.join(new_versions)) - if len(message) > 69: - message = '%s: automated update' % pkg - subprocess.check_call(['repoman', 'commit', '-S', '-m', message]) - else: - print('repoman manifest') - if not ARGS.dry_run: - subprocess.check_call(['repoman', 'manifest']) - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--commit', '-c', action='store_true') - parser.add_argument('--dry-run', '-n', action='store_true') - global ARGS - ARGS = parser.parse_args() - - debs = get_deb_packages(ARCHIVE, DIST, COMP, ARCH) - for pkg in PKGMAP: - sync_ebuilds(pkg, debs) - -if __name__ == '__main__': - main()