From e45c73e66fc18d27bdf5797876fbeb07786a4af1 Mon Sep 17 00:00:00 2001 From: Jimmy Tang Date: Tue, 22 Mar 2011 22:24:07 +0000 Subject: [PATCH] Touch up Makefile to depend on StatFS.hs --- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index 08e2f59..4ae8392 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SysConfig.hs: configure.hs TestConfig.hs hsc2hs $< perl -i -pe 's/^{-# INCLUDE.*//' $@ -$(bins): SysConfig.hs Touch.hs +$(bins): SysConfig.hs Touch.hs StatFS.hs $(GHCMAKE) $@ git-annex.1: doc/git-annex.mdwn -- 1.7.4.1
StatFS.hs never gets depended on and compiled, the makefile was just missing something
Thanks, done! Interested to hear if StatFS.hs works on OSX (no warning) or is a no-op (with warning). --Joey
for now it gives a warning, it looks like it should be easy enough to add OSX support, I guess it's a case of just digging around documentation to find the equivalent calls/headers. I'll give it a go at making this feature work on OSX and get back to you.
jtang@exia:~/develop/git-annex $ make hsc2hs StatFS.hsc StatFS.hsc:85:2: warning: #warning free space checking code not available for this OS StatFS.hsc:85:2: warning: #warning free space checking code not available for this OS StatFS.hsc:85:2: warning: #warning free space checking code not available for this OS
Just did some minor digging around and checking, this seems to satisfy the compilers etc... I have yet to confirm that it really is working as expected. Also it might be better to check for a darwin operating system instead of apple I think, though I don't know of any one really using a pure darwin OS. But for now it works (I think)
Alternatively, you can just load it up in ghci and see if it reports numbers that make sense:
Ok, well it looks like it isn't doing anything useful at all.
Actually I may have just been stupid and should have read the man page on statfs...
yields this...
we could just stick another if defined (APPLE) instead of what I previously had and it looks like it will do the right thing on OSX.
I forgot to mention that the statfs64 stuff in OSX seems to be deprecated, see http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/statfs64.2.html
on a slightly different note, is anonymous pushing to the "wiki" over git allowed? I'd prefer to be able to edit stuff inline for updating some of my own comments if I can :P
Try the changes I've pushed to use statfs64 on apple.
There is actually a standardized statvfs that I'd rather use, but after the last time that I tried going with the POSIX option first only to find it was not broadly implemented, I was happy to find some already existing code that worked for some OSs.
(While ikiwiki supports anonymous git push, it's a feature we have not rolled out on Branchable.com yet, and anyway, ikiwiki disallows editing existing comments that way. I would, however, be happy to git pull changes from somewhere.)