summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-08 13:00:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-08 13:00:58 -0400
commit9c5e49160d8a01d3edcecf3324fd4f1a2bafb72c (patch)
tree29fe7b5e645b0aaa98baa2b4197c44229be9bfc5
parent560b644a52971a7e4706c775982ec29e03ca3ab2 (diff)
parentd49a33d139af878606486dac6da62482897ae379 (diff)
Merge branch 'master' into desymlink
-rw-r--r--Build/OSXMkLibs.hs36
-rw-r--r--Makefile15
-rw-r--r--doc/design/assistant/blog/day_147__direct_mode.mdwn36
-rw-r--r--doc/forum/External_drive_syncs_git-annex_branch_but_not_master_branch.mdwn1
-rw-r--r--doc/forum/__34__du__34___equivalent_on_an_annex__63__/comment_6_48f6a2761a34b7f991325f1d24e2c5ff._comment8
-rw-r--r--doc/forum/gadu_-_git-annex_disk_usage.mdwn7
-rw-r--r--doc/forum/gadu_-_git-annex_disk_usage/comment_1_067d0ffe8900751bd2d2743254ac4d77._comment11
-rw-r--r--doc/forum/gadu_-_git-annex_disk_usage/comment_2_ec8b57426e4d82c3392eb7dd683f2ddc._comment17
-rw-r--r--doc/preferred_content/comment_4_6a9bc657bc7415f0e118357d8c6664c6._comment18
-rwxr-xr-xstandalone/linux/runshell2
-rwxr-xr-xstandalone/osx/git-annex.app/Contents/MacOS/runshell14
11 files changed, 141 insertions, 24 deletions
diff --git a/Build/OSXMkLibs.hs b/Build/OSXMkLibs.hs
index 2dddd01f6..45a86000b 100644
--- a/Build/OSXMkLibs.hs
+++ b/Build/OSXMkLibs.hs
@@ -36,24 +36,28 @@ installLibs :: FilePath -> IO [Maybe FilePath]
installLibs appbase = do
needlibs <- otool appbase
forM needlibs $ \lib -> do
- let libdir = parentDir lib
- let dest = appbase ++ lib
+ let dest = appbase </> takeFileName lib
ifM (doesFileExist dest)
( return Nothing
, do
- createDirectoryIfMissing True (appbase ++ libdir)
- _ <- boolSystem "cp" [File lib, File dest]
+ createDirectoryIfMissing True appbase
putStrLn $ "installing " ++ lib
- return $ Just libdir
+ _ <- boolSystem "cp" [File lib, File dest]
+ return $ Just appbase
)
+{- Returns libraries to install. -}
otool :: FilePath -> IO [FilePath]
otool appbase = do
files <- filterM doesFileExist =<< dirContentsRecursive appbase
- s <- readProcess "otool" ("-L" : files)
- return $ nub $ filter (not . framework) $ parseOtool s
+ l <- forM files $ \file -> do
+ libs <- filter unprocessed . parseOtool
+ <$> readProcess "otool" ["-L", file]
+ forM_ libs $ \lib -> install_name_tool file lib
+ return libs
+ return $ nub $ concat l
where
- framework f = ".framework" `isInfixOf` f
+ unprocessed s = not ("@executable_path" `isInfixOf` s)
parseOtool :: String -> [FilePath]
parseOtool = catMaybes . map parse . lines
@@ -62,6 +66,22 @@ parseOtool = catMaybes . map parse . lines
| "\t" `isPrefixOf` l = headMaybe $ words l
| otherwise = Nothing
+{- Adjusts binaries to use libraries in paths relative to the executable.
+ -
+ - Assumes all executables are installed into the same directory, and
+ - the libraries will be installed in subdirectories that match their
+ - absolute paths. -}
+install_name_tool :: FilePath -> FilePath -> IO ()
+install_name_tool binary lib = do
+ ok <- boolSystem "install_name_tool"
+ [ Param "-change"
+ , File lib
+ , Param $ "@executable_path" ++ (dropFileName lib)
+ , File binary
+ ]
+ unless ok $
+ hPutStrLn stderr $ "install_name_tool failed for " ++ binary
+
main :: IO ()
main = getArgs >>= go
where
diff --git a/Makefile b/Makefile
index 41658e606..e9077eb07 100644
--- a/Makefile
+++ b/Makefile
@@ -144,7 +144,7 @@ hackage: sdist
@cabal upload dist/*.tar.gz
THIRDPARTY_BINS=git curl lsof xargs rsync uuid wget gpg \
- sha1sum sha224sum sha256sum sha384sum sha512sum cp ssh
+ sha1sum sha224sum sha256sum sha384sum sha512sum cp ssh sh
LINUXSTANDALONE_DEST=$(GIT_ANNEX_TMP_BUILD_DIR)/git-annex.linux
linuxstandalone:
@@ -192,19 +192,18 @@ osxapp:
install -d $(GIT_ANNEX_TMP_BUILD_DIR)/build-dmg
cp -R standalone/osx/git-annex.app "$(OSXAPP_DEST)"
- install -d "$(OSXAPP_BASE)/bin"
- cp git-annex "$(OSXAPP_BASE)/bin/"
- strip "$(OSXAPP_BASE)/bin/git-annex"
- ln -sf git-annex "$(OSXAPP_BASE)/bin/git-annex-shell"
+ install -d "$(OSXAPP_BASE)"
+ cp git-annex "$(OSXAPP_BASE)"
+ strip "$(OSXAPP_BASE)/git-annex"
+ ln -sf git-annex "$(OSXAPP_BASE)/git-annex-shell"
gzcat standalone/licences.gz > $(OSXAPP_BASE)/LICENSE
cp $(OSXAPP_BASE)/LICENSE $(GIT_ANNEX_TMP_BUILD_DIR)/build-dmg/LICENSE.txt
for bin in $(THIRDPARTY_BINS); do \
- cp "$$(which "$$bin")" "$(OSXAPP_BASE)/bin/"; \
+ cp "$$(which "$$bin")" "$(OSXAPP_BASE)"; \
done
- install -d "$(OSXAPP_BASE)/git-core"
- (cd "$(shell git --exec-path)" && tar c .) | (cd "$(OSXAPP_BASE)"/git-core && tar x)
+ (cd "$(shell git --exec-path)" && tar c .) | (cd "$(OSXAPP_BASE)" && tar x)
runghc Build/OSXMkLibs.hs $(OSXAPP_BASE)
rm -f tmp/git-annex.dmg
diff --git a/doc/design/assistant/blog/day_147__direct_mode.mdwn b/doc/design/assistant/blog/day_147__direct_mode.mdwn
new file mode 100644
index 000000000..1a7523785
--- /dev/null
+++ b/doc/design/assistant/blog/day_147__direct_mode.mdwn
@@ -0,0 +1,36 @@
+Started laying the groundwork for [[desymlink]]'s direct mode.
+I got rather far!
+
+A git repo can be configured with `annex.direct` and all actions that
+transfer objects to it will replace the symlinks with regular files.
+Removing objects also works (and puts back a broken symlink),
+as does checking if an object is present, which even detects if a file
+has been modified.
+
+So far, this works best when such a direct mode repository is used as a git
+remote of another repository. It is also possible to run a few git-annex
+commands, like "get" in a direct mode repository, though others, like
+"drop" won't work because they rely on the symlink to map back to the key.
+
+Direct mode relies on map files existing for each key in the repository, that tell
+what file(s) use it. It also relies on cache files, that contain the last
+known mtime, size, and inode of the file. So far, I've been setting these
+files up by hand.
+
+The main thing that's missing is support for transferring objects from
+direct mode repositories. There's no single place I can modify to support
+that (like I could for the stuff mentioned above), and also it's difficult
+to do safely, since files could be modified at any time.
+
+So it'll need to quarantine files, to prevent a modified version from
+getting sent out. I could either do this by copying the file, or by
+temporarily `git annex lock`ing it. Unsure which choice would be less
+annoying..
+
+----
+
+Also did some investigation with Jimmy of the OSX app git-config hang.
+Seems to be some kind of imcompatability between the 10.7 autobuilder and
+10.8. Next step is probably to try to build on 10.8. Might also
+be worth trying <http://macdylibbundler.sourceforge.net/>, although my
+own scripts do more or less the same thing to build the app.
diff --git a/doc/forum/External_drive_syncs_git-annex_branch_but_not_master_branch.mdwn b/doc/forum/External_drive_syncs_git-annex_branch_but_not_master_branch.mdwn
new file mode 100644
index 000000000..76294b6a6
--- /dev/null
+++ b/doc/forum/External_drive_syncs_git-annex_branch_but_not_master_branch.mdwn
@@ -0,0 +1 @@
+I have an external HDD which I setup as a remote manually before I started using the assistant. When I plug it in files sync fine and the git-annex branch gets synced, but the master branch doesn't; git annex sync doesn't do the job and I have to run git pull. This is annoying because it means that portable drive is useless as a backup, since it doesn't have the required metadata; I have to manually git pull to make it a useful backup. How can I make the assistant sync the metadata in--if not the master branch, at least origin/master so I could merge later without the remote available. Thanks.
diff --git a/doc/forum/__34__du__34___equivalent_on_an_annex__63__/comment_6_48f6a2761a34b7f991325f1d24e2c5ff._comment b/doc/forum/__34__du__34___equivalent_on_an_annex__63__/comment_6_48f6a2761a34b7f991325f1d24e2c5ff._comment
new file mode 100644
index 000000000..1c456e24b
--- /dev/null
+++ b/doc/forum/__34__du__34___equivalent_on_an_annex__63__/comment_6_48f6a2761a34b7f991325f1d24e2c5ff._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="Steve"
+ ip="92.104.175.136"
+ subject="gadu 0.01 is up"
+ date="2012-12-08T06:22:50Z"
+ content="""
+I've got an initial try at gadu up over at <http://git-annex.mysteryvortex.com/git-annex-utils.html> I created a separate thread for it: <http://git-annex.branchable.com/forum/gadu_-_git-annex_disk_usage/>
+"""]]
diff --git a/doc/forum/gadu_-_git-annex_disk_usage.mdwn b/doc/forum/gadu_-_git-annex_disk_usage.mdwn
new file mode 100644
index 000000000..c7a20c327
--- /dev/null
+++ b/doc/forum/gadu_-_git-annex_disk_usage.mdwn
@@ -0,0 +1,7 @@
+Based on the thread over at <http://git-annex.branchable.com/forum/__34__du__34___equivalent_on_an_annex__63__/> I decided to finally write a du like utility for git-annex. A 0.01 version is up over at <http://git-annex.mysteryvortex.com/git-annex-utils.html>. It works, but I intend to make it smarter about handling git repos and annexed files, as well as adding more of the options available in the standard du utility.
+
+Currently it will tally up the sizes of links that look like they are annexed files. I plan to make it actually interact with git and git-annex to verify the files are annexed and enable options like tallying files only from specific remotes, only missing files, not double counting files which are annexed multiple times but stored only once, etc...
+
+I'll have time to work on this on the weekends, and plan to get my git repo up soon. After gadu is mostly complete I might work on some other tools.
+
+Releases are signed with a PGP key with fingerprint 5E1A 65D7 D5E9 56F1 C239 43DF C6C8 9A0B 6003 8953 (available on the website)
diff --git a/doc/forum/gadu_-_git-annex_disk_usage/comment_1_067d0ffe8900751bd2d2743254ac4d77._comment b/doc/forum/gadu_-_git-annex_disk_usage/comment_1_067d0ffe8900751bd2d2743254ac4d77._comment
new file mode 100644
index 000000000..9699b6ee6
--- /dev/null
+++ b/doc/forum/gadu_-_git-annex_disk_usage/comment_1_067d0ffe8900751bd2d2743254ac4d77._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="Steve"
+ ip="92.104.175.136"
+ subject="0.02 is up"
+ date="2012-12-08T14:20:16Z"
+ content="""
+I fixed some bugs that gave the wrong answer occasionally, and made gadu much smarter now.
+
+It now searches for the .git dir an makes sure the git-annex links are well formed before counting them.
+I also added a few more du like options.
+"""]]
diff --git a/doc/forum/gadu_-_git-annex_disk_usage/comment_2_ec8b57426e4d82c3392eb7dd683f2ddc._comment b/doc/forum/gadu_-_git-annex_disk_usage/comment_2_ec8b57426e4d82c3392eb7dd683f2ddc._comment
new file mode 100644
index 000000000..04c6c3f65
--- /dev/null
+++ b/doc/forum/gadu_-_git-annex_disk_usage/comment_2_ec8b57426e4d82c3392eb7dd683f2ddc._comment
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="http://sunny256.sunbase.org/"
+ nickname="sunny256"
+ subject="comment 2"
+ date="2012-12-08T15:35:16Z"
+ content="""
+Have downloaded v0.02 and experimented a bit, and it seems to work nicely. A couple of things, though:
+
+- It displays the sizes in 512 byte blocks as default. I find that very confusing, and the standard `du`(1) from GNU coreutils uses 1024kB as default. AFAIK 512 byte blocks is an old way of measuring sizes from the really ancient UNIX days. Traditionally correct, maybe, but not very useful these days.
+- When not specifying a path, can it use \"`.`\" as default?
+- A human-readable format would've been nice, like 234M or 13G. The `du`(1) from GNU coreutils uses `-h` for this, but that option is already used for `--help`. And that's OK, I think `-h` should be reserved for that purpose. IMHO using `-h` as a synonym for `--human-readable` was a bad choice by coreutils, but it's too late to change that now.
+
+Is there any Git repository available for git-annex-utils somewhere? That's my preferred way of getting updates and follow the development.
+
+Anyway, thanks. :)
+
+"""]]
diff --git a/doc/preferred_content/comment_4_6a9bc657bc7415f0e118357d8c6664c6._comment b/doc/preferred_content/comment_4_6a9bc657bc7415f0e118357d8c6664c6._comment
new file mode 100644
index 000000000..0ac5dec52
--- /dev/null
+++ b/doc/preferred_content/comment_4_6a9bc657bc7415f0e118357d8c6664c6._comment
@@ -0,0 +1,18 @@
+[[!comment format=mdwn
+ username="http://edheil.wordpress.com/"
+ ip="173.162.44.162"
+ subject="comment 4"
+ date="2012-12-07T20:24:18Z"
+ content="""
+Built a new copy of git-annex yesterday. I have a \"client\" on my macbook, and two \"backup\"s, one on an external HD, one on an ssh git remote.
+
+git annex get --auto works beautifully!
+
+It doesn't seem to work for copying content *to* a place where it's needed, though.
+
+If I drop a file from my \"backup\" USB drive, and then go back to my macbook and do a \"git annex sync\" and \"git annex copy --to=usbdrive --auto\" it does not send the file out to the USB drive, even though by preferred content settings, the USB drive should \"want\" the file because it's a backup drive and it wants all content.
+
+Similarly, if I add a new file on my macbook and then do a \"git annex copy --to=usbdrive auto\" it does not get copied to the USB drive.
+
+Is this missing functionality, or should the preferred content setting for remotes only affect the assistant?
+"""]]
diff --git a/standalone/linux/runshell b/standalone/linux/runshell
index 816c3036e..e3d75d7a0 100755
--- a/standalone/linux/runshell
+++ b/standalone/linux/runshell
@@ -67,5 +67,5 @@ if [ "$1" ]; then
shift 1
exec "$cmd" "$@"
else
- $SHELL
+ sh
fi
diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell
index 51748285a..3366620ab 100755
--- a/standalone/osx/git-annex.app/Contents/MacOS/runshell
+++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell
@@ -55,18 +55,18 @@ export PATH
# different versions of a single library. And it seems to work better
# than DYLD_FALLBACK_LIBRARY_PATH, which fails to override old system
# versions of libraries when a program in the app needs a newer version.
-ORIG_DYLD_ROOT_PATH="$DYLD_ROOT_PATH"
-export ORIG_DYLD_ROOT_PATH
-DYLD_ROOT_PATH=$base
-export DYLD_ROOT_PATH
+#ORIG_DYLD_ROOT_PATH="$DYLD_ROOT_PATH"
+#export ORIG_DYLD_ROOT_PATH
+#DYLD_ROOT_PATH=$base
+#export DYLD_ROOT_PATH
ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH"
export ORIG_GIT_EXEC_PATH
-GIT_EXEC_PATH=$base/git-core
+GIT_EXEC_PATH=$base
export GIT_EXEC_PATH
# Indicate which variables were exported above.
-GIT_ANNEX_STANDLONE_ENV="PATH DYLD_ROOT_PATH GIT_EXEC_PATH"
+GIT_ANNEX_STANDLONE_ENV="PATH GIT_EXEC_PATH"
export GIT_ANNEX_STANDLONE_ENV
if [ "$1" ]; then
@@ -74,5 +74,5 @@ if [ "$1" ]; then
shift 1
exec "$cmd" "$@"
else
- $SHELL
+ sh
fi