git-annex-5.20140412ubuntu1/0000755000000000000000000000000012322726450012223 5ustar git-annex-5.20140412ubuntu1/Backend.hs0000644000000000000000000000667412230065652014121 0ustar {- git-annex key/value backends - - Copyright 2010,2013 Joey Hess - - Licensed under the GNU GPL version 3 or higher. -} module Backend ( list, orderedList, genKey, lookupFile, isAnnexLink, chooseBackend, lookupBackendName, maybeLookupBackendName ) where import Common.Annex import qualified Annex import Annex.CheckAttr import Annex.CatFile import Annex.Link import Types.Key import Types.KeySource import qualified Types.Backend as B import Config -- When adding a new backend, import it here and add it to the list. import qualified Backend.Hash import qualified Backend.WORM import qualified Backend.URL list :: [Backend] list = Backend.Hash.backends ++ Backend.WORM.backends ++ Backend.URL.backends {- List of backends in the order to try them when storing a new key. -} orderedList :: Annex [Backend] orderedList = do l <- Annex.getState Annex.backends -- list is cached here if not $ null l then return l else do f <- Annex.getState Annex.forcebackend case f of Just name | not (null name) -> return [lookupBackendName name] _ -> do l' <- gen . annexBackends <$> Annex.getGitConfig Annex.changeState $ \s -> s { Annex.backends = l' } return l' where gen [] = list gen l = map lookupBackendName l {- Generates a key for a file, trying each backend in turn until one - accepts it. -} genKey :: KeySource -> Maybe Backend -> Annex (Maybe (Key, Backend)) genKey source trybackend = do bs <- orderedList let bs' = maybe bs (: bs) trybackend genKey' bs' source genKey' :: [Backend] -> KeySource -> Annex (Maybe (Key, Backend)) genKey' [] _ = return Nothing genKey' (b:bs) source = do r <- B.getKey b source case r of Nothing -> genKey' bs source Just k -> return $ Just (makesane k, b) where -- keyNames should not contain newline characters. makesane k = k { keyName = map fixbadchar (keyName k) } fixbadchar c | c == '\n' = '_' | otherwise = c {- Looks up the key and backend corresponding to an annexed file, - by examining what the file links to. - - In direct mode, there is often no link on disk, in which case - the symlink is looked up in git instead. However, a real link - on disk still takes precedence over what was committed to git in direct - mode. -} lookupFile :: FilePath -> Annex (Maybe (Key, Backend)) lookupFile file = do mkey <- isAnnexLink file case mkey of Just key -> makeret key Nothing -> ifM isDirect ( maybe (return Nothing) makeret =<< catKeyFile file , return Nothing ) where makeret k = let bname = keyBackendName k in case maybeLookupBackendName bname of Just backend -> return $ Just (k, backend) Nothing -> do warning $ "skipping " ++ file ++ " (unknown backend " ++ bname ++ ")" return Nothing {- Looks up the backend that should be used for a file. - That can be configured on a per-file basis in the gitattributes file. -} chooseBackend :: FilePath -> Annex (Maybe Backend) chooseBackend f = Annex.getState Annex.forcebackend >>= go where go Nothing = maybeLookupBackendName <$> checkAttr "annex.backend" f go (Just _) = Just . Prelude.head <$> orderedList {- Looks up a backend by name. May fail if unknown. -} lookupBackendName :: String -> Backend lookupBackendName s = fromMaybe unknown $ maybeLookupBackendName s where unknown = error $ "unknown backend " ++ s maybeLookupBackendName :: String -> Maybe Backend maybeLookupBackendName s = headMaybe matches where matches = filter (\b -> s == B.name b) list git-annex-5.20140412ubuntu1/COPYRIGHT0000777000000000000000000000000012230065652016666 2debian/copyrightustar git-annex-5.20140412ubuntu1/templates/0000755000000000000000000000000012314623045014216 5ustar git-annex-5.20140412ubuntu1/templates/page.hamlet0000644000000000000000000000140312270473513016330 0ustar
git-annex
    $forall (name, route, isactive) <- navbar
  • #{name} $maybe reldir <- relDir webapp
      $if hasFileBrowser
    • ^{actionButton FileBrowserR (Just "Files") (Just "Click to open a file browser") "" "icon-folder-open icon-white"}
    • Repository: #{reldir} ^{controlMenu} $nothing
      ^{content} git-annex-5.20140412ubuntu1/templates/error.cassius0000644000000000000000000000006012230065652016740 0ustar body padding-top: 60px padding-bottom: 40px git-annex-5.20140412ubuntu1/templates/controlmenu.hamlet0000644000000000000000000000065612230065652017767 0ustar
      • Add another local repository
      • Switch repository
      • Restart daemon
      • Shutdown daemon
      • View log git-annex-5.20140412ubuntu1/templates/repolist.hamlet0000644000000000000000000000500512314623045017253 0ustar
        $if onlyCloud reposelector $if not (null repolist)

        Cloud repositories $else No cloud repositories are configured yet. $else $if not (null repolist)

        Repositories $forall (name, repoid, actions) <- repolist
          #{name} $if needsEnabled actions not enabled $else $if notWanted actions cleaning out.. $else $if notSyncing actions syncing disabled $else syncing enabled # $if lacksUUID repoid (metadata only) $if needsEnabled actions enable $else actions
        $if nootherrepos Add another repository $else Add another repository   Sync your files with another device, or # share with a friend. git-annex-5.20140412ubuntu1/templates/actionbutton.hamlet0000644000000000000000000000031312230065652020121 0ustar #{fromMaybe "" label} git-annex-5.20140412ubuntu1/templates/page.cassius0000644000000000000000000000011612230065652016525 0ustar body padding-top: 60px padding-bottom: 40px .sidebar-nav padding: 9px 0 git-annex-5.20140412ubuntu1/templates/notifications/0000755000000000000000000000000012270473513017073 5ustar git-annex-5.20140412ubuntu1/templates/notifications/longpolling.julius0000644000000000000000000000037512270473513022661 0ustar $(function() { $.get("@{geturl}", function(url){ var f = function() { longpoll_div(url, #{ident} , function() { setTimeout(f, #{delay}); } , function() { window.location.reload(true); } ); }; setTimeout(f, #{startdelay}); }); }); git-annex-5.20140412ubuntu1/templates/repolist.julius0000644000000000000000000000112012230065652017307 0ustar $(function() { var setup = function() { $("#costsortable").sortable({ items: ".repoline", handle: ".handle", cursor: "move", forceHelperSize: true, start: function(event, ui) { ui.item.children(".draghide").hide(); }, stop: function(event, ui) { ui.item.children(".draghide").show(); var list = $("#costsortable").sortable("toArray"); var moved = ui.item.attr("id"); $.ajax({ 'url': "@{RepositoriesReorderR}", 'data': { 'moved': moved, 'list': list } }); }, }); }; longpollcallbacks.add(setup); setup(); }); git-annex-5.20140412ubuntu1/templates/dashboard/0000755000000000000000000000000012270473513016151 5ustar git-annex-5.20140412ubuntu1/templates/dashboard/transfers.hamlet0000644000000000000000000000367312270473513021365 0ustar

        Transfers $if transfersrunning $forall (transfer, info) <- transfers $with percent <- maybe "unknown" (showPercentage 0) $ percentComplete transfer info