Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 407301 - app-admin/haskell-updater: provide a portage set
Summary: app-admin/haskell-updater: provide a portage set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
: 445069 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-07 16:25 UTC by Martin von Gagern
Modified: 2012-12-22 20:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/usr/share/portage/config/sets/haskell.conf (haskell.conf,560 bytes, text/plain)
2012-07-09 18:25 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2012-03-07 16:25:07 UTC
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.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2012-03-07 16:53:53 UTC
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.
Comment 2 Martin von Gagern 2012-03-07 18:51:39 UTC
(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.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2012-07-08 18:20:26 UTC
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!
Comment 4 Martin von Gagern 2012-07-09 18:25:25 UTC
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.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2012-12-22 20:21:22 UTC
*** Bug 445069 has been marked as a duplicate of this bug. ***