hub 1.3.0 → 1.4.0
raw patch · 22 files changed
+35/−1103 lines, 22 files
Files
- Hub/Commands.hs +2/−2
- Hub/Directory/Allocate.hs +0/−37
- Hub/Hub.hs +2/−1
- Hub/Parse.hs +19/−5
- Hub/Poss.hs +7/−1
- Hub/Prog.hs +2/−0
- Makefile +0/−26
- README +0/−12
- Version.hs +0/−20
- help.txt +0/−205
- hub.cabal +2/−2
- hub.hs +1/−1
- hub.manifest +0/−5
- man/Makefile +0/−19
- man/bin/fixup.sh +0/−28
- man/hub-1.txt +0/−526
- man/hub-5.txt +0/−127
- man/hub.1.gz binary
- man/hub.5.gz binary
- man/manpage-base.xsl +0/−35
- man/manpage-normal.xsl +0/−13
- prep.hs +0/−38
Hub/Commands.hs view
@@ -4,7 +4,7 @@ -- This module provides the routines the Main dispatcher calls fater analysing -- the CommandLine AST. ----- (c) 2011-2012 Chris Dornan+-- (c) 2011-2015 Chris Dornan module Hub.Commands@@ -248,7 +248,7 @@ _install hub pkns = do notLocked hub execP HubO (EE InheritRS InheritRS [] []) FullMDE hub CabalP- ("install":map prettyPkgNick pkns)+ ("install":inst_aHUB hub++map prettyPkgNick pkns) _erase :: Hub -> [PkgNick] -> Bool -> IO () _erase hub pkns0 ff =
− Hub/Directory/Allocate.hs
@@ -1,37 +0,0 @@------ >>> Hub.Directory.Allocate <<<------ This module logically belongs to HUb.Directory and would be placed there--- except doing so would establish an import sysle between Hub.Hub and--- Hub.Directory through Hub.Parse.------ (c) 2011-2012 Chris Dornan---module Hub.Directory.Allocate- ( allocate- ) where--import qualified Control.Exception as E-import Text.Printf-import System.Directory-import System.Environment-import Hub.System----- allocate a library directory from the heap in the (default) directory--allocate :: IO FilePath-allocate =- do hme <- home- createDirectoryIfMissing True $ printf "%s/.hubrc/heap" hme- i <- inc $ printf "%s/.hubrc/heap/counter.txt" hme- let pth = printf "%s/.hubrc/heap/%d" hme i- createDirectoryIfMissing True pth- return pth--home :: IO FilePath-home = catchIO (getEnv "HOME") $ \_ -> return "/"--catchIO :: IO a -> (IOError->IO a) -> IO a-catchIO = E.catch
Hub/Hub.hs view
@@ -6,7 +6,7 @@ -- the 'exec' utilities for setting up the PATH, GHC_PACKAGE_PATH and munging -- cabal's command-line arguments, etc. ----- (c) 2011-2012 Chris Dornan+-- (c) 2011-2015 Chris Dornan module Hub.Hub@@ -51,6 +51,7 @@ , tl_binHUB :: FilePath , ci_vrnHUB :: Maybe String , glb_dbHUB :: FilePath+ , inst_aHUB :: [String] , usr___HUB :: Maybe UsrHub } deriving (Show)
Hub/Parse.hs view
@@ -4,7 +4,7 @@ -- This module parses the hub XML file to produce a Hub, and the inverse, -- dumping a Hub into XML. ----- (c) 2011-2012 Chris Dornan+-- (c) 2011-2015 Chris Dornan module Hub.Parse@@ -54,6 +54,8 @@ ] ++ [ printf " <lockd>%s</lockd>" lks | not $ null lks ] +++ [ printf " <insta>%s</insta>" $ string2xml $ unwords insa | not $ null insa+ ] ++ [ "</hub>" ] @@ -70,6 +72,7 @@ mb_civrn = ci_vrnHUB hub glbdb = glb_dbHUB hub mb_uh = usr___HUB hub+ insa = inst_aHUB hub fail_err :: HubName -> FilePath -> Err -> IO a@@ -117,6 +120,7 @@ , chk_usrdb , chk_usrgh , chk_lockd+ , chk_insta -- depracated (no warnings yet) , chk_hpbin , chk_cibin@@ -135,11 +139,12 @@ , usrghST :: Maybe FilePath , usrdbST :: Maybe FilePath , lockdST :: Maybe Bool+ , instaST :: Maybe [String] } deriving (Show) start :: HubName -> FilePath -> Loc -> PSt start hn fp lc =- ST hn fp lc Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing+ ST hn fp lc Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing final :: HubSource -> FilePath -> HubKind -> Poss Err PSt -> Poss Err Hub final _ _ _ (NOPE er) = NOPE er@@ -149,17 +154,19 @@ tl <- get_tl cv <- get_cv gl <- get_gl+ ia <- get_ia mb_pr <- case (mb_ur,mb_gh) of (Just ur,Nothing) -> (Just . ((,) ur)) `fmap` calc_gh gl (Just ur,Just gh) -> return $ Just (ur,gh) (Nothing,_ ) -> return Nothing- return $ HUB hs hn hk hf co hc tl cv gl $ fmap mk_uhb mb_pr+ return $ HUB hs hn hk hf co hc tl cv gl ia $ fmap mk_uhb mb_pr where get_co = maybe (YUP "" ) YUP mb_co get_hc = maybe (NOPE hc_err ) YUP mb_hc get_tl = maybe (YUP toolsBin) YUP mb_tl get_cv = maybe (YUP Nothing ) (YUP . Just) mb_cv get_gl = maybe (NOPE gl_err ) YUP mb_gl+ get_ia = maybe (YUP [] ) YUP mb_ia hc_err = err lc "Hub doesn't specify a GHC bin directory" gl_err = err lc "Hub doesn't specify a global package directory"@@ -174,7 +181,7 @@ msg = "Could not derive the global hub name from the " ++ "filepath of the global package databse" - ST hn hf lc mb_co mb_hc mb_tl mb_cv mb_gl mb_gh mb_ur mb_lk = st+ ST hn hf lc mb_co mb_hc mb_tl mb_cv mb_gl mb_gh mb_ur mb_lk mb_ia = st trial :: PSt -> Node -> (PSt -> Node -> Maybe(Poss Err PSt)) -> Poss Err PSt -> Poss Err PSt trial st nd f ps = maybe ps id $ f st nd@@ -187,7 +194,7 @@ chk_comnt, chk_wspce, chk_hcbin, chk_tlbin, chk_civrn, chk_glbdb, chk_usrgh, chk_usrdb,- chk_hpbin, chk_cibin, chk_lockd :: PSt -> Node -> Maybe(Poss Err PSt)+ chk_hpbin, chk_cibin, chk_lockd, chk_insta :: PSt -> Node -> Maybe(Poss Err PSt) chk_wspce st nd = case nd of@@ -253,6 +260,13 @@ case lockdST st of Nothing -> YUP (st{lockdST=Just $ not $ all isSpace arg}) Just _ -> NOPE $ err lc "<lockd> respecified"++chk_insta st0 nd = simple_node True st0 nd "insta" chk+ where+ chk st lc arg =+ case instaST st of+ Nothing -> YUP (st{instaST=Just $ words arg})+ Just _ -> NOPE $ err lc "<insta> respecified" -- deprecated (pre-0.3) constructions
Hub/Poss.hs view
@@ -3,7 +3,7 @@ -- -- This module reestablishes an unvandalised monadic Either type. ----- (c) 2011-2012 Chris Dornan+-- (c) 2011-2015 Chris Dornan module Hub.Poss@@ -12,11 +12,17 @@ , ei2ps ) where +import Control.Applicative+ data Poss e a = NOPE e | YUP a deriving (Show) instance Monad (Poss e) where (>>=) ps f = poss NOPE f ps return = YUP++instance Applicative (Poss e) where+ (<*>) ps ps' = do f <- ps; x<-ps'; return $ f x+ pure = return instance Functor (Poss e) where fmap f p = poss NOPE (YUP . f) p
Hub/Prog.hs view
@@ -41,6 +41,7 @@ | HappyP | HaddockP | GhcModP+ | GhcModiP | HLintP | HDevToolsP | HaskellDocsP@@ -63,6 +64,7 @@ AlexP -> PROG p "alex" TlPT HappyP -> PROG p "happy" TlPT GhcModP -> PROG p "ghc-mod" TlPT+ GhcModiP -> PROG p "ghc-modi" TlPT HLintP -> PROG p "hlint" TlPT HDevToolsP -> PROG p "hdevtools" TlPT HaskellDocsP -> PROG p "haskell-docs" TlPT
− Makefile
@@ -1,26 +0,0 @@-OD = dist/build/hub-ID = /usr/hs/bin-HC = mkdir -p $(OD); ghc -XHaskell2010 --make -O1 -outputdir build -Wall-VR = $(shell runghc Version)-CM = "for building Hub ($(VR))" -OP = '\nNo hub on path: ensure hub-src.har or hub.cabal packages are installed\n\n' --all: hub--hub: prep- $(HC) -o $(OD)/hub hub.hs--prep:- hub load build-hub <build-hub.har || printf $(OP)- hub comment build-hub $(CM) || true- hub set build-hub || true- runhaskell prep--install:- install -D $(OD)/hub $(DESTDIR)$(ID)/hub- install -D man/hub.1.gz $(DESTDIR)/usr/share/man/man1/hub.1.gz- install -D man/hub.5.gz $(DESTDIR)/usr/share/man/man5/hub.5.gz--clean:- cabal clean- rm -rf build
− README
@@ -1,12 +0,0 @@-This package provides a utility for multiplexing multiple-GHC and Haskell Platform installations, the installation-being selected by environment variable or a hidden configuraton-file or in the current working directory or one of its parents.--Thye utility also allows users to build sandboxes (called hubs)-which may link to one of the the GHC installtions installed on-the local system, and extend them with packages private to the hub.--Utilities are also provided for erasing packages from an hub and-annotating, duplicating, renaming, locking, archiving and recovering-hubs.
− Version.hs
@@ -1,20 +0,0 @@------ >>> Version <<<------ Keeper of the version information.------ (c) 2011-2012 Chris Dornan---module Version- ( version- , main- ) where---version :: String-version = "1.3.0"---main :: IO ()-main = putStrLn version
− help.txt
@@ -1,205 +0,0 @@- Hub Help Page- - hub --usage is an aliase for the 'hub usage' command- hub --help is an aliase for the 'hub help' command- hub --version is an aliase for the 'hub version' command--hub usage-- List the syntax of all the hub commands.--hub help [<hub-command>]-- List the help for a command or all commands if none specified.-- See "hub usage" for a command-syntax summary.--hub version-- List the version information.--hub default [<g-hub>|-]-- (Needs to be run as root.)- - If no arguments are given then this command lists the the default global- hub for the system (i.e., the default global hub used to set up each- user's 'home' hub).- - If a global hub <g-hub> is specified then <g-hub> will become the- default global hub.- - If a '-' is specified then any older default settings are discarded and- the system default re-established.--hub ls [-a] [-q]-- List the user hubs belonging to the logged in user and all of the- global hubs. If -a is specified then all hubs are listed, otherwise- the hidden hub (those starting with "__") are ommitted. Normally the- locked status and any comments associated with the hub are displayed,- but these will be ommitted if the -q flag is given.--hub set [<hub>|-]-- Set the 'current' hub for a directory and its sub-directories.- - The HUB environment variable can be set to a hub name to override this- setting.- - '^' can genereally be specified in place of <hub>/<g-hub>/<u-hub>- in a hub command to refer to the current hub. --hub info [<hub>]-- Describe a hub. (See 'hub set' on how to set the current hub.)- - (See 'hub set' on how to set the current hub.)--hub lock [<hub>]-- Lock a hub so that it can not be removed or renamed or have packages- added or removed.-- (See 'hub set' on how to set the current hub.)--hub unlock [<hub>]-- Remove the lock from a hub.-- (See 'hub lock' on locking a hub and 'hub set' on how to set the current hub.)--hub name-- List the name of the current hub.- - (See 'hub set' on how to set the current hub.)--hub path [<hub>]-- List the path of the XML file defining the named or current hub.- - (See 'hub set' on how to set the current hub.)--hub xml [<hub>]-- List the contents of the XML file defining the named or current hub.- - (See 'hub set' on how to set the current hub.)--hub init [-n [<hub>]]-hub init [-s] [<hub>] <u-hub'>-- The first form creates a new user hub with some unique name __h<num>- and associates the current working directory with the new hub. If- a hub is specified then that determines the global hub for the new- hub otherwise the current defaulkt hub is used.- - The second from creates the new named user hub <u-hub'>. If <hub>- is specified then the global hub for the new hub is determined by- this hub otherwise the default hub is used. Iff --set is specified- the hub associated with the current directory is set to the new hub.- - (See 'hub set' on how to set the current hub.)--hub comment [<u-hub>] <comment-string>-- Set the comment string for a user hub.-- (See 'hub set' on how to set the current hub.)--hub cp [<u-hub>] <u-hub'>-- Duplicate <u-hub> (or the current hib) in <u-hub'>.- - (See 'hub set' on how to set the current hub.)--hub mv [<u-hub>] <u-hub'>-- Rename user hub <u-hub> (or the current hub) to <u-hub'>.- - (See 'hub set' on how to set the current hub.)--hub rm <u-hub>-- Delete user hub <u-hub>.--hub swap [<u-hub>] <u-hub'>-- Swap the contents of user hub <u-hub> (or the current hub) with- user hub <u-hub'>.- - (See 'hub set' on how to set the current hub.)--hub list [<hub>]-- List the packages belonging to a hub (calls 'ghc-pkg list').-- (See 'hub set' on how to set the current hub.)--hub check [<hub>]-- Check the packages belonging to a hub are coherent - (calls 'ghc-pkg check').-- (See 'hub set' on how to set the current hub.)--hub install <pkg-name> ...-- Equivalent to: hub install-into ^ <pkg-name> ... --hub install-into <u-hub> <pkg-name> ...-- Uses 'cabal install' to install the named packages into a user- hub.-- (See 'hub set' on how to set the current hub.)--hub erase <pkg-name> ...-- Equivalent to: hub esase-from ^ <pkg-name> ... --hub erase-from [-f] <u-hub> <pkg-name> ...-- Run the garbage collector on the user hubs to reclaim library code- that is no longer referenced by them. (The directories aren't removed- from the file system, but moved from `~/.hubrc/heap` to- `~/.hubrc/garbage` for manual removal.) -- (See 'hub set' on how to set the current hub.)--hub gc-- Run the garbage collector to reclaim library code that is no longer- referenced by the hubs.--hub save [<u-hub>]- - Save out the configuration of the hub onto standard output.-- (See 'hub set' on how to set the current hub.)--hub load [<u-hub>]-- Load the hub from standard input. If the named hub doesn't- exist then the hub is created with the global hub specified by the- archive. If <u-hub> does exist then it is checked that it is using the- global hub specified and if necessary removed and recreated referencing- the right global hub.- - Any surplus packages not mentioned in the archive are then removed.- - Finally any packages missing from the hub listed in the archive are- installed with cabal-install.-- (See 'hub set' on how to set the current hub.)--hub verify [-s] [<u-hub>]-- Check that the named hub (or the default hub) uses the global hub- specified in the archive and that it contains all of the packages- at the versions specified by the archive. If -s is specified- then check that the hub contains no packages other than those specified- by the archive.-- (See 'hub set' on how to set the current hub.)
hub.cabal view
@@ -1,6 +1,6 @@ Name: hub-Version: 1.3.0-Copyright: Chris Dornan, 2011-2013+Version: 1.4.0+Copyright: Chris Dornan, 2011-2015 Maintainer: Chris Dornan <chris@chrisdornan.com> Author: Chris Dornan <chris@chrisdornan.com> License: BSD3
hub.hs view
@@ -3,7 +3,7 @@ -- -- Main driver for the hub tool (see the README for details). ----- (c) 2011-2012 Chris Dornan+-- (c) 2011-2015 Chris Dornan module Main(main) where
− hub.manifest
@@ -1,5 +0,0 @@-^=7.6.3-List-0.5.1-hexpat-0.20.5-process-1.2.0.0-utf8-string-0.3.7
− man/Makefile
@@ -1,19 +0,0 @@-all: hub.1.gz hub.5.gz--%.gz: %- gzip -c $< >$@--%.html: %.xml- xmlto -m manpage-normal.xsl html $^- mv index.html $@--%.1: %-1.xml- xmlto -m manpage-normal.xsl man $^- bin/fixup.sh $@--%.5: %-5.xml- xmlto -m manpage-normal.xsl man $^- bin/fixup.sh $@--%.xml: %.txt- asciidoc -b docbook -d manpage $^
− man/bin/fixup.sh
@@ -1,28 +0,0 @@-#!/bin/bash--set -e--if [ $# -ne 1 ]; then- echo" usage: $0 <file>"- exit 1-fi--file=$1--if [ ! -f ${file} ]; then- echo ${file}: not found- exit 1-fi--if [ -f ${file}.tmp ]; then- echo ${file}.tmp: in use- exit 1-fi--version=$(cd .. && runghc Version)--mv ${file} ${file}.tmp--cat ${file}.tmp | sed -e 's/\[FIXME: manual\]/User Commands/' -e "s/\\[FIXME: source\\]/Hub ${version}/" >${file}--rm ${file}.tmp
− man/hub-1.txt
@@ -1,526 +0,0 @@-hub(1)-======--NAME------hub - manage Haskell hubs (for selecting toolchains, libraries and sandboxes)---SYNOPSIS---------------- hub usage- hub help [<hub-command>]- hub version- hub default [<g-hub>|-]- hub ls [-a] [-q]- hub set [<hub>|-]- hub info [<hub>]- hub lock [<hub>]- hub unlock [<hub>]- hub name- hub path [<hub>]- hub xml [<hub>]- hub init [-n [<hub>]]- hub init [-s] [<hub>] <u-hub'>- hub comment [<u-hub>] <comment-string>- hub cp [<u-hub>] <u-hub'>- hub mv [<u-hub>] <u-hub'>- hub rm <u-hub>- hub swap [<u-hub>] <u-hub'>- hub list [<hub>]- hub check [<hub>]- hub install <pkg-name> ...- hub install-into <u-hub> <pkg-name> ...- hub erase <pkg-name> ...- hub erase-from [-f] <u-hub> <pkg-name> ...- hub gc- hub save [<u-hub>]- hub load [<u-hub>]- hub verify [-s] [<u-hub>]-------DESCRIPTION--------------The hub tool (i) integrates multiple releases of the Glasgow-Haskell Compiler into a single installation with a simple-mechanism for selecting between the installations and (ii)-provides a sandbox mechanism, allowing users to install-packages on a per-project basis.--The tool organizes compilation contexts around so-called "hubs"-which contain their own GHC package databases. A global hub-is shared among all users on the system and is typically installed-with the system package utility (e.g., 'yum' or 'apt') from-a public repository. Each global hubs is associated with a-single global package database.--User hubs belong to individual users, point at a global hub and-own a user package database into which the user can install packages-with 'cabal' and 'ghc'.--A directory will typically be statically associated with a hub.-Invoking 'cabal' and 'ghc within such a directory (or any of its-sub-directories) will select the appropriate version of GHC-(as determined by the hub configuration) and will set up the-tools to work with package database that is private to that-hub.--This is perhaps best illustrated by a sample session:------- hub init -n 7.0.4 # create new hub based on GHC-7.0.4- # and associate the current directory with it- cabal install SHA # install the latest version of the SHA package- # in the user package database of the hub- ghci crypto.hs # load crypto.hs into 'ghci', which may make use of- # the GHC-7.0.4 core packages and the SHA- # package and any of its dependent packages.-------(This assumes GHC-7.0.4 is already installed; if not it may need to be-installed first with, for example 'yum install ghc-7.0.4-hub'.)--Each hub is named. We didn't specify a name for the new hub in the above-example so a new unused name like '__h006' will have been chosen. It could-be renamed to something more distinctive and then associated with another work-tree.------- hub mv __h006 crypto # rename hub to something more memorable- hub set crypto # remember to re-associate the current directory- # with the newly-named hub- cd ~/digest # switch to another work tree- hub set crypto # associate it with the crypto hub-------Now both work trees will be associated with the 'crypto' hub and any changes-made to it -- adding or removing packages -- will be reflected in the GHC-compilation context of both work trees.- -To list all of the hub available to a user use------- hub ls-------The listing won't include any hubs with names that start with '__'. To see-these in the listing use.------- hub ls -a--------To find out more about an individual hub use------- hub info crypto--------Note that global hub names start with a digit (e.g., '7.0.4',-'2011.4.0.0') and user hub names start with a letter or underscore-(e.g., 'crypto', '__h006').--As well as the directory context, the 'HUB' environment variable can-be used to select the context for Haskell toolkit command. E.g.,------- HUB=2011.2.0.1 ghc-pkg list-------If the HUB environment variable is set it will always take precedence over-any directory settings.--To copy, rename, remove, swap, (un)lock, save, verify or load-a hub then use the 'hub cp', 'hub mv', 'hub rm', 'hub swap',-'hub lock', 'hub unlock', 'hub save', 'hub verify' or 'hub load',-respectively (see below).--If you have acquired the hub tool by installing the hub package-everything should be set up for you. Otherwise, you will have to-install the hub binary on your execution path under its own name ('hub')-and under the name of each of the standard GHC tools ('ghc', 'ghci',-'ghc-pkg', etc., and 'cabal') you want it to manage. (This is usually-managed by installing the hub program into a directory (like `/usr/hs/bin`)-and creating links from 'ghc', 'ghci', 'ghc-pkg', 'cabal', etc. to the-'hub' program.) --To add a new global hub you will have to install an xml file in-`/usr/hs/hub (see hub(5) for details of the format of this file). Each-global hub configuration must specify where the compiler tools-are located.---COMMANDS------------`hub usage`::-- Lists the syntax of all the hub commands.---`hub help [<hub-command>]`::-- Lists the help for a command or all commands if none- specified. See "hub usage" for a command-syntax summary.---`hub version`::-- Lists the version information.---`hub default [<g-hub>|-]`::-- (Needs to be run as root.) If no arguments are given then this- command lists the the default global hub for the system (i.e.,- the default global hub used to set up each user's 'home' hub). If- a global hub <g-hub> is specified then <g-hub> will become the- default global hub. If a '-' is specified then any older default- settings are discarded and the system default re-established.---`hub ls [-a] [-q]`::-- List the user hubs belonging to the logged in user and all of the- global hubs. If -a is specified then all hubs are listed, otherwise- the hidden hub (those starting with "__") are ommitted. Normally the- locked status and any comments associated with the hub are displayed,- but these will be ommitted if the -q flag is given.---`hub set [<hub>|-]`::-- Set the 'current' hub for a directory and its sub-directories.- The HUB environment variable can be set to a hub name to override- this setting.---`hub info [<hub>]`::-- Describe a hub. (See 'hub set' on how to set the current hub.)---`hub lock [<hub>]`::-- Lock a hub so that it can not be removed or renamed or have packages- added or removed.---`hub unlock [<hub>]`::-- Remove the lock from a hub (see `hub lock` above).---`hub name`::-- List the name of the current hub. (See 'hub set' on how to set- the current hub.)---`hub path [<hub>]`::-- List the path of the XML file defining the named or current- hub.---`hub xml [<hub>]`::-- List the contents of the XML file defining the named or current- hub.---`hub init [-n [<hub>]]`::-- (See also 'hub init [-s]' below.) Create a new user hub with some- unique name __h<num> and associates the current working directory with- the new hub. If a hub is specified then that determines the global- hub for the new hub otherwise the current default hub is used.---`hub init [-s] [<hub>] <u-hub'>`::-- (See also 'hub init -n' above.) Create the new named user hub <u-hub'>.- If <hub> is specified then the global hub for the new hub is determined by- this hub otherwise the default hub is used. Iff -s is specified- the hub associated with the current directory is set to the new hub.---`hub cp [<u-hub>] <u-hub'>`::-- Duplicate <u-hub> (or the current hub) in- <u-hub'>. (See 'hub set' on how to set the current hub.)---`hub mv [<u-hub>] <u-hub'>`::-- Renames user hub <u-hub> (or the current hub) to <u-hub'>. (See- 'hub set' on how to set the current hub.)---`hub rm <u-hub>`::-- Deletes user hub <hub>.---`hub swap [<u-hub>] <u-hub'>`::-- Swaps the contents of user hub <u-hub> (or the current hub) with- user hub <u-hub'>.---`hub list [<hub>]`::-- List the packages belonging to a hub (calls 'ghc-pkg list').---`hub check [<hub>]`::-- Check the packages belonging to a hub are coherent - (calls 'ghc-pkg check').---`hub install <pkg-name>`... ::-- Equivalent to: hub install-into ^ <pkg-name> ...---`hub install-into <u-hub> <pkg-name>`... ::-- Uses 'cabal install' to install the named packages into the named- hub (or the current hub). (See 'hub set' on how to set the current hub.)---`hub erase <pkg-name>`... ::-- Equivalent to: hub erase-from ^ <pkg-name> ...---`hub erase-from <u-hub> <pkg-name>`...::-- Determine all of the packages dependent on the list of named packaqes- in the hub, lists them and offers to remove them from the hub (by- invoking 'ghc-pkg unregister'). (See 'hub set' on how to set the- current hub.)---`hub gc`::-- Run the garbage collector on the user hubs to reclaim library code- that is no longer referenced by them. (The directories aren't removed- from the file system, but moved from `~/.hubrc/heap` to- `~/.hubrc/garbage` for manual removal.)--`hub save [<u-hub>]`::-- Save out the configuration of the hub onto standard output.- (See 'hub set' on how to set the current hub.)---`hub load [<u-hub>]`::-- Load the hub from standard input. (i) If the named hub doesn't- exist then the hub is created with the global hub specified by the- archive; but If <u-hub> does exist then it is checked that it is using- the global hub specified and if necessary removed and recreated- referencing the right global hub. (ii) Any surplus packages not- mentioned in the archive are then removed. (iii) Finally any packages- missing from the hub listed in the archive are installed with- `cabal-install`.---`hub verify [-s] [<u-hub>]`::-- Check that the named hub (or the default hub) uses the global hub- specified in the archive and that it contains all of the packages- at the versions specified by the archive. If -s is specified- then check that the hub contains no packages other than those specified- by the archive.---EXAMPLE 1------------List the packages in the (installed) 2011.2.0.1 Haskell Platform:------- HUB=2011.2.0.1 ghc-pkg list-------or equivalently,------- hub list 2011.2.0.1--------EXAMPLE 2------------Create a new hub based on the default hub, attach it to the current directory-and install the latest edition of `hexpat` into it.------- hub init- cabal install hexpat--------EXAMPLE 3------------Duplicates the contents of hub `foo` into hub `bar`-and installs the SHA package into it.------- hub cp foo bar- hub install-into bar SHA--------EXAMPLE 4------------Unpacks `GLUT-2.1.2.1` and runs one of its example programs using the-(installed) Haskell Platform 2011.2.0.1.------- cabal unpack GLUT-2.1.2.1- HUB=2011.2.0.1 runhaskell GLUT-2.1.2.1/examples/BOGLGP/Chapter01/Simple.hs--------EXAMPLE 5------------Install the `SHA` package into `my-test` and lock the hub against it being -removed, renamed or having packages added or removed.------ hub install-into my-test SHA- hub lock my-test--------EXAMPLE 6------------Remove the `text` package from the current hub, performs a garbage collection-of the user hubs and check all of the package databases for consistency-(assumes `bash`).------- hub erase text- hub gc- for h in $(hub ls -a -q); do hub check ${h}; done--------EXAMPLE 7------------Archive the current hub into precious.har.------- hub save >precious.har----- ---EXAMPLE 8------------(i) Load hub precious from `precsious.har`, creating the hub and erasing and-installing packages as necessary; doing nothing if the hub already exists-in the correct configuration. (ii) Configure the current work tree to use-`precious`. (iii) Use `precious` to compile `golum.hs`.------- hub load precious <precious.har- hub set precious- ghc --make golum.hs----- -----ENVIRONMENT VARIABLES------------------------`HUB`::-- This environment variable determines the hub that the hub- wrapper will use while invoking a compiler tool. If it is not- set then the .hub file (set by `hub set`) in the current- directory or one its parent directories is used to determine- the 'current' hub. If no parent directory defines the current- hub then the default global hub is used (see the `hub default`- command). The `HUB` environment variable overrides all of- these so it is best left unset in interactive sessions unless- you really want to force a single hub to be used regardless of- work tree configuration.---FILES--------`.hub`::-- Lists the name of the hub for the current directory- and it's subdirectories.--`~/.hubrc/hub/<u-hub>.xml`::-- Contains the hub-spefification file for user hub <u-hub>.--`~/.hubrc/lib/<u-hub>/package.config`::-- Contains the package database for user hub <u-hub>.--`~/.hubrc/heap`::-- Contains directories containing the library files for the- packages installed in the user hubs.--`~/.hubrc/garbage`::-- Contains directories removed from `~/.hubrc/heap` by the garbage collector.--`/usr/hs/bin`::- The standard location for the 'hub' program and the rest of- the Haskell tools (as links to the 'hub' program) -- this directory- should be put on the PATH if the tools aren't installed in /usr/bin.--`/usr/hs/hub/<g-hub>.xml`::-- XML configuration file for global hub <g-hub>.--`/usr/hs/db`::-- Standard location for the package databases for system hubs.--`/usr/hs/ghc/<version>`::-- Standard location for GHC <version> installation.--`/usr/hs/hp/<version>`::-- Standard installation locations for Haskell Platform <version>.---SEE ALSO-----------hub(5)::-- Describes the format of the XML configuration files used to- configure the user and global hubs.---http://justhub.org::-- The home page of the JustHub distribution contains- introductory material and links to wikis and articles.---BUGS-------The Hub issue tracker is at https://github.com/haskell-hub/hub-src/issues.----AUTHOR--------Chris Dornan <chris@chrisdornan.com>
− man/hub-5.txt
@@ -1,127 +0,0 @@-hub(5)-======---NAME------hub - syntax of XML files used to configure Haskell hubs---SYNOPSIS-----------A Hub configuration file is an XML file that always contains a-`<hub>` node, which will contain a '<comnt>', `<hcbin>`, '<tlbin>' and-`<glbdb>` sub-nodes.--If (and only if) the file is configuring a user hub, it will also have a-`<usrgh>` and `<usrdb>` sub-nodes and possibly a `<lockd>` sub-node.---DESCRIPTION--------------`<comnt>`::-- Brief single-line of text describing the hub.--`<hcbin>`::-- The path of the `bin` directory containing the `ghc` tools- to be used with the hub.- -`<tlbin>`::- - The path of directory containing the generic tools (especially `cabal`)- to be used with the hub.--`<civrn>`::- - The version of 'Cabal-install' to use with this hub. The presence of this- node is optional. When present it will force the use of- '<tlbin>/cabal-<civrn>' for the cabal executable.--`<glbdb>`::-- The path of the global package database to be used with the- hub.--`<usrgh>`::- - The name of the global hub associated with this user hub (present for- user hubs only).--`<usrdb>`::-- The path of the user package database to be used with the- hub (present for user hubs only).--`<lockd>`::-- The presence of this node signifies that the hub is locked. If it is- present it should contain the string "rmie". (Only user hubs may- be locked.)---EXAMPLE 1------------Hub configuration file for global hub `2011.2.0.1`:------- <hub>- <comnt>Haskell Platform 2011.2.0.1</comnt>- <hcbin>/usr/hs/ghc/7.0.3/bin</hcbin>- <glbdb>/usr/hs/db/2011.2.0.1.d</glbdb>- </hub>--------EXAMPLE 2------------Hub configuration file for hub `home`, a user hub based-on the global hub `7.4.1`:------- <hub>- <comnt>Hub for building the hub tool</comnt>- <hcbin>/usr/hs/ghc/7.4.1/bin</hcbin>- <tlbin>/usr/hs/tools</tlbin>- <civrn>0.14.0</civrn>- <usrgh>7.4.1</usrgh>- <glbdb>/usr/hs/db/7.4.1.d</glbdb>- <usrdb>/home/chris/.hubrc/lib/hub-src/package.config</usrdb>- </hub>--------FILES--------`~/.hubrc/hub/<u-hub>.xml`::-- Contains the hub-spefification file for user hub <u-hub>.--`/usr/hs/hub/<g-hub>.xml`::-- XML configuration file for global hub <g-hub>.---SEE ALSO-----------hub(1)::-- The hub command for managing and configuring user hubs.---http://justhub.org::-- The home page of the JustHub distribution contains- introductory material and links to wikis and articles.---AUTHOR--------Chris Dornan <chris@chrisdornan.com>
− man/hub.1.gz
binary file changed (5370 → absent bytes)
− man/hub.5.gz
binary file changed (1544 → absent bytes)
− man/manpage-base.xsl
@@ -1,35 +0,0 @@-<!-- manpage-base.xsl:- special formatting for manpages rendered from asciidoc+docbook -->-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"- version="1.0">--<!-- these params silence some output from xmlto -->-<xsl:param name="man.output.quietly" select="1"/>-<xsl:param name="refentry.meta.get.quietly" select="1"/>--<!-- convert asciidoc callouts to man page format;- git.docbook.backslash and git.docbook.dot params- must be supplied by another XSL file or other means -->-<xsl:template match="co">- <xsl:value-of select="concat(- $git.docbook.backslash,'fB(',- substring-after(@id,'-'),')',- $git.docbook.backslash,'fR')"/>-</xsl:template>-<xsl:template match="calloutlist">- <xsl:value-of select="$git.docbook.dot"/>- <xsl:text>sp </xsl:text>- <xsl:apply-templates/>- <xsl:text> </xsl:text>-</xsl:template>-<xsl:template match="callout">- <xsl:value-of select="concat(- $git.docbook.backslash,'fB',- substring-after(@arearefs,'-'),- '. ',$git.docbook.backslash,'fR')"/>- <xsl:apply-templates/>- <xsl:value-of select="$git.docbook.dot"/>- <xsl:text>br </xsl:text>-</xsl:template>--</xsl:stylesheet>
− man/manpage-normal.xsl
@@ -1,13 +0,0 @@-<!-- manpage-normal.xsl:- special settings for manpages rendered from asciidoc+docbook- handles anything we want to keep away from docbook-xsl 1.72.0 -->-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"- version="1.0">--<xsl:import href="manpage-base.xsl"/>--<!-- these are the normal values for the roff control characters -->-<xsl:param name="git.docbook.backslash">\</xsl:param>-<xsl:param name="git.docbook.dot" >.</xsl:param>--</xsl:stylesheet>
− prep.hs
@@ -1,38 +0,0 @@------ >>> Main (prep) <<<------ This program 'Haskelises' the hub help text.------ (c) 2011-2012 Chris Dornan---module Main(main) where--import System.Locale-import Data.Time-import Text.Printf---main :: IO ()-main =- do cts <- readFile "help.txt"- writeFile "Hub/HelpText.hs" $ mk_text_mod "Hub.HelpText" "helpText" cts--mk_text_mod :: String -> String -> String -> String-mk_text_mod mn fn cts =- case lines cts of- [] -> error "that is strange, the text file is empty"- ln:lns -> unlines $ pre ln ++ foldr mdl pst lns- where- pre ln = [ printf "module %s(%s) where" mn fn- , ""- , printf "%s :: String" fn- , printf "%s = unlines" fn- , printf " [ %s" $ show ln- ]-- mdl ln t = [ printf " , %s" $ show ln- ] ++ t-- pst = [ " ]"- ]