summaryrefslogtreecommitdiff
path: root/dev-lang/ocaml/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-lang/ocaml/files
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-lang/ocaml/files')
-rw-r--r--dev-lang/ocaml/files/ocaml-rebuild.sh51
-rw-r--r--dev-lang/ocaml/files/ocaml.conf5
2 files changed, 56 insertions, 0 deletions
diff --git a/dev-lang/ocaml/files/ocaml-rebuild.sh b/dev-lang/ocaml/files/ocaml-rebuild.sh
new file mode 100644
index 000000000000..7dd14a4eb7d2
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml-rebuild.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+# run like this: ocaml-rebuild.sh [-h | -f] [emerge_options]
+
+emerge=/usr/bin/emerge
+
+if [ "$1" = "-h" ]
+then
+ echo "usage: ocaml-rebuild.sh [-h | -f(orce)] [emerge_options]"
+ echo "With -f, the packages will first be unmerged and then emerged"
+ echo "with the given options to ensuree correct dependancy analysis."
+ echo "Otherwise emerge is run with the --pretend flag and the given"
+ echo "options."
+ echo "It is recommended to keep the list of rebuilt packages printed"
+ echo "in pretend mode in case something go wrong"
+ exit 1
+fi
+
+if [ "$1" = "-f" ]
+then
+ pretend=0
+ shift
+else
+ pretend=1
+fi
+
+depends=`find /var/db/pkg -name DEPEND -exec grep -l 'dev-lang/ocaml\\|dev-ml/findlib' {} \;`
+
+for dep in $depends
+do
+ dir=`dirname $dep`
+ pkg=`basename $dir`
+ category=`cat $dir/CATEGORY`
+ slot=`cat $dir/SLOT`
+
+ tobuild=">=$category/$pkg:$slot $tobuild"
+ tobuildstr="\">=$category/$pkg:$slot\" $tobuildstr"
+done
+
+if [ "$tobuild" = "" ] ; then
+ echo "Nothing to do!"
+ exit 0
+fi
+
+echo Building $tobuildstr
+
+if [ $pretend -eq 1 ]
+then
+ $emerge --pretend $@ $tobuild
+else
+ $emerge --oneshot $@ $tobuild
+fi
diff --git a/dev-lang/ocaml/files/ocaml.conf b/dev-lang/ocaml/files/ocaml.conf
new file mode 100644
index 000000000000..083b8cef960b
--- /dev/null
+++ b/dev-lang/ocaml/files/ocaml.conf
@@ -0,0 +1,5 @@
+# Rebuild all ocaml modules (must be rebuilt after each ocaml upgrade)
+[ocaml-rebuild]
+class = portage.sets.dbapi.OwnerSet
+files = /usr/lib/ocaml
+exclude-files = /usr/bin/ocaml