From 9084abd75755969ee93a4896d4a12f5be70052c4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Sep 2014 12:53:51 -0400 Subject: prep release --- git-annex.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-annex.cabal') diff --git a/git-annex.cabal b/git-annex.cabal index 079da8858..5b2b2daca 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140916 +Version: 5.20140919 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From d3465e2c656049daef795182ac6c42851bc4fd54 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Sep 2014 15:09:13 -0400 Subject: prep release --- debian/changelog | 4 ++-- git-annex.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'git-annex.cabal') diff --git a/debian/changelog b/debian/changelog index 18a9898c5..3ee0374e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -git-annex (5.20140920) UNRELEASED; urgency=medium +git-annex (5.20140926) unstable; urgency=high * Depend on new enough git for --no-gpg-sign to work. Closes: #762446 * Work around failure to build on mips by using cabal, not Setup, to build in debian/rules. - -- Joey Hess Mon, 22 Sep 2014 13:50:00 -0400 + -- Joey Hess Fri, 26 Sep 2014 15:09:02 -0400 git-annex (5.20140919) unstable; urgency=high diff --git a/git-annex.cabal b/git-annex.cabal index 5b2b2daca..9dd815732 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140919 +Version: 5.20140926 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From e02a0a79d4aa8852378d4e049858a98626580bc8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Sep 2014 14:25:15 -0400 Subject: prep release --- debian/changelog | 4 ++-- git-annex.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'git-annex.cabal') diff --git a/debian/changelog b/debian/changelog index 3f3cdcef0..ae0e2c758 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -git-annex (5.20140927) UNRELEASED; urgency=medium +git-annex (5.20140927) unstable; urgency=medium * Really depend (not just build-depend) on new enough git for --no-gpg-sign to work. Closes: #763057 * Add temporary workaround for bug #763078 which broke building on armel and armhf. - -- Joey Hess Sat, 27 Sep 2014 12:14:15 -0400 + -- Joey Hess Sat, 27 Sep 2014 14:25:09 -0400 git-annex (5.20140926) unstable; urgency=high diff --git a/git-annex.cabal b/git-annex.cabal index 9dd815732..84448eca7 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140926 +Version: 5.20140927 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From a2aeb9198b588ad7c98785c661054090d450e393 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Sep 2014 14:08:29 -0400 Subject: Adjust cabal file to support building w/o assistant on the hurd. I used to have this and hackage rejected the os(gnu), so I am going to see if the new hackage still rejects it. --- debian/changelog | 6 ++++++ git-annex.cabal | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'git-annex.cabal') diff --git a/debian/changelog b/debian/changelog index ae0e2c758..79e56d949 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (5.20140928) UNRELEASED; urgency=medium + + * Adjust cabal file to support building w/o assistant on the hurd. + + -- Joey Hess Mon, 29 Sep 2014 14:07:51 -0400 + git-annex (5.20140927) unstable; urgency=medium * Really depend (not just build-depend) on new enough git for --no-gpg-sign diff --git a/git-annex.cabal b/git-annex.cabal index 84448eca7..fe5a8bb27 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -153,7 +153,7 @@ Executable git-annex Build-Depends: DAV (>= 1.0), http-client CPP-Options: -DWITH_WEBDAV - if flag(Assistant) && ! os(solaris) + if flag(Assistant) && ! os(solaris) && ! os(gnu) CPP-Options: -DWITH_ASSISTANT if flag(Assistant) @@ -174,8 +174,9 @@ Executable git-annex Build-Depends: hinotify CPP-Options: -DWITH_INOTIFY else - CPP-Options: -DWITH_KQUEUE - C-Sources: Utility/libkqueue.c + if ! os(gnu) + CPP-Options: -DWITH_KQUEUE + C-Sources: Utility/libkqueue.c if (os(linux)) if flag(Dbus) -- cgit v1.2.3 From 7c90e33ee6ffaad2b7d186496d7ff7c88f774b7f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 3 Oct 2014 14:12:01 -0400 Subject: rewrote and expanded package description --- debian/control | 19 ++++++++++++------- git-annex.cabal | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) (limited to 'git-annex.cabal') diff --git a/debian/control b/debian/control index 3b4ee9e84..4cfccaaa1 100644 --- a/debian/control +++ b/debian/control @@ -108,10 +108,15 @@ Description: manage files with git, without checking their contents into git dealing with files larger than git can currently easily handle, whether due to limitations in memory, time, or disk space. . - Even without file content tracking, being able to manage files with git, - move files around and delete files with versioned directory trees, and use - branches and distributed clones, are all very handy reasons to use git. And - annexed files can co-exist in the same git repository with regularly - versioned files, which is convenient for maintaining documents, Makefiles, - etc that are associated with annexed files but that benefit from full - revision control. + It can store large files in many places, from local hard drives, to a + large number of cloud storage services, including S3, WebDAV, + and rsync, with a dozen cloud storage providers usable via plugins. + Files can be stored encrypted with gpg, so that the cloud storage + provider cannot see your data. git-annex keeps track of where each file + is stored, so it knows how many copies are available, and has many + facilities to ensure your data is preserved. + . + git-annex can also be used to keep a folder in sync between computers, + noticing when files are changed, and automatically committing them + to git and transferring them to other computers. The git-annex webapp + makes it easy to set up and use git-annex this way. diff --git a/git-annex.cabal b/git-annex.cabal index fe5a8bb27..ce0e8279b 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -18,13 +18,18 @@ Description: dealing with files larger than git can currently easily handle, whether due to limitations in memory, time, or disk space. . - Even without file content tracking, being able to manage files with git, - move files around and delete files with versioned directory trees, and use - branches and distributed clones, are all very handy reasons to use git. And - annexed files can co-exist in the same git repository with regularly - versioned files, which is convenient for maintaining documents, Makefiles, - etc that are associated with annexed files but that benefit from full - revision control. + It can store large files in many places, from local hard drives, to a + large number of cloud storage services, including S3, WebDAV, + and rsync, with a dozen cloud storage providers usable via plugins. + Files can be stored encrypted with gpg, so that the cloud storage + provider cannot see your data. git-annex keeps track of where each file + is stored, so it knows how many copies are available, and has many + facilities to ensure your data is preserved. + . + git-annex can also be used to keep a folder in sync between computers, + noticing when files are changed, and automatically committing them + to git and transferring them to other computers. The git-annex webapp + makes it easy to set up and use git-annex this way. Flag S3 Description: Enable S3 support -- cgit v1.2.3 From b1c5b32ea4ff8c2d86ee596d538a1f354235eb8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 Oct 2014 10:13:27 -0400 Subject: prep release --- debian/changelog | 4 ++-- git-annex.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'git-annex.cabal') diff --git a/debian/changelog b/debian/changelog index 9ac33fed1..fc809b457 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -git-annex (5.20140928) UNRELEASED; urgency=medium +git-annex (5.20141013) unstable; urgency=medium * Adjust cabal file to support building w/o assistant on the hurd. * Support building with yesod 1.4. @@ -6,7 +6,7 @@ git-annex (5.20140928) UNRELEASED; urgency=medium * map: Handle .git prefixed remote repos. Closes: #614759 * repair: Prevent auto gc from happening when fetching from a remote. - -- Joey Hess Mon, 29 Sep 2014 14:07:51 -0400 + -- Joey Hess Mon, 13 Oct 2014 10:13:06 -0400 git-annex (5.20140927) unstable; urgency=medium diff --git a/git-annex.cabal b/git-annex.cabal index ce0e8279b..18a7150dd 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140927 +Version: 5.20141013 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From 5f127608b8616e19b7e86bd550e714da118ee42e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 15 Oct 2014 13:31:20 -0400 Subject: Remove hurd stuff from cabal file, since hackage currently rejects it. https://github.com/haskell/hackage-server/issues/269 --- debian/changelog | 2 ++ git-annex.cabal | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'git-annex.cabal') diff --git a/debian/changelog b/debian/changelog index 4724b63de..911b97049 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ git-annex (5.20141014) UNRELEASED; urgency=medium * vicfg: Deleting configurations now resets to the default, where before it has no effect. + * Remove hurd stuff from cabal file, since hackage currently rejects + it. -- Joey Hess Tue, 14 Oct 2014 14:09:24 -0400 diff --git a/git-annex.cabal b/git-annex.cabal index 18a7150dd..4e13326c2 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -158,7 +158,7 @@ Executable git-annex Build-Depends: DAV (>= 1.0), http-client CPP-Options: -DWITH_WEBDAV - if flag(Assistant) && ! os(solaris) && ! os(gnu) + if flag(Assistant) && ! os(solaris) CPP-Options: -DWITH_ASSISTANT if flag(Assistant) @@ -179,9 +179,8 @@ Executable git-annex Build-Depends: hinotify CPP-Options: -DWITH_INOTIFY else - if ! os(gnu) - CPP-Options: -DWITH_KQUEUE - C-Sources: Utility/libkqueue.c + CPP-Options: -DWITH_KQUEUE + C-Sources: Utility/libkqueue.c if (os(linux)) if flag(Dbus) -- cgit v1.2.3 From a87f9b63077c8b93f4b2284d494c0081bd938f8d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 15 Oct 2014 20:33:52 -0400 Subject: Use haskell setenv library to clean up several ugly workarounds for inability to manipulate the environment on windows. Didn't know that this library existed! This includes making git-annex not re-exec itself on start on windows, and making the test suite on Windows run tests without forking. --- Annex/Environment.hs | 15 +++++---------- Git/CurrentRepo.hs | 10 +--------- Git/Index.hs | 4 ++-- Test.hs | 6 ------ Utility/Env.hs | 29 +++++++++++++++-------------- Utility/Gpg.hs | 2 +- Utility/Lsof.hs | 2 +- debian/changelog | 4 ++++ doc/todo/windows_support.mdwn | 4 ---- git-annex.cabal | 2 +- git-annex.hs | 39 +++++++++------------------------------ 11 files changed, 39 insertions(+), 78 deletions(-) (limited to 'git-annex.cabal') diff --git a/Annex/Environment.hs b/Annex/Environment.hs index b1b5e96e9..a580c0ed1 100644 --- a/Annex/Environment.hs +++ b/Annex/Environment.hs @@ -35,24 +35,19 @@ checkEnvironment = do liftIO checkEnvironmentIO checkEnvironmentIO :: IO () -checkEnvironmentIO = -#ifdef mingw32_HOST_OS - noop -#else - whenM (null <$> myUserGecos) $ do - username <- myUserName - ensureEnv "GIT_AUTHOR_NAME" username - ensureEnv "GIT_COMMITTER_NAME" username +checkEnvironmentIO = whenM (null <$> myUserGecos) $ do + username <- myUserName + ensureEnv "GIT_AUTHOR_NAME" username + ensureEnv "GIT_COMMITTER_NAME" username where #ifndef __ANDROID__ -- existing environment is not overwritten - ensureEnv var val = void $ setEnv var val False + ensureEnv var val = setEnv var val False #else -- Environment setting is broken on Android, so this is dealt with -- in runshell instead. ensureEnv _ _ = noop #endif -#endif {- Runs an action that commits to the repository, and if it fails, - sets user.email and user.name to a dummy value and tries the action again. -} diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs index 23ebbbcad..f611f7a34 100644 --- a/Git/CurrentRepo.hs +++ b/Git/CurrentRepo.hs @@ -5,17 +5,13 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Git.CurrentRepo where import Common import Git.Types import Git.Construct import qualified Git.Config -#ifndef mingw32_HOST_OS import Utility.Env -#endif {- Gets the current git repository. - @@ -42,17 +38,13 @@ get = do setCurrentDirectory d return $ addworktree wt r where -#ifndef mingw32_HOST_OS pathenv s = do v <- getEnv s case v of Just d -> do - void $ unsetEnv s + unsetEnv s Just <$> absPath d Nothing -> return Nothing -#else - pathenv _ = return Nothing -#endif configure Nothing (Just r) = Git.Config.read r configure (Just d) _ = do diff --git a/Git/Index.hs b/Git/Index.hs index d712245a8..c42ac42f8 100644 --- a/Git/Index.hs +++ b/Git/Index.hs @@ -21,8 +21,8 @@ import Utility.Env override :: FilePath -> IO (IO ()) override index = do res <- getEnv var - void $ setEnv var index True - return $ void $ reset res + setEnv var index True + return $ reset res where var = "GIT_INDEX_FILE" reset (Just v) = setEnv var v True diff --git a/Test.hs b/Test.hs index 5a12c11f1..298730fa5 100644 --- a/Test.hs +++ b/Test.hs @@ -1346,7 +1346,6 @@ test_add_subdirs testenv = intmpclonerepo testenv $ do -- (when the OS allows) so test coverage collection works. git_annex :: TestEnv -> String -> [String] -> IO Bool git_annex testenv command params = do -#ifndef mingw32_HOST_OS forM_ (M.toList testenv) $ \(var, val) -> Utility.Env.setEnv var val True @@ -1357,11 +1356,6 @@ git_annex testenv command params = do Left _ -> return False where run = GitAnnex.run (command:"-q":params) -#else - Utility.SafeCommand.boolSystemEnv "git-annex" - (map Param $ command : params) - (Just $ M.toList testenv) -#endif {- Runs git-annex and returns its output. -} git_annex_output :: TestEnv -> String -> [String] -> IO String diff --git a/Utility/Env.hs b/Utility/Env.hs index 6763c24e1..bfb61aa8d 100644 --- a/Utility/Env.hs +++ b/Utility/Env.hs @@ -14,6 +14,7 @@ import Utility.Exception import Control.Applicative import Data.Maybe import qualified System.Environment as E +import qualified System.SetEnv #else import qualified System.Posix.Env as PE #endif @@ -39,27 +40,27 @@ getEnvironment = PE.getEnvironment getEnvironment = E.getEnvironment #endif -{- Returns True if it could successfully set the environment variable. +{- Sets an environment variable. To overwrite an existing variable, + - overwrite must be True. - - - There is, apparently, no way to do this in Windows. Instead, - - environment varuables must be provided when running a new process. -} -setEnv :: String -> String -> Bool -> IO Bool + - On Windows, setting a variable to "" unsets it. -} +setEnv :: String -> String -> Bool -> IO () #ifndef mingw32_HOST_OS -setEnv var val overwrite = do - PE.setEnv var val overwrite - return True +setEnv var val overwrite = PE.setEnv var val overwrite #else -setEnv _ _ _ = return False +setEnv var val True = System.Setenv.setEnv var val +setEnv var val False = do + r <- getEnv var + case r of + Nothing -> setEnv var val True + Just _ -> return True #endif -{- Returns True if it could successfully unset the environment variable. -} -unsetEnv :: String -> IO Bool +unsetEnv :: String -> IO () #ifndef mingw32_HOST_OS -unsetEnv var = do - PE.unsetEnv var - return True +unsetEnv = PE.unsetEnv #else -unsetEnv _ = return False +unsetEnv = System.Setenv.unsetEnv #endif {- Adds the environment variable to the input environment. If already diff --git a/Utility/Gpg.hs b/Utility/Gpg.hs index f880e55fa..50f78a1de 100644 --- a/Utility/Gpg.hs +++ b/Utility/Gpg.hs @@ -334,7 +334,7 @@ testHarness a = do setup = do base <- getTemporaryDirectory dir <- mktmpdir $ base "gpgtmpXXXXXX" - void $ setEnv var dir True + setEnv var dir True -- For some reason, recent gpg needs a trustdb to be set up. _ <- pipeStrict [Params "--trust-model auto --update-trustdb"] [] _ <- pipeStrict [Params "--import -q"] $ unlines diff --git a/Utility/Lsof.hs b/Utility/Lsof.hs index ee4036b16..e44d13197 100644 --- a/Utility/Lsof.hs +++ b/Utility/Lsof.hs @@ -32,7 +32,7 @@ setup = do when (isAbsolute cmd) $ do path <- getSearchPath let path' = takeDirectory cmd : path - void $ setEnv "PATH" (intercalate [searchPathSeparator] path') True + setEnv "PATH" (intercalate [searchPathSeparator] path') True {- Checks each of the files in a directory to find open files. - Note that this will find hard links to files elsewhere that are open. -} diff --git a/debian/changelog b/debian/changelog index 4fafd331a..f00faf46d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,10 @@ git-annex (5.20141014) UNRELEASED; urgency=medium it. * initremote: Don't allow creating a special remote that has the same name as an existing git remote. + * Windows: Use haskell setenv library to clean up several ugly workarounds + for inability to manipulate the environment on windows. This includes + making git-annex not re-exec itself on start on windows, and making the + test suite on Windows run tests without forking. -- Joey Hess Tue, 14 Oct 2014 14:09:24 -0400 diff --git a/doc/todo/windows_support.mdwn b/doc/todo/windows_support.mdwn index 7e8ff4476..a48fcbc4e 100644 --- a/doc/todo/windows_support.mdwn +++ b/doc/todo/windows_support.mdwn @@ -19,10 +19,6 @@ usable! * Deleting a git repository from inside the webapp fails "RemoveDirectory permision denied ... file is being used by another process" -* There are a lot of hacks to avoid setting environment on windows, - because I didn't know about . - Those hacks should be removed! - ## potential encoding problems [[bugs/Unicode_file_names_ignored_on_Windows]] is fixed, but some potential diff --git a/git-annex.cabal b/git-annex.cabal index 4e13326c2..270e1b74a 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -125,7 +125,7 @@ Executable git-annex GHC-Options: -O2 if (os(windows)) - Build-Depends: Win32, Win32-extras, unix-compat (>= 0.4.1.3) + Build-Depends: Win32, Win32-extras, unix-compat (>= 0.4.1.3), setenv C-Sources: Utility/winprocess.c else Build-Depends: unix diff --git a/git-annex.hs b/git-annex.hs index f1af0eea5..f2005e13e 100644 --- a/git-annex.hs +++ b/git-annex.hs @@ -19,9 +19,6 @@ import qualified Test #ifdef mingw32_HOST_OS import Utility.UserInfo import Utility.Env -import Config.Files -import System.Process -import System.Exit #endif main :: IO () @@ -33,7 +30,9 @@ main = do | isshell n = CmdLine.GitAnnexShell.run ps | otherwise = #ifdef mingw32_HOST_OS - winEnv gitannex ps + do + winEnv + gitannex ps #else gitannex ps #endif @@ -49,37 +48,17 @@ main = do #ifdef mingw32_HOST_OS {- On Windows, if HOME is not set, probe it and set it. - - This is a workaround for some Cygwin commands needing HOME to be set, - - and for there being no known way to set environment variables on - - Windows, except by passing an environment in each call to a program. - - While ugly, this workaround is easier than trying to ensure HOME is set - - in all calls to the affected programs. + - This is a workaround for some Cygwin commands needing HOME to be set. - - If TZ is set, unset it. - TZ being set can interfere with workarounds for Windows timezone - horribleness, and prevents getCurrentTimeZone from seeing the system - time zone. - - - - Due to Windows limitations, have to re-exec git-annex with the new - - environment. -} -winEnv :: ([String] -> IO ()) -> [String] -> IO () -winEnv a ps = do - e <- getEnvironment +winEnv :: IO () +winEnv = do home <- myHomeDir - let e' = wantedenv e home - if (e' /= e) - then do - cmd <- readProgramFile - (_, _, _, pid) <- createProcess (proc cmd ps) - { env = Just e' } - exitWith =<< waitForProcess pid - else a ps - where - wantedenv e home = delEntry "TZ" $ case lookup "HOME" e of - Nothing -> e - Just _ -> addEntries - [ ("HOME", home) - , ("CYGWIN", "nodosfilewarning") - ] e + setEnv "HOME" home False + setEnv "CYGWIN" "nodosfilewarning" True + unsetEnv "TZ" #endif -- cgit v1.2.3