It would be great if the list of packages computed by haskell-updater could be made available as a portage set. I don't expect you to re-implement haskell-updater in python. Instead I'd want an option to generate machine-readable output (i.e. one package per line, no banner up front) together with some python code which runs haskell-updater and turns its output into a suitable python data structure. Rationale: It's nice to know that one can repair most dependency issues by emerging sets like @preserved-rebuild. So the more problems can be fixed this way, the better.
There already is al option to do something with broken packages. haskell-updater -C your-handler It accepts ${PN}:${SLOT} for each argument. I agree, that default output of haskell-updater is a bit messy for script handling. I'll try to address it in 1.2.0.6. As for portage sets, I dunno. Does portage-2.2 allows plugs to be set into it? Would be nice if we would setup post-emerge hook.
(In reply to comment #1) > There already is al option to do something with broken packages. > > haskell-updater -C your-handler > > It accepts ${PN}:${SLOT} for each argument. I thought about that, e.g. "haskell-updater -C echo". But the stuff preceding the output of that command is a lot of garbage for script processing. And as it all goes to stdout, instead of being split between stdout and stderr, things remain messy. Now that I think about it, maybe using "-C echo" in conjunction with a "tail -n1" would be reasonable. Although that still gives "Nothing to build!" instead of an empty output list. > I agree, that default output of haskell-updater is a bit > messy for script handling. I'll try to address it in 1.2.0.6. Something cleaner than "haskell-updater -C echo | tail -n1" would be nice. See below for the kind of difference this would make. > As for portage sets, I dunno. Does portage-2.2 allows plugs to be set > into it? Adding new sets is simply a matter of installing a specific configuration file. There has to be a python class implementing it, but portage already ships a CommandOutputSet which should work well for this purpose. The following is untested, but should work fine: === Begin /usr/share/portage/config/sets/haskell.conf === # Rebuild packages required to fix broken haskell dependencies. [haskell-dep] class = portage.sets.shell.CommandOutputSet command = /usr/sbin/haskell-updater --dep-check --machine-readable-list # Rebuild Haskell packages after a GHC upgrade. [haskell-upgrade] class = portage.sets.shell.CommandOutputSet command = /usr/sbin/haskell-updater --upgrade --machine-readable-list # Do both of the above, using just a single invokation of haskell-updater. [haskell-update] class = portage.sets.shell.CommandOutputSet command = /usr/sbin/haskell-updater --machine-readable-list === End /usr/share/portage/config/sets/haskell.conf === This assumes an option --machine-readable-list which will not invoke a package manager but instead print one atom at a time, without any other output. The command is passed to shell, so as a workaround one could probably use this: LC_ALL=C /usr/sbin/haskell-updater -C echo | tail -n1 | grep -v 'Nothing to build' | tr ' ' '\n' You will agree that this is rather ugly, so I hope for a new option instead. See http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=blob;f=pym/portage/_sets/shell.py for the implementation of CommandOutputSet, and instructions on the kind of configuration and output it expects. http://www.ffta.host.sk/Documenta/portage.html#config-set-classes-CommandOutputSet says pretty much the same. > Would be nice if we would setup post-emerge hook. I don't think that kind of hook is possible yet. And if I e.g. run emerge with --ask, I probably wouldn't want some hook to remerge stuff unasked. Tricky.
Ok, some months later, but i've got to it and pushed out: > *haskell-updater-1.2.0.6 (08 Jul 2012) > > 08 Jul 2012; Sergei Trofimovich <slyfox@gentoo.org> > +files/haskell-updater-1.2.0.5-ghc-7.5.patch, +haskell-updater-1.2.0.6.ebuild: > Version bump. With new '--list-only' and '--quiet' options requested by Martin > von Gagern in bug #407301 Specifically commit https://github.com/gentoo-haskell/haskell-updater/commit/4bc83a4a91872a16d628fdf3fcf74faa38a3e4e4 adds '--list-only' and '--quiet' options to get broken atoms. Can you try that and see if it's good enough? Thanks!
Created attachment 317722 [details] /usr/share/portage/config/sets/haskell.conf (In reply to comment #3) > Ok, some months later, but i've got to it and pushed out: Great, thanks! > Can you try that and see if it's good enough? Downgraded ghc and gave it a try; looks good so far. You might want to include a suitable sets configuration, though, like the one I'm attaching here.
*** Bug 445069 has been marked as a duplicate of this bug. ***