From f5261f60c3d4462088768959014189a3aa61ff30 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 3 Jun 2012 15:05:59 -0700 Subject: Make standalone man-page installation possible The `cabal install git-annex` doesn't install the man pages, and the Makefile only installed the man pages as part of a full build/install. So, I factored out the documentation parts of the Makefile. --- Makefile | 12 ++++++++---- doc/install.mdwn | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 94dc05a81..26367aa46 100644 --- a/Makefile +++ b/Makefile @@ -47,17 +47,21 @@ git-annex-shell.1: doc/git-annex-shell.mdwn git-union-merge.1: doc/git-union-merge.mdwn ./mdwn2man git-union-merge 1 doc/git-union-merge.mdwn > git-union-merge.1 -install: all - install -d $(DESTDIR)$(PREFIX)/bin - install $(bins) $(DESTDIR)$(PREFIX)/bin - ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell +install-mans: $(mans) install -d $(DESTDIR)$(PREFIX)/share/man/man1 install -m 0644 $(mans) $(DESTDIR)$(PREFIX)/share/man/man1 + +install-docs: docs install-mans install -d $(DESTDIR)$(PREFIX)/share/doc/git-annex if [ -d html ]; then \ rsync -a --delete html/ $(DESTDIR)$(PREFIX)/share/doc/git-annex/html/; \ fi +install: all install-docs + install -d $(DESTDIR)$(PREFIX)/bin + install $(bins) $(DESTDIR)$(PREFIX)/bin + ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell + test: @if ! $(GHCMAKE) -O0 test $(clibs); then \ echo "** failed to build the test suite" >&2; \ diff --git a/doc/install.mdwn b/doc/install.mdwn index fe0522aa0..1f4b54f54 100644 --- a/doc/install.mdwn +++ b/doc/install.mdwn @@ -20,6 +20,28 @@ As a haskell package, git-annex can be installed using cabal. For example: The above downloads the latest release. Alternatively, you can [[download]] it yourself and [[manually_build_with_cabal|install/cabal]]. +### Man pages + +Cabal does not install the man pages. Do: + + cd /tmp + cabal unpack git-annex + cd git-annex* + make install-mans PREFIX=~/.cabal + +to install man pages under ~/.cabal/share/man (or $PREFIX/share/man +generally). If ~/.cabal/bin is on your PATH, and you're on a Debian +derivative, you're probably set. + +On Debian systems, `manpath` will print the paths searched for manual +pages. The paths searched are inferred from your PATH. Experiments +indicate that, on Ubuntu, D/share/man will be searched for manual +pages whenever D/bin is on your PATH. So, having ~/.cabal/bin on your +PATH is enough to make the above example work. The `man manpath` does +not document this, but see +http://linux.derkeiler.com/Mailing-Lists/Debian/2003-08/0956.html for +some other special cases. + ## Installation by hand To build and use git-annex, you will need: -- cgit v1.2.3 From 1cfd2e1c0572acf13f75897af3f5921cf0950e75 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Wed, 6 Jun 2012 01:57:31 -0700 Subject: Remove INSTALL note about man pages. --- doc/install.mdwn | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/doc/install.mdwn b/doc/install.mdwn index 1f4b54f54..fe0522aa0 100644 --- a/doc/install.mdwn +++ b/doc/install.mdwn @@ -20,28 +20,6 @@ As a haskell package, git-annex can be installed using cabal. For example: The above downloads the latest release. Alternatively, you can [[download]] it yourself and [[manually_build_with_cabal|install/cabal]]. -### Man pages - -Cabal does not install the man pages. Do: - - cd /tmp - cabal unpack git-annex - cd git-annex* - make install-mans PREFIX=~/.cabal - -to install man pages under ~/.cabal/share/man (or $PREFIX/share/man -generally). If ~/.cabal/bin is on your PATH, and you're on a Debian -derivative, you're probably set. - -On Debian systems, `manpath` will print the paths searched for manual -pages. The paths searched are inferred from your PATH. Experiments -indicate that, on Ubuntu, D/share/man will be searched for manual -pages whenever D/bin is on your PATH. So, having ~/.cabal/bin on your -PATH is enough to make the above example work. The `man manpath` does -not document this, but see -http://linux.derkeiler.com/Mailing-Lists/Debian/2003-08/0956.html for -some other special cases. - ## Installation by hand To build and use git-annex, you will need: -- cgit v1.2.3 From 6f17b2fb39f389b01accee420548b54e22f41e0a Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Wed, 6 Jun 2012 02:35:32 -0700 Subject: WIP: Add man page installation to Setup.hs This works with `cabal-dev install .`, but `cabal sdist` does not yet include the man pages (tried adding a `make $(mans)` before `cabal sdist` in `make sdist`, but no luck). XXX: Need to go back and replace spaces with tabs. --- Setup.hs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Setup.hs b/Setup.hs index c36d6e4fe..c722077eb 100644 --- a/Setup.hs +++ b/Setup.hs @@ -3,6 +3,9 @@ import Distribution.Simple import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Setup +import Distribution.Simple.Utils (installOrdinaryFiles) +import Distribution.PackageDescription (PackageDescription(..)) +import Distribution.Verbosity (Verbosity) import System.Cmd import System.FilePath @@ -11,6 +14,7 @@ import qualified Build.Configure as Configure main = defaultMainWithHooks simpleUserHooks { preConf = configure , instHook = install + , postInst = const installManpages } configure _ _ = do @@ -25,3 +29,23 @@ install pkg_descr lbi userhooks flags = do where installDirs = absoluteInstallDirs pkg_descr lbi $ fromFlag (copyDest defaultCopyFlags) + +-- See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages. +-- +-- Based on pandoc's 'Setup.installManpages' and 'postInst' hook. +-- Would be easier to just use 'rawSystem' as above. +-- +-- XXX: fix tabs! +installManpages :: InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () +installManpages flags pkg lbi = + installOrdinaryFiles verbosity dstManDir manpages + where + srcManDir = "" + -- The 'NoCopyDest' means "don't add an additional path prefix". + -- The pandoc Setup.hs uses 'NoCopyDest' in the post install hook + -- and the 'CopyDest' from the copy flags in the post copy hook. + dstManDir = mandir (absoluteInstallDirs pkg lbi NoCopyDest) "man1" + manpages = zip (repeat srcManDir) + [ "git-annex.1" + , "git-annex-shell.1" ] + verbosity = fromFlag $ installVerbosity flags -- cgit v1.2.3 From 817a42056b228bccae2c3111214944bde1286325 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Thu, 7 Jun 2012 19:01:49 -0700 Subject: Add note about lhs2tex's man page installation. --- Setup.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Setup.hs b/Setup.hs index c722077eb..9d2162f47 100644 --- a/Setup.hs +++ b/Setup.hs @@ -35,6 +35,10 @@ install pkg_descr lbi userhooks flags = do -- Based on pandoc's 'Setup.installManpages' and 'postInst' hook. -- Would be easier to just use 'rawSystem' as above. -- +-- XXX: lhs2tex installs man pages with the 'postCopy' hook. +-- I chose 'postInst'. Pandoc uses both :P So, probably +-- to use the 'postCopy' hook. +-- -- XXX: fix tabs! installManpages :: InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () installManpages flags pkg lbi = -- cgit v1.2.3 From 2b29a0228527e00d112770cb89b07f28c6bb0a14 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sat, 9 Jun 2012 20:46:41 -0700 Subject: Make man pages when making sdist. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 26367aa46..9ac06e1d7 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,7 @@ clean: # Workaround for cabal sdist not running Setup hooks, so I cannot # generate a file list there. sdist: clean + @make $(mans) @if [ ! -e git-annex.cabal.orig ]; then cp git-annex.cabal git-annex.cabal.orig; fi @sed -e "s!\(Extra-Source-Files: \).*!\1$(shell find . -name .git -prune -or -not -name \\*.orig -not -type d -print | perl -ne 'print unless length >= 100')!i" < git-annex.cabal.orig > git-annex.cabal @cabal sdist -- cgit v1.2.3 From 6c8507ee1b0a5bd361c38ec0fa342e616b990357 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sat, 9 Jun 2012 23:32:25 -0700 Subject: Combine post install commands in 'postInst' and add 'postCopy' hook. The creation of the 'git-annex-shell' symlink was in 'postInst' hook. I combined it with the man-page installation in a 'postInst' hook and a 'postCopy' hook. I don't understand how to use the `cabal copy` command, but the examples I looked at defined both hooks. Relevant comments from the source: * man-page installation: See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages. Based on pandoc's and lhs2tex's 'Setup.installManpages' and 'postInst' hooks. My understanding: 'postCopy' is run for `cabal copy`, 'postInst' is run for `cabal inst`, and copy is not a generalized install, so you have to write two nearly identical hooks. Summary of hooks: http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple-UserHooks.htm-- Other people are also confused: * Bug: 'postCopy' and 'postInst' are confusing: http://hackage.haskell.org/trac/hackage/ticket/718 * A cabal maintainer suggests using 'postCopy' instead of 'postInst', because `cabal install` is `cabal copy` followed by `cabal register`: http://www.haskell.org/pipermail/libraries/2008-March/009416.html Although that sounds desirable, it's not true, as the reply and experiments indicate. * the `cabal copy` command: ???: Not sure how you're supposed to use this. E.g., when I do cabal install --prefix=/tmp/git-annex-install cabal copy --deistdir=/tmp/git-annex-copy I get the copy under /tmp/git-annex-copy/tmp/git-annex-install Also, `cabal install` fails when given a relative --prefix. --- Setup.hs | 95 ++++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 66 insertions(+), 29 deletions(-) diff --git a/Setup.hs b/Setup.hs index 9d2162f47..b2370a837 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,55 +1,92 @@ +{-# LANGUAGE NamedFieldPuns #-} {- cabal setup file -} import Distribution.Simple import Distribution.Simple.LocalBuildInfo import Distribution.Simple.Setup -import Distribution.Simple.Utils (installOrdinaryFiles) +import Distribution.Simple.Utils (installOrdinaryFiles, rawSystemExit) import Distribution.PackageDescription (PackageDescription(..)) import Distribution.Verbosity (Verbosity) -import System.Cmd import System.FilePath import qualified Build.Configure as Configure main = defaultMainWithHooks simpleUserHooks { preConf = configure - , instHook = install - , postInst = const installManpages + , postInst = myPostInst + , postCopy = myPostCopy } configure _ _ = do Configure.run Configure.tests return (Nothing, []) -install pkg_descr lbi userhooks flags = do - r <- (instHook simpleUserHooks) pkg_descr lbi userhooks flags - _ <- rawSystem "ln" ["-sf", "git-annex", - bindir installDirs "git-annex-shell"] - return r - where - installDirs = absoluteInstallDirs pkg_descr lbi $ - fromFlag (copyDest defaultCopyFlags) +myPostInst :: Args -> InstallFlags -> PackageDescription + -> LocalBuildInfo -> IO () +myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do + installGitAnnexShell dest verbosity pkg lbi + installManpages dest verbosity pkg lbi + where + dest = NoCopyDest + verbosity = fromFlag installVerbosity + +-- ???: Not sure how you're supposed to use this. E.g., when I do +-- +-- cabal install --prefix=/tmp/git-annex-install +-- cabal copy --deistdir=/tmp/git-annex-copy +-- +-- I get the copy under +-- +-- /tmp/git-annex-copy/tmp/git-annex-install +-- +-- Also, `cabal install` fails when given a relative --prefix. +myPostCopy :: Args -> CopyFlags -> PackageDescription + -> LocalBuildInfo -> IO () +myPostCopy _ (CopyFlags { copyDest, copyVerbosity }) pkg lbi = do + installGitAnnexShell dest verbosity pkg lbi + installManpages dest verbosity pkg lbi + where + dest = fromFlag copyDest + verbosity = fromFlag copyVerbosity + +installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription + -> LocalBuildInfo -> IO () +installGitAnnexShell copyDest verbosity pkg lbi = + rawSystemExit verbosity "ln" + ["-sf", "git-annex", dstBinDir "git-annex-shell"] + where + dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest -- See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages. -- --- Based on pandoc's 'Setup.installManpages' and 'postInst' hook. --- Would be easier to just use 'rawSystem' as above. +-- Based on pandoc's and lhs2tex's 'Setup.installManpages' and +-- 'postInst' hooks. +-- +-- My understanding: 'postCopy' is run for `cabal copy`, 'postInst' is +-- run for `cabal inst`, and copy is not a generalized install, so you +-- have to write two nearly identical hooks. +-- +-- Summary of hooks: +-- http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple-UserHooks.htm-- +-- Other people are also confused: +-- +-- * Bug: 'postCopy' and 'postInst' are confusing: +-- http://hackage.haskell.org/trac/hackage/ticket/718 -- --- XXX: lhs2tex installs man pages with the 'postCopy' hook. --- I chose 'postInst'. Pandoc uses both :P So, probably --- to use the 'postCopy' hook. +-- * A cabal maintainer suggests using 'postCopy' instead of +-- 'postInst', because `cabal install` is `cabal copy` followed by +-- `cabal register`: +-- http://www.haskell.org/pipermail/libraries/2008-March/009416.html +-- Although that sounds desirable, it's not true, as the reply and +-- experiments indicate. -- -- XXX: fix tabs! -installManpages :: InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () -installManpages flags pkg lbi = - installOrdinaryFiles verbosity dstManDir manpages +installManpages :: CopyDest -> Verbosity -> PackageDescription + -> LocalBuildInfo -> IO () +installManpages copyDest verbosity pkg lbi = + installOrdinaryFiles verbosity dstManDir srcManpages where - srcManDir = "" - -- The 'NoCopyDest' means "don't add an additional path prefix". - -- The pandoc Setup.hs uses 'NoCopyDest' in the post install hook - -- and the 'CopyDest' from the copy flags in the post copy hook. - dstManDir = mandir (absoluteInstallDirs pkg lbi NoCopyDest) "man1" - manpages = zip (repeat srcManDir) - [ "git-annex.1" - , "git-annex-shell.1" ] - verbosity = fromFlag $ installVerbosity flags + dstManDir = mandir (absoluteInstallDirs pkg lbi copyDest) "man1" + srcManpages = zip (repeat srcManDir) manpages + srcManDir = "" + manpages = ["git-annex.1", "git-annex-shell.1"] -- cgit v1.2.3 From 4453351ca4b3dfe313b475bbf6e1de9a9b250fb5 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 10 Jun 2012 02:11:40 -0700 Subject: Add a .dir-locals.el that configures emacs' treatment of tabs. The Haskell code uses tabs for indentation, and displays well with tab-width set to 2. So, I created a .dir-locals.el (applies to all files opened in emacs at or below ./), which sets 'tab-width' to 2, turns on 'indent-tabs-mode', and highlights leading spaces in 'haskell-mode'. --- .dir-locals.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000000000..e523528e2 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,22 @@ +;; Configure emacs' treatment of tabs. +;; +;; See +;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html +;; for a description of this file. +;; +;; The 'nil' below applies to all modes. +((nil . ((indent-tabs-mode . t) + (tab-width . 2))) + (haskell-mode . ( + ;; Highlight leading space characters, to avoid indenting with + ;; spaces. + ;; + ;; Emacs will prompt you about this, saying it's unsafe, but + ;; you can permanently store an exception by pressing "!", + ;; which inserts + ;; + ;; (safe-local-variable-values . (quote ((eval highlight-regexp "^ *")))) + ;; + ;; in your ~/.emacs ... except the exception doesn't work, and + ;; emacs still asks you on each file you open :P + (eval . (highlight-regexp "^ *"))))) -- cgit v1.2.3 From d76afc8152cbade2dbfe68c7ef786b2fa5a79f2f Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 10 Jun 2012 02:21:13 -0700 Subject: Replace indentation spaces by tabs in Setup.hs. --- Setup.hs | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/Setup.hs b/Setup.hs index b2370a837..3f282e0aa 100644 --- a/Setup.hs +++ b/Setup.hs @@ -14,7 +14,7 @@ import qualified Build.Configure as Configure main = defaultMainWithHooks simpleUserHooks { preConf = configure , postInst = myPostInst - , postCopy = myPostCopy + , postCopy = myPostCopy } configure _ _ = do @@ -24,11 +24,11 @@ configure _ _ = do myPostInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do - installGitAnnexShell dest verbosity pkg lbi - installManpages dest verbosity pkg lbi - where - dest = NoCopyDest - verbosity = fromFlag installVerbosity + installGitAnnexShell dest verbosity pkg lbi + installManpages dest verbosity pkg lbi + where + dest = NoCopyDest + verbosity = fromFlag installVerbosity -- ???: Not sure how you're supposed to use this. E.g., when I do -- @@ -43,19 +43,19 @@ myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () myPostCopy _ (CopyFlags { copyDest, copyVerbosity }) pkg lbi = do - installGitAnnexShell dest verbosity pkg lbi - installManpages dest verbosity pkg lbi - where - dest = fromFlag copyDest - verbosity = fromFlag copyVerbosity + installGitAnnexShell dest verbosity pkg lbi + installManpages dest verbosity pkg lbi + where + dest = fromFlag copyDest + verbosity = fromFlag copyVerbosity installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installGitAnnexShell copyDest verbosity pkg lbi = - rawSystemExit verbosity "ln" - ["-sf", "git-annex", dstBinDir "git-annex-shell"] - where - dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest + rawSystemExit verbosity "ln" + ["-sf", "git-annex", dstBinDir "git-annex-shell"] + where + dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest -- See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages. -- @@ -79,14 +79,12 @@ installGitAnnexShell copyDest verbosity pkg lbi = -- http://www.haskell.org/pipermail/libraries/2008-March/009416.html -- Although that sounds desirable, it's not true, as the reply and -- experiments indicate. --- --- XXX: fix tabs! installManpages :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installManpages copyDest verbosity pkg lbi = - installOrdinaryFiles verbosity dstManDir srcManpages - where - dstManDir = mandir (absoluteInstallDirs pkg lbi copyDest) "man1" - srcManpages = zip (repeat srcManDir) manpages - srcManDir = "" - manpages = ["git-annex.1", "git-annex-shell.1"] + installOrdinaryFiles verbosity dstManDir srcManpages + where + dstManDir = mandir (absoluteInstallDirs pkg lbi copyDest) "man1" + srcManpages = zip (repeat srcManDir) manpages + srcManDir = "" + manpages = ["git-annex.1", "git-annex-shell.1"] -- cgit v1.2.3 From f4b82e31b47ac17bbd55dfcdb681cb82174dda00 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 10 Jun 2012 18:59:16 -0700 Subject: Fix Makefile dependencies for `make test`. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ac06e1d7..03bada30e 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ install: all install-docs install $(bins) $(DESTDIR)$(PREFIX)/bin ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell -test: +test: $(sources) $(clibs) @if ! $(GHCMAKE) -O0 test $(clibs); then \ echo "** failed to build the test suite" >&2; \ exit 1; \ -- cgit v1.2.3 From 721de7067c43b8693aa6b4c163ecf9ec39d907d2 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 10 Jun 2012 19:03:35 -0700 Subject: Add cabal-dev to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b6b8d606d..1de0aaf72 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ html Utility/Touch.hs Utility/libdiskfree.o dist +cabal-dev -- cgit v1.2.3 From b86f201bdf5bba6da51647486ac5cf2dbbf206bd Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 10 Jun 2012 19:17:51 -0700 Subject: Rename git-annex.cabal. --- git-annex.cabal | 60 --------------------------------------------- git-annex.cabal.template.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 git-annex.cabal create mode 100644 git-annex.cabal.template.sh diff --git a/git-annex.cabal b/git-annex.cabal deleted file mode 100644 index c15167831..000000000 --- a/git-annex.cabal +++ /dev/null @@ -1,60 +0,0 @@ -Name: git-annex -Version: 3.20120605 -Cabal-Version: >= 1.8 -License: GPL -Maintainer: Joey Hess -Author: Joey Hess -Stability: Stable -Copyright: 2010-2012 Joey Hess -License-File: GPL -Extra-Source-Files: use-make-sdist-instead -Homepage: http://git-annex.branchable.com/ -Build-type: Custom -Category: Utility -Synopsis: manage files with git, without checking their contents into git -Description: - git-annex allows managing files with git, without checking the file - contents into git. While that may seem paradoxical, it is useful when - dealing with files larger than git can currently easily handle, whether due - to limitations in memory, time, or disk space. - . - Even without file content tracking, being able to manage files with git, - move files around and delete files with versioned directory trees, and use - branches and distributed clones, are all very handy reasons to use git. And - annexed files can co-exist in the same git repository with regularly - versioned files, which is convenient for maintaining documents, Makefiles, - etc that are associated with annexed files but that benefit from full - revision control. - -Flag S3 - Description: Enable S3 support - -Executable git-annex - Main-Is: git-annex.hs - Build-Depends: MissingH, hslogger, directory, filepath, - unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, - pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, - base == 4.5.*, monad-control, transformers-base, lifted-base, - IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - Other-Modules: Utility.Touch - C-Sources: Utility/libdiskfree.c - Extensions: CPP - - if flag(S3) - Build-Depends: hS3 - CPP-Options: -DWITH_S3 - -Test-Suite test - Type: exitcode-stdio-1.0 - Main-Is: test.hs - Build-Depends: testpack, HUnit, MissingH, hslogger, directory, filepath, - unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, - pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, - base == 4.5.*, monad-control, transformers-base, lifted-base, - IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - C-Sources: Utility/libdiskfree.c - Extensions: CPP - -source-repository head - type: git - location: git://git-annex.branchable.com/ diff --git a/git-annex.cabal.template.sh b/git-annex.cabal.template.sh new file mode 100644 index 000000000..c15167831 --- /dev/null +++ b/git-annex.cabal.template.sh @@ -0,0 +1,60 @@ +Name: git-annex +Version: 3.20120605 +Cabal-Version: >= 1.8 +License: GPL +Maintainer: Joey Hess +Author: Joey Hess +Stability: Stable +Copyright: 2010-2012 Joey Hess +License-File: GPL +Extra-Source-Files: use-make-sdist-instead +Homepage: http://git-annex.branchable.com/ +Build-type: Custom +Category: Utility +Synopsis: manage files with git, without checking their contents into git +Description: + git-annex allows managing files with git, without checking the file + contents into git. While that may seem paradoxical, it is useful when + dealing with files larger than git can currently easily handle, whether due + to limitations in memory, time, or disk space. + . + Even without file content tracking, being able to manage files with git, + move files around and delete files with versioned directory trees, and use + branches and distributed clones, are all very handy reasons to use git. And + annexed files can co-exist in the same git repository with regularly + versioned files, which is convenient for maintaining documents, Makefiles, + etc that are associated with annexed files but that benefit from full + revision control. + +Flag S3 + Description: Enable S3 support + +Executable git-annex + Main-Is: git-annex.hs + Build-Depends: MissingH, hslogger, directory, filepath, + unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, + pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, + base == 4.5.*, monad-control, transformers-base, lifted-base, + IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance + Other-Modules: Utility.Touch + C-Sources: Utility/libdiskfree.c + Extensions: CPP + + if flag(S3) + Build-Depends: hS3 + CPP-Options: -DWITH_S3 + +Test-Suite test + Type: exitcode-stdio-1.0 + Main-Is: test.hs + Build-Depends: testpack, HUnit, MissingH, hslogger, directory, filepath, + unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, + pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, + base == 4.5.*, monad-control, transformers-base, lifted-base, + IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance + C-Sources: Utility/libdiskfree.c + Extensions: CPP + +source-repository head + type: git + location: git://git-annex.branchable.com/ -- cgit v1.2.3 From 7753b33c8860486edf37936e30f35da9db7c8f8b Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sun, 10 Jun 2012 19:24:15 -0700 Subject: Refactor generation of git-annex.cabal and incorporate man pages. 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. --- .gitignore | 1 + Makefile | 18 +++++++++++------- gen-other-modules.sh | 32 ++++++++++++++++++++++++++++++++ git-annex.cabal.template.sh | 20 ++++++++++++++++++-- 4 files changed, 62 insertions(+), 9 deletions(-) create mode 100755 gen-other-modules.sh mode change 100644 => 100755 git-annex.cabal.template.sh diff --git a/.gitignore b/.gitignore index 1de0aaf72..74c0e672a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ test configure Build/SysConfig.hs git-annex +git-annex.cabal git-annex.1 git-annex-shell.1 git-union-merge.1 diff --git a/Makefile b/Makefile index 03bada30e..131daade7 100644 --- a/Makefile +++ b/Makefile @@ -98,16 +98,20 @@ docs: $(mans) clean: rm -rf tmp $(bins) $(mans) test configure *.tix .hpc $(sources) \ - doc/.ikiwiki html dist $(clibs) + doc/.ikiwiki html dist $(clibs) git-annex.cabal # Workaround for cabal sdist not running Setup hooks, so I cannot # generate a file list there. -sdist: clean - @make $(mans) - @if [ ! -e git-annex.cabal.orig ]; then cp git-annex.cabal git-annex.cabal.orig; fi - @sed -e "s!\(Extra-Source-Files: \).*!\1$(shell find . -name .git -prune -or -not -name \\*.orig -not -type d -print | perl -ne 'print unless length >= 100')!i" < git-annex.cabal.orig > git-annex.cabal - @cabal sdist - @mv git-annex.cabal.orig git-annex.cabal +sdist: clean $(mans) + # Could make this a .PHONY, but it needs to be rerun each time, + # unless we want to list a *lot* of dependencies. + ./git-annex.cabal.template.sh > git-annex.cabal + # Complains about not running 'configure' first, but adding + # + # cabal configure + # + # does not help. + cabal sdist # Upload to hackage. hackage: sdist diff --git a/gen-other-modules.sh b/gen-other-modules.sh new file mode 100755 index 000000000..3c50d91e7 --- /dev/null +++ b/gen-other-modules.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Generate module list for 'Other-Modules:' field in git-annex.cabal. +# This would be simpler if the code were under ./src. + +find Annex Annex.hs \ + Backend Backend.hs \ + Build \ + Checks.hs \ + CmdLine.hs \ + Command Command.hs \ + Common Common.hs \ + Config.hs \ + Crypto.hs \ + Git Git.hs \ + GitAnnex.hs \ + GitAnnexShell.hs \ + Init.hs \ + Limit.hs \ + Locations.hs \ + Logs \ + Messages Messages.hs \ + Option.hs \ + Remote Remote.hs \ + Seek.hs \ + Setup.hs \ + Types Types.hs \ + Upgrade Upgrade.hs \ + Usage.hs \ + Utility \ + -name '*.hs' \ +| sed -r -e 's!.hs!!' -e 's!/!.!g' diff --git a/git-annex.cabal.template.sh b/git-annex.cabal.template.sh old mode 100644 new mode 100755 index c15167831..46eaad745 --- a/git-annex.cabal.template.sh +++ b/git-annex.cabal.template.sh @@ -1,3 +1,9 @@ +#!/bin/bash + +# Template for git-annex.cabal: the 'Other-Module:' fields are +# dynamically generated. + +cat <= 1.8 @@ -7,7 +13,6 @@ Author: Joey Hess Stability: Stable Copyright: 2010-2012 Joey Hess License-File: GPL -Extra-Source-Files: use-make-sdist-instead Homepage: http://git-annex.branchable.com/ Build-type: Custom Category: Utility @@ -25,6 +30,9 @@ Description: versioned files, which is convenient for maintaining documents, Makefiles, etc that are associated with annexed files but that benefit from full revision control. +Extra-Source-Files: + git-annex.1 git-annex-shell.1 + INSTALL README CHANGELOG NEWS GPL Flag S3 Description: Enable S3 support @@ -36,7 +44,10 @@ Executable git-annex pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, base == 4.5.*, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - Other-Modules: Utility.Touch + Other-Modules: + Utility.Touch + -- Auto-generated list of all Haskell modules: +`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` C-Sources: Utility/libdiskfree.c Extensions: CPP @@ -53,8 +64,13 @@ Test-Suite test base == 4.5.*, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance C-Sources: Utility/libdiskfree.c + Other-Modules: + Utility.Touch + -- Auto-generated list of all Haskell modules: +`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` Extensions: CPP source-repository head type: git location: git://git-annex.branchable.com/ +EOF -- cgit v1.2.3 From 236ae1fbc4fa114cfcef5a7d71c40cb1c2ef9d8f Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Mon, 11 Jun 2012 23:27:00 -0700 Subject: Add link COPYRIGHT -> debian/copyright; add COPYRIGHT to sdist. --- COPYRIGHT | 1 + git-annex.cabal.template.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 COPYRIGHT diff --git a/COPYRIGHT b/COPYRIGHT new file mode 120000 index 000000000..9060ce820 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1 @@ +debian/copyright \ No newline at end of file diff --git a/git-annex.cabal.template.sh b/git-annex.cabal.template.sh index 46eaad745..5ff8155e9 100755 --- a/git-annex.cabal.template.sh +++ b/git-annex.cabal.template.sh @@ -32,7 +32,7 @@ Description: revision control. Extra-Source-Files: git-annex.1 git-annex-shell.1 - INSTALL README CHANGELOG NEWS GPL + INSTALL README CHANGELOG NEWS GPL COPYRIGHT Flag S3 Description: Enable S3 support -- cgit v1.2.3 From 9fe433390d3860bdb740c54b015889805578c992 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Tue, 12 Jun 2012 00:39:21 -0700 Subject: Remove .dir-locals.el and add doc/contributing.mdwn. 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. --- .dir-locals.el | 22 ---------------------- .gitignore | 3 +++ CONTRIBUTING | 1 + doc/contributing.mdwn | 7 +++++++ 4 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 .dir-locals.el create mode 120000 CONTRIBUTING create mode 100644 doc/contributing.mdwn diff --git a/.dir-locals.el b/.dir-locals.el deleted file mode 100644 index e523528e2..000000000 --- a/.dir-locals.el +++ /dev/null @@ -1,22 +0,0 @@ -;; Configure emacs' treatment of tabs. -;; -;; See -;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html -;; for a description of this file. -;; -;; The 'nil' below applies to all modes. -((nil . ((indent-tabs-mode . t) - (tab-width . 2))) - (haskell-mode . ( - ;; Highlight leading space characters, to avoid indenting with - ;; spaces. - ;; - ;; Emacs will prompt you about this, saying it's unsafe, but - ;; you can permanently store an exception by pressing "!", - ;; which inserts - ;; - ;; (safe-local-variable-values . (quote ((eval highlight-regexp "^ *")))) - ;; - ;; in your ~/.emacs ... except the exception doesn't work, and - ;; emacs still asks you on each file you open :P - (eval . (highlight-regexp "^ *"))))) diff --git a/.gitignore b/.gitignore index 74c0e672a..e176e59c2 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,7 @@ html Utility/Touch.hs Utility/libdiskfree.o dist +# Sandboxed builds cabal-dev +# Project-local emacs configuration +.dir-locals.el diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 120000 index 000000000..8ad193e22 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1 @@ +doc/contributing.mdwn \ No newline at end of file diff --git a/doc/contributing.mdwn b/doc/contributing.mdwn new file mode 100644 index 000000000..11c6c1987 --- /dev/null +++ b/doc/contributing.mdwn @@ -0,0 +1,7 @@ +## Style + +This project uses tabs for indentation and the code looks fine with +any tab width. If you are using Emacs, and have it configured to use +spaces for indentation, then you can add a ./.dir-locals.el to use +tabs for files in this project. See +http://www.emacswiki.org/emacs/DirectoryVariables. -- cgit v1.2.3 From 72b0054931cd0d41477fa7270154cb53d8e94e4d Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Tue, 12 Jun 2012 00:53:35 -0700 Subject: Get ready for a simple 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! --- gen-other-modules.sh | 32 ------------------- git-annex.cabal | 76 +++++++++++++++++++++++++++++++++++++++++++++ git-annex.cabal.template.sh | 76 --------------------------------------------- 3 files changed, 76 insertions(+), 108 deletions(-) delete mode 100755 gen-other-modules.sh create mode 100755 git-annex.cabal delete mode 100755 git-annex.cabal.template.sh diff --git a/gen-other-modules.sh b/gen-other-modules.sh deleted file mode 100755 index 3c50d91e7..000000000 --- a/gen-other-modules.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Generate module list for 'Other-Modules:' field in git-annex.cabal. -# This would be simpler if the code were under ./src. - -find Annex Annex.hs \ - Backend Backend.hs \ - Build \ - Checks.hs \ - CmdLine.hs \ - Command Command.hs \ - Common Common.hs \ - Config.hs \ - Crypto.hs \ - Git Git.hs \ - GitAnnex.hs \ - GitAnnexShell.hs \ - Init.hs \ - Limit.hs \ - Locations.hs \ - Logs \ - Messages Messages.hs \ - Option.hs \ - Remote Remote.hs \ - Seek.hs \ - Setup.hs \ - Types Types.hs \ - Upgrade Upgrade.hs \ - Usage.hs \ - Utility \ - -name '*.hs' \ -| sed -r -e 's!.hs!!' -e 's!/!.!g' diff --git a/git-annex.cabal b/git-annex.cabal new file mode 100755 index 000000000..5ff8155e9 --- /dev/null +++ b/git-annex.cabal @@ -0,0 +1,76 @@ +#!/bin/bash + +# Template for git-annex.cabal: the 'Other-Module:' fields are +# dynamically generated. + +cat <= 1.8 +License: GPL +Maintainer: Joey Hess +Author: Joey Hess +Stability: Stable +Copyright: 2010-2012 Joey Hess +License-File: GPL +Homepage: http://git-annex.branchable.com/ +Build-type: Custom +Category: Utility +Synopsis: manage files with git, without checking their contents into git +Description: + git-annex allows managing files with git, without checking the file + contents into git. While that may seem paradoxical, it is useful when + dealing with files larger than git can currently easily handle, whether due + to limitations in memory, time, or disk space. + . + Even without file content tracking, being able to manage files with git, + move files around and delete files with versioned directory trees, and use + branches and distributed clones, are all very handy reasons to use git. And + annexed files can co-exist in the same git repository with regularly + versioned files, which is convenient for maintaining documents, Makefiles, + etc that are associated with annexed files but that benefit from full + revision control. +Extra-Source-Files: + git-annex.1 git-annex-shell.1 + INSTALL README CHANGELOG NEWS GPL COPYRIGHT + +Flag S3 + Description: Enable S3 support + +Executable git-annex + Main-Is: git-annex.hs + Build-Depends: MissingH, hslogger, directory, filepath, + unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, + pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, + base == 4.5.*, monad-control, transformers-base, lifted-base, + IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance + Other-Modules: + Utility.Touch + -- Auto-generated list of all Haskell modules: +`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` + C-Sources: Utility/libdiskfree.c + Extensions: CPP + + if flag(S3) + Build-Depends: hS3 + CPP-Options: -DWITH_S3 + +Test-Suite test + Type: exitcode-stdio-1.0 + Main-Is: test.hs + Build-Depends: testpack, HUnit, MissingH, hslogger, directory, filepath, + unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, + pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, + base == 4.5.*, monad-control, transformers-base, lifted-base, + IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance + C-Sources: Utility/libdiskfree.c + Other-Modules: + Utility.Touch + -- Auto-generated list of all Haskell modules: +`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` + Extensions: CPP + +source-repository head + type: git + location: git://git-annex.branchable.com/ +EOF diff --git a/git-annex.cabal.template.sh b/git-annex.cabal.template.sh deleted file mode 100755 index 5ff8155e9..000000000 --- a/git-annex.cabal.template.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Template for git-annex.cabal: the 'Other-Module:' fields are -# dynamically generated. - -cat <= 1.8 -License: GPL -Maintainer: Joey Hess -Author: Joey Hess -Stability: Stable -Copyright: 2010-2012 Joey Hess -License-File: GPL -Homepage: http://git-annex.branchable.com/ -Build-type: Custom -Category: Utility -Synopsis: manage files with git, without checking their contents into git -Description: - git-annex allows managing files with git, without checking the file - contents into git. While that may seem paradoxical, it is useful when - dealing with files larger than git can currently easily handle, whether due - to limitations in memory, time, or disk space. - . - Even without file content tracking, being able to manage files with git, - move files around and delete files with versioned directory trees, and use - branches and distributed clones, are all very handy reasons to use git. And - annexed files can co-exist in the same git repository with regularly - versioned files, which is convenient for maintaining documents, Makefiles, - etc that are associated with annexed files but that benefit from full - revision control. -Extra-Source-Files: - git-annex.1 git-annex-shell.1 - INSTALL README CHANGELOG NEWS GPL COPYRIGHT - -Flag S3 - Description: Enable S3 support - -Executable git-annex - Main-Is: git-annex.hs - Build-Depends: MissingH, hslogger, directory, filepath, - unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, - pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, - base == 4.5.*, monad-control, transformers-base, lifted-base, - IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - Other-Modules: - Utility.Touch - -- Auto-generated list of all Haskell modules: -`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` - C-Sources: Utility/libdiskfree.c - Extensions: CPP - - if flag(S3) - Build-Depends: hS3 - CPP-Options: -DWITH_S3 - -Test-Suite test - Type: exitcode-stdio-1.0 - Main-Is: test.hs - Build-Depends: testpack, HUnit, MissingH, hslogger, directory, filepath, - unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, - pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, - base == 4.5.*, monad-control, transformers-base, lifted-base, - IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - C-Sources: Utility/libdiskfree.c - Other-Modules: - Utility.Touch - -- Auto-generated list of all Haskell modules: -`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` - Extensions: CPP - -source-repository head - type: git - location: git://git-annex.branchable.com/ -EOF -- cgit v1.2.3 From 79a71d9ba68818a62cbf96f3cf46d01ac662f836 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Tue, 12 Jun 2012 02:36:05 -0700 Subject: Simplify git-annex.cabal and generate sdist with make-sdist.sh. 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. --- Makefile | 16 ++++------------ git-annex.cabal | 24 +++++------------------- make-sdist.sh | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 31 deletions(-) mode change 100755 => 100644 git-annex.cabal create mode 100755 make-sdist.sh diff --git a/Makefile b/Makefile index ca9ea2036..d23f08a7d 100644 --- a/Makefile +++ b/Makefile @@ -98,20 +98,12 @@ docs: $(mans) clean: rm -rf tmp $(bins) $(mans) test configure *.tix .hpc $(sources) \ - doc/.ikiwiki html dist $(clibs) git-annex.cabal + doc/.ikiwiki html dist $(clibs) -# Workaround for cabal sdist not running Setup hooks, so I cannot -# generate a file list there. +# Workaround for `cabal sdist` requiring all included files to be listed +# in .cabal. sdist: clean $(mans) - # Could make this a .PHONY, but it needs to be rerun each time, - # unless we want to list a *lot* of dependencies. - ./git-annex.cabal.template.sh > git-annex.cabal - # Complains about not running 'configure' first, but adding - # - # cabal configure - # - # does not help. - cabal sdist + ./make-sdist.sh # Upload to hackage. hackage: sdist diff --git a/git-annex.cabal b/git-annex.cabal old mode 100755 new mode 100644 index 5ff8155e9..ac039bc63 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,11 +1,5 @@ -#!/bin/bash - -# Template for git-annex.cabal: the 'Other-Module:' fields are -# dynamically generated. - -cat <= 1.8 License: GPL Maintainer: Joey Hess @@ -30,9 +24,6 @@ Description: versioned files, which is convenient for maintaining documents, Makefiles, etc that are associated with annexed files but that benefit from full revision control. -Extra-Source-Files: - git-annex.1 git-annex-shell.1 - INSTALL README CHANGELOG NEWS GPL COPYRIGHT Flag S3 Description: Enable S3 support @@ -44,10 +35,8 @@ Executable git-annex pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, base == 4.5.*, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance - Other-Modules: - Utility.Touch - -- Auto-generated list of all Haskell modules: -`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` + -- Need to list this because it's generated from a .hsc file. + Other-Modules: Utility.Touch C-Sources: Utility/libdiskfree.c Extensions: CPP @@ -55,6 +44,7 @@ Executable git-annex Build-Depends: hS3 CPP-Options: -DWITH_S3 +-- XXX: Broken. Test-Suite test Type: exitcode-stdio-1.0 Main-Is: test.hs @@ -63,14 +53,10 @@ Test-Suite test pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, base == 4.5.*, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance + Other-Modules: Utility.Touch C-Sources: Utility/libdiskfree.c - Other-Modules: - Utility.Touch - -- Auto-generated list of all Haskell modules: -`./gen-other-modules.sh | xargs -n1 -i echo ' '{}` Extensions: CPP source-repository head type: git location: git://git-annex.branchable.com/ -EOF diff --git a/make-sdist.sh b/make-sdist.sh new file mode 100755 index 000000000..debc5195e --- /dev/null +++ b/make-sdist.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Create target directory +cabal sdist +sdist_dir=$(basename dist/*.tar.gz .tar.gz) +rm -f dist/*.tar.gz +mkdir dist/$sdist_dir + +find . \( -name .git -or -name dist -or -name cabal-dev \) -prune \ + -or -not -name \\*.orig -not -type d -print \ +| perl -ne 'print unless length >= 100' \ +| xargs cp --parents --target-directory dist/$sdist_dir + +cd dist +tar -caf $sdist_dir.tar.gz $sdist_dir -- cgit v1.2.3 From 2e0965eba9fa024f0df308d663fc584eb43c2726 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Tue, 12 Jun 2012 02:45:53 -0700 Subject: Generate sdist tarball name from git-annex.cabal 'Version:'. Instead of generating with `cabal sdist`. --- make-sdist.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/make-sdist.sh b/make-sdist.sh index debc5195e..409871916 100755 --- a/make-sdist.sh +++ b/make-sdist.sh @@ -1,10 +1,8 @@ #!/bin/bash # Create target directory -cabal sdist -sdist_dir=$(basename dist/*.tar.gz .tar.gz) -rm -f dist/*.tar.gz -mkdir dist/$sdist_dir +sdist_dir=git-annex-$(grep '^Version:' git-annex.cabal | sed -re 's/Version: *//') +mkdir --parents dist/$sdist_dir find . \( -name .git -or -name dist -or -name cabal-dev \) -prune \ -or -not -name \\*.orig -not -type d -print \ -- cgit v1.2.3 From 000bbba3c0fe0e2abbee9646428720edf765ae01 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Tue, 12 Jun 2012 02:50:09 -0700 Subject: Clean up Setup.hs. 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. --- Setup.hs | 50 ++++---------------------------------------------- 1 file changed, 4 insertions(+), 46 deletions(-) diff --git a/Setup.hs b/Setup.hs index 3f282e0aa..faca87cd2 100644 --- a/Setup.hs +++ b/Setup.hs @@ -14,15 +14,13 @@ import qualified Build.Configure as Configure main = defaultMainWithHooks simpleUserHooks { preConf = configure , postInst = myPostInst - , postCopy = myPostCopy } configure _ _ = do Configure.run Configure.tests return (Nothing, []) -myPostInst :: Args -> InstallFlags -> PackageDescription - -> LocalBuildInfo -> IO () +myPostInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do installGitAnnexShell dest verbosity pkg lbi installManpages dest verbosity pkg lbi @@ -30,27 +28,7 @@ myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do dest = NoCopyDest verbosity = fromFlag installVerbosity --- ???: Not sure how you're supposed to use this. E.g., when I do --- --- cabal install --prefix=/tmp/git-annex-install --- cabal copy --deistdir=/tmp/git-annex-copy --- --- I get the copy under --- --- /tmp/git-annex-copy/tmp/git-annex-install --- --- Also, `cabal install` fails when given a relative --prefix. -myPostCopy :: Args -> CopyFlags -> PackageDescription - -> LocalBuildInfo -> IO () -myPostCopy _ (CopyFlags { copyDest, copyVerbosity }) pkg lbi = do - installGitAnnexShell dest verbosity pkg lbi - installManpages dest verbosity pkg lbi - where - dest = fromFlag copyDest - verbosity = fromFlag copyVerbosity - -installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription - -> LocalBuildInfo -> IO () +installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installGitAnnexShell copyDest verbosity pkg lbi = rawSystemExit verbosity "ln" ["-sf", "git-annex", dstBinDir "git-annex-shell"] @@ -59,28 +37,8 @@ installGitAnnexShell copyDest verbosity pkg lbi = -- See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages. -- --- Based on pandoc's and lhs2tex's 'Setup.installManpages' and --- 'postInst' hooks. --- --- My understanding: 'postCopy' is run for `cabal copy`, 'postInst' is --- run for `cabal inst`, and copy is not a generalized install, so you --- have to write two nearly identical hooks. --- --- Summary of hooks: --- http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple-UserHooks.htm-- --- Other people are also confused: --- --- * Bug: 'postCopy' and 'postInst' are confusing: --- http://hackage.haskell.org/trac/hackage/ticket/718 --- --- * A cabal maintainer suggests using 'postCopy' instead of --- 'postInst', because `cabal install` is `cabal copy` followed by --- `cabal register`: --- http://www.haskell.org/pipermail/libraries/2008-March/009416.html --- Although that sounds desirable, it's not true, as the reply and --- experiments indicate. -installManpages :: CopyDest -> Verbosity -> PackageDescription - -> LocalBuildInfo -> IO () +-- Based on pandoc's Setup.hs. +installManpages :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installManpages copyDest verbosity pkg lbi = installOrdinaryFiles verbosity dstManDir srcManpages where -- cgit v1.2.3 From 66a961b1b70c17e84379168d713cfa19728ad446 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jun 2012 11:35:24 -0400 Subject: remove cabal file --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index e176e59c2..d628f23b7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ test configure Build/SysConfig.hs git-annex -git-annex.cabal git-annex.1 git-annex-shell.1 git-union-merge.1 -- cgit v1.2.3 From 7b3b6e4654f51b0eec62af912d24e7e7c331c716 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jun 2012 11:35:32 -0400 Subject: cleanup --- doc/contributing.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/contributing.mdwn b/doc/contributing.mdwn index 11c6c1987..c3ab3d69d 100644 --- a/doc/contributing.mdwn +++ b/doc/contributing.mdwn @@ -2,6 +2,6 @@ This project uses tabs for indentation and the code looks fine with any tab width. If you are using Emacs, and have it configured to use -spaces for indentation, then you can add a ./.dir-locals.el to use +spaces for indentation, then you can add a `./.dir-locals.el` to use tabs for files in this project. See -http://www.emacswiki.org/emacs/DirectoryVariables. +. -- cgit v1.2.3 From 0e944fd0e9b868929f54623848bd2473709595a0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jun 2012 11:36:42 -0400 Subject: Install man page when run by cabal, in a location where man will find it, even when installing under $HOME. Thanks, Nathan Collins --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index a058a1796..67ecdda45 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +git-annex (3.20120612) UNRELEASED; urgency=low + + * Install man page when run by cabal, in a location where man will + find it, even when installing under $HOME. Thanks, Nathan Collins + + -- Joey Hess Tue, 12 Jun 2012 11:35:59 -0400 + git-annex (3.20120611) unstable; urgency=medium * add: Prevent (most) modifications from being made to a file while it -- cgit v1.2.3 From 5f5f7b1a9f6d5c4361e44dcd46d3da6edc6a625a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jun 2012 11:38:16 -0400 Subject: tweak --- Setup.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/Setup.hs b/Setup.hs index faca87cd2..80d23cc87 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NamedFieldPuns #-} + {- cabal setup file -} import Distribution.Simple -- cgit v1.2.3 From 4ebb0b51d77484fcee12fd92a71b737b1aaca283 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jun 2012 11:48:31 -0400 Subject: remove xxx ... cabal test works for me --- git-annex.cabal | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-annex.cabal b/git-annex.cabal index 7b74cd252..9703b61f0 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 3.20120611 +Version: 3.20120612 Cabal-Version: >= 1.8 License: GPL Maintainer: Joey Hess @@ -44,7 +44,6 @@ Executable git-annex Build-Depends: hS3 CPP-Options: -DWITH_S3 --- XXX: Broken. Test-Suite test Type: exitcode-stdio-1.0 Main-Is: test.hs -- cgit v1.2.3