fixed all remaining build warnings on Windows

This commit is contained in:
Joey Hess 2014-12-29 17:25:59 -04:00
parent 67828b1c86
commit c9a3e80d32
13 changed files with 23 additions and 20 deletions

View file

@ -32,14 +32,14 @@ import Config
import Annex.Direct import Annex.Direct
import Annex.Content.Direct import Annex.Content.Direct
import Annex.Environment import Annex.Environment
import Annex.Perms
import Backend import Backend
import Annex.Hook
import Upgrade
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
import Utility.UserInfo import Utility.UserInfo
import Utility.FileMode import Utility.FileMode
import Annex.Perms
#endif #endif
import Annex.Hook
import Upgrade
genDescription :: Maybe String -> Annex String genDescription :: Maybe String -> Annex String
genDescription (Just d) = return d genDescription (Just d) = return d

View file

@ -35,9 +35,9 @@ import Config.Files
import Utility.Env import Utility.Env
import Types.CleanupActions import Types.CleanupActions
import Annex.Index (addGitEnv) import Annex.Index (addGitEnv)
import Utility.LockFile
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
import Annex.Perms import Annex.Perms
import Utility.LockFile
#endif #endif
{- Generates parameters to ssh to a given host (or user@host) on a given {- Generates parameters to ssh to a given host (or user@host) on a given

View file

@ -22,7 +22,9 @@ import Utility.SshConfig
import Utility.OSX import Utility.OSX
#else #else
import Utility.FreeDesktop import Utility.FreeDesktop
#ifdef linux_HOST_OS
import Utility.UserInfo import Utility.UserInfo
#endif
import Assistant.Install.Menu import Assistant.Install.Menu
#endif #endif

View file

@ -18,11 +18,11 @@ import Assistant.DaemonStatus
import Utility.NotificationBroadcaster import Utility.NotificationBroadcaster
#if WITH_DBUS #if WITH_DBUS
import Assistant.RemoteControl
import Utility.DBus import Utility.DBus
import DBus.Client import DBus.Client
import DBus import DBus
import Assistant.NetMessager import Assistant.NetMessager
import Assistant.RemoteControl
#else #else
#ifdef linux_HOST_OS #ifdef linux_HOST_OS
#warning Building without dbus support; will poll for network connection changes #warning Building without dbus support; will poll for network connection changes

View file

@ -40,15 +40,15 @@ import Assistant.Unused
import Logs.Unused import Logs.Unused
import Logs.Transfer import Logs.Transfer
import Config.Files import Config.Files
import Utility.DiskFree import Types.Key (keyBackendName)
import qualified Annex import qualified Annex
#ifdef WITH_WEBAPP #ifdef WITH_WEBAPP
import Assistant.WebApp.Types import Assistant.WebApp.Types
#endif #endif
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
import Utility.LogFile import Utility.LogFile
import Utility.DiskFree
#endif #endif
import Types.Key (keyBackendName)
import Data.Time.Clock.POSIX import Data.Time.Clock.POSIX
import qualified Data.Text as T import qualified Data.Text as T

View file

@ -34,10 +34,6 @@ import Utility.FileMode
import Utility.ThreadScheduler import Utility.ThreadScheduler
import Utility.Env import Utility.Env
#ifdef mingw32_HOST_OS
import Utility.Rsync
#endif
import qualified Data.Text as T import qualified Data.Text as T
import qualified Data.Map as M import qualified Data.Map as M
import Network.Socket import Network.Socket

View file

@ -24,10 +24,10 @@ import Assistant.DaemonStatus
import Assistant.WebApp.RepoList import Assistant.WebApp.RepoList
import Assistant.WebApp.Configurators import Assistant.WebApp.Configurators
import Assistant.XMPP import Assistant.XMPP
#endif
import qualified Git.Remote.Remove import qualified Git.Remote.Remove
import Remote.List import Remote.List
import Creds import Creds
#endif
#ifdef WITH_XMPP #ifdef WITH_XMPP
import Network.Protocol.XMPP import Network.Protocol.XMPP

View file

@ -358,7 +358,9 @@ copyFromRemote' r key file dest
| not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ do | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ do
params <- Ssh.rsyncParams r Download params <- Ssh.rsyncParams r Download
u <- getUUID u <- getUUID
#ifndef mingw32_HOST_OS
hardlink <- annexHardLink <$> Annex.getGitConfig hardlink <- annexHardLink <$> Annex.getGitConfig
#endif
-- run copy from perspective of remote -- run copy from perspective of remote
onLocal r $ do onLocal r $ do
ensureInitialized ensureInitialized

View file

@ -116,13 +116,12 @@ main ps = do
#if MIN_VERSION_optparse_applicative(0,10,0) #if MIN_VERSION_optparse_applicative(0,10,0)
case execParserPure pprefs pinfo args of case execParserPure pprefs pinfo args of
(Options.Applicative.Failure failure) -> do (Options.Applicative.Failure failure) -> do
let (msg, _exit) = renderFailure failure progdesc let (msg, _exit) = renderFailure failure "git-annex test"
error msg error msg
v -> handleParseResult v v -> handleParseResult v
#else #else
handleParseResult $ execParserPure pprefs pinfo args handleParseResult $ execParserPure pprefs pinfo args
#endif #endif
progdesc = "git-annex test"
ingredients :: [Ingredient] ingredients :: [Ingredient]
ingredients = ingredients =

View file

@ -21,8 +21,6 @@ import Utility.LockFile
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS
import System.Posix import System.Posix
import Control.Concurrent.Async import Control.Concurrent.Async
#else
import System.Exit
#endif #endif
#ifndef mingw32_HOST_OS #ifndef mingw32_HOST_OS

View file

@ -17,10 +17,10 @@ watchDir :: FilePath -> (FilePath -> Bool) -> Bool -> WatchHooks -> IO WatchMana
watchDir dir ignored scanevents hooks = do watchDir dir ignored scanevents hooks = do
scan dir scan dir
wm <- initWatchManager wm <- initWatchManager
void $ watchDirectory wm dir True [Create, Delete, Modify, Move] handle void $ watchDirectory wm dir True [Create, Delete, Modify, Move] dispatch
return wm return wm
where where
handle evt dispatch evt
| ignoredPath ignored (filePath evt) = noop | ignoredPath ignored (filePath evt) = noop
| otherwise = case evt of | otherwise = case evt of
(Deleted _ _) (Deleted _ _)

View file

@ -7,6 +7,7 @@
-} -}
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Utility.InodeCache ( module Utility.InodeCache (
InodeCache, InodeCache,
@ -182,7 +183,10 @@ checkSentinalFile s = do
SentinalStatus (not unchanged) tsdelta SentinalStatus (not unchanged) tsdelta
where where
#ifdef mingw32_HOST_OS #ifdef mingw32_HOST_OS
unchanged = oldinode == newinode && oldsize == newsize -- Since mtime can appear to change when the time zone is
-- changed in windows, we cannot look at the mtime for the
-- sentinal file.
unchanged = oldinode == newinode && oldsize == newsize && (newmtime == newmtime)
tsdelta = TSDelta $ do tsdelta = TSDelta $ do
-- Run when generating an InodeCache, -- Run when generating an InodeCache,
-- to get the current delta. -- to get the current delta.

View file

@ -13,8 +13,10 @@ module Utility.UserInfo (
myUserGecos, myUserGecos,
) where ) where
import Control.Applicative
import System.PosixCompat import System.PosixCompat
#ifndef mingw32_HOST_OS
import Control.Applicative
#endif
import Utility.Env import Utility.Env