Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 886568 Details for
Bug 926061
app-portage/nattka-0.4.1-r1: make-package-list command crashes without git checkout
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to remove git dependency for 'make-package-list' command
make_package_list_without_git.patch (text/plain), 7.71 KB, created by
A Schenck
on 2024-03-03 01:42:31 UTC
(
hide
)
Description:
Patch to remove git dependency for 'make-package-list' command
Filename:
MIME Type:
Creator:
A Schenck
Created:
2024-03-03 01:42:31 UTC
Size:
7.71 KB
patch
obsolete
>diff --git a/nattka/__main__.py b/nattka/__main__.py >index c68a523..0ed6b24 100644 >--- a/nattka/__main__.py >+++ b/nattka/__main__.py >@@ -392,96 +392,95 @@ class NattkaCommands(object): > return ret > > def make_package_list(self) -> int: >- repo, git_repo = self.get_git_repository() >+ repo = self.get_repository() > >- with git_repo: >- start_time = datetime.datetime.utcnow() >- packages = self.args.package >- if self.args.arch is None: >- initial_arches = '*' >- else: >- initial_arches = ' '.join(self.args.arch) >- if self.args.stabilization: >- bug_cat = BugCategory.STABLEREQ >- pkg_attr = 'cpvstr' >- else: >- bug_cat = BugCategory.KEYWORDREQ >- pkg_attr = 'key' >- >- b = BugInfo(bug_cat, f'{packages[0]} {initial_arches}\n') >- plist = dict(match_package_list(repo, b, only_new=True)) >- assert len(plist) == 1 >- cc_arches = sorted( >- [f'{x}@gentoo.org' for x >- in set(itertools.chain.from_iterable(plist.values())) >- if '-' not in x]) >- >- it = 1 >- # prepare the initial set >- b = BugInfo(bug_cat, '\n'.join(packages), cc=cc_arches) >+ start_time = datetime.datetime.utcnow() >+ packages = self.args.package >+ if self.args.arch is None: >+ initial_arches = '*' >+ else: >+ initial_arches = ' '.join(self.args.arch) >+ if self.args.stabilization: >+ bug_cat = BugCategory.STABLEREQ >+ pkg_attr = 'cpvstr' >+ else: >+ bug_cat = BugCategory.KEYWORDREQ >+ pkg_attr = 'key' >+ >+ b = BugInfo(bug_cat, f'{packages[0]} {initial_arches}\n') >+ plist = dict(match_package_list(repo, b, only_new=True)) >+ assert len(plist) == 1 >+ cc_arches = sorted( >+ [f'{x}@gentoo.org' for x >+ in set(itertools.chain.from_iterable(plist.values())) >+ if '-' not in x]) >+ >+ it = 1 >+ # prepare the initial set >+ b = BugInfo(bug_cat, '\n'.join(packages), cc=cc_arches) >+ new_plist = dict(match_package_list(repo, b, only_new=True)) >+ add_keywords(plist.items(), >+ b.category == BugCategory.STABLEREQ) >+ >+ while True: >+ log.info(f'Iteration {it}: running pkgcheck ...') >+ plist = new_plist >+ check_res, issues = check_dependencies( >+ repo, plist.items(), profiles=self.args.profiles) >+ >+ # all good? we're done! >+ if check_res: >+ break >+ >+ new_packages = set() >+ for i in issues: >+ eapi = repo[(i.category, i.package, i.version)].eapi >+ for d in i.deps: >+ # TODO: handle USE-deps meaningfully >+ # TODO: handle <-deps >+ r = eapi.atom_kls(d).no_usedeps >+ for m in reversed(sorted(repo.itermatch(r))): >+ if b.category == BugCategory.STABLEREQ: >+ # skip unkeyworded ebuilds >+ if not m.keywords: >+ continue >+ new_packages.add(getattr(m, pkg_attr)) >+ break >+ else: >+ log.error(f'No match for dependency: {d}') >+ return 1 >+ >+ assert new_packages >+ log.info( >+ f'New packages: {" ".join(sorted(new_packages))}') >+ >+ # apply on *new* packages >+ b = BugInfo(bug_cat, '\n'.join(new_packages), cc=cc_arches) > new_plist = dict(match_package_list(repo, b, only_new=True)) >- add_keywords(plist.items(), >- b.category == BugCategory.STABLEREQ) >- >- while True: >- log.info(f'Iteration {it}: running pkgcheck ...') >- plist = new_plist >- check_res, issues = check_dependencies( >- repo, plist.items(), profiles=self.args.profiles) >- >- # all good? we're done! >- if check_res: >- break >- >- new_packages = set() >- for i in issues: >- eapi = repo[(i.category, i.package, i.version)].eapi >- for d in i.deps: >- # TODO: handle USE-deps meaningfully >- # TODO: handle <-deps >- r = eapi.atom_kls(d).no_usedeps >- for m in reversed(sorted(repo.itermatch(r))): >- if b.category == BugCategory.STABLEREQ: >- # skip unkeyworded ebuilds >- if not m.keywords: >- continue >- new_packages.add(getattr(m, pkg_attr)) >- break >- else: >- log.error(f'No match for dependency: {d}') >- return 1 >- >- assert new_packages >- log.info( >- f'New packages: {" ".join(sorted(new_packages))}') >- >- # apply on *new* packages >- b = BugInfo(bug_cat, '\n'.join(new_packages), cc=cc_arches) >- new_plist = dict(match_package_list(repo, b, only_new=True)) >- for p in list(new_packages): >- if not any(getattr(x, pkg_attr) == p for x in new_plist): >- log.info(f'Package {p} seems to be a red herring ' >- f'(already keyworded everywhere)') >- new_packages.remove(p) >- add_keywords(new_plist.items(), >- b.category == BugCategory.STABLEREQ) >- >- # but test on *old* >- log.info(f'Iteration {it}: verifying ...') >- check_res, issues = check_dependencies( >- repo, plist.items(), profiles=self.args.profiles) >- if not check_res: >- log.error('Attempt to satisfy dependencies failed:') >- log.error('\n'.join(format_results(issues))) >- log.error('Please correct the package list and retry.') >- break >- >- for x in sorted(new_packages): >- # TODO: handle it gracefully >- assert x not in packages >- packages.append(x) >- >- it += 1 >+ for p in list(new_packages): >+ if not any(getattr(x, pkg_attr) == p for x in new_plist): >+ log.info(f'Package {p} seems to be a red herring ' >+ f'(already keyworded everywhere)') >+ new_packages.remove(p) >+ add_keywords(new_plist.items(), >+ b.category == BugCategory.STABLEREQ) >+ >+ # but test on *old* >+ log.info(f'Iteration {it}: verifying ...') >+ check_res, issues = check_dependencies( >+ repo, plist.items(), profiles=self.args.profiles) >+ if not check_res: >+ log.error('Attempt to satisfy dependencies failed:') >+ log.error('\n'.join(format_results(issues))) >+ log.error('Please correct the package list and retry.') >+ break >+ >+ for x in sorted(new_packages): >+ # TODO: handle it gracefully >+ assert x not in packages >+ packages.append(x) >+ >+ it += 1 > > end_time = datetime.datetime.utcnow() > log.info(f'Time elapsed: {end_time - start_time}')
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 926061
: 886568