[commit: ghc] master: ghc-pkg: Allow unregistering multiple packages in one call (0014fa5)

git at git.haskell.org git at git.haskell.org
Sun Oct 2 00:02:00 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0014fa56e9f2fe936da85627c92a288037c8c19b/ghc

>---------------------------------------------------------------

commit 0014fa56e9f2fe936da85627c92a288037c8c19b
Author: Niklas Hambüchen <mail at nh2.me>
Date:   Sat Oct 1 17:57:32 2016 -0400

    ghc-pkg: Allow unregistering multiple packages in one call
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2550
    
    GHC Trac Issues: #12637


>---------------------------------------------------------------

0014fa56e9f2fe936da85627c92a288037c8c19b
 utils/ghc-pkg/Main.hs | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 399522a..91eaeec 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -226,8 +226,8 @@ usageHeader prog = substProg prog $
   "    Register the package, overwriting any other package with the\n" ++
   "    same name. The input file should be encoded in UTF-8.\n" ++
   "\n" ++
-  "  $p unregister {pkg-id}\n" ++
-  "    Unregister the specified package.\n" ++
+  "  $p unregister [pkg-id] \n" ++
+  "    Unregister the specified packages in the order given.\n" ++
   "\n" ++
   "  $p expose {pkg-id}\n" ++
   "    Expose the specified package.\n" ++
@@ -422,9 +422,10 @@ runit verbosity cli nonopts = do
         registerPackage filename verbosity cli
                         multi_instance
                         expand_env_vars True force
-    ["unregister", pkgarg_str] -> do
-        pkgarg <- readPackageArg as_arg pkgarg_str
-        unregisterPackage pkgarg verbosity cli force
+    "unregister" : pkgarg_strs@(_:_) -> do
+        forM_ pkgarg_strs $ \pkgarg_str -> do
+          pkgarg <- readPackageArg as_arg pkgarg_str
+          unregisterPackage pkgarg verbosity cli force
     ["expose", pkgarg_str] -> do
         pkgarg <- readPackageArg as_arg pkgarg_str
         exposePackage pkgarg verbosity cli force



More information about the ghc-commits mailing list