summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant.hs1
-rw-r--r--Assistant/XMPP/Git.hs14
-rw-r--r--Creds.hs8
-rw-r--r--Remote/Rsync.hs38
-rw-r--r--Utility/Rsync.hs3
-rw-r--r--debian/changelog9
-rw-r--r--doc/design/assistant.mdwn6
-rw-r--r--doc/design/assistant/android.mdwn11
8 files changed, 59 insertions, 31 deletions
diff --git a/Assistant.hs b/Assistant.hs
index 039837586..b5e902d56 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -177,7 +177,6 @@ startDaemon assistant foreground listenhost startbrowser = do
logfd <- liftIO $ openLog logfile
if foreground
then do
- showStart "." desc
origout <- liftIO $ catchMaybeIO $
fdToHandle =<< dup stdOutput
origerr <- liftIO $ catchMaybeIO $
diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs
index 6a50e13f6..f48178985 100644
--- a/Assistant/XMPP/Git.hs
+++ b/Assistant/XMPP/Git.hs
@@ -92,8 +92,7 @@ xmppPush cid gitpush handledeferred = runPush SendPack cid handledeferred $ do
(readpush, Fd outf) <- liftIO createPipe
(Fd controlf, writecontrol) <- liftIO createPipe
- tmp <- liftAnnex $ fromRepo gitAnnexTmpDir
- let tmpdir = tmp </> "xmppgit"
+ tmpdir <- gettmpdir
installwrapper tmpdir
env <- liftIO getEnvironment
@@ -160,6 +159,17 @@ xmppPush cid gitpush handledeferred = runPush SendPack cid handledeferred $ do
, "exec " ++ program ++ " xmppgit"
]
modifyFileMode wrapper $ addModes executeModes
+ {- Use GIT_ANNEX_TMP_DIR if set, since that may be a better temp
+ - dir (ie, not on a crippled filesystem where we can't make
+ - the wrapper executable). -}
+ gettmpdir = do
+ v <- liftIO $ getEnv "GIT_ANNEX_TMP_DIR"
+ case v of
+ Nothing -> do
+ tmp <- liftAnnex $ fromRepo gitAnnexTmpDir
+ return $ tmp </> "xmppgit"
+ Just d -> return $ d </> "xmppgit"
+
type EnvVar = String
diff --git a/Creds.hs b/Creds.hs
index 4c6896663..943276e3c 100644
--- a/Creds.hs
+++ b/Creds.hs
@@ -122,13 +122,7 @@ writeCacheCreds :: Creds -> FilePath -> Annex ()
writeCacheCreds creds file = do
d <- fromRepo gitAnnexCredsDir
createAnnexDirectory d
- liftIO $ do
- let f = d </> file
- h <- openFile f WriteMode
- modifyFileMode f $ removeModes
- [groupReadMode, otherReadMode]
- hPutStr h creds
- hClose h
+ liftIO $ writeFileProtected (d </> file) creds
readCacheCredPair :: CredPairStorage -> Annex (Maybe CredPair)
readCacheCredPair storage = maybe Nothing decodeCredPair
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 88540a34b..58b66b74b 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -155,18 +155,20 @@ retrieveEncrypted o (cipher, enck) _ f p = withTmp enck $ \tmp ->
)
remove :: RsyncOpts -> Key -> Annex Bool
-remove o k = withRsyncScratchDir $ \tmp -> liftIO $ do
- {- Send an empty directory to rysnc to make it delete. -}
- let dummy = tmp </> keyFile k
- createDirectoryIfMissing True dummy
- rsync $ rsyncOptions o ++
- map (\s -> Param $ "--include=" ++ s) includes ++
- [ Param "--exclude=*" -- exclude everything else
- , Params "--quiet --delete --recursive"
- , partialParams
- , Param $ addTrailingPathSeparator dummy
- , Param $ rsyncUrl o
- ]
+remove o k = do
+ ps <- sendParams
+ withRsyncScratchDir $ \tmp -> liftIO $ do
+ {- Send an empty directory to rysnc to make it delete. -}
+ let dummy = tmp </> keyFile k
+ createDirectoryIfMissing True dummy
+ rsync $ rsyncOptions o ++ ps ++
+ map (\s -> Param $ "--include=" ++ s) includes ++
+ [ Param "--exclude=*" -- exclude everything else
+ , Params "--quiet --delete --recursive"
+ , partialParams
+ , Param $ addTrailingPathSeparator dummy
+ , Param $ rsyncUrl o
+ ]
where
{- Specify include rules to match the directories where the
- content could be. Note that the parent directories have
@@ -200,6 +202,15 @@ checkPresent r o k = do
partialParams :: CommandParam
partialParams = Params "--partial --partial-dir=.rsync-partial"
+{- When sending files from crippled filesystems, the permissions can be all
+ - messed up, and it's better to use the default permissions on the
+ - destination. -}
+sendParams :: Annex [CommandParam]
+sendParams = ifM crippledFileSystem
+ ( return [rsyncUseDestinationPermissions]
+ , return []
+ )
+
{- Runs an action in an empty scratch directory that can be used to build
- up trees for rsync. -}
withRsyncScratchDir :: (FilePath -> Annex Bool) -> Annex Bool
@@ -261,8 +272,9 @@ rsyncSend o callback k canrename src = withRsyncScratchDir $ \tmp -> do
liftIO $ createLink src dest
return True
)
+ ps <- sendParams
if ok
- then rsyncRemote o (Just callback)
+ then rsyncRemote o (Just callback) $ ps ++
[ Param "--recursive"
, partialParams
-- tmp/ to send contents of tmp dir
diff --git a/Utility/Rsync.hs b/Utility/Rsync.hs
index d4eeddc8c..652da8b20 100644
--- a/Utility/Rsync.hs
+++ b/Utility/Rsync.hs
@@ -45,6 +45,9 @@ rsyncServerParams =
, Params "-e.Lsf ."
]
+rsyncUseDestinationPermissions :: CommandParam
+rsyncUseDestinationPermissions = Param "--chmod=ugo=rwX"
+
rsync :: [CommandParam] -> IO Bool
rsync = boolSystem "rsync"
diff --git a/debian/changelog b/debian/changelog
index 758d01504..9b485d13b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
git-annex (4.20130502) UNRELEASED; urgency=low
* Android: The webapp is ported and working.
+ * git-annex-shell: Ensure that received files can be read. Files
+ transferred from some Android devices may have very broken permissions
+ as received.
* Temporarily add an upper bound to the version of yesod that can be built
with, since yesod 1.2 has a great many changes that will require extensive
work on the webapp.
@@ -12,12 +15,12 @@ git-annex (4.20130502) UNRELEASED; urgency=low
* direct: Fix a bug that could cause some files to be left in indirect mode.
* When initializing a directory special remote with a relative path,
the path is made absolute.
- * git-annex-shell: Ensure that received files can be read. Files
- transferred from some Android devices may have very broken permissions
- as received.
* SHA: Add a runtime sanity check that sha commands output something
that appears to be a real sha.
* configure: Better checking that sha commands output in the desired format.
+ * rsync special remotes: When sending from a crippled filesystem, use
+ the destination's default file permissions, as the local ones can
+ be arbitrarily broken. (Ie, ----rwxr-x for files on Android)
-- Joey Hess <joeyh@debian.org> Thu, 02 May 2013 20:39:19 -0400
diff --git a/doc/design/assistant.mdwn b/doc/design/assistant.mdwn
index 6e7d10221..55d3e4249 100644
--- a/doc/design/assistant.mdwn
+++ b/doc/design/assistant.mdwn
@@ -15,12 +15,12 @@ and use cases to add. Feel free to chip in with comments! --[[Joey]]
[presentation at LCA2013](http://mirror.linux.org.au/linux.conf.au/2013/mp4/gitannex.mp4)
* Month 8: [[!traillink Android]]
* Month 9: [[screencasts|videos]] and polishing
-* Month 10: bugfixing, Android webapp
+* Month 10: bugfixing, [[Android]] webapp
We are, approximately, here:
-* Month 11: more user-driven features and polishing
-* Month 12: "Windows purgatory" [[Windows]]
+* Month 11: [[Android]] and [[!traillink Windows]] porting
+* Month 12: finishing touches
## porting
diff --git a/doc/design/assistant/android.mdwn b/doc/design/assistant/android.mdwn
index 268b5aba3..83470c17e 100644
--- a/doc/design/assistant/android.mdwn
+++ b/doc/design/assistant/android.mdwn
@@ -1,3 +1,12 @@
+The Android port is just about usable. Still, we have some fun todo items
+to improve it.
+
+## high-priority TODO
+
+* [[bugs/Android_app_permission_denial_on_startup]]
+* S3 doesn't work (at least to Internet Archive:
+ "connect: does not exist (connection refused)")
+
## TODO
* Don't make app initially open terminal + webapp, but go to a page that
@@ -23,8 +32,6 @@
jobs when low on battery or run flat out when plugged in.
* The app should be aware of network status, and avoid expensive data
transfers when not on wifi. This may need to be configurable.
-* Jabber and Webdav configuration both fail with
- "getProtocolByname: does not exist (no such protocol name: tcp)"
* glacier and local pairing are not yet enabled for Android.
* The "Files" link doesn't start a file browser. Should be possible to do
on Android via intents, I suppose?