Remove post-copy hook 'myPostCopy': it's easy to write one based on
'myPostInst', so just wait until someone complains that it's missing.
Remove most comments.
Put long type sigs on one line like in the other source files.
The `cabal install` is happy as long as the files it needs are
present, but `cabal sdist` will only package up files you tell it to.
So, generate the source tarball ourselves.
The source tarball is generated by make-sdist.sh, which uses cabal
sdist to calculate the package name. Could also generate the name
from the 'Version:' field in git-annex.cabal.
I have a new idea: instead of the template-based approaches that work
around cabals requirement that you list all files to put in the sdist,
we can simply generate the sdist ourselves, with the files we
want. Take that cabal!
Add link CONTRIBUTING -> doc/contributing.mdwn, so that it's easy to
find (many files in doc/).
Add .dir-locals.el to .gitignore, now that it's no longer versioned.
The CONTRIBUTING file gives a reference to a page on the Emacs wiki
that shows how to set up a .dir-locals.el that sets up tabs for
indentation. I updated the wiki page to include the
`(highlight-regexp "^ *")` part, which had been the hardest to
discover.
I thought this might be a lock conflict that explains the deadlock when
built with -threaded, but it seems not.. it still locks! It even locks
without the committer thread.
Indeed, it locks when running "git annex add"! -threaded is exposing some
other problem.
Still, this seems conceptually cleaner and did not add any inneficiencies.
Also added some high-level documentation about the threads used.
The existing `sed | find | perl` hack in the Makefile was not
including the man pages in the generated git-annex.cabal. I couldn't
figure out why it didn't work; running the `find | perl` part of the
command *did* list the man pages ...
So, I set up a new hack. It produces a cleaner .cabal file and
includes the man pages in the sdist. I changed git-annex.cabal and
its generation as follows:
- git-annex.cabal is now generated by a here document in
git-annex.cabal.template.sh. The here document has inline file list
insertion, whereas before the file lists were inserted with sed.
- The 'Extra-Source-Files:' field now only includes the non-source
files: the man pages, plain text documentation, and license.
- The source dependencies are now listed in 'Other-Modules' sections
in the 'Executable' and 'Test-Suite' sections. The list of
dependencies is generated by `gen-other-modules.sh`.
- The ./debian and ./doc are no longer included in the sdist package.
These were not installed anywhere by `cabal install`. A user that
wants them could clone the git repo.
Running the tests with cabal is not yet working, i.e.
cabal configure --enable-tests && cabal build && cabal test
and
cabal install --enable-tests
fail to find Utility.Touch. However, I did not break this: it doesn't
work for the git-annex package on Hackage either. Next step is to
figure out how to deal with HSC in cabal ... or not bother, because
`make test` works. I'm worried this is a cabal bug.
To test building from sdist, I've been running
cd ../.. ; cabal sdist ; cd dist ; tar xf git-annex-3.20120605.tar.gz && cd git-annex-3.20120605 && rm -fr /tmp/git-annex && cabal install --prefix=/tmp/git-annex && tree -A /tmp/git-annex
in the dist directory. Using `cabal-dev install` is a better test,
but is very slow.
The commit thread now has access to a channel containing the times of
all uncommitted changes. This lets it be smart about detecting busy times
when a batch job is running (such as rm -rf, or untarring something, etc),
and avoid committing until it's done. While at the same time, instantly
committing one-off changes that the user is going to expect to see
immediately.
I had to use STM to implement the channel, because of
http://hackage.haskell.org/trac/ghc/ticket/4154
While this adds a dependency, I always wanted to use STM, so this actually
makes me happy. ;)
Also happy that shouldCommit is a pure function, so other commit smartness
strategies can easily be played with. Although the current one seems pretty
good.
There is one bug, for some reason it does double commits, every time.
Fixes build breakage when both 'mtl' and 'monads-tf' are present:
$ make git-annex
> ghc -O2 -Wall -ignore-package monads-fd -outputdir tmp -IUtility -DWITH_S3 --make git-annex Utility/libdiskfree.o
>
> Common.hs:6:8:
> Ambiguous module name `Control.Monad.State.Strict':
> it was found in multiple packages: monads-tf-0.1.0.0 mtl-2.1.1
> make: *** [git-annex] Error 1
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>