summaryrefslogtreecommitdiffstats
path: root/libraries/ocaml-findlib/doinst.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ocaml-findlib/doinst.sh')
-rw-r--r--libraries/ocaml-findlib/doinst.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/libraries/ocaml-findlib/doinst.sh b/libraries/ocaml-findlib/doinst.sh
index 842fcab2f7..fcce56473e 100644
--- a/libraries/ocaml-findlib/doinst.sh
+++ b/libraries/ocaml-findlib/doinst.sh
@@ -1,14 +1,14 @@
-#!/bin/sh
config() {
- old="$1"
- new="$old.new"
- if [ ! -r $old ]; then
- mv $new $old
- elif [ "$(cat $old | md5sum)" = "$(cat $new | md5sum)" ]; then
- rm $new
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
fi
}
-config etc/findlib.conf
+config etc/findlib.conf.new
destdir=$(chroot . /usr/bin/ocamlfind printconf destdir)/stublibs
ldconf=$(chroot . /usr/bin/ocamlfind printconf ldconf)