Configuration
ExitCodes
FeedHosts
- Logging
+ Network.Services.TSN.Logging
OptionalConfiguration
- Report
- Terminal
+ Network.Services.TSN.Report
+ Network.Services.TSN.Terminal
Unix
Xml
BIN = dist/build/htsn/htsn
TESTSUITE_BIN = dist/build/testsuite/testsuite
+SRCS := $(shell find src/ -type f -name '*.hs')
+TEST_SRCS := $(shell find test/ -type f -name '*.hs')
.PHONY : dist hlint
-$(BIN): src/*.hs
+$(BIN): $(SRCS)
runghc Setup.hs clean
runghc Setup.hs configure --user --prefix=/
runghc Setup.hs build
-profile: src/*.hs
+profile: $(SRCS)
runghc Setup.hs clean
- runghc Setup.hs configure --user --enable-executable-profiling --prefix=/
+ runghc Setup.hs configure --user \
+ --enable-executable-profiling \
+ --prefix=/
runghc Setup.hs build
-doc: *.cabal src/*.hs
+doc: *.cabal $(SRCS)
runghc Setup.hs configure --user --prefix=/
runghc Setup.hs hscolour --executables
runghc Setup.hs haddock --internal \
rm -f *.xml
rm -rf tmp
-$(TESTSUITE_BIN): src/*.hs test/TestSuite.hs
+$(TESTSUITE_BIN): $(SRCS) $(TEST_SRCS)
runghc Setup.hs configure --user --enable-tests --prefix=/
runghc Setup.hs build
exit_no_username,
exit_pidfile_exists )
import FeedHosts ( FeedHosts(..) )
-import Logging ( init_logging )
+import Network.Services.TSN.Logging ( init_logging )
import qualified OptionalConfiguration as OC (
OptionalConfiguration(..),
from_rc )
-import Report (
+import Network.Services.TSN.Report (
report_debug,
report_info,
report_warning,
report_error )
-import Terminal ( display_sent )
+import Network.Services.TSN.Terminal ( display_sent )
import Xml ( parse_xmlfid )
import Unix ( full_daemonize )
-module Logging (
+module Network.Services.TSN.Logging (
init_logging,
log_debug,
log_error,
-- | Convenience functions for reporting (display and/or logging)
-- status messages.
--
-module Report (
+module Network.Services.TSN.Report (
report_debug,
report_error,
report_info,
report_warning )
where
-import Logging (
+import Network.Services.TSN.Logging (
log_debug,
log_error,
log_info,
log_warning )
-import Terminal (
+import Network.Services.TSN.Terminal (
display_debug,
display_error,
display_info,
-module Terminal (
+module Network.Services.TSN.Terminal (
display_debug,
display_error,
display_info,
import System.Log ( Priority(..) )
import FeedHosts ( FeedHosts(..) )
-import Logging ( log_error ) -- Can't import report_error from Main
-import Terminal ( display_error ) -- 'cause of circular imports.
+import Network.Services.TSN.Report ( report_error )
-- Derive standalone instances of Data and Typeable for Priority. This
from_rc :: IO OptionalConfiguration
from_rc = do
etc <- catchIOError getSysconfDir (\e -> do
- display_error (show e)
- log_error (show e)
+ report_error (show e)
return "/etc")
home <- catchIOError getHomeDirectory (\e -> do
- display_error (show e)
- log_error (show e)
+ report_error (show e)
return "$(HOME)")
let global_config_path = etc </> "htsnrc"
let user_config_path = home </> ".htsnrc"
Configuration( pidfile,
run_as_group,
run_as_user ))
-import Logging ( log_info, log_error )
-import Terminal ( display_error )
+import Network.Services.TSN.Logging ( log_info, log_error )
+import Network.Services.TSN.Terminal ( display_error )
-- | Retrieve the uid associated with the given system user name. We
-- take a Maybe String as an argument so the user name can be passed