From 822a8c0ff85d4449cef2f5dd11bb2ae32e333c73 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 13:03:46 -0400 Subject: [PATCH 1/8] better nukefile Fixed handling of case when file does not exist to work like it did before, and avoid an excess stat call. --- Utility/Directory.hs | 6 ++++-- Utility/Exception.hs | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Utility/Directory.hs b/Utility/Directory.hs index 0a7690b445..13e6168cb8 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -93,8 +93,10 @@ moveFile src dest = tryIO (rename src dest) >>= onrename - Note that an exception is thrown if the file exists but - cannot be removed. -} nukeFile :: FilePath -> IO () +nukeFile file = void $ tryWhenExists go + where #ifndef mingw32_HOST_OS -nukeFile = removeLink + go = removeLink file #else -nukeFile = removeFile + go = removeFile file #endif diff --git a/Utility/Exception.hs b/Utility/Exception.hs index 45f2aecec1..bc928e18e7 100644 --- a/Utility/Exception.hs +++ b/Utility/Exception.hs @@ -12,6 +12,8 @@ module Utility.Exception where import Prelude hiding (catch) import Control.Exception import Control.Applicative +import Control.Monad +import System.IO.Error (isDoesNotExistError) {- Catches IO errors and returns a Bool -} catchBoolIO :: IO Bool -> IO Bool @@ -49,3 +51,8 @@ catchNonAsync a onerr = a `catches` tryNonAsync :: IO a -> IO (Either SomeException a) tryNonAsync a = (Right <$> a) `catchNonAsync` (return . Left) + +{- Catches only DoesNotExist exceptions, and lets all others through. -} +tryWhenExists :: IO a -> IO (Maybe a) +tryWhenExists a = either (const Nothing) Just <$> + tryJust (guard . isDoesNotExistError) a From 25dba9da249a17242decd547aebb26fba5a99a13 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 13:07:43 -0400 Subject: [PATCH 2/8] fix windows build --- Git/Construct.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Git/Construct.hs b/Git/Construct.hs index 5b2ec6f12c..6f58e9b289 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -27,6 +27,8 @@ module Git.Construct ( #ifndef __WINDOWS__ import System.Posix.User +#else +import Git.FilePath #endif import qualified Data.Map as M hiding (map, split) import Network.URI From ceb600d715dbe3dac3ce31fc9cc122d3997ea28c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 13:28:09 -0400 Subject: [PATCH 3/8] lift megaannex comment into tip, etc --- .../assistant/more_cloud_providers.mdwn | 3 ++ doc/special_remotes.mdwn | 1 + doc/tips/megaannex.mdwn | 45 +++++++++++++++++++ .../wishlist:_special_remote_mega.co.nz.mdwn | 2 + 4 files changed, 51 insertions(+) create mode 100644 doc/tips/megaannex.mdwn diff --git a/doc/design/assistant/more_cloud_providers.mdwn b/doc/design/assistant/more_cloud_providers.mdwn index 7949f8a7e4..35e53454ff 100644 --- a/doc/design/assistant/more_cloud_providers.mdwn +++ b/doc/design/assistant/more_cloud_providers.mdwn @@ -16,5 +16,8 @@ More should be added, such as: * Mediafire provides 50gb free and has a REST API. * Flickr provides 1 tb (!!!!) to free accounts, and can store at least photos and videos. +* mega.co.nz. Already supported via [[tips/megaannex]], would just need + webapp modifications to configure it. May want to use megaannex as-is to + build a non-hook special remote in haskell. See poll at [[polls/prioritizing_special_remotes]]. diff --git a/doc/special_remotes.mdwn b/doc/special_remotes.mdwn index 6c33b52686..96cc7790c2 100644 --- a/doc/special_remotes.mdwn +++ b/doc/special_remotes.mdwn @@ -26,6 +26,7 @@ for various cloud things: * [[tips/Internet_Archive_via_S3]] * [[tahoe-lafs|forum/tips:_special__95__remotes__47__hook_with_tahoe-lafs]] * [[tips/using_box.com_as_a_special_remote]] +* [[tips/using_mega.co.nz_as_a_special_remote|tips/megaannex]] * [[forum/special_remote_for_IMAP]] * [[forum/nntp__47__usenet special remote]] diff --git a/doc/tips/megaannex.mdwn b/doc/tips/megaannex.mdwn new file mode 100644 index 0000000000..0ff953db26 --- /dev/null +++ b/doc/tips/megaannex.mdwn @@ -0,0 +1,45 @@ +[Megaannex](https://github.com/TobiasTheViking/megaannex) +is a hook program for git-annex to use mega.co.nz as backend + +# Requirements: + + requests>=0.10 + pycrypto + +Credit for the mega api interface goes to: + + +## Install + +Clone the git repository in your home folder. + + git clone git://github.com/TobiasTheViking/megaannex.git + +This should make a ~/megannex folder + +## Setup + +Run the program once to make an empty config file. + + cd ~/megaannex; python2 megaannex.py + +Edit the megaannex.conf file. Add your mega.co.nz username and password + +Note: The folder option in the megaannex.conf file isn't yet used. + +## Configuring git-annex + + git config annex.mega-store-hook 'python2 ~/megaannex/megaannex.py store --subject $ANNEX_KEY --file $ANNEX_FILE' + git config annex.mega-retrieve-hook 'python2 ~/megaannex/megaannex.py getfile --subject $ANNEX_KEY --file $ANNEX_FILE' + git config annex.mega-checkpresent-hook 'python2 ~/megaannex/megaannex.py fileexists --subject $ANNEX_KEY' + git config annex.mega-remove-hook 'python2 ~/megaannex/megaannex.py delete --subject $ANNEX_KEY' + + git annex initremote mega type=hook hooktype=mega encryption=shared + git annex describe mega \"the mega.co.nz library\" + +## Notes + +You may need to use a different command than "python2", depending +on your python installation. + +-- Tobias diff --git a/doc/todo/wishlist:_special_remote_mega.co.nz.mdwn b/doc/todo/wishlist:_special_remote_mega.co.nz.mdwn index 788a3a43fa..41164084a2 100644 --- a/doc/todo/wishlist:_special_remote_mega.co.nz.mdwn +++ b/doc/todo/wishlist:_special_remote_mega.co.nz.mdwn @@ -1 +1,3 @@ mega.co.nz has 50gb for free accounts. They also have an API, so I guess it wouldn't be too hard to use it as a special remote. + +[[done]], see [[tips/megaannex]]. From b88901a647e7242c8c68b6c6d19fabb6624c7d5e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 13:32:01 -0400 Subject: [PATCH 4/8] fix quotes --- doc/tips/megaannex.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tips/megaannex.mdwn b/doc/tips/megaannex.mdwn index 0ff953db26..96f6f8a522 100644 --- a/doc/tips/megaannex.mdwn +++ b/doc/tips/megaannex.mdwn @@ -35,7 +35,7 @@ Note: The folder option in the megaannex.conf file isn't yet used. git config annex.mega-remove-hook 'python2 ~/megaannex/megaannex.py delete --subject $ANNEX_KEY' git annex initremote mega type=hook hooktype=mega encryption=shared - git annex describe mega \"the mega.co.nz library\" + git annex describe mega "the mega.co.nz library" ## Notes From b3a521db7084472314d1de67b76c8ce3caccc3b8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 14:23:27 -0400 Subject: [PATCH 5/8] releasing version 4.20130521 --- .gitignore | 1 + debian/changelog | 4 ++-- git-annex.cabal | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a9c93d96aa..deb0f79e83 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ cabal-dev .DS_Store .virthualenv tags +Setup diff --git a/debian/changelog b/debian/changelog index 30b61700bf..02a246e37d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -git-annex (4.20130517) UNRELEASED; urgency=low +git-annex (4.20130521) unstable; urgency=low * Sanitize debian changelog version before putting it into cabal file. Closes: #708619 @@ -23,7 +23,7 @@ git-annex (4.20130517) UNRELEASED; urgency=low * Linux standalone: Back to being built with glibc 2.13 for maximum portability. - -- Joey Hess Fri, 17 May 2013 11:17:03 -0400 + -- Joey Hess Tue, 21 May 2013 13:10:26 -0400 git-annex (4.20130516) unstable; urgency=low diff --git a/git-annex.cabal b/git-annex.cabal index 0652fb2754..284cd73c74 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 4.20130516 +Version: 4.20130521 Cabal-Version: >= 1.8 License: GPL Maintainer: Joey Hess From 84debab90d4c302b4e5a260cc9b372164117c4e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 14:24:02 -0400 Subject: [PATCH 6/8] add news item for git-annex 4.20130521 --- doc/news/version_4.20130323.mdwn | 37 -------------------------------- doc/news/version_4.20130521.mdwn | 24 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 37 deletions(-) delete mode 100644 doc/news/version_4.20130323.mdwn create mode 100644 doc/news/version_4.20130521.mdwn diff --git a/doc/news/version_4.20130323.mdwn b/doc/news/version_4.20130323.mdwn deleted file mode 100644 index 1ccdf90d1e..0000000000 --- a/doc/news/version_4.20130323.mdwn +++ /dev/null @@ -1,37 +0,0 @@ -git-annex 4.20130323 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * webapp: Repository list is now included in the dashboard, and other - UI tweaks. - * webapp: Improved UI for pairing your own devices together using XMPP. - * webapp: Display an alert when there are XMPP remotes, and a cloud - transfer repository needs to be configured. - * Add incrementalbackup repository group. - * webapp: Encourage user to install git-annex on a server when adding - a ssh server, rather than just funneling them through to rsync. - * xmpp: --debug now enables a sanitized dump of the XMPP protocol - * xmpp: Try harder to detect presence of clients when there's a git push - to send. - * xmpp: Re-enable XA flag, since disabling it did not turn out to help - with the problems Google Talk has with not always sending presence - messages to clients. - * map: Combine duplicate repositories, for a nicer looking map. - * Fix several bugs caused by a bad Ord instance for Remote. - * webapp: Switch all forms to POST. - * assistant: Avoid syncing with annex-ignored remotes when reconnecting - to the network, or connecting a drive. - * assistant: Fix OSX bug that prevented committing changed files to a - repository when in indirect mode. - * webapp: Improved alerts displayed when syncing with remotes, and - when syncing with a remote fails. - * webapp: Force wrap long filenames in transfer display. - * assistant: The ConfigMonitor left one zombie behind each time - it checked for changes, now fixed. - * get, copy, move: Display an error message when an identical transfer - is already in progress, rather than failing with no indication why. - * assistant: Several optimisations to file transfers. - * OSX app and standalone Linux tarball now both support being added to - PATH; no need to use runshell to start git-annex. - * webapp: When adding a removable drive, you can now specify the - directory inside it to use. - * webapp: Confirm whether user wants to combine repositories when - adding a removable drive that already has a repository on it."""]] \ No newline at end of file diff --git a/doc/news/version_4.20130521.mdwn b/doc/news/version_4.20130521.mdwn new file mode 100644 index 0000000000..af4f25bfa0 --- /dev/null +++ b/doc/news/version_4.20130521.mdwn @@ -0,0 +1,24 @@ +git-annex 4.20130521 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Sanitize debian changelog version before putting it into cabal file. + Closes: #[708619](http://bugs.debian.org/708619) + * Switch to MonadCatchIO-transformers for better handling of state while + catching exceptions. + * Fix a zombie that could result when running a process like gpg to + read and write to it. + * Allow building with gpg2. + * Disable building with the haskell threaded runtime when the webapp + is not built. This may fix builds on mips, s390x and sparc, which are + failing to link -lHSrts\_thr + * Temporarily build without webapp on kfreebsd-i386, until yesod is + installable there again. + * Direct mode bug fix: After a conflicted merge was automatically resolved, + the content of a file that was already present could incorrectly + be replaced with a symlink. + * Fix a bug in the git-annex branch handling code that could + cause info from a remote to not be merged and take effect immediately. + * Direct mode is now fully tested by the test suite. + * Detect bad content in ~/.config/git-annex/program and look in PATH instead. + * OSX: Fixed gpg included in dmg. + * Linux standalone: Back to being built with glibc 2.13 for maximum + portability."""]] \ No newline at end of file From 668e073829b5f2f39b91e908dca440f6dc92413d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 14:28:12 -0400 Subject: [PATCH 7/8] fix link to windows autobuild --- doc/install/Windows.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/Windows.mdwn b/doc/install/Windows.mdwn index 573f823c21..90568a8636 100644 --- a/doc/install/Windows.mdwn +++ b/doc/install/Windows.mdwn @@ -13,7 +13,7 @@ on Windows. A daily build is also available, thanks to Yury V. Zaytsev and [NEST](http://nest-initiative.org/). -* [download](https://qa.nest-initiative.org/view/msysGit/job/msysgit-git-annex-assistant-test/lastSuccessfulBuild/artifact/git-annex-installer.exe) ([build logs](https://qa.nest-initiative.org/view/msysGit/job/msysgit-git-annex-assistant-test/)) +* [download](https://qa.nest-initiative.org/view/msysGit/job/msysgit-git-annex-assistant-test/lastSuccessfulBuild/artifact/git-annex/git-annex-installer.exe) ([build logs](https://qa.nest-initiative.org/view/msysGit/job/msysgit-git-annex-assistant-test/)) ## building it yourself From ba118749bee2afda43c2b0128555de9486a3c9d1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2013 14:32:48 -0400 Subject: [PATCH 8/8] update --- doc/assistant/release_notes.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/assistant/release_notes.mdwn b/doc/assistant/release_notes.mdwn index 7f793be71f..6ce8bac762 100644 --- a/doc/assistant/release_notes.mdwn +++ b/doc/assistant/release_notes.mdwn @@ -1,3 +1,7 @@ +## version 4.20130521 + +This is a bugfix release. Recommended upgrade. + ## version 4.20130516 This version contains numerous bug fixes, and improvements.