git-annex/Assistant
Joey Hess d7c93b8913 fully support core.symlinks=false in all relevant symlink handling code
Refactored annex link code into nice clean new library.

Audited and dealt with calls to createSymbolicLink.
Remaining calls are all safe, because:

Annex/Link.hs:  ( liftIO $ createSymbolicLink linktarget file
  only when core.symlinks=true
Assistant/WebApp/Configurators/Local.hs:                createSymbolicLink link link
  test if symlinks can be made
Command/Fix.hs: liftIO $ createSymbolicLink link file
  command only works in indirect mode
Command/FromKey.hs:     liftIO $ createSymbolicLink link file
  command only works in indirect mode
Command/Indirect.hs:                    liftIO $ createSymbolicLink l f
  refuses to run if core.symlinks=false
Init.hs:                createSymbolicLink f f2
  test if symlinks can be made
Remote/Directory.hs:    go [file] = catchBoolIO $ createSymbolicLink file f >> return True
  fast key linking; catches failure to make symlink and falls back to copy
Remote/Git.hs:          liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True
  ditto
Upgrade/V1.hs:                          liftIO $ createSymbolicLink link f
  v1 repos could not be on a filesystem w/o symlinks

Audited and dealt with calls to readSymbolicLink.
Remaining calls are all safe, because:

Annex/Link.hs:		( liftIO $ catchMaybeIO $ readSymbolicLink file
  only when core.symlinks=true
Assistant/Threads/Watcher.hs:		ifM ((==) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file))
  code that fixes real symlinks when inotify sees them
  It's ok to not fix psdueo-symlinks.
Assistant/Threads/Watcher.hs:		mlink <- liftIO (catchMaybeIO $ readSymbolicLink file)
  ditto
Command/Fix.hs:	stopUnless ((/=) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file)) $ do
  command only works in indirect mode
Upgrade/V1.hs:	getsymlink = takeFileName <$> readSymbolicLink file
  v1 repos could not be on a filesystem w/o symlinks

Audited and dealt with calls to isSymbolicLink.
(Typically used with getSymbolicLinkStatus, but that is just used because
getFileStatus is not as robust; it also works on pseudolinks.)
Remaining calls are all safe, because:

Assistant/Threads/SanityChecker.hs:                             | isSymbolicLink s -> addsymlink file ms
  only handles staging of symlinks that were somehow not staged
  (might need to be updated to support pseudolinks, but this is
  only a belt-and-suspenders check anyway, and I've never seen the code run)
Command/Add.hs:         if isSymbolicLink s || not (isRegularFile s)
  avoids adding symlinks to the annex, so not relevant
Command/Indirect.hs:                            | isSymbolicLink s -> void $ flip whenAnnexed f $
  only allowed on systems that support symlinks
Command/Indirect.hs:            whenM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f) $ do
  ditto
Seek.hs:notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
  used to find unlocked files, only relevant in indirect mode
Utility/FSEvents.hs:                    | Files.isSymbolicLink s = runhook addSymlinkHook $ Just s
Utility/FSEvents.hs:                                            | Files.isSymbolicLink s ->
Utility/INotify.hs:                             | Files.isSymbolicLink s ->
Utility/INotify.hs:                     checkfiletype Files.isSymbolicLink addSymlinkHook f
Utility/Kqueue.hs:              | Files.isSymbolicLink s = callhook addSymlinkHook (Just s) change
  all above are lower-level, not relevant

Audited and dealt with calls to isSymLink.
Remaining calls are all safe, because:

Annex/Direct.hs:			| isSymLink (getmode item) =
  This is looking at git diff-tree objects, not files on disk
Command/Unused.hs:		| isSymLink (LsTree.mode l) = do
  This is looking at git ls-tree, not file on disk
Utility/FileMode.hs:isSymLink :: FileMode -> Bool
Utility/FileMode.hs:isSymLink = checkMode symbolicLinkMode
  low-level

Done!!
2013-02-17 16:43:14 -04:00
..
Install ifdef osx includes 2012-09-28 19:18:08 -04:00
Pairing crippled filesystem support, probing and initial support 2013-02-14 14:15:26 -04:00
Threads fully support core.symlinks=false in all relevant symlink handling code 2013-02-17 16:43:14 -04:00
Types webapp: Now allows restarting any threads that crash. 2013-01-26 17:09:33 +11:00
WebApp crippled filesystem support, probing and initial support 2013-02-14 14:15:26 -04:00
XMPP deal with Android's nonstandard shell location 2013-02-13 14:30:04 -04:00
Alert.hs write alerts to log in debug mode 2013-01-15 14:09:35 -04:00
BranchChange.hs split BranchChange and lifted 2012-10-29 19:20:54 -04:00
Changes.hs split Changes and lifted 2012-10-29 19:30:23 -04:00
Commits.hs split Commits and lifted 2012-10-29 19:35:18 -04:00
Common.hs webapp: Now allows restarting any threads that crash. 2013-01-26 17:09:33 +11:00
DaemonStatus.hs log alerts in notice mode, which is enabled by default 2013-01-15 14:34:39 -04:00
Drop.hs --auto fixes 2012-12-06 13:22:16 -04:00
Environment.hs assistant: Detect when system is not configured with a user name, and set environment to prevent git from failing. 2013-01-06 13:34:08 -04:00
Install.hs deal with Android's nonstandard shell location 2013-02-13 14:30:04 -04:00
MakeRemote.hs Bugfix: Fix hang in webapp when setting up a ssh remote with an absolute path. 2012-11-05 12:35:11 -04:00
Monad.hs webapp: Now allows restarting any threads that crash. 2013-01-26 17:09:33 +11:00
NamedThread.hs avoid a warning 2013-02-06 15:43:23 -04:00
NetMessager.hs update to dav 0.1, and basic uploading is working! 2012-11-15 13:46:16 -04:00
Pairing.hs can now build Android targeted binary 2013-02-10 15:48:38 -04:00
Pushes.hs whitespace fixes 2012-12-13 00:45:27 -04:00
ScanRemotes.hs where indentation 2012-10-31 02:34:03 -04:00
Ssh.hs deal with Android's nonstandard shell location 2013-02-13 14:30:04 -04:00
Sync.hs assistant: Fix syncing to just created ssh remotes. 2012-12-06 17:15:50 -04:00
TransferQueue.hs --auto fixes 2012-12-06 13:22:16 -04:00
TransferSlots.hs better handling of lifting from XMPP -> Assistant 2012-11-05 19:39:08 -04:00
WebApp.hs move local repo list out of control menu 2013-01-03 16:34:57 -04:00
XMPP.hs set negative XMPP presence priority 2012-11-10 15:33:12 -04:00