Merge branch 'master' into safesemaphore

Conflicts:
	debian/changelog
This commit is contained in:
Joey Hess 2012-10-07 17:36:58 -04:00
commit 18c9de5e14
12 changed files with 76 additions and 9 deletions

View file

@ -33,6 +33,9 @@ getVersion = handle <$> getConfig versionField ""
setVersion :: Annex ()
setVersion = setConfig versionField defaultVersion
removeVersion :: Annex ()
removeVersion = unsetConfig versionField
checkVersion :: Version -> Annex ()
checkVersion v
| v `elem` supportedVersions = noop

View file

@ -87,7 +87,7 @@ writeOSXDesktop command = do
installOSXAppFile :: FilePath -> FilePath -> Maybe String -> IO ()
installOSXAppFile appdir appfile mcontent = do
let src = "standalone" </> "macos" </> appdir </> appfile
let src = "standalone" </> "osx" </> appdir </> appfile
home <- myHomeDir
dest <- ifM systemwideInstall
( return $ "/Applications" </> appdir </> appfile

View file

@ -48,6 +48,7 @@ uninitialize :: Annex ()
uninitialize = do
gitPreCommitHookUnWrite
removeRepoUUID
removeVersion
{- Will automatically initialize if there is already a git-annex
branch from somewhere. Otherwise, require a manual init

View file

@ -164,10 +164,11 @@ tooManyWatches hook dir = do
]
querySysctl :: Read a => [CommandParam] -> IO (Maybe a)
querySysctl ps = do
v <- catchMaybeIO $ readProcess "sysctl" (toCommand ps)
querySysctl ps = getM go ["sysctl", "/sbin/sysctl", "/usr/sbin/sysctl"]
where
go p = do
v <- catchMaybeIO $ readProcess p (toCommand ps)
case v of
Nothing -> return Nothing
Just s -> return $ parsesysctl s
where
parsesysctl s = readish =<< lastMaybe (words s)

View file

@ -16,6 +16,12 @@ firstM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)
firstM _ [] = return Nothing
firstM p (x:xs) = ifM (p x) (return $ Just x , firstM p xs)
{- Runs the action on values from the list until it succeeds, returning
- its result. -}
getM :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b)
getM _ [] = return Nothing
getM p (x:xs) = maybe (getM p xs) (return . Just) =<< p x
{- Returns true if any value in the list satisfies the predicate,
- stopping once one is found. -}
anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool

1
debian/changelog vendored
View file

@ -13,6 +13,7 @@ git-annex (3.20121002) UNRELEASED; urgency=low
* Depend on and use the Haskell SafeSemaphore library, which provides
exception-safe versions of SampleVar and QSemN.
Thanks, Ben Gamari for an excellent patch set.
* uninit: Unset annex.version. Closes: #689852
-- Joey Hess <joeyh@debian.org> Mon, 01 Oct 2012 15:09:49 -0400

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="http://meep.pl/"
ip="193.23.174.18"
subject="Include/exclude"
date="2012-10-06T08:40:23Z"
content="""
It seems that example 2 reads weird for filtering because exclude/include say *what to do* while copies/in say *what to test*. An alias (maybe \"glob\") for include should be acceptable both ways (largerthan=10mb or glob=junk/\* or not glob=\*.mp3).
That said, I would vote for keeping PCEs. And actually the simple \"not (copies=trusted:2 or in=usbdrive)\" does not read significantly worse than with \"dontwant\". (In *my bikeshed* we would have \"all\" == \"glob=\*\" and \"except\" == \"and not\").
"""]]

View file

@ -6,7 +6,7 @@ locally paired systems, and remote servers with rsync.
Help me prioritize my work: What special remote would you most like
to use with the git-annex assistant?
[[!poll open=yes 14 "Amazon S3 (done)" 9 "Amazon Glacier" 6 "Box.com" 52 "My phone (or MP3 player)" 7 "Tahoe-LAFS" 3 "OpenStack SWIFT" 14 "Google Drive"]]
[[!poll open=yes 14 "Amazon S3 (done)" 9 "Amazon Glacier" 6 "Box.com" 52 "My phone (or MP3 player)" 7 "Tahoe-LAFS" 3 "OpenStack SWIFT" 15 "Google Drive"]]
This poll is ordered with the options I consider easiest to build
listed first. Mostly because git-annex already supports them and they

View file

@ -23,6 +23,9 @@ The webapp is a web server that displays a shiny interface.
* there could be a UI to export a file, which would make it be served up
over http by the web app
* there could be a UI (some javascript thing) in the web browser to
submit urls to the web app to be added to the annex and downloaded.
See: [[todo/wishlist:_an_"assistant"_for_web-browsing_--_tracking_the_sources_of_the_downloads]]
* Display the `inotify max_user_watches` exceeded message. **done**
* Display something sane when kqueue runs out of file descriptors.
* allow renaming git remotes and/or setting git-annex repo descriptions

View file

@ -0,0 +1,25 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawmYiJgOvC4IDYkr2KIjMlfVD9r_1Sij_jY"
nickname="Douglas"
subject="setup: standalone/macos/git-annex.app/Contents/Info.plist: does not exist"
date="2012-10-06T14:46:55Z"
content="""
I tried installing with cabal and homebrew on Mountain Lion. After cabal install git-annex I get:
Linking dist/build/git-annex/git-annex ...
Installing executable(s) in /Users/dfc/.cabal/bin
setup: standalone/macos/git-annex.app/Contents/Info.plist: does not exist
cabal: Error: some packages failed to install:
git-annex-3.20121001 failed during the final install step. The exception was:
ExitFailure 1
There is no directory named macos inside of standalone:
jumbo:git-annex-3.20121001 dfc$ ls -l standalone/
total 112
-rw-r--r--+ 1 dfc staff 55614 Oct 6 10:40 licences.gz
drwxr-xr-x+ 6 dfc staff 204 Oct 6 10:40 linux
drwxr-xr-x+ 3 dfc staff 102 Oct 6 10:40 osx
"""]]

View file

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="http://joeyh.name/"
ip="4.154.0.149"
subject="comment 3"
date="2012-10-06T21:05:45Z"
content="""
@Douglas, I've fixed that in git. FWIW, the program is installed before that point. Actually, I am leaning toward not having cabal install that plist file at all.
"""]]

View file

@ -1,6 +1,6 @@
A replacement for a web-browser's downloads menu that uses git-annex internally ([[`addurl`|tips/using the web as a special remote]] command for the download, and `drop` or `git rm` for the clean up) would be quite helpful:
say, when working on a topic, writing a paper or similar things, I usually have a Git repo with my text, all relevant data and processing code, and possibly other backround information. It's nice to store the literature you needed at the same place where you work. (So that it is easy to catch up with what I was doing and thinking over when I left this work aside for a while, perhaps after cloning the repo from another location.)
say, when working on a topic, writing a paper or similar things, I usually have a Git repo with my text, all relevant data and processing code, and possibly other background information. It's nice to store the literature you needed at the same place where you work. (So that it is easy to catch up with what I was doing and thinking over when I left this work aside for a while, perhaps after cloning the repo from another location.)
When I find an interesting literature, I save the file to the directory with my work, and read it. Then I might return to it to re-read it. There might be references to this document from my work, so I'd like them to work as links (perhaps pointing at the local file, but also at the source URL for the case when my document is read by someone else not on my system).
@ -8,10 +8,19 @@ I need to keep track of the source URLs for the documents I have saved which I r
That's a task that fits well git-annex.
Note that doing the dull work of copying and pasting the URL and the downloading it and then opening it for reading is a pain to do every time I'm interested in a document I have found on the web. (Of course, I would need to fill out the bibliogrphic information for this document if I want to refer to it, but that can be done later. Initially, I wish I just don't lose the source URL of a documented at the moment when I get interested in it and start reading.)
Note that doing the dull work of copying and pasting the URL and the downloading it and then opening it for reading is a pain to do every time I'm interested in a document I have found on the web. (Of course, I would need to fill out the bibliogrphic information for this document if I want to refer to it, but that can be done later. Initially, I wish I just don't lose the source URL of a document at the moment when I get interested in it and start reading.)
So, I could be assisted by a replacement of the "downloads" menu of, say, Firefox: whenever I want to open a file for viewing (like a PDF), it should ask me where to save it, and I'd choose the directory with my work, then it should register it with git-annex (so that the source URL is saved, and perhaps it should also write down the referring page's URL somewhere nearby automatically), download it, and open with a viewer for reading.
Then I'll have the interesting literature there when I'm offline; the source URLs would be saved, so that they can be put into the references. Also, if I distribute this work with Git, at another location git-annex can be used to easily get all the literature again.
(Hmmm... probably, the browser that this will be simplest for me to implement for is emacs-w3m; simply, some functions calling git-annex...)
> This seems fairly doable to implement since the git-annex [[design/assistant]]
> already has a webapp. So a javascript toolbar thing could be made that
> submits the current url (or maybe links dragged into it?) to the webapp
> for adding to the annex.
>
> The only wrinkle is that the webapp runs under a new url each time
> it starts, due to using a high port and embedding some auth token in the
> url. --[[Joey]]