summaryrefslogtreecommitdiff
path: root/Utility
Commit message (Collapse)AuthorAge
* more general readProcess' merged from propellorGravatar Joey Hess2014-11-19
|
* Work around apparent bug in lsof 4.88's -F output format.Gravatar Joey Hess2014-11-12
|
* generalize monadsGravatar Joey Hess2014-11-12
|
* switch from hGetSome to hGetGravatar Joey Hess2014-11-03
| | | | | | | | | | | | | | This should be essentially no-op change for hGetContentsMetered, since it always gets the entire contents. So the only difference is that each chunk of the lazy bytestring will always be the full chunk size. So, I'm pretty sure this is safe. Also, the only current users of hGetContentsMetered are reading files, so the stream won't block for long in the middle. The improvement is that hGetUntilMetered will always get some multiple of the defaultChunkSize. This will allow the S3 multipart code to pick a fixed size and know that hGetUntilMetered will really get that size. (cherry picked from commit bd09046291a5fde26afc02f5838c6594c1fa9c00)
* hGetUntilMeteredGravatar Joey Hess2014-11-03
|
* Windows: Fix crash when user.name is not set in git config.Gravatar Joey Hess2014-10-31
|
* getUserEntryForID does not work on windowsGravatar Joey Hess2014-10-31
| | | | Throw an error instead, mentioning the relevant env vars.
* more accurate version boundsGravatar Joey Hess2014-10-24
|
* deal with yesod's second gratuitous rename of the same function in a yearGravatar Joey Hess2014-10-23
|
* typoGravatar Joey Hess2014-10-16
|
* typosGravatar Joey Hess2014-10-16
|
* Use haskell setenv library to clean up several ugly workarounds for ↵Gravatar Joey Hess2014-10-15
| | | | | | | | | 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.
* revert reversionGravatar Joey Hess2014-10-15
| | | | | | This reverts commit 05c37ced983e89505c2c3cdcbe1db67e3a86560b. Android build is going to have consistent versions again.
* unbreak android buildGravatar Joey Hess2014-10-14
| | | | | | | | This reverts commit cfc51c5e4ec04f9d5088c42922217cf90b63c903 and commit 78f94f50674d60c7d54307029bef1edf9b27782b. Those commits were fine, except the android autobuilder currently has a bit of a mess of yesod versions and broke. Better to wait on this.
* more accurate bounds on yesod boostrap3 ifdefsGravatar Joey Hess2014-10-13
|
* avoid using Assistant.WebApp.Bootstrap3 when building with current yesodGravatar Joey Hess2014-10-09
| | | | | | | Only use that when building with ancient yesod, which does not include it. This also let me remove ifdefs in the file to support building with the new version of yesod.
* indent with tabs not spacesGravatar Joey Hess2014-10-09
| | | | | | | | | | | Found these with: git grep "^ " $(find -type f -name \*.hs) |grep -v ': where' Unfortunately there is some inline hamlet that cannot use tabs for indentation. Also, Assistant/WebApp/Bootstrap3.hs is a copy of a module and so I'm leaving it as-is.
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* Windows: Avoid crashing trying to list gpg secret keys, for gcrypt which is ↵Gravatar Joey Hess2014-09-16
| | | | not yet supported on Windows.
* Rather than crashing when there's a problem with the requested bloomfilter ↵Gravatar Joey Hess2014-09-12
| | | | capacity/accuracy, fall back to a reasonable default bloom filter size.
* Do not preserve permissions and acls when copying files from one local git ↵Gravatar Joey Hess2014-08-26
| | | | | | | | | | | | | | | | | repository to another. Timestamps are still preserved as long as cp --preserve=timestamps is supported. This avoids cp -a overriding the default mode acls that the user might have set in a git repository. With GNU cp, this behavior change should not be a breaking change, because git-anex also uses rsync sometimes in the same situation, and has only ever preserved timestamps when using rsync. Systems without GNU cp will no longer use cp -a, but instead just cp. So, timestamps will no longer be preserved. Preserving timestamps when copying between repos is not guaranteed anyway. Closes: #729757
* fix imports for windowsGravatar Joey Hess2014-08-23
|
* final scary locking refactoring (for now)Gravatar Joey Hess2014-08-20
| | | | | | | | | | Note that while before checkTransfer this called getLock with WriteLock, getLockStatus's use of ReadLock will also notice any exclusive locks. Since transfer info files are only locked exclusively, never shared, there is no behavior change. Also, fixes checkLocked to actually return Just False when the file exists, but is not locked.
* more lock file refactoringGravatar Joey Hess2014-08-20
| | | | | | | | Also fixes a test suite failures introduced in recent commits, where inAnnexSafe failed in indirect mode, since it tried to open the lock file ReadWrite. This is why the new checkLocked opens it ReadOnly. This commit was sponsored by Chad Horohoe.
* more lock file refactoringGravatar Joey Hess2014-08-20
|
* reorganize and refactor lock codeGravatar Joey Hess2014-08-20
| | | | | | | | Added a convenience Utility.LockFile that is not a windows/posix portability shim, but still manages to cut down on the boilerplate around locking. This commit was sponsored by Johan Herland.
* Ensure that all lock fds are close-on-exec, fixing various problems with ↵Gravatar Joey Hess2014-08-20
| | | | | | | | | | | | | | | | | | them being inherited by child processes such as git commands. (With the exception of daemon pid locking.) This fixes at part of #758630. I reproduced the assistant locking eg, a removable drive's annex journal lock file and forking a long-running git-cat-file process that inherited that lock. This did not affect Windows. Considered doing a portable Utility.LockFile layer, but git-annex uses posix locks in several special ways that have no direct Windows equivilant, and it seems like it would mostly be a complication. This commit was sponsored by Protonet.
* add compat cruft for old versions of http-types and http-conduitGravatar Joey Hess2014-08-17
|
* work around default Accept-Encoding in http-clientGravatar Joey Hess2014-08-15
|
* memoize construction of the Request -> Request function to apply the UrlOptionsGravatar Joey Hess2014-08-15
|
* Switched from the old haskell HTTP library to http-conduit.Gravatar Joey Hess2014-08-15
| | | | | | | | | | | | | | | | | | The hoary old HTTP library was only used when checking if an url exists, when curl was not available. It had many problems, including not supporting https at all. Now, this is done using http-conduit for all urls that it supports. Falls back to curl for any url that http-conduit doesn't like (probably ftp etc, but could also be an url that its parser chokes on for whatever reason). This adds a new dependency on http-conduit, but webdav support already indirectly depended on that, and the s3-aws branch also uses it. This opens up the possibility of using http-conduit for large file downloads, but for now I've left it using wget/curl. This commit was sponsored by Paul Tötterman.
* fix build on windows with unix-compat-0.4.1.3Gravatar Joey Hess2014-08-11
| | | | | | | FileID type changed, needs Arbitrary instance. On the plus side, getFileStatus on Windows now actually gets file id's, not always 0, so direct mode is safer there now.
* qualify catch and tryGravatar Joey Hess2014-08-10
| | | | got a build failure on android due to there being a Prelude.catch
* fix windows buildGravatar Joey Hess2014-08-10
|
* unify exception handling into Utility.ExceptionGravatar Joey Hess2014-08-07
| | | | | | | | | | | | | | | | | | | | Removed old extensible-exceptions, only needed for very old ghc. Made webdav use Utility.Exception, to work after some changes in DAV's exception handling. Removed Annex.Exception. Mostly this was trivial, but note that tryAnnex is replaced with tryNonAsync and catchAnnex replaced with catchNonAsync. In theory that could be a behavior change, since the former caught all exceptions, and the latter don't catch async exceptions. However, in practice, nothing in the Annex monad uses async exceptions. Grepping for throwTo and killThread only find stuff in the assistant, which does not seem related. Command.Add.undo is changed to accept a SomeException, and things that use it for rollback now catch non-async exceptions, rather than only IOExceptions.
* generalized using the extensions packageGravatar Joey Hess2014-08-07
|
* move ugly rsync zombie workaroundGravatar Joey Hess2014-08-03
| | | | | | | | | | | | This reaping of any processes came to cause me problems when redoing the rsync special remote -- a gpg process that was running gets waited on and the place that then checks its return code fails. I cannot reproduce any zombies when using the rsync special remote. But I still can when using a normal git remote, accessed over ssh. There is 1 zombie per file downloaded without this horrible hack enabled. So, move the hack to only be used in that case.
* testremote: New command to test uploads/downloads to a remote.Gravatar Joey Hess2014-08-01
| | | | | | | | | This only performs some basic tests so far; no testing of chunking or resuming. Also, the existing encryption type of the remote is used; it would be good later to derive an encrypted and a non-encrypted version of the remote and test them both. This commit was sponsored by Joseph Liu.
* lift types from IO to AnnexGravatar Joey Hess2014-07-29
| | | | | | | | | | | Some remotes like External need to run store and retrieve actions in Annex, not IO. In order to do that lift, I had to dive pretty deep into the utilities, making Utility.Gpg and Utility.Tmp be partly converted to using MonadIO, and Control.Monad.Catch for exception handling. There should be no behavior changes in this commit. This commit was sponsored by Michael Barabanov.
* resume interrupted chunked downloadsGravatar Joey Hess2014-07-27
| | | | | | | | | | | | | | | | | | Leverage the new chunked remotes to automatically resume downloads. Sort of like rsync, although of course not as efficient since this needs to start at a chunk boundry. But, unlike rsync, this method will work for S3, WebDAV, external special remotes, etc, etc. Only directory special remotes so far, but many more soon! This implementation will also properly handle starting a download from one remote, interrupting, and resuming from another one, and so on. (Resuming interrupted chunked uploads is similarly doable, although slightly more expensive.) This commit was sponsored by Thomas Djärv.
* core implementation of new style chunkingGravatar Joey Hess2014-07-25
| | | | | | | | | | | | | | | | Not yet used by any special remotes, but should not be too hard to add it to most of them. storeChunks is the hairy bit! It's loosely based on Remote.Directory.storeLegacyChunked. The object is read in using a lazy bytestring, which is streamed though, creating chunks as needed, without ever buffering more than 1 chunk in memory. Getting the progress meter update to work right was also fun, since progress meter values are absolute. Finessed by constructing an offset meter. This commit was sponsored by Richard Collins.
* increase sleepGravatar Joey Hess2014-07-16
|
* Windows: fix crash after 10 minutesGravatar Joey Hess2014-07-16
| | | | | getLine in waitForTermination doesn't work when stdin is closed.. Just loop forever, there was no reason to getLine here I think.
* Windows: Fix locking issue that prevented the webapp starting (since ↵Gravatar Joey Hess2014-07-14
| | | | | | | | 5.20140707). Reversion introduced in 89c188fac37c20c40b0a9dabeb35403cfa4e4f52. The locking code was wrong; the webapp re-ran itself, saw pid was locked, and so didn't start!
* deal with process-1.2.0.0 throwing an exception when program DNE (may only ↵Gravatar Joey Hess2014-07-13
| | | | | | | | | | | | | | | fix the tip of the iceberg) Configure crashed on systems with that process and without eg, sha256sum. The rest of the code in configure looks to work ok, since it uses sh -c to probe for commands, and sh is always in path so it works. Dunno about all the rest of git-annex. Not a huge amount of external program use, other than git, so perhaps this won't be a large pain. Note that boolSystem can throw an exception now if the program doesn't exist. Could easily be changed back to False.
* refactorGravatar Joey Hess2014-07-10
|
* Fix minor FD leak in journal code.Gravatar Joey Hess2014-07-09
| | | | | | | | | | | | | | | | | | | | | | | | Minor because normally only 1 FD is leaked per git-annex run. However, the test suite leaks a few hundred FDs, and this broke it on the Debian autobuilders, which seem to have a tigher than usual ulimit. The leak was introduced by the lazy getDirectoryContents' that was introduced in b54de1dad4874b7561d2c5a345954b6b5c594078 in order to scale to millions of journal files -- if the lazy list was never fully consumed, the directory handle did not get closed. Instead, pull in openDirectory/readDirectory/closeDirectory code that I already developed and submitted in a patch to the haskell directory library earlier. Using this in journalDirty avoids the place that the lazy list caused a problem. And using it in stageJournal eliminates the need for getDirectoryContents'. The getJournalFiles* functions are switched back to using the regular strict getDirectoryContents. I'm not sure if those always consume the whole list, so this avoids any leak. And the things that call those are things like git annex unused, which also look at every file committed to the git-annex branch, so would need more work to scale to insane numbers of files anyway.
* Support building with bloomfilter 2.0.0.Gravatar Joey Hess2014-07-07
|
* fix windows buildGravatar Joey Hess2014-07-05
|
* work around getDirectoryContents not streaming lazilyGravatar Joey Hess2014-07-04
|