summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-19 14:07:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-19 14:07:23 -0400
commit00153eed48a2328969cc08688ef674a4c19c2014 (patch)
treef2ee8ac90225d1d2329f45b43061b53b7757d815 /Remote
parentec9e9343d9fa99b0786ee93ff142484e2402d3c8 (diff)
unify elipsis handling
And add a simple dots-based progress display, currently only used in v2 upgrade.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Bup.hs10
-rw-r--r--Remote/Git.hs4
-rw-r--r--Remote/Hook.hs4
-rw-r--r--Remote/Rsync.hs4
-rw-r--r--Remote/S3real.hs6
-rw-r--r--Remote/Web.hs4
6 files changed, 16 insertions, 16 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index 4ea455226..1023cda18 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -76,7 +76,7 @@ bupSetup u c = do
-- bup init will create the repository.
-- (If the repository already exists, bup init again appears safe.)
- showNote "bup init"
+ showAction "bup init"
bup "init" buprepo [] >>! error "bup init failed"
storeBupUUID u buprepo
@@ -93,7 +93,7 @@ bupParams command buprepo params =
bup :: String -> BupRepo -> [CommandParam] -> Annex Bool
bup command buprepo params = do
- showProgress -- make way for bup output
+ showOutput -- make way for bup output
liftIO $ boolSystem "bup" $ bupParams command buprepo params
pipeBup :: [CommandParam] -> Maybe Handle -> Maybe Handle -> IO Bool
@@ -109,7 +109,7 @@ bupSplitParams :: Git.Repo -> BupRepo -> Key -> CommandParam -> Annex [CommandPa
bupSplitParams r buprepo k src = do
o <- getConfig r "bup-split-options" ""
let os = map Param $ words o
- showProgress -- make way for bup output
+ showOutput -- make way for bup output
return $ bupParams "split" buprepo
(os ++ [Param "-n", Param (show k), src])
@@ -157,7 +157,7 @@ remove _ = do
checkPresent :: Git.Repo -> Git.Repo -> Key -> Annex (Either IOException Bool)
checkPresent r bupr k
| Git.repoIsUrl bupr = do
- showNote ("checking " ++ Git.repoDescribe r ++ "...")
+ showAction $ "checking " ++ Git.repoDescribe r
ok <- onBupRemote bupr boolSystem "git" params
return $ Right ok
| otherwise = liftIO $ try $ boolSystem "git" $ Git.gitCommandLine bupr params
@@ -172,7 +172,7 @@ storeBupUUID u buprepo = do
r <- liftIO $ bup2GitRemote buprepo
if Git.repoIsUrl r
then do
- showNote "storing uuid"
+ showAction "storing uuid"
onBupRemote r boolSystem "git"
[Params $ "config annex.uuid " ++ u]
>>! error "ssh failed"
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 1f22ad11c..de51c891e 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -115,7 +115,7 @@ inAnnex r key = if Git.repoIsUrl r
a <- Annex.new r
Annex.eval a (Content.inAnnex key)
checkremote = do
- showNote ("checking " ++ Git.repoDescribe r ++ "...")
+ showAction $ "checking " ++ Git.repoDescribe r
inannex <- onRemote r (boolSystem, False) "inannex"
[Param (show key)]
return $ Right inannex
@@ -156,7 +156,7 @@ copyToRemote r key
rsyncHelper :: [CommandParam] -> Annex Bool
rsyncHelper p = do
- showProgress -- make way for progress bar
+ showOutput -- make way for progress bar
res <- liftIO $ rsync p
if res
then return res
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index f0e4d5bfb..87f86ffe4 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -98,7 +98,7 @@ runHook :: String -> String -> Key -> Maybe FilePath -> Annex Bool -> Annex Bool
runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype hook
where
run command = do
- showProgress -- make way for hook output
+ showOutput -- make way for hook output
res <- liftIO $ boolSystemEnv
"sh" [Param "-c", Param command] $ hookEnv k f
if res
@@ -133,7 +133,7 @@ remove h k = runHook h "remove" k Nothing $ return True
checkPresent :: Git.Repo -> String -> Key -> Annex (Either IOException Bool)
checkPresent r h k = do
- showNote ("checking " ++ Git.repoDescribe r ++ "...")
+ showAction $ "checking " ++ Git.repoDescribe r
v <- lookupHook h "checkpresent"
liftIO (try (check v) ::IO (Either IOException Bool))
where
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index ca4236276..f073e7bd7 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -141,7 +141,7 @@ remove o k = withRsyncScratchDir $ \tmp -> do
checkPresent :: Git.Repo -> RsyncOpts -> Key -> Annex (Either IOException Bool)
checkPresent r o k = do
- showNote ("checking " ++ Git.repoDescribe r ++ "...")
+ showAction $ "checking " ++ Git.repoDescribe r
-- note: Does not currently differnetiate between rsync failing
-- to connect, and the file not being present.
res <- liftIO $ boolSystem "sh" [Param "-c", Param cmd]
@@ -174,7 +174,7 @@ withRsyncScratchDir a = do
rsyncRemote :: RsyncOpts -> [CommandParam] -> Annex Bool
rsyncRemote o params = do
- showProgress -- make way for progress bar
+ showOutput -- make way for progress bar
res <- liftIO $ rsync $ rsyncOptions o ++ defaultParams ++ params
if res
then return res
diff --git a/Remote/S3real.hs b/Remote/S3real.hs
index cbd3ef622..e4dcc2a71 100644
--- a/Remote/S3real.hs
+++ b/Remote/S3real.hs
@@ -185,7 +185,7 @@ remove r k = s3Action r False $ \(conn, bucket) -> do
checkPresent :: Remote Annex -> Key -> Annex (Either IOException Bool)
checkPresent r k = s3Action r noconn $ \(conn, bucket) -> do
- showNote ("checking " ++ name r ++ "...")
+ showAction $ "checking " ++ name r
res <- liftIO $ getObjectInfo conn $ bucketKey r bucket k
case res of
Right _ -> return $ Right True
@@ -241,13 +241,13 @@ iaMunge = (>>= munge)
genBucket :: RemoteConfig -> Annex ()
genBucket c = do
conn <- s3ConnectionRequired c
- showNote "checking bucket"
+ showAction "checking bucket"
loc <- liftIO $ getBucketLocation conn bucket
case loc of
Right _ -> return ()
Left err@(NetworkError _) -> s3Error err
Left (AWSError _ _) -> do
- showNote $ "creating bucket in " ++ datacenter
+ showAction $ "creating bucket in " ++ datacenter
res <- liftIO $ createBucketIn conn bucket datacenter
case res of
Right _ -> return ()
diff --git a/Remote/Web.hs b/Remote/Web.hs
index 60f64cfe0..2f8fac23b 100644
--- a/Remote/Web.hs
+++ b/Remote/Web.hs
@@ -106,7 +106,7 @@ checkKey key = do
checkKey' :: [URLString] -> Annex Bool
checkKey' [] = return False
checkKey' (u:us) = do
- showNote ("checking " ++ u)
+ showAction $ "checking " ++ u
e <- liftIO $ urlexists u
if e then return e else checkKey' us
@@ -129,6 +129,6 @@ urlexists url =
download :: [URLString] -> FilePath -> Annex Bool
download [] _ = return False
download (url:us) file = do
- showProgress -- make way for curl progress bar
+ showOutput -- make way for curl progress bar
ok <- liftIO $ boolSystem "curl" [Params "-L -C - -# -o", File file, File url]
if ok then return ok else download us file