Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208991 - dev-lang/ocaml - ocaml-rebuild.sh script should use portage API instead of messing with VDB directly
Summary: dev-lang/ocaml - ocaml-rebuild.sh script should use portage API instead of me...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Team for the ML programming language family
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-05 12:28 UTC by Jakub Moc (RETIRED)
Modified: 2011-06-11 17:39 UTC (History)
1 user (show)

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


Attachments
ocaml-rebuild.sh (ocaml-rebuild.sh,1.72 KB, text/plain)
2008-02-05 15:44 UTC, Jakub Moc (RETIRED)
Details
Some clean up without messing too much around (ocaml-rebuild.sh.patch,2.40 KB, text/plain)
2008-06-05 15:06 UTC, Christian Faulhammer (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Moc (RETIRED) gentoo-dev 2008-02-05 12:28:09 UTC
This really is nasty, please have a look at portageq and use that for the script internals, instead of doing grep on hardcoded VDB location. I really don't have time to rewrite this ATM, but here's some idea:

`portageq match / ''` gives you a list of installed packages, save it to pkg
`portageq metadata / ebuild $pkg DEPEND` gives you DEPENDs of $pkg, grep it for 
dev-lang/ocaml and dev-ml/findlib, if you get a match, save it to tocleanstr/tobuildstr
- do your job now...
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-02-05 15:44:02 UTC
Created attachment 142729 [details]
ocaml-rebuild.sh

A quick rewrite... play with this. :)
Comment 2 Alexis Ballier gentoo-dev 2008-02-05 16:54:21 UTC
$ time dash ocaml-rebuild2.sh
[...]

real	10m39.998s
user	8m45.153s
sys	0m47.599s

$ time dash /usr/sbin/ocaml-rebuild.sh
[...]

real	0m38.953s
user	0m5.736s
sys	0m0.468s


is that really something we want to move to ?!?
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2008-06-05 15:06:31 UTC
Created attachment 155605 [details]
Some clean up without messing too much around

I got an error in line 38 of the old script anyway, so I cleaned up the script at least.  Even fixed some typos.
Comment 4 Alexis Ballier gentoo-dev 2008-06-05 18:07:14 UTC
(In reply to comment #3)
> Created an attachment (id=155605) [edit]
> Some clean up without messing too much around
> 
> I got an error in line 38 of the old script anyway, so I cleaned up the script
> at least.  Even fixed some typos.
> 

hmm yeah that's the slot stuff I had been poked about.
I was thinking about simplifying the stuff here, but first the story:
- the script removes & reinstalls ocaml packages
- it used to do =cat/pkg-version, which fails if the package has been removed since it was installed
- it was then changed to >=cat/pkg-version
- then it didnt reinstall slotted packages

So what I'm thinking about is something:
emerge >=cat/pkg-version:slot

that'll remove the slot hack and should fix your syntax error.

About the change from `` to $(), I'd prefer the former as it seems `` is supported by more shells (even if we force bash for now, and even if $() is "nicer")
Comment 5 Christian Faulhammer (RETIRED) gentoo-dev 2008-06-06 07:06:57 UTC
(In reply to comment #4)
> hmm yeah that's the slot stuff I had been poked about.
> I was thinking about simplifying the stuff here, but first the story:
> - the script removes & reinstalls ocaml packages
> - it used to do =cat/pkg-version, which fails if the package has been removed
> since it was installed
> - it was then changed to >=cat/pkg-version
> - then it didnt reinstall slotted packages

 Just by the way, there exist qatom which can do the atom extraction for you.
 
> So what I'm thinking about is something:
> emerge >=cat/pkg-version:slot
> 
> that'll remove the slot hack and should fix your syntax error.

 I am fine with it.
 
> About the change from `` to $(), I'd prefer the former as it seems `` is
> supported by more shells (even if we force bash for now, and even if $() is
> "nicer")

 That makes me sad. :)

Comment 6 Alexis Ballier gentoo-dev 2011-06-11 17:39:51 UTC
well, now ocaml-3.12.0-r1 installs a portage set file to replace ocaml-rebuild.sh; emerge @ocaml-rebuild

->fixed