Commits

camlspotter committed 78f3dc2

CleanOPAMPackages

  • Participants
  • Parent commits d0ef6ea

Comments (0)

Files changed (1)

 
 OPAMPrefix = $(shell opam config -var prefix)
 
+CleanOPAMPackages() =
+    installed=$(shell opam list -installed | awk '$$2 !~ /(base|system|package)/ { print $$1 }')
+    if $(gt $(length $(installed)), 0):
+        println(Uninstalling OPAM packages: $(string $(installed)))
+        opam --yes remove $(installed)
+
 GetOPAMBuildDir(opamname) =
     ver = $(GetOPAMVersion $(opamname))
     return "$(OPAMPrefix)$(DIRSEP)build$(DIRSEP)$(opamname).$(ver)"