diff options
author | Joey Hess <joeyh@joeyh.name> | 2020-01-02 12:34:10 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2020-01-02 12:42:57 -0400 |
commit | 9df8a6eb9405dde4464d27133c04f5ee539a85de (patch) | |
tree | 8a7ac5f52be8679f8a2525515a0b2c1b715c99ad /Utility/PosixFiles.hs | |
parent | 16022a8b98f4bc134542e78a42538364d2f97d92 (diff) | |
download | git-repair-9df8a6eb9405dde4464d27133c04f5ee539a85de.tar.gz |
merge from git-annex and relicense accordingly
Merge git library and utility from git-annex. The former is now relicensed
AGPL, so git-repair as a whole becomes AGPL.
For simplicity, I am relicensing the remainder of the code in git-repair
AGPL as well, per the header changes in this commit. While that code is
also technically available under the GPL license, as it's been released
under that license before, changes going forward will be only released by
me under the AGPL.
Diffstat (limited to 'Utility/PosixFiles.hs')
-rw-r--r-- | Utility/PosixFiles.hs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Utility/PosixFiles.hs b/Utility/PosixFiles.hs deleted file mode 100644 index 37253da..0000000 --- a/Utility/PosixFiles.hs +++ /dev/null @@ -1,42 +0,0 @@ -{- POSIX files (and compatablity wrappers). - - - - This is like System.PosixCompat.Files, but with a few fixes. - - - - Copyright 2014 Joey Hess <id@joeyh.name> - - - - License: BSD-2-clause - -} - -{-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -fno-warn-tabs #-} - -module Utility.PosixFiles ( - module X, - rename -) where - -import System.PosixCompat.Files as X hiding (rename) - -#ifndef mingw32_HOST_OS -import System.Posix.Files (rename) -#else -import qualified System.Win32.File as Win32 -import qualified System.Win32.HardLink as Win32 -#endif - -{- System.PosixCompat.Files.rename on Windows calls renameFile, - - so cannot rename directories. - - - - Instead, use Win32 moveFile, which can. It needs to be told to overwrite - - any existing file. -} -#ifdef mingw32_HOST_OS -rename :: FilePath -> FilePath -> IO () -rename src dest = Win32.moveFileEx src dest Win32.mOVEFILE_REPLACE_EXISTING -#endif - -{- System.PosixCompat.Files.createLink throws an error, but windows - - does support hard links. -} -#ifdef mingw32_HOST_OS -createLink :: FilePath -> FilePath -> IO () -createLink = Win32.createHardLink -#endif |