ysulsky avatar ysulsky committed 7614c2d

build-and-install: uninstall in reverse order

Comments (0)

Files changed (2)

base/type-conv/syntax/META

 # OASIS_START
-# DO NOT EDIT (digest: b651fcddae83a0b465ce4d37e1e3eb78)
+# DO NOT EDIT (digest: 0db3e3d863cd3be314dcea4d54ef71a5)
 version = "2.3.0"
 description = "Syntax extension for type-conv"
 requires = "camlp4"
-archive(syntax,preprocessor) = "pa_type_conv.cma"
-archive(syntax,toploop) = "pa_type_conv.cma"
+archive(syntax, preprocessor) = "pa_type_conv.cma"
+archive(syntax, toploop) = "pa_type_conv.cma"
 exists_if = "pa_type_conv.cma"
 # OASIS_STOP
 

build-and-install

 async
 "
 
+if $uninstall; then
+  libraries=$(echo "$libraries" | tac)
+fi
+
 cd "$tree"
 for dir in $libraries; do
   echo "------ base/$dir ------"
   pushd base/$dir
   optflags=
+  
+  if $uninstall; then
+    make uninstall || true
+    popd; continue
+  fi
+  
   case $dir in
       core|core/extended) optflags="$linuxflag $timerflag" ;;
       async/scheduler)    optflags="$linuxflag" ;;
       async) # horrible hack (avoids rebuilding async_{core,scheduler,extra})
+          src=$(pwd)
           dest=$(mktemp -d -t ocaml-core-async.XXXXXX)
           mkdir -p "$dest/base/async"
           cp -rp ../../build-common.sh "$dest/"
           trap "rm -r '$dest'" EXIT
           ;;
   esac
-  if $uninstall; then
-    make uninstall || true
-  else
-    ./oasis.sh $optflags "${configopts[@]:+${configopts[@]}}"
-    make build BUILDFLAGS="$makeflags"
-    make install || true
-  fi
+  ./oasis.sh $optflags "${configopts[@]:+${configopts[@]}}"
+  make build BUILDFLAGS="$makeflags"
+  make install || true
+
+  case $dir in
+      async) # copy the generated setup.ml and setup.data back
+        cp -rp "$dest"/base/async/{Makefile,setup.ml,setup.data,myocamlbuild.ml} "$src"/
+      ;;
+  esac
   popd
 
 done
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.