From a5426f14cac3c64299cac62ee6fe86a35f41f584 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Apr 2015 21:29:15 -0400 Subject: When a key's size is unknown, still check the annex.diskreserve, and avoid getting content if the disk is too full. We can't check if there's enough disk space to download the content, but we *can* check if there's certainly not enough! --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 5f62dc62c..8bbadfea2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * bittorrent: Fix handling of magnet links. * Windows: Fixed support of remotes on other drives. (A reversion introduced in version 5.20150113.) + * When a key's size is unknown, still check the annex.diskreserve, + and avoid getting content if the disk is too full. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 -- cgit v1.2.3 From 293903ba38209a1e574ab6a929872ac5c31dfaf4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Apr 2015 13:36:12 -0400 Subject: Fix fsck --from a git remote in a local directory, and from a directory special remote. This was a reversion caused by the relative path changes in 5.20150113. The directory special remote was not affected in its normal configuration, since annex-directory is an absolute path normally. But it could fail when a relative path was used. The git remote was affected even when an absolute path to it was used in .git/config, since git-annex now converts all such paths to relative. --- Remote/Directory.hs | 10 +++++++--- Remote/Git.hs | 13 ++++++++++--- Test.hs | 5 +++++ debian/changelog | 3 +++ ...36__remote__44___copies_symlinks_instead_of_content.mdwn | 2 ++ 5 files changed, 27 insertions(+), 6 deletions(-) (limited to 'debian/changelog') diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 2eeb79317..916013172 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -162,9 +162,13 @@ retrieveCheap _ (UnpaddedChunks _) _ _ = return False retrieveCheap _ (LegacyChunks _) _ _ = return False #ifndef mingw32_HOST_OS retrieveCheap d NoChunks k f = liftIO $ catchBoolIO $ do - file <- getLocation d k - createSymbolicLink file f - return True + file <- absPath =<< getLocation d k + ifM (doesFileExist file) + ( do + createSymbolicLink file f + return True + , return False + ) #else retrieveCheap _ _ _ _ = return False #endif diff --git a/Remote/Git.hs b/Remote/Git.hs index abefc113e..fdd0049ca 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -445,10 +445,17 @@ copyFromRemote' r key file dest copyFromRemoteCheap :: Remote -> Key -> FilePath -> Annex Bool #ifndef mingw32_HOST_OS copyFromRemoteCheap r key file - | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ do - loc <- liftIO $ gitAnnexLocation key (repo r) $ + | not $ Git.repoIsUrl (repo r) = guardUsable (repo r) (return False) $ liftIO $ do + loc <- gitAnnexLocation key (repo r) $ fromJust $ remoteGitConfig $ gitconfig r - liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True + ifM (doesFileExist loc) + ( do + absloc <- absPath loc + catchBoolIO $ do + createSymbolicLink absloc file + return True + , return False + ) | Git.repoIsSsh (repo r) = ifM (Annex.Content.preseedTmp key file) ( copyFromRemote' r key Nothing file diff --git a/Test.hs b/Test.hs index e57c9021c..e8440dd1d 100644 --- a/Test.hs +++ b/Test.hs @@ -199,6 +199,7 @@ unitTests note = testGroup ("Unit Tests " ++ note) , testCase "fsck (bare)" test_fsck_bare , testCase "fsck (local untrusted)" test_fsck_localuntrusted , testCase "fsck (remote untrusted)" test_fsck_remoteuntrusted + , testCase "fsck --from remote" test_fsck_fromremote , testCase "migrate" test_migrate , testCase "migrate (via gitattributes)" test_migrate_via_gitattributes , testCase "unused" test_unused @@ -613,6 +614,10 @@ test_fsck_remoteuntrusted = intmpclonerepo $ do git_annex "untrust" ["origin"] @? "untrust of origin failed" fsck_should_fail "content not replicated to enough non-untrusted repositories" +test_fsck_fromremote :: Assertion +test_fsck_fromremote = intmpclonerepo $ do + git_annex "fsck" ["--from", "origin"] @? "fsck --from origin failed" + fsck_should_fail :: String -> Assertion fsck_should_fail m = not <$> git_annex "fsck" [] @? "fsck failed to fail with " ++ m diff --git a/debian/changelog b/debian/changelog index 8bbadfea2..fc7c23d87 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,9 @@ git-annex (5.20150410) UNRELEASED; urgency=medium (A reversion introduced in version 5.20150113.) * When a key's size is unknown, still check the annex.diskreserve, and avoid getting content if the disk is too full. + * Fix fsck --from a git remote in a local directory, and from + a directory special remote. + This was a reversion caused by the relative path changes in 5.20150113. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 diff --git a/doc/bugs/fsck_--from___36__remote__44___copies_symlinks_instead_of_content.mdwn b/doc/bugs/fsck_--from___36__remote__44___copies_symlinks_instead_of_content.mdwn index 593b7e9aa..732af2990 100644 --- a/doc/bugs/fsck_--from___36__remote__44___copies_symlinks_instead_of_content.mdwn +++ b/doc/bugs/fsck_--from___36__remote__44___copies_symlinks_instead_of_content.mdwn @@ -76,3 +76,5 @@ See transcript lrwxrwxrwx 1 gemma users 197 Apr 18 17:27 fsck24477.SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt -> ../corrupt/.git/annex/objects/x7/01/SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt/SHA256E-s2--0263829989b6fd954f72baaf2fc64bc2e2f01d692d4de72986ea808f6e99813f.txt lrwxrwxrwx 1 gemma users 197 Apr 18 17:27 fsck24477.SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt -> ../corrupt/.git/annex/objects/41/pJ/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt/SHA256E-s2--87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7.txt lrwxrwxrwx 1 gemma users 197 Apr 18 17:27 fsck24477.SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt -> ../corrupt/.git/annex/objects/Vw/zz/SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt/SHA256E-s2--a3a5e715f0cc574a73c3f9bebb6bc24f32ffd5b67b387244c2c909da779a1478.txt + +> reproduced, test cased, fixed, [[done]] --[[Joey]] -- cgit v1.2.3 From 5f62e03e618b20a32e3a927be2bdf71dd525d5ae Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Apr 2015 14:13:07 -0400 Subject: fsck --from remote: When bad content is found in the remote, and the local repo does not have a copy of the content, preserve the bad content in .git/annex/bad/ to avoid further data loss. --- Command/Fsck.hs | 40 ++++++++++++++++++++++++++++++++-------- Utility/CopyFile.hs | 7 ++++++- debian/changelog | 3 +++ 3 files changed, 41 insertions(+), 9 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 08753b612..74cff7491 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -31,6 +31,7 @@ import Config import Types.Key import Types.CleanupActions import Utility.HumanTime +import Utility.CopyFile import Git.FilePath import Utility.PID import qualified Database.Fsck as FsckDb @@ -273,7 +274,7 @@ checkKeySize key = ifM isDirect checkKeySizeRemote :: Key -> Remote -> Maybe FilePath -> Annex Bool checkKeySizeRemote _ _ Nothing = return True checkKeySizeRemote key remote (Just file) = - checkKeySizeOr (badContentRemote remote) key file + checkKeySizeOr (badContentRemote remote file) key file checkKeySizeOr :: (Key -> Annex String) -> Key -> FilePath -> Annex Bool checkKeySizeOr bad key file = case Types.Key.keySize key of @@ -318,7 +319,7 @@ checkBackend backend key mfile = go =<< isDirect checkBackendRemote :: Backend -> Key -> Remote -> Maybe FilePath -> Annex Bool checkBackendRemote backend key remote = maybe (return True) go where - go = checkBackendOr (badContentRemote remote) backend key + go file = checkBackendOr (badContentRemote remote file) backend key file checkBackendOr :: (Key -> Annex String) -> Backend -> Key -> FilePath -> Annex Bool checkBackendOr bad backend key file = @@ -380,13 +381,36 @@ badContentDirect file key = do logStatus key InfoMissing return "left in place for you to examine" -badContentRemote :: Remote -> Key -> Annex String -badContentRemote remote key = do - ok <- Remote.removeKey remote key - when ok $ +{- Bad content is dropped from the remote. We have downloaded a copy + - from the remote to a temp file already (in some cases, it's just a + - symlink to a file in the remote). To avoid any further data loss, + - that temp file is moved to the bad content directory unless + - the local annex has a copy of the content. -} +badContentRemote :: Remote -> FilePath -> Key -> Annex String +badContentRemote remote localcopy key = do + bad <- fromRepo gitAnnexBadDir + let destbad = bad key2file key + movedbad <- ifM (inAnnex key <||> liftIO (doesFileExist destbad)) + ( return False + , do + createAnnexDirectory (parentDir destbad) + liftIO $ catchDefaultIO False $ + ifM (isSymbolicLink <$> getSymbolicLinkStatus localcopy) + ( copyFileExternal CopyTimeStamps localcopy destbad + , do + moveFile localcopy destbad + return True + ) + ) + + dropped <- Remote.removeKey remote key + when dropped $ Remote.logStatus remote key InfoMissing - return $ (if ok then "dropped from " else "failed to drop from ") - ++ Remote.name remote + return $ case (movedbad, dropped) of + (True, True) -> "moved from " ++ Remote.name remote ++ + " to " ++ destbad + (False, True) -> "dropped from " ++ Remote.name remote + (_, False) -> "failed to drop from" ++ Remote.name remote runFsck :: Incremental -> FilePath -> Key -> Annex Bool -> CommandStart runFsck inc file key a = ifM (needFsck inc key) diff --git a/Utility/CopyFile.hs b/Utility/CopyFile.hs index b123d006d..1c07ca110 100644 --- a/Utility/CopyFile.hs +++ b/Utility/CopyFile.hs @@ -16,7 +16,12 @@ module Utility.CopyFile ( import Common import qualified Build.SysConfig as SysConfig -data CopyMetaData = CopyTimeStamps | CopyAllMetaData +data CopyMetaData + -- Copy timestamps when possible, but no other metadata, and + -- when copying a symlink, makes a copy of its content. + = CopyTimeStamps + -- Copy all metadata when possible. + | CopyAllMetaData deriving (Eq) {- The cp command is used, because I hate reinventing the wheel, diff --git a/debian/changelog b/debian/changelog index fc7c23d87..00aed03a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,9 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * Fix fsck --from a git remote in a local directory, and from a directory special remote. This was a reversion caused by the relative path changes in 5.20150113. + * fsck --from remote: When bad content is found in the remote, + and the local repo does not have a copy of the content, preserve + the bad content in .git/annex/bad/ to avoid further data loss. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 -- cgit v1.2.3 From 2781e270c7f388d4d0e252240b84b4a299d040fd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Apr 2015 14:23:34 -0400 Subject: fsck --from remote: Avoid downloading a key if it would go over the annex.diskreserve limit. --- Command/Fsck.hs | 6 ++++-- debian/changelog | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 74cff7491..39dba08dd 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -135,14 +135,16 @@ performRemote key file backend numcopies remote = let cleanup = liftIO $ catchIO (removeFile tmp) (const noop) cleanup cleanup `after` a tmp - getfile tmp = - ifM (Remote.retrieveKeyFileCheap remote key tmp) + getfile tmp = ifM (checkDiskSpace (Just tmp) key 0) + ( ifM (Remote.retrieveKeyFileCheap remote key tmp) ( return True , ifM (Annex.getState Annex.fast) ( return False , Remote.retrieveKeyFile remote key Nothing tmp dummymeter ) ) + , return False + ) dummymeter _ = noop startKey :: Incremental -> Key -> NumCopies -> CommandStart diff --git a/debian/changelog b/debian/changelog index 00aed03a0..2acdfac96 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * fsck --from remote: When bad content is found in the remote, and the local repo does not have a copy of the content, preserve the bad content in .git/annex/bad/ to avoid further data loss. + * fsck --from remote: Avoid downloading a key if it would go over + the annex.diskreserve limit. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 -- cgit v1.2.3 From ea2180a6c141411f8ebdd041f065fae54ff2f780 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 18 Apr 2015 16:04:25 -0400 Subject: required: New command, like wanted, but for required content. Also refactored some code to reduce duplication. --- CmdLine/GitAnnex.hs | 2 + Command/GroupWanted.hs | 19 ++------ Command/Wanted.hs | 56 ++++++++++++---------- debian/changelog | 1 + doc/git-annex-preferred-content.mdwn | 7 +++ doc/git-annex.mdwn | 8 ++++ doc/required_content.mdwn | 3 +- ...e_interface_for_required_content_setthings.mdwn | 2 + 8 files changed, 57 insertions(+), 41 deletions(-) (limited to 'debian/changelog') diff --git a/CmdLine/GitAnnex.hs b/CmdLine/GitAnnex.hs index fde4e2d08..326dd3b2b 100644 --- a/CmdLine/GitAnnex.hs +++ b/CmdLine/GitAnnex.hs @@ -74,6 +74,7 @@ import qualified Command.Dead import qualified Command.Group import qualified Command.Wanted import qualified Command.GroupWanted +import qualified Command.Required import qualified Command.Schedule import qualified Command.Ungroup import qualified Command.Vicfg @@ -149,6 +150,7 @@ cmds = concat , Command.Group.cmd , Command.Wanted.cmd , Command.GroupWanted.cmd + , Command.Required.cmd , Command.Schedule.cmd , Command.Ungroup.cmd , Command.Vicfg.cmd diff --git a/Command/GroupWanted.hs b/Command/GroupWanted.hs index 859a39c1b..8fff47013 100644 --- a/Command/GroupWanted.hs +++ b/Command/GroupWanted.hs @@ -13,6 +13,7 @@ import Command import Logs.PreferredContent import Types.Messages import Types.Group +import Command.Wanted (performGet, performSet) import qualified Data.Map as M @@ -24,22 +25,8 @@ seek :: CommandSeek seek = withWords start start :: [String] -> CommandStart -start (g:[]) = next $ performGet g +start (g:[]) = next $ performGet groupPreferredContentMapRaw g start (g:expr:[]) = do showStart "groupwanted" g - next $ performSet g expr + next $ performSet groupPreferredContentSet expr g start _ = error "Specify a group." - -performGet :: Group -> CommandPerform -performGet g = do - Annex.setOutput QuietOutput - m <- groupPreferredContentMapRaw - liftIO $ putStrLn $ fromMaybe "" $ M.lookup g m - next $ return True - -performSet :: Group -> String -> CommandPerform -performSet g expr = case checkPreferredContentExpression expr of - Just e -> error $ "Parse error: " ++ e - Nothing -> do - groupPreferredContentSet g expr - next $ return True diff --git a/Command/Wanted.hs b/Command/Wanted.hs index 6b87e51d8..07f5ee7c3 100644 --- a/Command/Wanted.hs +++ b/Command/Wanted.hs @@ -1,6 +1,6 @@ {- git-annex command - - - Copyright 2013 Joey Hess + - Copyright 2013-2015 Joey Hess - - Licensed under the GNU GPL version 3 or higher. -} @@ -13,39 +13,47 @@ import Command import qualified Remote import Logs.PreferredContent import Types.Messages +import Types.StandardGroups import qualified Data.Map as M cmd :: [Command] -cmd = [command "wanted" (paramPair paramRemote (paramOptional paramExpression)) seek - SectionSetup "get or set preferred content expression"] - -seek :: CommandSeek -seek = withWords start - -start :: [String] -> CommandStart -start = parse +cmd = cmd' "wanted" "get or set preferred content expression" + preferredContentMapRaw + preferredContentSet + +cmd' + :: String + -> String + -> Annex (M.Map UUID PreferredContentExpression) + -> (UUID -> PreferredContentExpression -> Annex ()) + -> [Command] +cmd' name desc getter setter = [command name pdesc seek SectionSetup desc] where - parse (name:[]) = go name performGet - parse (name:expr:[]) = go name $ \uuid -> do - showStart "wanted" name - performSet expr uuid - parse _ = error "Specify a repository." - - go name a = do - u <- Remote.nameToUUID name + pdesc = paramPair paramRemote (paramOptional paramExpression) + + seek = withWords start + + start (rname:[]) = go rname (performGet getter) + start (rname:expr:[]) = go rname $ \uuid -> do + showStart name rname + performSet setter expr uuid + start _ = error "Specify a repository." + + go rname a = do + u <- Remote.nameToUUID rname next $ a u -performGet :: UUID -> CommandPerform -performGet uuid = do +performGet :: Ord a => Annex (M.Map a PreferredContentExpression) -> a -> CommandPerform +performGet getter a = do Annex.setOutput QuietOutput - m <- preferredContentMapRaw - liftIO $ putStrLn $ fromMaybe "" $ M.lookup uuid m + m <- getter + liftIO $ putStrLn $ fromMaybe "" $ M.lookup a m next $ return True -performSet :: String -> UUID -> CommandPerform -performSet expr uuid = case checkPreferredContentExpression expr of +performSet :: Ord a => (a -> PreferredContentExpression -> Annex ()) -> String -> a -> CommandPerform +performSet setter expr a = case checkPreferredContentExpression expr of Just e -> error $ "Parse error: " ++ e Nothing -> do - preferredContentSet uuid expr + setter a expr next $ return True diff --git a/debian/changelog b/debian/changelog index 2acdfac96..53de77cc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,7 @@ git-annex (5.20150410) UNRELEASED; urgency=medium the bad content in .git/annex/bad/ to avoid further data loss. * fsck --from remote: Avoid downloading a key if it would go over the annex.diskreserve limit. + * required: New command, like wanted, but for required content. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 diff --git a/doc/git-annex-preferred-content.mdwn b/doc/git-annex-preferred-content.mdwn index 95dae8c14..49512f465 100644 --- a/doc/git-annex-preferred-content.mdwn +++ b/doc/git-annex-preferred-content.mdwn @@ -10,6 +10,13 @@ using `git annex vicfg` or `git annex wanted`. They are used by the `--auto` option, by `git annex sync --content`, and by the git-annex assistant. +While preferred content expresses a preference, it can be overridden +by simply using `git annex drop`. On the other hand, required content +settings are enforced; `git annex drop` will refuse to drop a file if +doing so would violate its required content settings. A repository's +required content can be configured using `git annex vicfg` or +`git annex required`. + Preferred content expressions are similar, but not identical to the [[git-annex-matching-options]](1), just without the dashes. For example: diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 6fd10aed0..3dc54a308 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -264,8 +264,16 @@ subdirectories). * `groupwanted groupname [expression]` + Get or set groupwanted expression. + See [[git-annex-groupwanted]](1) for details. +* `required repository [expression]` + + Get or set required content expression. + + See [[git-annex-required]](1) for details. + * `schedule repository [expression]` Get or set scheduled jobs. diff --git a/doc/required_content.mdwn b/doc/required_content.mdwn index 91c5614a8..e17951d9d 100644 --- a/doc/required_content.mdwn +++ b/doc/required_content.mdwn @@ -6,7 +6,8 @@ archival repositories, and also require that one copy be stored offsite. The format of required content expressions is the same as [[preferred_content]] expressions. -Required content settings can be edited using `git annex vicfg`. +Required content settings can be edited using `git annex vicfg` +or set using `git annex required`. Each repository can have its own settings, and other repositories will try to honor those settings when interacting with it. diff --git a/doc/todo/command_line_interface_for_required_content_setthings.mdwn b/doc/todo/command_line_interface_for_required_content_setthings.mdwn index 1334b151a..30889f8bb 100644 --- a/doc/todo/command_line_interface_for_required_content_setthings.mdwn +++ b/doc/todo/command_line_interface_for_required_content_setthings.mdwn @@ -9,3 +9,5 @@ used feature, and vicfg can already configure it. one when it comes to that. Oh well.) --[[Joey]] + +> [[done]] --[[Joey]] -- cgit v1.2.3 From 7a59f4d08dd07a25fc4de7c59948f41c8d3b8882 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 Apr 2015 11:05:32 -0400 Subject: Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. --- Utility/Verifiable.hs | 11 ++++++----- debian/changelog | 2 ++ debian/control | 1 - git-annex.cabal | 2 +- standalone/android/cabal.config | 1 - standalone/linux/cabal.config | 1 - 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'debian/changelog') diff --git a/Utility/Verifiable.hs b/Utility/Verifiable.hs index a861416e2..278c320ae 100644 --- a/Utility/Verifiable.hs +++ b/Utility/Verifiable.hs @@ -7,11 +7,12 @@ module Utility.Verifiable where -import Data.Digest.Pure.SHA -import Data.ByteString.Lazy.UTF8 (fromString) -import qualified Data.ByteString.Lazy as L +import Data.ByteString.UTF8 (fromString) +import qualified Data.ByteString as S -type Secret = L.ByteString +import Utility.Hash + +type Secret = S.ByteString type HMACDigest = String {- A value, verifiable using a HMAC digest and a secret. -} @@ -28,7 +29,7 @@ verify :: (Eq a, Show a) => Verifiable a -> Secret -> Bool verify v secret = v == mkVerifiable (verifiableVal v) secret calcDigest :: String -> Secret -> HMACDigest -calcDigest v secret = showDigest $ hmacSha1 secret $ fromString v +calcDigest v secret = calcMac HmacSha1 secret (fromString v) {- for quickcheck -} prop_verifiable_sane :: String -> String -> Bool diff --git a/debian/changelog b/debian/changelog index 53de77cc8..ba498e0a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,8 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * fsck --from remote: Avoid downloading a key if it would go over the annex.diskreserve limit. * required: New command, like wanted, but for required content. + * Removed dependency on haskell SHA library, + instead using cryptohash >= 0.11.0. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 diff --git a/debian/control b/debian/control index 11f42a8c1..85a3e67e6 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,6 @@ Build-Depends: libghc-data-default-dev, libghc-hslogger-dev, libghc-pcre-light-dev, - libghc-sha-dev, libghc-cryptohash-dev (>= 0.11.0), libghc-dataenc-dev, libghc-utf8-string-dev, diff --git a/git-annex.cabal b/git-annex.cabal index 9b0407e1a..99601f2a3 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -105,7 +105,7 @@ Executable git-annex Main-Is: git-annex.hs Build-Depends: MissingH, hslogger, directory, filepath, containers (>= 0.5.0.0), utf8-string, mtl (>= 2), - bytestring, old-locale, time, dataenc, SHA, process, json, + bytestring, old-locale, time, dataenc, process, json, base (>= 4.5 && < 4.9), monad-control, exceptions (>= 0.6), transformers, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance, SafeSemaphore, uuid, random, dlist, unix-compat, async, stm (>= 2.3), diff --git a/standalone/android/cabal.config b/standalone/android/cabal.config index 5ba5bacc2..f39dee91f 100644 --- a/standalone/android/cabal.config +++ b/standalone/android/cabal.config @@ -6,7 +6,6 @@ constraints: Crypto ==4.2.5.1, MissingH ==1.2.1.0, MonadRandom ==0.1.13, QuickCheck ==2.7.6, - SHA ==1.6.1, SafeSemaphore ==0.10.1, aeson ==0.7.0.6, ansi-terminal ==0.6.1.1, diff --git a/standalone/linux/cabal.config b/standalone/linux/cabal.config index 5ba5bacc2..f39dee91f 100644 --- a/standalone/linux/cabal.config +++ b/standalone/linux/cabal.config @@ -6,7 +6,6 @@ constraints: Crypto ==4.2.5.1, MissingH ==1.2.1.0, MonadRandom ==0.1.13, QuickCheck ==2.7.6, - SHA ==1.6.1, SafeSemaphore ==0.10.1, aeson ==0.7.0.6, ansi-terminal ==0.6.1.1, -- cgit v1.2.3 From 8898cbf038733ef37af81e69c78bef29a438dcfb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Apr 2015 11:08:32 -0400 Subject: update some windows libraries for newer version of cygwin --- Build/NullSoftInstaller.hs | 3 ++- debian/changelog | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'debian/changelog') diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs index 42260bd3f..160225bf1 100644 --- a/Build/NullSoftInstaller.hs +++ b/Build/NullSoftInstaller.hs @@ -191,11 +191,12 @@ cygwinDlls = , "cygintl-8.dll" , "cygwind-0.dll" , "cyggssapi-3.dll" + , "cyggssapi_krb5-2.dll" , "cygkrb5-26.dll" , "cygz.dll" , "cygidn-11.dll" , "libcurl-4.dll" - , "cyggnutls-26.dll" + , "cyggnutls-28.dll" , "libcrypto.dll" , "libssl.dll" , "cyggcrypt-11.dll" diff --git a/debian/changelog b/debian/changelog index ba498e0a1..ed8e38973 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * required: New command, like wanted, but for required content. * Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. + * Windows: Bundled versions of rsync, wget, ssh, and gpg from + cygwin all updated. Thanks, Yury V. Zaytsev. -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 -- cgit v1.2.3 From 2f2921b8bad2a5f6ee339f058bb8cad2b305e8a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Apr 2015 13:35:09 -0400 Subject: reorder --- debian/changelog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index ed8e38973..9248df329 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,11 +7,7 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * info dir: Added information about repositories that contain files in the specified directory. * info: Added --bytes option. - * Windows: Renamed start menu file to avoid loop in some versions - of Windows where the menu file is treated as a git-annex program. * bittorrent: Fix handling of magnet links. - * Windows: Fixed support of remotes on other drives. - (A reversion introduced in version 5.20150113.) * When a key's size is unknown, still check the annex.diskreserve, and avoid getting content if the disk is too full. * Fix fsck --from a git remote in a local directory, and from @@ -25,6 +21,10 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * required: New command, like wanted, but for required content. * Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. + * Windows: Renamed start menu file to avoid loop in some versions + of Windows where the menu file is treated as a git-annex program. + * Windows: Fixed support of remotes on other drives. + (A reversion introduced in version 5.20150113.) * Windows: Bundled versions of rsync, wget, ssh, and gpg from cygwin all updated. Thanks, Yury V. Zaytsev. -- cgit v1.2.3 From ce62996c449959fafdc29ce54e62eaee13d96628 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Apr 2015 14:01:41 -0400 Subject: Make repo init more robust. The setDifferences that got added to initialize turns out to make a git commit, and before ensureCommit has been used. Thus, repo init can fail when the system has a broken hostname etc. Move the ensureCommit to the very first thing to avoid this kind of breakage. --- Annex/Init.hs | 10 +++++----- debian/changelog | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'debian/changelog') diff --git a/Annex/Init.hs b/Annex/Init.hs index 50f4d8522..2cc1c1897 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -57,15 +57,15 @@ genDescription Nothing = do initialize :: Maybe String -> Annex () initialize mdescription = do + {- This will make the first commit to git, so ensure git is set up + - properly to allow commits when running it. -} + ensureCommit $ Annex.Branch.create + prepUUID initialize' u <- getUUID - {- This will make the first commit to git, so ensure git is set up - - properly to allow commits when running it. -} - ensureCommit $ do - Annex.Branch.create - describeUUID u =<< genDescription mdescription + describeUUID u =<< genDescription mdescription -- Everything except for uuid setup. initialize' :: Annex () diff --git a/debian/changelog b/debian/changelog index 9248df329..2628369bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,7 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * required: New command, like wanted, but for required content. * Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. + * Make repo init more robust. * Windows: Renamed start menu file to avoid loop in some versions of Windows where the menu file is treated as a git-annex program. * Windows: Fixed support of remotes on other drives. -- cgit v1.2.3 From c4ac44e2e5148bdc564faa89fe4bb3ff84aa0d42 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Apr 2015 14:44:15 -0400 Subject: prep release --- debian/changelog | 4 ++-- git-annex.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 2628369bc..553e91cb2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -git-annex (5.20150410) UNRELEASED; urgency=medium +git-annex (5.20150420) unstable; urgency=medium * Fix activity log parsing, which caused the log to not retain activity from other uuids. @@ -29,7 +29,7 @@ git-annex (5.20150410) UNRELEASED; urgency=medium * Windows: Bundled versions of rsync, wget, ssh, and gpg from cygwin all updated. Thanks, Yury V. Zaytsev. - -- Joey Hess Thu, 09 Apr 2015 20:59:43 -0400 + -- Joey Hess Mon, 20 Apr 2015 14:44:04 -0400 git-annex (5.20150409) unstable; urgency=medium diff --git a/git-annex.cabal b/git-annex.cabal index 99601f2a3..e49bb9a58 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20150409 +Version: 5.20150420 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From 4f849757359859ea300f56816f45e9dc7e650a8d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Apr 2015 14:53:14 -0400 Subject: changelog for https://github.com/joeyh/git-annex/pull/41 --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 553e91cb2..eda96be46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,9 @@ git-annex (5.20150420) unstable; urgency=medium * Removed dependency on haskell SHA library, instead using cryptohash >= 0.11.0. * Make repo init more robust. + * New debian/rules build-standalone target, which generates a + git-annex-standalone.deb that should work on many old Debian etc + systems. Thanks, Yaroslav Halchenko. * Windows: Renamed start menu file to avoid loop in some versions of Windows where the menu file is treated as a git-annex program. * Windows: Fixed support of remotes on other drives. -- cgit v1.2.3 From 4da106cf1703c763f6cbe3d2843e5e10f4160405 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 Apr 2015 15:55:42 -0400 Subject: S3: Enable debug logging when annex.debug or --debug is set. To debug a bug report, but generally useful. --- Remote/S3.hs | 11 ++++++++--- debian/changelog | 6 ++++++ ...comment_1_533c4a26200501486a9ec103e1301391._comment | 18 ++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 doc/bugs/Can__39__t_get_content_from_S3_with_s3-aws_library/comment_1_533c4a26200501486a9ec103e1301391._comment (limited to 'debian/changelog') diff --git a/Remote/S3.hs b/Remote/S3.hs index b0c1de114..06aa79d65 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -28,6 +28,7 @@ import Control.Monad.Trans.Resource import Control.Monad.Catch import Data.Conduit import Data.IORef +import System.Log.Logger import Common.Annex import Types.Remote @@ -149,7 +150,7 @@ s3Setup' u mcreds c = if configIA c then archiveorg else defaulthost writeUUIDFile archiveconfig u use archiveconfig --- Sets up a http connection manager for S3 encdpoint, which allows +-- Sets up a http connection manager for S3 endpoint, which allows -- http connections to be reused across calls to the helper. prepareS3 :: Remote -> S3Info -> (S3Handle -> helper) -> Preparer helper prepareS3 r info = resourcePrepare $ const $ @@ -388,13 +389,13 @@ sendS3Handle' => S3Handle -> r -> ResourceT IO a -sendS3Handle' h = AWS.pureAws (hawscfg h) (hs3cfg h) (hmanager h) +sendS3Handle' h r = AWS.pureAws (hawscfg h) (hs3cfg h) (hmanager h) r withS3Handle :: RemoteConfig -> UUID -> S3Info -> (S3Handle -> Annex a) -> Annex a withS3Handle c u info a = do creds <- getRemoteCredPairFor "S3" c (AWS.creds u) awscreds <- liftIO $ genCredentials $ fromMaybe nocreds creds - let awscfg = AWS.Configuration AWS.Timestamp awscreds (AWS.defaultLog AWS.Error) + let awscfg = AWS.Configuration AWS.Timestamp awscreds debugMapper bracketIO (newManager httpcfg) closeManager $ \mgr -> a $ S3Handle mgr awscfg s3cfg info where @@ -518,3 +519,7 @@ genCredentials (keyid, secret) = AWS.Credentials mkLocationConstraint :: AWS.Region -> S3.LocationConstraint mkLocationConstraint "US" = S3.locationUsClassic mkLocationConstraint r = r + +debugMapper :: AWS.Logger +debugMapper AWS.Debug t = debugM "S3" (T.unpack t) +debugMapper _ _ = noop diff --git a/debian/changelog b/debian/changelog index eda96be46..ad08554d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (5.20150421) UNRELEASED; urgency=medium + + * S3: Enable debug logging when annex.debug or --debug is set. + + -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 + git-annex (5.20150420) unstable; urgency=medium * Fix activity log parsing, which caused the log to not retain diff --git a/doc/bugs/Can__39__t_get_content_from_S3_with_s3-aws_library/comment_1_533c4a26200501486a9ec103e1301391._comment b/doc/bugs/Can__39__t_get_content_from_S3_with_s3-aws_library/comment_1_533c4a26200501486a9ec103e1301391._comment new file mode 100644 index 000000000..8921214a9 --- /dev/null +++ b/doc/bugs/Can__39__t_get_content_from_S3_with_s3-aws_library/comment_1_533c4a26200501486a9ec103e1301391._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-04-21T19:23:18Z" + content=""" +So the http 301 redirect seems to be the relevant clue. + +Perhaps the old S3 library followed such redirects and the new aws library +does not. Although AFAICS, http-client should follow redirects by default. + +Are you able to store new files in this remote and get them back out? + +Which Amazon datacenter is the bucket at? + +I've added some more debugging to the S3 remote; --debug will now +have it log the http requests and responses. Perhaps this will give us +more clues to the problem. +"""]] -- cgit v1.2.3 From 05abf0e4e99e7a146505da09d275c56fd0aafad4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2015 16:19:05 -0400 Subject: Dropped support for older versions of yesod and warp than the ones in Debian Jessie. 466 lines of compat cruft deleted! --- Utility/WebApp.hs | 22 ---------------------- Utility/Yesod.hs | 32 -------------------------------- debian/changelog | 2 ++ debian/control | 10 ++++++---- debian/copyright | 4 ---- git-annex.cabal | 13 ++++++++++--- 6 files changed, 18 insertions(+), 65 deletions(-) (limited to 'debian/changelog') diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 54f2d6f2b..ce6a61c42 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -94,11 +94,7 @@ fixSockAddr addr = addr -- disable buggy sloworis attack prevention code webAppSettings :: Settings -#if MIN_VERSION_warp(2,1,0) webAppSettings = setTimeout halfhour defaultSettings -#else -webAppSettings = defaultSettings { settingsTimeout = halfhour } -#endif where halfhour = 30 * 60 @@ -155,11 +151,7 @@ lookupRequestField k req = fromMaybe "" . lookup k $ Wai.requestHeaders req {- Rather than storing a session key on disk, use a random key - that will only be valid for this run of the webapp. -} -#if MIN_VERSION_yesod(1,2,0) webAppSessionBackend :: Yesod.Yesod y => y -> IO (Maybe Yesod.SessionBackend) -#else -webAppSessionBackend :: Yesod.Yesod y => y -> IO (Maybe (Yesod.SessionBackend y)) -#endif webAppSessionBackend _ = do g <- newGenIO :: IO SystemRandom case genBytes 96 g of @@ -170,18 +162,8 @@ webAppSessionBackend _ = do where timeout = 120 * 60 -- 120 minutes use key = -#if MIN_VERSION_yesod(1,2,0) Just . Yesod.clientSessionBackend key . fst <$> Yesod.clientSessionDateCacher timeout -#else -#if MIN_VERSION_yesod(1,1,7) - Just . Yesod.clientSessionBackend2 key . fst - <$> Yesod.clientSessionDateCacher timeout -#else - return $ Just $ - Yesod.clientSessionBackend key timeout -#endif -#endif #ifdef WITH_WEBAPP_SECURE type AuthToken = SecureMem @@ -219,11 +201,7 @@ genAuthToken = do - Note that the usual Yesod error page is bypassed on error, to avoid - possibly leaking the auth token in urls on that page! -} -#if MIN_VERSION_yesod(1,2,0) checkAuthToken :: (Monad m, Yesod.MonadHandler m) => (Yesod.HandlerSite m -> AuthToken) -> m Yesod.AuthResult -#else -checkAuthToken :: forall t sub. (t -> AuthToken) -> Yesod.GHandler sub t Yesod.AuthResult -#endif checkAuthToken extractAuthToken = do webapp <- Yesod.getYesod req <- Yesod.getRequest diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index 231bb291e..a8055d34d 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -19,70 +19,38 @@ module Utility.Yesod #endif #if ! MIN_VERSION_yesod(1,4,0) , withUrlRenderer -#endif -#if ! MIN_VERSION_yesod(1,2,0) - , Html #endif ) where -#if MIN_VERSION_yesod(1,2,0) import Yesod as Y -#else -import Yesod as Y hiding (Html) -#endif -#if MIN_VERSION_yesod_form(1,3,8) import Yesod.Form.Bootstrap3 as Y hiding (bfs) -#else -import Assistant.WebApp.Bootstrap3 as Y hiding (bfs) -#endif #ifndef __NO_TH__ import Yesod.Default.Util import Language.Haskell.TH.Syntax (Q, Exp) -#if MIN_VERSION_yesod_default(1,1,0) import Data.Default (def) import Text.Hamlet hiding (Html) #endif -#endif #if ! MIN_VERSION_yesod(1,4,0) -#if MIN_VERSION_yesod(1,2,0) import Data.Text (Text) #endif -#endif #ifndef __NO_TH__ widgetFile :: String -> Q Exp -#if ! MIN_VERSION_yesod_default(1,1,0) -widgetFile = widgetFileNoReload -#else widgetFile = widgetFileNoReload $ def { wfsHamletSettings = defaultHamletSettings { hamletNewlines = AlwaysNewlines } } -#endif hamletTemplate :: FilePath -> FilePath hamletTemplate f = globFile "hamlet" f #endif {- Lift Handler to Widget -} -#if MIN_VERSION_yesod(1,2,0) liftH :: Monad m => HandlerT site m a -> WidgetT site m a liftH = handlerToWidget -#else -liftH :: MonadLift base m => base a -> m a -liftH = lift -#endif -{- Misc new names for stuff. -} -#if ! MIN_VERSION_yesod(1,2,0) -withUrlRenderer :: forall master sub. HtmlUrl (Route master) -> GHandler sub master RepHtml -withUrlRenderer = hamletToRepHtml - -type Html = RepHtml -#else #if ! MIN_VERSION_yesod_core(1,2,20) withUrlRenderer :: MonadHandler m => ((Route (HandlerSite m) -> [(Text, Text)] -> Text) -> output) -> m output withUrlRenderer = giveUrlRenderer #endif -#endif diff --git a/debian/changelog b/debian/changelog index ad08554d8..e71152bd7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * S3: Enable debug logging when annex.debug or --debug is set. + * Dropped support for older versions of yesod and warp than the ones + in Debian Jessie. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/debian/control b/debian/control index 85a3e67e6..f49751251 100644 --- a/debian/control +++ b/debian/control @@ -33,13 +33,15 @@ Build-Depends: libghc-stm-dev (>= 2.3), libghc-dbus-dev (>= 0.10.3) [linux-any], libghc-fdo-notify-dev (>= 0.3) [linux-any], - libghc-yesod-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-yesod-static-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-yesod-default-dev [i386 amd64 kfreebsd-amd64 powerpc], + libghc-yesod-dev (>= 1.2.6.1) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], + libghc-yesod-core-dev (>= 1.2.19) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], + libghc-yesod-form-dev (>= 1.3.15) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], + libghc-yesod-static-dev (>= 1.2.4) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], + libghc-yesod-default-dev (>= 1.2.0) [i386 amd64 kfreebsd-amd64 powerpc], libghc-hamlet-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], libghc-shakespeare-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], libghc-clientsession-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-warp-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], + libghc-warp-dev (>= 3.0.0.5) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], libghc-warp-tls-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], libghc-wai-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], libghc-wai-extra-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], diff --git a/debian/copyright b/debian/copyright index 7b9807680..322d68f04 100644 --- a/debian/copyright +++ b/debian/copyright @@ -28,10 +28,6 @@ Files: Utility/Gpg.hs Utility/DirWatcher* Copyright: © 2010-2014 Joey Hess License: GPL-3+ -Files: Assistant/WebApp/Bootstrap3.hs -Copyright: 2010 Michael Snoyman -License: BSD-2-clause - Files: doc/logo* */favicon.ico standalone/osx/git-annex.app/Contents/Resources/git-annex.icns standalone/android/icons/* Copyright: 2007 Henrik Nyh 2010 Joey Hess diff --git a/git-annex.cabal b/git-annex.cabal index e49bb9a58..dc1773224 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -199,10 +199,17 @@ Executable git-annex if flag(Webapp) Build-Depends: - yesod, yesod-default, yesod-static, yesod-form, yesod-core, - wai, wai-extra, warp, warp-tls, + yesod (>= 1.2.6), + yesod-default (>= 1.2.0), + yesod-static (>= 1.2.4), + yesod-form (>= 1.3.15), + yesod-core (>= 1.2.19), + path-pieces (>= 0.1.4), + warp (>= 3.0.0.5), + warp-tls, + wai, wai-extra, blaze-builder, crypto-api, hamlet, clientsession, - template-haskell, aeson, path-pieces, + template-haskell, aeson, shakespeare CPP-Options: -DWITH_WEBAPP if flag(Webapp) && flag (Webapp-secure) -- cgit v1.2.3 From 8112d0a6978caad2b2852b41b8eb284f9a5d4605 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2015 16:23:41 -0400 Subject: also drop old dbus compat --- Assistant/Threads/MountWatcher.hs | 4 ---- Assistant/Threads/NetWatcher.hs | 8 -------- debian/changelog | 2 +- debian/control | 2 +- git-annex.cabal | 4 ++-- 5 files changed, 4 insertions(+), 16 deletions(-) (limited to 'debian/changelog') diff --git a/Assistant/Threads/MountWatcher.hs b/Assistant/Threads/MountWatcher.hs index 023af53cb..3ccdd1adc 100644 --- a/Assistant/Threads/MountWatcher.hs +++ b/Assistant/Threads/MountWatcher.hs @@ -63,11 +63,7 @@ dbusThread urlrenderer = do wasmounted <- liftIO $ swapMVar mvar nowmounted handleMounts urlrenderer wasmounted nowmounted liftIO $ forM_ mountChanged $ \matcher -> -#if MIN_VERSION_dbus(0,10,7) void $ addMatch client matcher handleevent -#else - listen client matcher handleevent -#endif , do liftAnnex $ warning "No known volume monitor available through dbus; falling back to mtab polling" diff --git a/Assistant/Threads/NetWatcher.hs b/Assistant/Threads/NetWatcher.hs index ad3a87a91..07ccdaf24 100644 --- a/Assistant/Threads/NetWatcher.hs +++ b/Assistant/Threads/NetWatcher.hs @@ -112,11 +112,7 @@ checkNetMonitor client = do -} listenNMConnections :: Client -> (Bool -> IO ()) -> IO () listenNMConnections client setconnected = -#if MIN_VERSION_dbus(0,10,7) void $ addMatch client matcher -#else - listen client matcher -#endif $ \event -> mapM_ handleevent (map dictionaryItems $ mapMaybe fromVariant $ signalBody event) where @@ -166,11 +162,7 @@ listenWicdConnections client setconnected = do | any (== wicd_disconnected) status = setconnected False | otherwise = noop match matcher a = -#if MIN_VERSION_dbus(0,10,7) void $ addMatch client matcher a -#else - listen client matcher a -#endif #endif handleConnection :: Assistant () diff --git a/debian/changelog b/debian/changelog index e71152bd7..4553130d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * S3: Enable debug logging when annex.debug or --debug is set. - * Dropped support for older versions of yesod and warp than the ones + * Dropped support for older versions of yesod, warp, and dbus than the ones in Debian Jessie. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/debian/control b/debian/control index f49751251..ce7ce7504 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Build-Depends: libghc-edit-distance-dev, libghc-hinotify-dev [linux-any], libghc-stm-dev (>= 2.3), - libghc-dbus-dev (>= 0.10.3) [linux-any], + libghc-dbus-dev (>= 0.10.7) [linux-any], libghc-fdo-notify-dev (>= 0.3) [linux-any], libghc-yesod-dev (>= 1.2.6.1) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], libghc-yesod-core-dev (>= 1.2.19) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], diff --git a/git-annex.cabal b/git-annex.cabal index dc1773224..1f32067b2 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20150420 +Version: 5.20150421 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess @@ -183,7 +183,7 @@ Executable git-annex if (os(linux)) if flag(Dbus) - Build-Depends: dbus (>= 0.10.3) + Build-Depends: dbus (>= 0.10.7) CPP-Options: -DWITH_DBUS if flag(DesktopNotify) -- cgit v1.2.3 From 8fb9ed4c74ecd332a1d2c8219cd3429b78053b0b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2015 14:12:25 -0400 Subject: S3: git annex info will show additional information about a S3 remote (endpoint, port, storage class) --- Remote/S3.hs | 23 ++++++++++++++++------- debian/changelog | 2 ++ 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'debian/changelog') diff --git a/Remote/S3.hs b/Remote/S3.hs index c9de36745..cf46c2b28 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -28,6 +28,7 @@ import Control.Monad.Trans.Resource import Control.Monad.Catch import Data.Conduit import Data.IORef +import Data.Bits.Utils import System.Log.Logger import Common.Annex @@ -89,13 +90,7 @@ gen r u c gc = do , availability = GloballyAvailable , remotetype = remote , mkUnavailable = gen r u (M.insert "host" "!dne!" c) gc - , getInfo = includeCredsInfo c (AWS.creds u) $ catMaybes - [ Just ("bucket", fromMaybe "unknown" (getBucketName c)) - , if configIA c - then Just ("internet archive item", iaItemUrl $ fromMaybe "unknown" $ getBucketName c) - else Nothing - , Just ("partsize", maybe "unlimited" (roughSize storageUnits False) (getPartSize c)) - ] + , getInfo = includeCredsInfo c (AWS.creds u) (s3Info c) , claimUrl = Nothing , checkUrl = Nothing } @@ -528,3 +523,17 @@ debugMapper level t = forward "S3" (T.unpack t) AWS.Info -> infoM AWS.Warning -> warningM AWS.Error -> errorM + +s3Info :: RemoteConfig -> [(String, String)] +s3Info c = catMaybes + [ Just ("bucket", fromMaybe "unknown" (getBucketName c)) + , Just ("endpoint", w82s (S.unpack (S3.s3Endpoint s3c))) + , Just ("port", show (S3.s3Port s3c)) + , Just ("storage class", show (getStorageClass c)) + , if configIA c + then Just ("internet archive item", iaItemUrl $ fromMaybe "unknown" $ getBucketName c) + else Nothing + , Just ("partsize", maybe "unlimited" (roughSize storageUnits False) (getPartSize c)) + ] + where + s3c = s3Configuration c diff --git a/debian/changelog b/debian/changelog index 4553130d6..b151d2963 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * S3: Enable debug logging when annex.debug or --debug is set. * Dropped support for older versions of yesod, warp, and dbus than the ones in Debian Jessie. + * S3: git annex info will show additional information about a S3 remote + (endpoint, port, storage class) -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From 060e698c88fefab5a55e99d5d8a45897fc1571ac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2015 14:16:53 -0400 Subject: S3: git annex enableremote will not create a bucket name, which failed since the bucket already exists. --- Remote/S3.hs | 9 +++++---- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'debian/changelog') diff --git a/Remote/S3.hs b/Remote/S3.hs index cf46c2b28..d290f9596 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -98,9 +98,9 @@ gen r u c gc = do s3Setup :: Maybe UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID) s3Setup mu mcreds c = do u <- maybe (liftIO genUUID) return mu - s3Setup' u mcreds c -s3Setup' :: UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID) -s3Setup' u mcreds c = if configIA c then archiveorg else defaulthost + s3Setup' (isNothing mu) u mcreds c +s3Setup' :: Bool -> UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID) +s3Setup' new u mcreds c = if configIA c then archiveorg else defaulthost where remotename = fromJust (M.lookup "name" c) defbucket = remotename ++ "-" ++ fromUUID u @@ -120,7 +120,8 @@ s3Setup' u mcreds c = if configIA c then archiveorg else defaulthost (c', encsetup) <- encryptionSetup c c'' <- setRemoteCredPair encsetup c' (AWS.creds u) mcreds let fullconfig = c'' `M.union` defaults - genBucket fullconfig u + when new $ + genBucket fullconfig u use fullconfig archiveorg = do diff --git a/debian/changelog b/debian/changelog index b151d2963..fa707a0af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium in Debian Jessie. * S3: git annex info will show additional information about a S3 remote (endpoint, port, storage class) + * S3: git annex enableremote will not create a bucket name, which + failed since the bucket already exists. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From 454b6c96dee4b854decdcda78c6c2b11fd43c21b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 27 Apr 2015 17:40:21 -0400 Subject: Fix bogus failure of fsck --fast. --- Command/Fsck.hs | 20 +++++++++++--------- Remote/Helper/Special.hs | 2 +- debian/changelog | 1 + doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn | 3 +++ 4 files changed, 16 insertions(+), 10 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 39dba08dd..eea0ebc11 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -112,14 +112,15 @@ performRemote key file backend numcopies remote = dispatch (Left err) = do showNote err return False - dispatch (Right True) = withtmp $ \tmpfile -> - ifM (getfile tmpfile) - ( go True (Just tmpfile) - , do + dispatch (Right True) = withtmp $ \tmpfile -> do + r <- getfile tmpfile + case r of + Nothing -> go True Nothing + Just True -> go True (Just tmpfile) + Just False -> do warning "failed to download file from remote" void $ go True Nothing return False - ) dispatch (Right False) = go False Nothing go present localcopy = check [ verifyLocationLogRemote key file remote present @@ -137,13 +138,14 @@ performRemote key file backend numcopies remote = cleanup `after` a tmp getfile tmp = ifM (checkDiskSpace (Just tmp) key 0) ( ifM (Remote.retrieveKeyFileCheap remote key tmp) - ( return True + ( return (Just True) , ifM (Annex.getState Annex.fast) - ( return False - , Remote.retrieveKeyFile remote key Nothing tmp dummymeter + ( return Nothing + , Just <$> + Remote.retrieveKeyFile remote key Nothing tmp dummymeter ) ) - , return False + , return (Just False) ) dummymeter _ = noop diff --git a/Remote/Helper/Special.hs b/Remote/Helper/Special.hs index 696a43a7a..7dd861a4e 100644 --- a/Remote/Helper/Special.hs +++ b/Remote/Helper/Special.hs @@ -199,7 +199,7 @@ specialRemote' cfg c preparestorer prepareretriever prepareremover preparecheckp readBytes $ \encb -> storer (enck k) (ByteContent encb) p - -- call retrieve-r to get chunks; decrypt them; stream to dest file + -- call retriever to get chunks; decrypt them; stream to dest file retrieveKeyFileGen k dest p enc = safely $ prepareretriever k $ safely . go where diff --git a/debian/changelog b/debian/changelog index fa707a0af..24acb8144 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium (endpoint, port, storage class) * S3: git annex enableremote will not create a bucket name, which failed since the bucket already exists. + * Fix bogus failure of fsck --fast. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn b/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn index 2d269e61c..77392b36d 100644 --- a/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn +++ b/doc/todo/enable_fsck_--fast_for_S3_remotes.mdwn @@ -25,3 +25,6 @@ failed while ``git annex fsck -f S3remote`` works fine. But, to check for the presence of a file (which is my understanding of what ``--fast`` is for here), it shouldn't be necessary to download the file. + +> [[fixed|done]]; it was not supposed to fail at all in this case, and +> won't anymore. --[[Joey]] -- cgit v1.2.3 From c32e51a706258a8be90c125475c6741d9b4936ad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 27 Apr 2015 18:00:58 -0400 Subject: S3: Fix incompatability with bucket names used by hS3; the aws library cannot handle upper-case bucket names. git-annex now converts them to lower case automatically. For example, it failed to get files from a bucket named S3. Also fixes `git annex initremote UPPERCASE type=S3`, which failed with the new aws library, with a signing error message. --- Remote/S3.hs | 4 ++-- debian/changelog | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/Remote/S3.hs b/Remote/S3.hs index d290f9596..d8914d822 100644 --- a/Remote/S3.hs +++ b/Remote/S3.hs @@ -129,7 +129,7 @@ s3Setup' new u mcreds c = if configIA c then archiveorg else defaulthost c' <- setRemoteCredPair noEncryptionUsed c (AWS.creds u) mcreds -- Ensure user enters a valid bucket name, since -- this determines the name of the archive.org item. - let validbucket = replace " " "-" $ map toLower $ + let validbucket = replace " " "-" $ fromMaybe (error "specify bucket=") $ getBucketName c' let archiveconfig = @@ -447,7 +447,7 @@ extractS3Info c = do } getBucketName :: RemoteConfig -> Maybe BucketName -getBucketName = M.lookup "bucket" +getBucketName = map toLower <$$> M.lookup "bucket" getStorageClass :: RemoteConfig -> S3.StorageClass getStorageClass c = case M.lookup "storageclass" c of diff --git a/debian/changelog b/debian/changelog index 24acb8144..ffca9cda3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * S3: git annex enableremote will not create a bucket name, which failed since the bucket already exists. * Fix bogus failure of fsck --fast. + * S3: Fix incompatability with bucket names used by hS3; the aws library + cannot handle upper-case bucket names. git-annex now converts them to + lower case automatically. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From bad1f3faa36fd29c6baa66f0cfd57b1c8b6fdb22 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 27 Apr 2015 18:10:56 -0400 Subject: changelog --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index ffca9cda3..4840490d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium in Debian Jessie. * S3: git annex info will show additional information about a S3 remote (endpoint, port, storage class) - * S3: git annex enableremote will not create a bucket name, which - failed since the bucket already exists. + * S3: Let git annex enableremote be used, without trying to recreate + a bucket that should already exist. * Fix bogus failure of fsck --fast. * S3: Fix incompatability with bucket names used by hS3; the aws library cannot handle upper-case bucket names. git-annex now converts them to -- cgit v1.2.3 From a3c475831fa99555c0263c979856eb51862468c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Apr 2015 13:46:12 -0400 Subject: import: Check for gitignored files before moving them into the tree. (Needs git 1.8.4 or newer.) --- Command/Import.hs | 15 ++++++++++----- debian/changelog | 2 ++ doc/bugs/git_annex_import:_ignored_names_fatal.mdwn | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Import.hs b/Command/Import.hs index 17cb49db1..060be6c65 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -16,6 +16,7 @@ import Backend import Remote import Types.KeySource import Types.Key +import Annex.CheckIgnore cmd :: [Command] cmd = [withOptions opts $ notBareRepo $ command "import" paramPaths seek @@ -79,11 +80,15 @@ start mode (srcfile, destfile) = next $ return True importfile = do handleexisting =<< liftIO (catchMaybeIO $ getSymbolicLinkStatus destfile) - liftIO $ createDirectoryIfMissing True (parentDir destfile) - liftIO $ if mode == Duplicate || mode == SkipDuplicates - then void $ copyFileExternal CopyAllMetaData srcfile destfile - else moveFile srcfile destfile - Command.Add.perform destfile + ignored <- not <$> Annex.getState Annex.force <&&> checkIgnored destfile + if ignored + then error $ "not importing " ++ destfile ++ " which is .gitignored (use --force to override)" + else do + liftIO $ createDirectoryIfMissing True (parentDir destfile) + liftIO $ if mode == Duplicate || mode == SkipDuplicates + then void $ copyFileExternal CopyAllMetaData srcfile destfile + else moveFile srcfile destfile + Command.Add.perform destfile handleexisting Nothing = noop handleexisting (Just s) | isDirectory s = notoverwriting "(is a directory)" diff --git a/debian/changelog b/debian/changelog index 4840490d4..527a09f41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * S3: Fix incompatability with bucket names used by hS3; the aws library cannot handle upper-case bucket names. git-annex now converts them to lower case automatically. + * import: Check for gitignored files before moving them into the tree. + (Needs git 1.8.4 or newer.) -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/git_annex_import:_ignored_names_fatal.mdwn b/doc/bugs/git_annex_import:_ignored_names_fatal.mdwn index e96ca2acb..8981cadd8 100644 --- a/doc/bugs/git_annex_import:_ignored_names_fatal.mdwn +++ b/doc/bugs/git_annex_import:_ignored_names_fatal.mdwn @@ -36,3 +36,6 @@ Can't the ignored files just be ignored? # End of transcript or log. """]] + +> Made git-annex import check for gitignored files before +> moving them into the work tree. [[done]] --[[Joey]] -- cgit v1.2.3 From 4ade15a1fc13771629f8d0f462b8db9f199c169d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Apr 2015 13:56:41 -0400 Subject: import: Don't stop entire import when one file fails due to being gitignored or conflicting with something in the work tree. --- Command/Import.hs | 38 +++++++++++++++++++++++--------------- debian/changelog | 2 ++ 2 files changed, 25 insertions(+), 15 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Import.hs b/Command/Import.hs index 060be6c65..261bd7b8e 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -79,24 +79,32 @@ start mode (srcfile, destfile) = liftIO $ removeFile srcfile next $ return True importfile = do - handleexisting =<< liftIO (catchMaybeIO $ getSymbolicLinkStatus destfile) ignored <- not <$> Annex.getState Annex.force <&&> checkIgnored destfile if ignored - then error $ "not importing " ++ destfile ++ " which is .gitignored (use --force to override)" + then do + warning $ "not importing " ++ destfile ++ " which is .gitignored (use --force to override)" + stop else do - liftIO $ createDirectoryIfMissing True (parentDir destfile) - liftIO $ if mode == Duplicate || mode == SkipDuplicates - then void $ copyFileExternal CopyAllMetaData srcfile destfile - else moveFile srcfile destfile - Command.Add.perform destfile - handleexisting Nothing = noop - handleexisting (Just s) - | isDirectory s = notoverwriting "(is a directory)" - | otherwise = ifM (Annex.getState Annex.force) - ( liftIO $ nukeFile destfile - , notoverwriting "(use --force to override, or a duplication option such as --deduplicate to clean up)" - ) - notoverwriting why = error $ "not overwriting existing " ++ destfile ++ " " ++ why + existing <- liftIO (catchMaybeIO $ getSymbolicLinkStatus destfile) + case existing of + Nothing -> importfilechecked + (Just s) + | isDirectory s -> notoverwriting "(is a directory)" + | otherwise -> ifM (Annex.getState Annex.force) + ( do + liftIO $ nukeFile destfile + importfilechecked + , notoverwriting "(use --force to override, or a duplication option such as --deduplicate to clean up)" + ) + importfilechecked = do + liftIO $ createDirectoryIfMissing True (parentDir destfile) + liftIO $ if mode == Duplicate || mode == SkipDuplicates + then void $ copyFileExternal CopyAllMetaData srcfile destfile + else moveFile srcfile destfile + Command.Add.perform destfile + notoverwriting why = do + warning $ "not overwriting existing " ++ destfile ++ " " ++ why + stop checkdup dupa notdupa = do backend <- chooseBackend destfile let ks = KeySource srcfile srcfile Nothing diff --git a/debian/changelog b/debian/changelog index 527a09f41..ac96777ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium lower case automatically. * import: Check for gitignored files before moving them into the tree. (Needs git 1.8.4 or newer.) + * import: Don't stop entire import when one file fails due to being + gitignored or conflicting with something in the work tree. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From 97c488a31cc63005e17536208df1f4f25ed866a6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Apr 2015 15:53:16 -0400 Subject: Improve integration with KDE's file manager to work with dolphin version 14.12.3 while still being compatable with 4.14.2. Thanks, silvio. --- Assistant/Install.hs | 6 ++++-- debian/changelog | 3 +++ doc/bugs/dolphin_integration_file_is_broken.mdwn | 3 +++ .../comment_3_89c166c4e44380b8f354f2c6b5e42fad._comment | 10 ++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 doc/bugs/dolphin_integration_file_is_broken/comment_3_89c166c4e44380b8f354f2c6b5e42fad._comment (limited to 'debian/changelog') diff --git a/Assistant/Install.hs b/Assistant/Install.hs index 6da6d2389..00d719bec 100644 --- a/Assistant/Install.hs +++ b/Assistant/Install.hs @@ -145,10 +145,12 @@ installFileManagerHooks program = do , "Name=" ++ command , "Icon=git-annex" , unwords - [ "Exec=sh -c 'cd \"$(dirname '%U')\" &&" + [ "Exec=sh -c 'cd \"$(dirname \"$1\")\" &&" , program , command - , "--notify-start --notify-finish -- %U'" + , "--notify-start --notify-finish -- \"$1\"'" + , "false" -- this becomes $0 in sh, so unused + , "%f" ] ] #else diff --git a/debian/changelog b/debian/changelog index ac96777ac..2db52813e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,9 @@ git-annex (5.20150421) UNRELEASED; urgency=medium (Needs git 1.8.4 or newer.) * import: Don't stop entire import when one file fails due to being gitignored or conflicting with something in the work tree. + * Improve integration with KDE's file manager to work with dolphin + version 14.12.3 while still being compatable with 4.14.2. + Thanks, silvio. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/dolphin_integration_file_is_broken.mdwn b/doc/bugs/dolphin_integration_file_is_broken.mdwn index 4b0e11cae..2f2fc1c4e 100644 --- a/doc/bugs/dolphin_integration_file_is_broken.mdwn +++ b/doc/bugs/dolphin_integration_file_is_broken.mdwn @@ -32,3 +32,6 @@ or simply # End of transcript or log. """]] + +> [[fixed|done]]; confirmed the new version still works on filenames with +> spaces in them. --[[Joey]] diff --git a/doc/bugs/dolphin_integration_file_is_broken/comment_3_89c166c4e44380b8f354f2c6b5e42fad._comment b/doc/bugs/dolphin_integration_file_is_broken/comment_3_89c166c4e44380b8f354f2c6b5e42fad._comment new file mode 100644 index 000000000..fdbc3beb1 --- /dev/null +++ b/doc/bugs/dolphin_integration_file_is_broken/comment_3_89c166c4e44380b8f354f2c6b5e42fad._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2015-04-29T19:37:42Z" + content=""" +So a much newer version than the one in Debian yet.. + +I tried your command line with the old version in Debian, and it seems to +work ok, so thanks for the improvement! +"""]] -- cgit v1.2.3 From e0544f17c1ac482445ff1ae18a413be7cad68f2c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Apr 2015 14:03:24 -0400 Subject: import: Before removing a duplicate file in --deduplicate or --clean-duplicates mode, verify that enough copies of its content still exist. --- Command/Import.hs | 24 ++++++++++++++++++++++-- debian/changelog | 3 +++ doc/bugs/clean-duplicates_causes_data_loss.mdwn | 3 +++ 3 files changed, 28 insertions(+), 2 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Import.hs b/Command/Import.hs index 261bd7b8e..58e4db38a 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -17,6 +17,9 @@ import Remote import Types.KeySource import Types.Key import Annex.CheckIgnore +import Annex.NumCopies +import Types.TrustLevel +import Logs.Trust cmd :: [Command] cmd = [withOptions opts $ notBareRepo $ command "import" paramPaths seek @@ -76,8 +79,14 @@ start mode (srcfile, destfile) = where deletedup k = do showNote $ "duplicate of " ++ key2file k - liftIO $ removeFile srcfile - next $ return True + ifM (verifiedExisting k destfile) + ( do + liftIO $ removeFile srcfile + next $ return True + , do + warning "could not verify that the content is still present in the annex; not removing from the import location" + stop + ) importfile = do ignored <- not <$> Annex.getState Annex.force <&&> checkIgnored destfile if ignored @@ -120,3 +129,14 @@ start mode (srcfile, destfile) = CleanDuplicates -> checkdup (Just deletedup) Nothing SkipDuplicates -> checkdup Nothing (Just importfile) _ -> return (Just importfile) + +verifiedExisting :: Key -> FilePath -> Annex Bool +verifiedExisting key destfile = do + -- Look up the numcopies setting for the file that it would be + -- imported to, if it were imported. + need <- getFileNumCopies destfile + + (remotes, trusteduuids) <- knownCopies key + untrusteduuids <- trustGet UnTrusted + let tocheck = Remote.remotesWithoutUUID remotes (trusteduuids++untrusteduuids) + verifyEnoughCopies [] key need trusteduuids [] tocheck diff --git a/debian/changelog b/debian/changelog index 2db52813e..ec53afd4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,9 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * Improve integration with KDE's file manager to work with dolphin version 14.12.3 while still being compatable with 4.14.2. Thanks, silvio. + * import: Before removing a duplicate file in --deduplicate or + --clean-duplicates mode, verify that enough copies of its content still + exist. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/clean-duplicates_causes_data_loss.mdwn b/doc/bugs/clean-duplicates_causes_data_loss.mdwn index df1f7e131..c5d545420 100644 --- a/doc/bugs/clean-duplicates_causes_data_loss.mdwn +++ b/doc/bugs/clean-duplicates_causes_data_loss.mdwn @@ -25,3 +25,6 @@ g-a import --clean-duplicates ~/tmp/importme (containing a, b and c) into 'impor ### Please provide any additional information below. I can provide the script if it is wanted (coded in Perl, couple of non-core dependencies). + +> Decided to go ahead and make it check remotes like drop does, so [[done]] +> --[[Joey]] -- cgit v1.2.3 From 508920bf728cfb5e4568b68a2943bd33efac26bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Apr 2015 15:28:17 -0400 Subject: Improve behavior when a git-annex command is told to operate on a file that doesn't exist. It will now continue to other files specified after that on the command line, and only error out at the end. --- CmdLine/Action.hs | 2 +- CmdLine/Seek.hs | 5 +++-- Command/Add.hs | 5 ++++- Messages.hs | 15 ++++++++------- debian/changelog | 4 ++++ 5 files changed, 20 insertions(+), 11 deletions(-) (limited to 'debian/changelog') diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index a32abbbee..b566621bb 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -43,7 +43,7 @@ commandAction a = account =<< tryIO go account (Right True) = return True account (Right False) = incerr account (Left err) = do - showErr err + toplevelWarning True (show err) showEndFail incerr incerr = do diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index 1db075ec3..96076261f 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -218,8 +218,9 @@ seekHelper a params = do ll <- inRepo $ \g -> concat <$> forM (segmentXargsOrdered params) (runSegmentPaths (\fs -> Git.Command.leaveZombie <$> a fs g)) forM_ (map fst $ filter (null . snd) $ zip params ll) $ \p -> - unlessM (isJust <$> liftIO (catchMaybeIO $ getSymbolicLinkStatus p)) $ - error $ p ++ " not found" + unlessM (isJust <$> liftIO (catchMaybeIO $ getSymbolicLinkStatus p)) $ do + toplevelWarning False (p ++ " not found") + Annex.incError return $ concat ll notSymlink :: FilePath -> IO Bool diff --git a/Command/Add.hs b/Command/Add.hs index c461c4d56..d53ba91ad 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -116,7 +116,10 @@ start file = ifAnnexed file addpresent add - Lockdown can fail if a file gets deleted, and Nothing will be returned. -} lockDown :: FilePath -> Annex (Maybe KeySource) -lockDown = either (\e -> showErr e >> return Nothing) (return . Just) <=< lockDown' +lockDown = either + (\e -> warning (show e) >> return Nothing) + (return . Just) + <=< lockDown' lockDown' :: FilePath -> Annex (Either IOException KeySource) lockDown' file = ifM crippledFileSystem diff --git a/Messages.hs b/Messages.hs index 0e83a7243..5dffbd8de 100644 --- a/Messages.hs +++ b/Messages.hs @@ -19,7 +19,7 @@ module Messages ( showEndOk, showEndFail, showEndResult, - showErr, + toplevelWarning, warning, warningIO, indent, @@ -117,15 +117,16 @@ showEndResult ok = handleMessage (JSON.end ok) $ putStrLn msg | ok = "ok" | otherwise = "failed" -showErr :: (Show a) => a -> Annex () -showErr e = warning' $ "git-annex: " ++ show e +toplevelWarning :: Bool -> String -> Annex () +toplevelWarning makeway s = warning' makeway ("git-annex: " ++ s) warning :: String -> Annex () -warning = warning' . indent +warning = warning' True . indent -warning' :: String -> Annex () -warning' w = do - handleMessage q $ putStr "\n" +warning' :: Bool -> String -> Annex () +warning' makeway w = do + when makeway $ + handleMessage q $ putStr "\n" liftIO $ do hFlush stdout hPutStrLn stderr w diff --git a/debian/changelog b/debian/changelog index ec53afd4f..38db4ee67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,10 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * import: Before removing a duplicate file in --deduplicate or --clean-duplicates mode, verify that enough copies of its content still exist. + * Improve behavior when a git-annex command is told to operate + on a file that doesn't exist. It will now continue to other + files specified after that on the command line, and only error out at + the end. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From 4e1898c1ceff2f37088c888d3ed4ffd0e4ba3cc2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 May 2015 13:53:45 -0400 Subject: assistant: Added --autostop to complement --autostart. --- Command/Assistant.hs | 40 +++++++++++++++++----- debian/changelog | 1 + ...not_run_from_inside_a_git_annex_repository.mdwn | 3 ++ doc/git-annex-assistant.mdwn | 5 +++ 4 files changed, 40 insertions(+), 9 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Assistant.hs b/Command/Assistant.hs index 590a2e437..97bc08c7b 100644 --- a/Command/Assistant.hs +++ b/Command/Assistant.hs @@ -20,7 +20,7 @@ import Assistant.Install import System.Environment cmd :: [Command] -cmd = [noRepo checkAutoStart $ dontCheck repoExists $ withOptions options $ +cmd = [noRepo checkNoRepoOpts $ dontCheck repoExists $ withOptions options $ notBareRepo $ command "assistant" paramNothing seek SectionCommon "automatically sync changes"] @@ -30,11 +30,15 @@ options = , Command.Watch.stopOption , autoStartOption , startDelayOption + , autoStopOption ] autoStartOption :: Option autoStartOption = flagOption [] "autostart" "start in known repositories" +autoStopOption :: Option +autoStopOption = flagOption [] "autostop" "stop in known repositories" + startDelayOption :: Option startDelayOption = fieldOption [] "startdelay" paramNumber "delay before running startup scan" @@ -43,25 +47,31 @@ seek ps = do stopdaemon <- getOptionFlag Command.Watch.stopOption foreground <- getOptionFlag Command.Watch.foregroundOption autostart <- getOptionFlag autoStartOption + autostop <- getOptionFlag autoStopOption startdelay <- getOptionField startDelayOption (pure . maybe Nothing parseDuration) - withNothing (start foreground stopdaemon autostart startdelay) ps + withNothing (start foreground stopdaemon autostart autostop startdelay) ps -start :: Bool -> Bool -> Bool -> Maybe Duration -> CommandStart -start foreground stopdaemon autostart startdelay +start :: Bool -> Bool -> Bool -> Bool -> Maybe Duration -> CommandStart +start foreground stopdaemon autostart autostop startdelay | autostart = do liftIO $ autoStart startdelay stop + | autostop = do + liftIO autoStop + stop | otherwise = do liftIO ensureInstalled ensureInitialized Command.Watch.start True foreground stopdaemon startdelay -{- Run outside a git repository. Check to see if any parameter is - - --autostart and enter autostart mode. -} -checkAutoStart :: CmdParams -> IO () -checkAutoStart _ = ifM (elem "--autostart" <$> getArgs) +{- Run outside a git repository; support autostart and autostop mode. -} +checkNoRepoOpts :: CmdParams -> IO () +checkNoRepoOpts _ = ifM (elem "--autostart" <$> getArgs) ( autoStart Nothing - , error "Not in a git repository." + , ifM (elem "--autostop" <$> getArgs) + ( autoStop + , error "Not in a git repository." + ) ) autoStart :: Maybe Duration -> IO () @@ -89,3 +99,15 @@ autoStart startdelay = do [ Param "assistant" , Param $ "--startdelay=" ++ fromDuration (fromMaybe (Duration 5) startdelay) ] + +autoStop :: IO () +autoStop = do + dirs <- liftIO readAutoStartFile + program <- programPath + forM_ dirs $ \d -> do + putStrLn $ "git-annex autostop in " ++ d + setCurrentDirectory d + ifM (boolSystem program [Param "assistant", Param "--stop"]) + ( putStrLn "ok" + , putStrLn "failed" + ) diff --git a/debian/changelog b/debian/changelog index 38db4ee67..db428c5f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium on a file that doesn't exist. It will now continue to other files specified after that on the command line, and only error out at the end. + * assistant: Added --autostop to complement --autostart. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/git_annex_assistant_--stop_fails_if_not_run_from_inside_a_git_annex_repository.mdwn b/doc/bugs/git_annex_assistant_--stop_fails_if_not_run_from_inside_a_git_annex_repository.mdwn index 70ece97ec..61a01d73f 100644 --- a/doc/bugs/git_annex_assistant_--stop_fails_if_not_run_from_inside_a_git_annex_repository.mdwn +++ b/doc/bugs/git_annex_assistant_--stop_fails_if_not_run_from_inside_a_git_annex_repository.mdwn @@ -16,3 +16,6 @@ WantedBy=default.target """]] > This seems to overlap with [[todo/server-level_daemon__63__/]] in some way... --[[anarcat]] + +> Added --autostop and improved the docuemntation for --stop. [[done]] +> --[[Joey]] diff --git a/doc/git-annex-assistant.mdwn b/doc/git-annex-assistant.mdwn index a88a7019b..5c0f6408b 100644 --- a/doc/git-annex-assistant.mdwn +++ b/doc/git-annex-assistant.mdwn @@ -36,6 +36,11 @@ For more details about the git-annex assistant, see Stop a running daemon in the current repository. +* `--autostop` + + The complement to --autostart; stops all running daemons in the + repositories listed in the autostart file. + # SEE ALSO [[git-annex]](1) -- cgit v1.2.3 From 742bdf6353ac8e08fb603fe60b53c1495d4fa801 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 1 May 2015 15:33:29 -0400 Subject: Android: Updated bundled ssh from 6.1p1 to 6.4p1. Tested it builds, but have not run it yet. --- debian/changelog | 1 + ...ent_1_64bc9b8b7de6084a837f8b17269447b7._comment | 12 +++ standalone/android/openssh.config.h | 4 +- standalone/android/openssh.patch | 109 +++++++++------------ 4 files changed, 61 insertions(+), 65 deletions(-) create mode 100644 doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index db428c5f5..82243d93d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium files specified after that on the command line, and only error out at the end. * assistant: Added --autostop to complement --autostart. + * Android: Updated bundled ssh from 6.1p1 to 6.4p1. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment b/doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment new file mode 100644 index 000000000..083a05ce5 --- /dev/null +++ b/doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-05-01T19:24:18Z" + content=""" +git-annex for android bundles ssh from +git://github.com/CyanogenMod/android_external_openssh.git + +That has not yet been updated to a new enough ssh version to have this +feature. Will have to wait for it to be updated, or if I learn of a newer +port of ssh to android someplace I could change to it. +"""]] diff --git a/standalone/android/openssh.config.h b/standalone/android/openssh.config.h index 31e78e0b8..3464947e6 100644 --- a/standalone/android/openssh.config.h +++ b/standalone/android/openssh.config.h @@ -1,4 +1,6 @@ #define DISABLE_SHADOW 1 +#define HAVE_MBLEN 1 +#define HAVE_USLEEP 1 #define DISABLE_UTMP 1 #define DISABLE_UTMPX 1 #define DISABLE_WTMP 1 @@ -217,7 +219,7 @@ #define LOCKED_PASSWD_PREFIX "!" #define LOGIN_PROGRAM_FALLBACK "/bin/login" #define MISSING_FD_MASK 1 -#define MISSING_HOWMANY 1 +#define HAVE_DECL_HOWMANY 0 #define OPENSSL_HAS_ECC 1 #define OPENSSL_PRNG_ONLY 1 #define PACKAGE_BUGREPORT "openssh-unix-dev@mindrot.org" diff --git a/standalone/android/openssh.patch b/standalone/android/openssh.patch index 996143d0e..7eb7211f9 100644 --- a/standalone/android/openssh.patch +++ b/standalone/android/openssh.patch @@ -1,8 +1,8 @@ diff --git a/auth.c b/auth.c -index 6623e0f..dd10253 100644 +index 84fca58..63c3c3e 100644 --- a/auth.c +++ b/auth.c -@@ -337,7 +337,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) +@@ -364,7 +364,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) char *file, ret[MAXPATHLEN]; int i; @@ -11,7 +11,7 @@ index 6623e0f..dd10253 100644 "u", pw->pw_name, (char *)NULL); /* -@@ -347,7 +347,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) +@@ -374,7 +374,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) if (*file == '/') return (file); @@ -19,18 +19,18 @@ index 6623e0f..dd10253 100644 + i = snprintf(ret, sizeof(ret), "%s/%s", _PATH_ROOT_HOME_PREFIX, file); if (i < 0 || (size_t)i >= sizeof(ret)) fatal("expand_authorized_keys: path too long"); - xfree(file); -@@ -436,7 +436,7 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, + free(file); +@@ -463,7 +463,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir, strerror(errno)); return -1; } -- if (realpath(pw->pw_dir, homedir) != NULL) -+ if (realpath(_PATH_ROOT_HOME_PREFIX, homedir) != NULL) +- if (pw_dir != NULL && realpath(pw_dir, homedir) != NULL) ++ if (_PATH_ROOT_HOME_PREFIX != NULL && realpath(_PATH_ROOT_HOME_PREFIX, homedir) != NULL) comparehome = 1; - /* check the open file to avoid races */ + if (!S_ISREG(stp->st_mode)) { diff --git a/authfile.c b/authfile.c -index 7dd4496..00462e9 100644 +index 63ae16b..7b7841a 100644 --- a/authfile.c +++ b/authfile.c @@ -613,6 +613,7 @@ int @@ -42,7 +42,7 @@ index 7dd4496..00462e9 100644 if (fstat(fd, &st) < 0) return 0; diff --git a/misc.c b/misc.c -index 0bf2db6..4327d03 100644 +index 3b9792f..516e7ae 100644 --- a/misc.c +++ b/misc.c @@ -25,6 +25,7 @@ @@ -53,39 +53,20 @@ index 0bf2db6..4327d03 100644 #include #include -@@ -538,12 +539,13 @@ tilde_expand_filename(const char *filename, uid_t uid) - } else if ((pw = getpwuid(uid)) == NULL) /* ~/path */ +@@ -539,8 +540,9 @@ tilde_expand_filename(const char *filename, uid_t uid) fatal("tilde_expand_filename: No such uid %ld", (long)uid); -- if (strlcpy(ret, pw->pw_dir, sizeof(ret)) >= sizeof(ret)) -+ char *pw_dir=_PATH_ROOT_HOME_PREFIX; -+ if (strlcpy(ret, pw_dir, sizeof(ret)) >= sizeof(ret)) - fatal("tilde_expand_filename: Path too long"); - /* Make sure directory has a trailing '/' */ - len = strlen(pw->pw_dir); -- if ((len == 0 || pw->pw_dir[len - 1] != '/') && +- if (len == 0 || pw->pw_dir[len - 1] != '/') ++ char *pw_dir=_PATH_ROOT_HOME_PREFIX; + len = strlen(pw_dir); -+ if ((len == 0 || pw_dir[len - 1] != '/') && - strlcat(ret, "/", sizeof(ret)) >= sizeof(ret)) - fatal("tilde_expand_filename: Path too long"); - -diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c -index d2bea21..5b5d599 100644 ---- a/openbsd-compat/getrrsetbyname.c -+++ b/openbsd-compat/getrrsetbyname.c -@@ -56,8 +56,7 @@ - #include - - #include "getrrsetbyname.h" --#include "nameser.h" --#include "nameser_compat.h" -+#include "arpa/nameser.h" - - #if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO - extern int h_errno; ++ if (len == 0 || pw_dir[len - 1] != '/') + sep = "/"; + else + sep = ""; diff --git a/pathnames.h b/pathnames.h -index b7b9d91..3c10b11 100644 +index 3b7584c..1103266 100644 --- a/pathnames.h +++ b/pathnames.h @@ -67,7 +67,7 @@ @@ -98,23 +79,23 @@ index b7b9d91..3c10b11 100644 /* diff --git a/readconf.c b/readconf.c -index 097bb05..dcbc008 100644 +index e22c952..87c1c8a 100644 --- a/readconf.c +++ b/readconf.c -@@ -1085,7 +1085,7 @@ read_config_file(const char *filename, const char *host, Options *options, +@@ -1113,7 +1113,7 @@ read_config_file(const char *filename, const char *host, Options *options, if ((f = fopen(filename, "r")) == NULL) return 0; -- if (checkperm) { -+ if (checkperm && 0) { +- if (flags & SSHCONF_CHECKPERM) { ++ if (0) { struct stat sb; if (fstat(fileno(f), &sb) == -1) diff --git a/ssh-add.c b/ssh-add.c -index 738644d..f6fce4a 100644 +index 5e8166f..f0edc30 100644 --- a/ssh-add.c +++ b/ssh-add.c -@@ -471,7 +471,7 @@ main(int argc, char **argv) +@@ -496,7 +496,7 @@ main(int argc, char **argv) } for (i = 0; default_files[i]; i++) { @@ -124,32 +105,32 @@ index 738644d..f6fce4a 100644 if (stat(buf, &st) < 0) continue; diff --git a/ssh-keygen.c b/ssh-keygen.c -index 4baf7df..ef8bb25 100644 +index 40ba5e3..82c2ebf 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c -@@ -224,7 +224,7 @@ ask_filename(struct passwd *pw, const char *prompt) +@@ -228,7 +228,7 @@ ask_filename(struct passwd *pw, const char *prompt) } } snprintf(identity_file, sizeof(identity_file), "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, name); -+ _PATH_ROOT_HOME_PREFIX, name); +- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, name); ++ _PATH_ROOT_HOME_PREFIX, name); fprintf(stderr, "%s (%s): ", prompt, identity_file); if (fgets(buf, sizeof(buf), stdin) == NULL) exit(1); -@@ -2268,7 +2268,7 @@ main(int argc, char **argv) +@@ -2561,7 +2561,7 @@ main(int argc, char **argv) /* Create ~/.ssh directory if it doesn't already exist. */ snprintf(dotsshdir, sizeof dotsshdir, "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, -+ _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_DIR); +- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, ++ _PATH_ROOT_HOME_PREFIX, + _PATH_SSH_USER_DIR); if (strstr(identity_file, dotsshdir) != NULL) { if (stat(dotsshdir, &st) < 0) { diff --git a/ssh.c b/ssh.c -index 898e966..ef6c858 100644 +index 1e2cdd5..cc48c2d 100644 --- a/ssh.c +++ b/ssh.c -@@ -703,7 +703,7 @@ main(int ac, char **av) +@@ -707,7 +707,7 @@ main(int ac, char **av) fatal("Can't open user config file %.100s: " "%.100s", config, strerror(errno)); } else { @@ -157,8 +138,8 @@ index 898e966..ef6c858 100644 + r = snprintf(buf, sizeof buf, "%s/%s", _PATH_ROOT_HOME_PREFIX, _PATH_SSH_USER_CONFFILE); if (r > 0 && (size_t)r < sizeof(buf)) - (void)read_config_file(buf, host, &options, 1); -@@ -748,7 +748,7 @@ main(int ac, char **av) + (void)read_config_file(buf, host, &options, +@@ -773,7 +773,7 @@ main(int ac, char **av) if (options.local_command != NULL) { debug3("expanding LocalCommand: %s", options.local_command); cp = options.local_command; @@ -167,16 +148,16 @@ index 898e966..ef6c858 100644 "h", host, "l", thishost, "n", host_arg, "r", options.user, "p", portstr, "u", pw->pw_name, "L", shorthost, (char *)NULL); -@@ -888,7 +888,7 @@ main(int ac, char **av) +@@ -913,7 +913,7 @@ main(int ac, char **av) */ if (config == NULL) { r = snprintf(buf, sizeof buf, "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, -+ _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_DIR); +- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, ++ _PATH_ROOT_HOME_PREFIX, + _PATH_SSH_USER_DIR); if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) { #ifdef WITH_SELINUX -@@ -1532,7 +1532,7 @@ load_public_identity_files(void) +@@ -1565,7 +1565,7 @@ load_public_identity_files(void) if ((pw = getpwuid(original_real_uid)) == NULL) fatal("load_public_identity_files: getpwuid failed"); pwname = xstrdup(pw->pw_name); @@ -186,7 +167,7 @@ index 898e966..ef6c858 100644 fatal("load_public_identity_files: gethostname: %s", strerror(errno)); diff --git a/uidswap.c b/uidswap.c -index bc6194e..5cbf5d1 100644 +index 50d20d6..d226cc9 100644 --- a/uidswap.c +++ b/uidswap.c @@ -28,7 +28,6 @@ @@ -194,10 +175,10 @@ index bc6194e..5cbf5d1 100644 #ifdef ANDROID -#include - #include + #include #include #endif -@@ -230,7 +229,7 @@ permanently_set_uid(struct passwd *pw) +@@ -216,7 +215,7 @@ permanently_set_uid(struct passwd *pw) debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, (u_int)pw->pw_gid); @@ -206,7 +187,7 @@ index bc6194e..5cbf5d1 100644 if (pw->pw_uid == AID_SHELL) { prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0); -@@ -317,7 +316,7 @@ permanently_set_uid(struct passwd *pw) +@@ -281,7 +280,7 @@ permanently_set_uid(struct passwd *pw) (u_int)pw->pw_uid); } -- cgit v1.2.3 From 37705c7157dd2190fee7da528024211b084412c0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 May 2015 13:53:06 -0400 Subject: Work around wget bug #784348 which could cause it to clobber git-annex symlinks when downloading from ftp. --- Utility/Url.hs | 16 ++++++++++++---- debian/changelog | 2 ++ ...4___after___34__git_annex_addurl_--file__34__.mdwn | 2 ++ ...omment_1_dca81d5db9a966fc992ed28bb3c2a242._comment | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__/comment_1_dca81d5db9a966fc992ed28bb3c2a242._comment (limited to 'debian/changelog') diff --git a/Utility/Url.hs b/Utility/Url.hs index 1b0c394b7..9c5d6a708 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -25,6 +25,9 @@ module Utility.Url ( ) where import Common +import Utility.Tmp +import qualified Build.SysConfig + import Network.URI import Network.HTTP.Conduit import Network.HTTP.Types @@ -32,8 +35,6 @@ import qualified Data.CaseInsensitive as CI import qualified Data.ByteString as B import qualified Data.ByteString.UTF8 as B8 -import qualified Build.SysConfig - type URLString = String type Headers = [String] @@ -242,8 +243,15 @@ download' quiet url file uo = do writeFile file "" go "curl" $ headerparams ++ quietopt "-s" ++ [Params "-f -L -C - -# -o"] - go cmd opts = boolSystem cmd $ - addUserAgent uo $ reqParams uo++opts++[File file, File url] + + {- Run wget in a temp directory because it has been buggy + - and overwritten files in the current directory, even though + - it was asked to write to a file elsewhere. -} + go cmd opts = withTmpDir "downloadurl" $ \tmp -> do + relfile <- relPathDirToFile tmp file + let ps = addUserAgent uo $ reqParams uo++opts++[File relfile, File url] + boolSystem' cmd ps $ \p -> p { cwd = Just tmp } + quietopt s | quiet = [Param s] | otherwise = [] diff --git a/debian/changelog b/debian/changelog index 82243d93d..d7efa4228 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium the end. * assistant: Added --autostop to complement --autostart. * Android: Updated bundled ssh from 6.1p1 to 6.4p1. + * Work around wget bug #784348 which could cause it to clobber git-annex + symlinks when downloading from ftp. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn b/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn index 0c9755385..d9ab7670d 100644 --- a/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn +++ b/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn @@ -103,3 +103,5 @@ $ # End of transcript or log. """]] + +> workaround in place; [[done]] --[[Joey]] diff --git a/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__/comment_1_dca81d5db9a966fc992ed28bb3c2a242._comment b/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__/comment_1_dca81d5db9a966fc992ed28bb3c2a242._comment new file mode 100644 index 000000000..65ebab1f2 --- /dev/null +++ b/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__/comment_1_dca81d5db9a966fc992ed28bb3c2a242._comment @@ -0,0 +1,19 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-05-05T17:11:38Z" + content=""" +Thanks for a great bug report! + +Unfortunately, this turns out to be a bug in wget, as shown by this transcript: + + joey@darkstar:~/tmp/y>ls + README@ + joey@darkstar:~/tmp/y>wget -q --show-progress --clobber -c -O .git/annex/tmp/SHA256E-s1495--8822780b87a880ca9956ac108812557044618859cecb07df488df57e8134e34f ftp://ftp.funet.fi/pub/Linux/mirrors/debian/README --user-agent git-annex/5.20150505-gcdb212f + joey@darkstar:~/tmp/y>ls + joey@darkstar:~/tmp/y> + +I have filed a bug report on wget , +and I guess I'll try to work around it in git-annex by running wget +inside an empty temp directory. +"""]] -- cgit v1.2.3 From 4315fd674b0e9163f0026d8d164f03be53124b9f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 May 2015 14:05:02 -0400 Subject: Support checking ftp urls for file presence. --- Utility/Url.hs | 10 +++++++--- debian/changelog | 1 + ...ex_get__34___after___34__git_annex_addurl_--file__34__.mdwn | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'debian/changelog') diff --git a/Utility/Url.hs b/Utility/Url.hs index 9c5d6a708..1d34b558f 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -123,10 +123,14 @@ getUrlInfo url uo = case parseURIRelaxed url of | Build.SysConfig.curl -> do output <- catchDefaultIO "" $ readProcess "curl" $ toCommand curlparams + let len = extractlencurl output + let good = found len Nothing case lastMaybe (lines output) of - Just ('2':_:_) -> found - (extractlencurl output) - Nothing + Just ('2':_:_) -> good + -- don't try to parse ftp status + -- codes; if curl got a length, + -- it's good + _ | "ftp" `isInfixOf` uriScheme u && isJust len -> good _ -> dne | otherwise -> dne Nothing -> dne diff --git a/debian/changelog b/debian/changelog index d7efa4228..39bfe5748 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * Android: Updated bundled ssh from 6.1p1 to 6.4p1. * Work around wget bug #784348 which could cause it to clobber git-annex symlinks when downloading from ftp. + * Support checking ftp urls for file presence. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn b/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn index d9ab7670d..1081b7acf 100644 --- a/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn +++ b/doc/bugs/git-annex_deletes_file_when_using___34__git_annex_get__34___after___34__git_annex_addurl_--file__34__.mdwn @@ -105,3 +105,8 @@ $ """]] > workaround in place; [[done]] --[[Joey]] + +> Also, fixed it to allow dropping the file if the ftp server seems +> to reply with a successful result (it's replying with 350, which is not +> unambiguously good, but since curl is able to get the right file length, +> the file is presumably still on the ftp server. --[[Joey]] -- cgit v1.2.3 From 2bbb276e38fb8503daccf7a419336d67c0a23c9c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 May 2015 13:44:53 -0400 Subject: contentlocation, examinekey, lookupkey: Added --batch mode option. --- CmdLine/Batch.hs | 41 ++++++++++++++++++++++++++++++++++++++ Command/ContentLocation.hs | 11 +++++----- Command/ExamineKey.hs | 9 +++++---- Command/LookupKey.hs | 12 ++++++----- debian/changelog | 1 + doc/git-annex-contentlocation.mdwn | 11 ++++++++++ doc/git-annex-examinekey.mdwn | 5 +++++ doc/git-annex-lookupkey.mdwn | 10 ++++++++++ 8 files changed, 86 insertions(+), 14 deletions(-) create mode 100644 CmdLine/Batch.hs (limited to 'debian/changelog') diff --git a/CmdLine/Batch.hs b/CmdLine/Batch.hs new file mode 100644 index 000000000..836472eb0 --- /dev/null +++ b/CmdLine/Batch.hs @@ -0,0 +1,41 @@ +{- git-annex batch commands + - + - Copyright 2015 Joey Hess + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module CmdLine.Batch where + +import Common.Annex +import Command + +batchOption :: Option +batchOption = flagOption [] "batch" "enable batch mode" + +data BatchMode = Batch | NoBatch +type Batchable t = BatchMode -> t -> CommandStart + +-- A Batchable command can run in batch mode, or not. +-- In batch mode, one line at a time is read, parsed, and a reply output to +-- stdout. In non batch mode, the command's parameters are parsed and +-- a reply output for each. +batchable :: ((t -> CommandStart) -> CommandSeek) -> Batchable t -> CommandSeek +batchable seeker starter params = ifM (getOptionFlag batchOption) + ( batchloop + , seeker (starter NoBatch) params + ) + where + batchloop = do + mp <- liftIO $ catchMaybeIO getLine + case mp of + Nothing -> return () + Just p -> do + seeker (starter Batch) [p] + batchloop + +-- bad input is indicated by an empty line in batch mode. In non batch +-- mode, exit on bad input. +batchBadInput :: BatchMode -> Annex () +batchBadInput NoBatch = liftIO exitFailure +batchBadInput Batch = liftIO $ putStrLn "" diff --git a/Command/ContentLocation.hs b/Command/ContentLocation.hs index 3f4775f57..10879f5b1 100644 --- a/Command/ContentLocation.hs +++ b/Command/ContentLocation.hs @@ -9,19 +9,20 @@ module Command.ContentLocation where import Common.Annex import Command +import CmdLine.Batch import Annex.Content cmd :: [Command] -cmd = [noCommit $ noMessages $ +cmd = [withOptions [batchOption] $ noCommit $ noMessages $ command "contentlocation" (paramRepeating paramKey) seek SectionPlumbing "looks up content for a key"] seek :: CommandSeek -seek = withKeys start +seek = batchable withKeys start -start :: Key -> CommandStart -start k = do - liftIO . maybe exitFailure putStrLn +start :: Batchable Key +start batchmode k = do + maybe (batchBadInput batchmode) (liftIO . putStrLn) =<< inAnnex' (pure True) Nothing check k stop where diff --git a/Command/ExamineKey.hs b/Command/ExamineKey.hs index 00d4d3a95..05db9817a 100644 --- a/Command/ExamineKey.hs +++ b/Command/ExamineKey.hs @@ -9,21 +9,22 @@ module Command.ExamineKey where import Common.Annex import Command +import CmdLine.Batch import qualified Utility.Format import Command.Find (formatOption, getFormat, showFormatted, keyVars) import Types.Key cmd :: [Command] -cmd = [noCommit $ noMessages $ withOptions [formatOption, jsonOption] $ +cmd = [noCommit $ noMessages $ withOptions [formatOption, jsonOption, batchOption] $ command "examinekey" (paramRepeating paramKey) seek SectionPlumbing "prints information from a key"] seek :: CommandSeek seek ps = do format <- getFormat - withKeys (start format) ps + batchable withKeys (start format) ps -start :: Maybe Utility.Format.Format -> Key -> CommandStart -start format key = do +start :: Maybe Utility.Format.Format -> Batchable Key +start format _ key = do showFormatted format (key2file key) (keyVars key) stop diff --git a/Command/LookupKey.hs b/Command/LookupKey.hs index 0485232ae..6e7f07049 100644 --- a/Command/LookupKey.hs +++ b/Command/LookupKey.hs @@ -9,18 +9,20 @@ module Command.LookupKey where import Common.Annex import Command +import CmdLine.Batch import Annex.CatFile import Types.Key cmd :: [Command] -cmd = [notBareRepo $ noCommit $ noMessages $ +cmd = [withOptions [batchOption] $ notBareRepo $ noCommit $ noMessages $ command "lookupkey" (paramRepeating paramFile) seek SectionPlumbing "looks up key used for file"] seek :: CommandSeek -seek = withStrings start +seek = batchable withStrings start -start :: String -> CommandStart -start file = do - liftIO . maybe exitFailure (putStrLn . key2file) =<< catKeyFile file +start :: Batchable String +start batchmode file = do + maybe (batchBadInput batchmode) (liftIO . putStrLn . key2file) + =<< catKeyFile file stop diff --git a/debian/changelog b/debian/changelog index 39bfe5748..f9a0aee93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * Work around wget bug #784348 which could cause it to clobber git-annex symlinks when downloading from ftp. * Support checking ftp urls for file presence. + * contentlocation, examinekey, lookupkey: Added --batch mode option. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/git-annex-contentlocation.mdwn b/doc/git-annex-contentlocation.mdwn index 128622bc8..a090e3754 100644 --- a/doc/git-annex-contentlocation.mdwn +++ b/doc/git-annex-contentlocation.mdwn @@ -16,6 +16,17 @@ Note that in direct mode, the file will typically be in the git work tree, and while its content should correspond to the key, the file could become modified at any time after git-annex checks it. +# OPTIONS + +* `--batch` + + Enable batch mode, in which a line containing the key is read from + stdin, the filename to its content is output to stdout (with a trailing + newline), and repeat. + + Note that if a key's content is not present, an empty line is output to + stdout instead. + # SEE ALSO [[git-annex]](1) diff --git a/doc/git-annex-examinekey.mdwn b/doc/git-annex-examinekey.mdwn index 3a8159f66..49bc95711 100644 --- a/doc/git-annex-examinekey.mdwn +++ b/doc/git-annex-examinekey.mdwn @@ -33,6 +33,11 @@ that can be determined purely by looking at the key. Enable JSON output. This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object. +* `--batch` + + Enable batch mode, in which a line containing a key is read from stdin, + the information about it is output to stdout, and repeat. + # EXAMPLES The location a key's value is stored (in indirect mode) diff --git a/doc/git-annex-lookupkey.mdwn b/doc/git-annex-lookupkey.mdwn index 568bbdc05..154b4a753 100644 --- a/doc/git-annex-lookupkey.mdwn +++ b/doc/git-annex-lookupkey.mdwn @@ -13,6 +13,16 @@ index. The key is output to stdout. If there is no key (because the file is not present in the index, or is not a git-annex managed file), nothing is output, and it exits nonzero. +# OPTIONS + +* `--batch` + + Enable batch mode, in which a line containing the filename is read from + stdin, the key is output to stdout (with a trailing newline), and repeat. + + Note that is there is no key corresponding to the file, an empty line is + output to stdout instead. + # SEE ALSO [[git-annex]](1) -- cgit v1.2.3 From 137cac6e685732504da466a05590b69ce0eb93a7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 May 2015 14:45:20 -0400 Subject: fsck: Ignore error recording the fsck in the activity log, which can happen when running fsck in a read-only repository. Closes: #698559 (fsck can still need to write to the repository if it find problems, but a successful fsck can be done read-only) --- Command/Fsck.hs | 2 +- debian/changelog | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'debian/changelog') diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 46d7c2e77..be59484d9 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -76,7 +76,7 @@ seek ps = do (withFilesInGit $ whenAnnexed $ start from i) ps withFsckDb i FsckDb.closeDb - recordActivity Fsck u + void $ tryIO $ recordActivity Fsck u start :: Maybe Remote -> Incremental -> FilePath -> Key -> CommandStart start from inc file key = do diff --git a/debian/changelog b/debian/changelog index f9a0aee93..ef1357324 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,11 @@ git-annex (5.20150421) UNRELEASED; urgency=medium symlinks when downloading from ftp. * Support checking ftp urls for file presence. * contentlocation, examinekey, lookupkey: Added --batch mode option. + * fsck: Ignore error recording the fsck in the activity log, + which can happen when running fsck in a read-only repository. + Closes: #698559 + (fsck can still need to write to the repository if it find problems, + but a successful fsck can be done read-only) -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From c60ba579661ed502d361eca0e7ce94c8a6544fc7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 May 2015 15:43:36 -0400 Subject: Windows: Remove cygwin ssh, the newer version of which has stopped honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. --- Build/BundledPrograms.hs | 5 +++-- Build/NullSoftInstaller.hs | 5 ++++- debian/changelog | 2 ++ doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn | 26 ++++++++++++++++++++---- 4 files changed, 31 insertions(+), 7 deletions(-) (limited to 'debian/changelog') diff --git a/Build/BundledPrograms.hs b/Build/BundledPrograms.hs index 1e826cb10..4ceee3b52 100644 --- a/Build/BundledPrograms.hs +++ b/Build/BundledPrograms.hs @@ -35,13 +35,14 @@ bundledPrograms = catMaybes #endif , Just "rsync" #ifndef darwin_HOST_OS +#ifndef mingw32_HOST_OS -- OS X has ssh installed by default. -- Linux probably has ssh, but not guaranteed. - -- On Windows, msysgit provides ssh, but not in PATH, - -- so we ship our own. + -- On Windows, msysgit provides ssh. , Just "ssh" , Just "ssh-keygen" #endif +#endif #ifndef mingw32_HOST_OS , Just "sh" #endif diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs index 0abd07f95..e9a22d843 100644 --- a/Build/NullSoftInstaller.hs +++ b/Build/NullSoftInstaller.hs @@ -92,7 +92,7 @@ uninstaller = "git-annex-uninstall.exe" gitInstallDir :: Exp FilePath gitInstallDir = fromString "$PROGRAMFILES\\Git" --- This intentionall has a different name than git-annex or +-- This intentionally has a different name than git-annex or -- git-annex-webapp, since it is itself treated as an executable file. -- Also, on XP, the filename is displayed, not the description. startMenuItem :: Exp FilePath @@ -152,6 +152,9 @@ makeInstaller gitannex license htmlhelp extrabins launchers = nsis $ do section "cmd" [] $ do setOutPath "$INSTDIR\\cmd" mapM_ addfile (gitannex:extrabins) + -- copy msysgit's ssh into cmd so it's always in PATH + -- (bin is only in PATH from git bash) + copyFiles [] "$INSTDIR\\bin\\ssh.exe" "$INSTDIR\\cmd\\ssh.exe" section "meta" [] $ do setOutPath "$INSTDIR\\doc\\git\\html" addfile htmlhelp diff --git a/debian/changelog b/debian/changelog index ef1357324..d59e21bcc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium Closes: #698559 (fsck can still need to write to the repository if it find problems, but a successful fsck can be done read-only) + * Windows: Remove cygwin ssh, the newer version of which has stopped + honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn b/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn index 47f061659..cb58e009f 100644 --- a/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn +++ b/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn @@ -14,10 +14,13 @@ Problem doesn't seem to affect the bundled ssh, just rsync. --[[Joey]] > So the workaround is to > delete Git/bin/ssh.exe and leave Git/cmd/ssh.exe. Then rsync works. > However, this may screw up git's use of ssh or other stuff. +> +> Particularly, cygwin's ssh doesn't honor HOME anymore, instead using +> the getpwent home, which doesn't exist. > > Also, see > [[webapp_fails_to_connect_to_ssh_repository___40__windows__41__]] -> which is the inverse of this bug. +> which is the inverse of this bug perhaps, or at least seems related. > > Using 2 ssh's that try to use config from different places seems like > a losing propisition. Need to find an rsync that works with git's ssh. @@ -38,13 +41,28 @@ Problem doesn't seem to affect the bundled ssh, just rsync. --[[Joey]] >>> Possible fixes: >>> >>> * Roll the bundled ssh and rsync back to the older versions. ->>> (But, this seems like it would leave ->>> [[webapp_fails_to_connect_to_ssh_repository___40__windows__41__]] ->>> unfixed, unless the old version of ssh didn't have that problem.) +>>> +>>> **This works**. And, seems that the older version of ssh from cygwin +>>> looks at HOME, rather than getpwent home which the newer +>>> cygwin ssh does. +>>> >>> * Roll the bundled rsync back, drop ssh. Rely on msysgit's bundled ssh, >>> copying it into cmd so it's in PATH. Check: Does this combo work? +>>> +>>> **This works**! rsync 3.0.9 works ok with msysgit's bundled ssh. +>>> rsync 3.1.1 is the one that needs a newer ssh. +>>> +>>> Note that this means we're using an old version of rsync +>>> from cygwin with libraries from a newer cygwin. That might prove +>>> fragile as cygwin is upgraded. +>>> >>> * Hope that msysgit gets updated to include a newer version of ssh >>> which works with the new rsync. +>>> +>>> (Seems reasonable as a long-term plan, assuming that the +>>> new rsync's problem with ssh is that it needs a new one, and not some +>>> special cygwin thing.) +>>> >>> * Get rsync from somewhere else, perhaps msysgit. (Maybe also get ssh >>> from msysgit?) >>> * Keep the new rsync from cygwin, and build ssh from source, -- cgit v1.2.3 From dccdfc88f82c622a761f371d9140974d44fdc871 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 May 2015 15:56:40 -0400 Subject: Windows: Roll back to an older version of rsync from cygwin. The newer version has some dependency on a newer ssh from cygwin. --- debian/changelog | 2 ++ doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn | 2 +- standalone/windows/build.sh | 9 +++++---- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index d59e21bcc..e5e7ed13e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,6 +38,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium but a successful fsck can be done read-only) * Windows: Remove cygwin ssh, the newer version of which has stopped honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. + * Windows: Roll back to an older version of rsync from cygwin. + The newer version has some dependency on a newer ssh from cygwin. -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn b/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn index cb58e009f..929770ccc 100644 --- a/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn +++ b/doc/bugs/rsync_on_windows_broken_by_upgrade.mdwn @@ -50,7 +50,7 @@ Problem doesn't seem to affect the bundled ssh, just rsync. --[[Joey]] >>> copying it into cmd so it's in PATH. Check: Does this combo work? >>> >>> **This works**! rsync 3.0.9 works ok with msysgit's bundled ssh. ->>> rsync 3.1.1 is the one that needs a newer ssh. +>>> rsync 3.1.1 is the one that needs a newer ssh. **[[done]]** >>> >>> Note that this means we're using an old version of rsync >>> from cygwin with libraries from a newer cygwin. That might prove diff --git a/standalone/windows/build.sh b/standalone/windows/build.sh index ef990004c..0eb06c8ef 100755 --- a/standalone/windows/build.sh +++ b/standalone/windows/build.sh @@ -16,9 +16,6 @@ PATH="/c/Program Files (x86)/NSIS:/c/msysgit/cmd:/c/msysgit/bin:$PATH" withcyg () { PATH="$PATH:/c/cygwin/bin" "$@" } -withcygpreferred () { - PATH="/c/cygwin/bin:$PATH" "$@" -} # This tells git-annex where to upgrade itself from. UPGRADE_LOCATION=http://downloads.kitenet.net/git-annex/windows/current/git-annex-installer.exe @@ -70,7 +67,11 @@ cabal install nsis ghc -fforce-recomp --make Build/NullSoftInstaller.hs # Want to include cygwin programs in bundle, not others, since # it includes the cygwin libs that go with them. -withcygpreferred Build/NullSoftInstaller.exe +# Currently need an older version of rsync than the one from cygwin. +if [ ! -e rsync.exe ]; then + wget https://downloads.kitenet.net/git-annex/windows/assets/rsync.exe +fi +PATH=".:/c/cygwin/bin:$PATH" withcygpreferred Build/NullSoftInstaller.exe rm -f last-incremental-failed -- cgit v1.2.3 From b116facc4a99ee63c82fa2ecec0de634c908c236 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 May 2015 18:07:13 -0400 Subject: remaining dataenc to sandi conversions I've tested all the dataenc to sandi conversions except Assistant.XMPP, and all have unchanged behavior, including behavior on large unicode code points. --- Assistant/XMPP.hs | 7 ++++--- Remote/Helper/Encryptable.hs | 9 +++++---- debian/changelog | 2 ++ debian/control | 2 +- doc/todo/replace_dataenc_with_sandi.mdwn | 2 ++ standalone/android/cabal.config | 2 +- 6 files changed, 15 insertions(+), 9 deletions(-) (limited to 'debian/changelog') diff --git a/Assistant/XMPP.hs b/Assistant/XMPP.hs index b9ae50e27..52cd31939 100644 --- a/Assistant/XMPP.hs +++ b/Assistant/XMPP.hs @@ -22,7 +22,8 @@ import qualified Data.Map as M import Data.ByteString (ByteString) import qualified Data.ByteString as B import Data.XML.Types -import qualified "dataenc" Codec.Binary.Base64 as B64 +import qualified "sandi" Codec.Binary.Base64 as B64 +import Data.Bits.Utils {- Name of the git-annex tag, in our own XML namespace. - (Not using a namespace URL to avoid unnecessary bloat.) -} @@ -212,10 +213,10 @@ encodeExitCode (ExitFailure n) = n {- Base 64 encoding a ByteString to use as the content of a tag. -} encodeTagContent :: ByteString -> [Node] -encodeTagContent b = [NodeContent $ ContentText $ T.pack $ B64.encode $ B.unpack b] +encodeTagContent b = [NodeContent $ ContentText $ T.pack $ w82s $ B.unpack $ B64.encode b] decodeTagContent :: Element -> Maybe ByteString -decodeTagContent elt = B.pack <$> B64.decode s +decodeTagContent elt = either (const Nothing) Just (B64.decode $ B.pack $ s2w8 s) where s = T.unpack $ T.concat $ elementText elt diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs index 2c1935ba9..3395db978 100644 --- a/Remote/Helper/Encryptable.hs +++ b/Remote/Helper/Encryptable.hs @@ -20,7 +20,8 @@ module Remote.Helper.Encryptable ( ) where import qualified Data.Map as M -import qualified "dataenc" Codec.Binary.Base64 as B64 +import qualified "sandi" Codec.Binary.Base64 as B64 +import qualified Data.ByteString as B import Data.Bits.Utils import Common.Annex @@ -172,12 +173,12 @@ describeEncryption c = case extractCipher c of ] {- Not using Utility.Base64 because these "Strings" are really - - bags of bytes and that would convert to unicode and not roung-trip + - bags of bytes and that would convert to unicode and not round-trip - cleanly. -} toB64bs :: String -> String -toB64bs = B64.encode . s2w8 +toB64bs = w82s . B.unpack . B64.encode . B.pack . s2w8 fromB64bs :: String -> String -fromB64bs s = fromMaybe bad $ w82s <$> B64.decode s +fromB64bs s = either (const bad) (w82s . B.unpack) (B64.decode $ B.pack $ s2w8 s) where bad = error "bad base64 encoded data" diff --git a/debian/changelog b/debian/changelog index e5e7ed13e..932b022fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,6 +40,8 @@ git-annex (5.20150421) UNRELEASED; urgency=medium honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. * Windows: Roll back to an older version of rsync from cygwin. The newer version has some dependency on a newer ssh from cygwin. + * Switch from the obsolete dataenc library for base64 encoding to sandi. + (Thanks, Magnus Therning) -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 diff --git a/debian/control b/debian/control index ce7ce7504..133c2ee49 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Build-Depends: libghc-hslogger-dev, libghc-pcre-light-dev, libghc-cryptohash-dev (>= 0.11.0), - libghc-dataenc-dev, + libghc-sandi-dev, libghc-utf8-string-dev, libghc-aws-dev (>= 0.9.2-2~), libghc-conduit-dev, diff --git a/doc/todo/replace_dataenc_with_sandi.mdwn b/doc/todo/replace_dataenc_with_sandi.mdwn index a35e54efd..9ce29663b 100644 --- a/doc/todo/replace_dataenc_with_sandi.mdwn +++ b/doc/todo/replace_dataenc_with_sandi.mdwn @@ -2,3 +2,5 @@ sandi is available in jessie, but not wheezy, so this is pending EOL of wheezy support. --[[Joey]] + +> [[fixed|done]] --[[Joey]] diff --git a/standalone/android/cabal.config b/standalone/android/cabal.config index f39dee91f..de7d72dc0 100644 --- a/standalone/android/cabal.config +++ b/standalone/android/cabal.config @@ -54,7 +54,7 @@ constraints: Crypto ==4.2.5.1, data-default-instances-containers ==0.0.1, data-default-instances-dlist ==0.0.1, data-default-instances-old-locale ==0.0.1, - dataenc ==0.14.0.7, + sandi ==0.3.0.1, dbus ==0.10.8, distributive ==0.4.4, dlist ==0.7.0.1, -- cgit v1.2.3 From d81fd516eb3db88bc230b49c38064b434f8931bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 May 2015 18:12:08 -0400 Subject: reorder --- debian/changelog | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 932b022fc..806bbd7ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,14 @@ git-annex (5.20150421) UNRELEASED; urgency=medium + * Improve behavior when a git-annex command is told to operate + on a file that doesn't exist. It will now continue to other + files specified after that on the command line, and only error out at + the end. * S3: Enable debug logging when annex.debug or --debug is set. - * Dropped support for older versions of yesod, warp, and dbus than the ones - in Debian Jessie. * S3: git annex info will show additional information about a S3 remote (endpoint, port, storage class) * S3: Let git annex enableremote be used, without trying to recreate a bucket that should already exist. - * Fix bogus failure of fsck --fast. * S3: Fix incompatability with bucket names used by hS3; the aws library cannot handle upper-case bucket names. git-annex now converts them to lower case automatically. @@ -15,33 +16,32 @@ git-annex (5.20150421) UNRELEASED; urgency=medium (Needs git 1.8.4 or newer.) * import: Don't stop entire import when one file fails due to being gitignored or conflicting with something in the work tree. - * Improve integration with KDE's file manager to work with dolphin - version 14.12.3 while still being compatable with 4.14.2. - Thanks, silvio. * import: Before removing a duplicate file in --deduplicate or --clean-duplicates mode, verify that enough copies of its content still exist. - * Improve behavior when a git-annex command is told to operate - on a file that doesn't exist. It will now continue to other - files specified after that on the command line, and only error out at - the end. + * Improve integration with KDE's file manager to work with dolphin + version 14.12.3 while still being compatable with 4.14.2. + Thanks, silvio. * assistant: Added --autostop to complement --autostart. - * Android: Updated bundled ssh from 6.1p1 to 6.4p1. * Work around wget bug #784348 which could cause it to clobber git-annex symlinks when downloading from ftp. * Support checking ftp urls for file presence. + * Fix bogus failure of fsck --fast. * contentlocation, examinekey, lookupkey: Added --batch mode option. * fsck: Ignore error recording the fsck in the activity log, which can happen when running fsck in a read-only repository. Closes: #698559 (fsck can still need to write to the repository if it find problems, but a successful fsck can be done read-only) + * Dropped support for older versions of yesod, warp, and dbus than the ones + in Debian Jessie. + * Switch from the obsolete dataenc library for base64 encoding to sandi. + (Thanks, Magnus Therning) + * Android: Updated bundled ssh from 6.1p1 to 6.4p1. * Windows: Remove cygwin ssh, the newer version of which has stopped honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. * Windows: Roll back to an older version of rsync from cygwin. The newer version has some dependency on a newer ssh from cygwin. - * Switch from the obsolete dataenc library for base64 encoding to sandi. - (Thanks, Magnus Therning) -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 -- cgit v1.2.3 From 94aceb2c601b64f5ea058d4f8c43938bf27cf69c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 May 2015 19:09:44 -0400 Subject: Debian's ghc now supports TH on arm! Adjust build dependencies to build the webapp on arm, and enable DAV support on arm. \o/ Also, adjust some other arch specific build dependencies that are now available on more architectures in Devian unstable. --- debian/changelog | 4 ++++ debian/control | 39 +++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 20 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 806bbd7ca..389160121 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,10 @@ git-annex (5.20150421) UNRELEASED; urgency=medium in Debian Jessie. * Switch from the obsolete dataenc library for base64 encoding to sandi. (Thanks, Magnus Therning) + * Debian's ghc now supports TH on arm! Adjust build dependencies + to build the webapp on arm, and enable DAV support on arm. \o/ + * Adjust some other arch specific build dependencies that are now + available on more architectures in Devian unstable. * Android: Updated bundled ssh from 6.1p1 to 6.4p1. * Windows: Remove cygwin ssh, the newer version of which has stopped honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. diff --git a/debian/control b/debian/control index db58dbe0b..40cea9e6c 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: libghc-aws-dev (>= 0.9.2-2~), libghc-conduit-dev, libghc-resourcet-dev, - libghc-dav-dev (>= 1.0) [amd64 i386 kfreebsd-amd64 kfreebsd-i386 powerpc], + libghc-dav-dev (>= 1.0) [amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 powerpc ppc64el hurd-i386], libghc-quickcheck2-dev, libghc-monad-control-dev (>= 0.3), libghc-exceptions-dev (>= 0.6), @@ -33,18 +33,18 @@ Build-Depends: libghc-stm-dev (>= 2.3), libghc-dbus-dev (>= 0.10.7) [linux-any], libghc-fdo-notify-dev (>= 0.3) [linux-any], - libghc-yesod-dev (>= 1.2.6.1) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-yesod-core-dev (>= 1.2.19) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-yesod-form-dev (>= 1.3.15) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-yesod-static-dev (>= 1.2.4) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-yesod-default-dev (>= 1.2.0) [i386 amd64 kfreebsd-amd64 powerpc], - libghc-hamlet-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-shakespeare-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-clientsession-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-warp-dev (>= 3.0.0.5) [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-warp-tls-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-wai-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], - libghc-wai-extra-dev [i386 amd64 kfreebsd-i386 kfreebsd-amd64 powerpc], + libghc-yesod-dev (>= 1.2.6.1) [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-yesod-core-dev (>= 1.2.19) [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-yesod-form-dev (>= 1.3.15) [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc] ppc64el, + libghc-yesod-static-dev (>= 1.2.4) [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-yesod-default-dev (>= 1.2.0) [i386 amd64 armel armhf kfreebsd-amd64 powerpc ppc64el], + libghc-hamlet-dev [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-shakespeare-dev [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-clientsession-dev [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-warp-dev (>= 3.0.0.5) [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-warp-tls-dev [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], + libghc-wai-dev [i386 amd64 kfreebsd-i386 armel armhf kfreebsd-amd64 powerpc ppc64el], + libghc-wai-extra-dev [i386 amd64 armel armhf kfreebsd-i386 kfreebsd-amd64 powerpc ppc64el], libghc-securemem-dev, libghc-byteable-dev, libghc-dns-dev, @@ -66,13 +66,12 @@ Build-Depends: libghc-esqueleto-dev, libghc-monad-logger-dev, libghc-feed-dev (>= 0.3.9.2), - libghc-regex-tdfa-dev [!mipsel !s390], - libghc-regex-compat-dev [mipsel s390], - libghc-tasty-dev (>= 0.7) [!sparc], - libghc-tasty-hunit-dev [!sparc], - libghc-tasty-quickcheck-dev [!sparc], - libghc-tasty-rerun-dev [!sparc], - libghc-optparse-applicative-dev [!sparc], + libghc-regex-tdfa-dev, + libghc-tasty-dev (>= 0.7), + libghc-tasty-hunit-dev, + libghc-tasty-quickcheck-dev, + libghc-tasty-rerun-dev, + libghc-optparse-applicative-dev, lsof [!kfreebsd-i386 !kfreebsd-amd64 !hurd-any], ikiwiki, perlmagick, -- cgit v1.2.3 From ddb66a7f8d1bd2ce626522d1d2af97e1ae5cde12 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 May 2015 13:05:33 -0400 Subject: Revert "Android: Updated bundled ssh from 6.1p1 to 6.4p1." This reverts commit 742bdf6353ac8e08fb603fe60b53c1495d4fa801. Build didn't actually seem to succeed, for both versions of android, so I'll need to revisit this later. --- debian/changelog | 2 - ...ent_1_64bc9b8b7de6084a837f8b17269447b7._comment | 12 --- standalone/android/Makefile | 3 +- standalone/android/openssh.config.h | 4 +- standalone/android/openssh.patch | 109 ++++++++++++--------- 5 files changed, 67 insertions(+), 63 deletions(-) delete mode 100644 doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 389160121..fc7fcd46c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,7 +27,6 @@ git-annex (5.20150421) UNRELEASED; urgency=medium symlinks when downloading from ftp. * Support checking ftp urls for file presence. * Fix bogus failure of fsck --fast. - * contentlocation, examinekey, lookupkey: Added --batch mode option. * fsck: Ignore error recording the fsck in the activity log, which can happen when running fsck in a read-only repository. Closes: #698559 @@ -41,7 +40,6 @@ git-annex (5.20150421) UNRELEASED; urgency=medium to build the webapp on arm, and enable DAV support on arm. \o/ * Adjust some other arch specific build dependencies that are now available on more architectures in Devian unstable. - * Android: Updated bundled ssh from 6.1p1 to 6.4p1. * Windows: Remove cygwin ssh, the newer version of which has stopped honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. * Windows: Roll back to an older version of rsync from cygwin. diff --git a/doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment b/doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment deleted file mode 100644 index 083a05ce5..000000000 --- a/doc/bugs/android_ed25519_algorithm/comment_1_64bc9b8b7de6084a837f8b17269447b7._comment +++ /dev/null @@ -1,12 +0,0 @@ -[[!comment format=mdwn - username="joey" - subject="""comment 1""" - date="2015-05-01T19:24:18Z" - content=""" -git-annex for android bundles ssh from -git://github.com/CyanogenMod/android_external_openssh.git - -That has not yet been updated to a new enough ssh version to have this -feature. Will have to wait for it to be updated, or if I learn of a newer -port of ssh to android someplace I could change to it. -"""]] diff --git a/standalone/android/Makefile b/standalone/android/Makefile index af825d5aa..261259bf4 100644 --- a/standalone/android/Makefile +++ b/standalone/android/Makefile @@ -30,7 +30,8 @@ $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp: $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/build-stamp: openssh.patch openssh.config.h # This is a known-good version that the patch works with. - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && git reset --hard b82300f4fa6917298a137817afbbd674a066e5da + # TODO: Upgrade + cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && git reset --hard 0a8617ed5af2f0248d0e9648e26b224e16ada742 cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && ./configure --host=arm-linux-androideabi --with-ssl-dir=../openssl --without-openssl-header-check cat openssh.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && patch -p1) cp openssh.config.h $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/config.h diff --git a/standalone/android/openssh.config.h b/standalone/android/openssh.config.h index 3464947e6..31e78e0b8 100644 --- a/standalone/android/openssh.config.h +++ b/standalone/android/openssh.config.h @@ -1,6 +1,4 @@ #define DISABLE_SHADOW 1 -#define HAVE_MBLEN 1 -#define HAVE_USLEEP 1 #define DISABLE_UTMP 1 #define DISABLE_UTMPX 1 #define DISABLE_WTMP 1 @@ -219,7 +217,7 @@ #define LOCKED_PASSWD_PREFIX "!" #define LOGIN_PROGRAM_FALLBACK "/bin/login" #define MISSING_FD_MASK 1 -#define HAVE_DECL_HOWMANY 0 +#define MISSING_HOWMANY 1 #define OPENSSL_HAS_ECC 1 #define OPENSSL_PRNG_ONLY 1 #define PACKAGE_BUGREPORT "openssh-unix-dev@mindrot.org" diff --git a/standalone/android/openssh.patch b/standalone/android/openssh.patch index 7eb7211f9..996143d0e 100644 --- a/standalone/android/openssh.patch +++ b/standalone/android/openssh.patch @@ -1,8 +1,8 @@ diff --git a/auth.c b/auth.c -index 84fca58..63c3c3e 100644 +index 6623e0f..dd10253 100644 --- a/auth.c +++ b/auth.c -@@ -364,7 +364,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) +@@ -337,7 +337,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) char *file, ret[MAXPATHLEN]; int i; @@ -11,7 +11,7 @@ index 84fca58..63c3c3e 100644 "u", pw->pw_name, (char *)NULL); /* -@@ -374,7 +374,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) +@@ -347,7 +347,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) if (*file == '/') return (file); @@ -19,18 +19,18 @@ index 84fca58..63c3c3e 100644 + i = snprintf(ret, sizeof(ret), "%s/%s", _PATH_ROOT_HOME_PREFIX, file); if (i < 0 || (size_t)i >= sizeof(ret)) fatal("expand_authorized_keys: path too long"); - free(file); -@@ -463,7 +463,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir, + xfree(file); +@@ -436,7 +436,7 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, strerror(errno)); return -1; } -- if (pw_dir != NULL && realpath(pw_dir, homedir) != NULL) -+ if (_PATH_ROOT_HOME_PREFIX != NULL && realpath(_PATH_ROOT_HOME_PREFIX, homedir) != NULL) +- if (realpath(pw->pw_dir, homedir) != NULL) ++ if (realpath(_PATH_ROOT_HOME_PREFIX, homedir) != NULL) comparehome = 1; - if (!S_ISREG(stp->st_mode)) { + /* check the open file to avoid races */ diff --git a/authfile.c b/authfile.c -index 63ae16b..7b7841a 100644 +index 7dd4496..00462e9 100644 --- a/authfile.c +++ b/authfile.c @@ -613,6 +613,7 @@ int @@ -42,7 +42,7 @@ index 63ae16b..7b7841a 100644 if (fstat(fd, &st) < 0) return 0; diff --git a/misc.c b/misc.c -index 3b9792f..516e7ae 100644 +index 0bf2db6..4327d03 100644 --- a/misc.c +++ b/misc.c @@ -25,6 +25,7 @@ @@ -53,20 +53,39 @@ index 3b9792f..516e7ae 100644 #include #include -@@ -539,8 +540,9 @@ tilde_expand_filename(const char *filename, uid_t uid) +@@ -538,12 +539,13 @@ tilde_expand_filename(const char *filename, uid_t uid) + } else if ((pw = getpwuid(uid)) == NULL) /* ~/path */ fatal("tilde_expand_filename: No such uid %ld", (long)uid); +- if (strlcpy(ret, pw->pw_dir, sizeof(ret)) >= sizeof(ret)) ++ char *pw_dir=_PATH_ROOT_HOME_PREFIX; ++ if (strlcpy(ret, pw_dir, sizeof(ret)) >= sizeof(ret)) + fatal("tilde_expand_filename: Path too long"); + /* Make sure directory has a trailing '/' */ - len = strlen(pw->pw_dir); -- if (len == 0 || pw->pw_dir[len - 1] != '/') -+ char *pw_dir=_PATH_ROOT_HOME_PREFIX; +- if ((len == 0 || pw->pw_dir[len - 1] != '/') && + len = strlen(pw_dir); -+ if (len == 0 || pw_dir[len - 1] != '/') - sep = "/"; - else - sep = ""; ++ if ((len == 0 || pw_dir[len - 1] != '/') && + strlcat(ret, "/", sizeof(ret)) >= sizeof(ret)) + fatal("tilde_expand_filename: Path too long"); + +diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c +index d2bea21..5b5d599 100644 +--- a/openbsd-compat/getrrsetbyname.c ++++ b/openbsd-compat/getrrsetbyname.c +@@ -56,8 +56,7 @@ + #include + + #include "getrrsetbyname.h" +-#include "nameser.h" +-#include "nameser_compat.h" ++#include "arpa/nameser.h" + + #if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO + extern int h_errno; diff --git a/pathnames.h b/pathnames.h -index 3b7584c..1103266 100644 +index b7b9d91..3c10b11 100644 --- a/pathnames.h +++ b/pathnames.h @@ -67,7 +67,7 @@ @@ -79,23 +98,23 @@ index 3b7584c..1103266 100644 /* diff --git a/readconf.c b/readconf.c -index e22c952..87c1c8a 100644 +index 097bb05..dcbc008 100644 --- a/readconf.c +++ b/readconf.c -@@ -1113,7 +1113,7 @@ read_config_file(const char *filename, const char *host, Options *options, +@@ -1085,7 +1085,7 @@ read_config_file(const char *filename, const char *host, Options *options, if ((f = fopen(filename, "r")) == NULL) return 0; -- if (flags & SSHCONF_CHECKPERM) { -+ if (0) { +- if (checkperm) { ++ if (checkperm && 0) { struct stat sb; if (fstat(fileno(f), &sb) == -1) diff --git a/ssh-add.c b/ssh-add.c -index 5e8166f..f0edc30 100644 +index 738644d..f6fce4a 100644 --- a/ssh-add.c +++ b/ssh-add.c -@@ -496,7 +496,7 @@ main(int argc, char **argv) +@@ -471,7 +471,7 @@ main(int argc, char **argv) } for (i = 0; default_files[i]; i++) { @@ -105,32 +124,32 @@ index 5e8166f..f0edc30 100644 if (stat(buf, &st) < 0) continue; diff --git a/ssh-keygen.c b/ssh-keygen.c -index 40ba5e3..82c2ebf 100644 +index 4baf7df..ef8bb25 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c -@@ -228,7 +228,7 @@ ask_filename(struct passwd *pw, const char *prompt) +@@ -224,7 +224,7 @@ ask_filename(struct passwd *pw, const char *prompt) } } snprintf(identity_file, sizeof(identity_file), "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, name); -+ _PATH_ROOT_HOME_PREFIX, name); +- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, name); ++ _PATH_ROOT_HOME_PREFIX, name); fprintf(stderr, "%s (%s): ", prompt, identity_file); if (fgets(buf, sizeof(buf), stdin) == NULL) exit(1); -@@ -2561,7 +2561,7 @@ main(int argc, char **argv) +@@ -2268,7 +2268,7 @@ main(int argc, char **argv) /* Create ~/.ssh directory if it doesn't already exist. */ snprintf(dotsshdir, sizeof dotsshdir, "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, -+ _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_DIR); +- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, ++ _PATH_ROOT_HOME_PREFIX, + _PATH_SSH_USER_DIR); if (strstr(identity_file, dotsshdir) != NULL) { if (stat(dotsshdir, &st) < 0) { diff --git a/ssh.c b/ssh.c -index 1e2cdd5..cc48c2d 100644 +index 898e966..ef6c858 100644 --- a/ssh.c +++ b/ssh.c -@@ -707,7 +707,7 @@ main(int ac, char **av) +@@ -703,7 +703,7 @@ main(int ac, char **av) fatal("Can't open user config file %.100s: " "%.100s", config, strerror(errno)); } else { @@ -138,8 +157,8 @@ index 1e2cdd5..cc48c2d 100644 + r = snprintf(buf, sizeof buf, "%s/%s", _PATH_ROOT_HOME_PREFIX, _PATH_SSH_USER_CONFFILE); if (r > 0 && (size_t)r < sizeof(buf)) - (void)read_config_file(buf, host, &options, -@@ -773,7 +773,7 @@ main(int ac, char **av) + (void)read_config_file(buf, host, &options, 1); +@@ -748,7 +748,7 @@ main(int ac, char **av) if (options.local_command != NULL) { debug3("expanding LocalCommand: %s", options.local_command); cp = options.local_command; @@ -148,16 +167,16 @@ index 1e2cdd5..cc48c2d 100644 "h", host, "l", thishost, "n", host_arg, "r", options.user, "p", portstr, "u", pw->pw_name, "L", shorthost, (char *)NULL); -@@ -913,7 +913,7 @@ main(int ac, char **av) +@@ -888,7 +888,7 @@ main(int ac, char **av) */ if (config == NULL) { r = snprintf(buf, sizeof buf, "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, -+ _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_DIR); +- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, ++ _PATH_ROOT_HOME_PREFIX, + _PATH_SSH_USER_DIR); if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) { #ifdef WITH_SELINUX -@@ -1565,7 +1565,7 @@ load_public_identity_files(void) +@@ -1532,7 +1532,7 @@ load_public_identity_files(void) if ((pw = getpwuid(original_real_uid)) == NULL) fatal("load_public_identity_files: getpwuid failed"); pwname = xstrdup(pw->pw_name); @@ -167,7 +186,7 @@ index 1e2cdd5..cc48c2d 100644 fatal("load_public_identity_files: gethostname: %s", strerror(errno)); diff --git a/uidswap.c b/uidswap.c -index 50d20d6..d226cc9 100644 +index bc6194e..5cbf5d1 100644 --- a/uidswap.c +++ b/uidswap.c @@ -28,7 +28,6 @@ @@ -175,10 +194,10 @@ index 50d20d6..d226cc9 100644 #ifdef ANDROID -#include - #include + #include #include #endif -@@ -216,7 +215,7 @@ permanently_set_uid(struct passwd *pw) +@@ -230,7 +229,7 @@ permanently_set_uid(struct passwd *pw) debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, (u_int)pw->pw_gid); @@ -187,7 +206,7 @@ index 50d20d6..d226cc9 100644 if (pw->pw_uid == AID_SHELL) { prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0); -@@ -281,7 +280,7 @@ permanently_set_uid(struct passwd *pw) +@@ -317,7 +316,7 @@ permanently_set_uid(struct passwd *pw) (u_int)pw->pw_uid); } -- cgit v1.2.3 From 88ee184494c8c51d2c00d5c1e195eebc9f472b7d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 May 2015 13:39:00 -0400 Subject: Improve quvi 0.4 output parsing to handle cases wher there is no known filename extension. This is currently the case when using quvi with youtube. In this case, the extension ".m" will be used. --- Command/AddUrl.hs | 2 +- Command/ImportFeed.hs | 2 +- Utility/Quvi.hs | 6 +++--- debian/changelog | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'debian/changelog') diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 5defc52d9..6474f2614 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -178,7 +178,7 @@ startWeb relaxed optfile pathdepth s = go $ fromMaybe bad $ parseURI urlstring pathmax <- liftIO $ fileNameLengthLimit "." let file = flip fromMaybe optfile $ truncateFilePath pathmax $ sanitizeFilePath $ - Quvi.pageTitle page ++ "." ++ Quvi.linkSuffix link + Quvi.pageTitle page ++ "." ++ fromMaybe "m" (Quvi.linkSuffix link) showStart "addurl" file next $ performQuvi relaxed urlstring (Quvi.linkUrl link) file #else diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs index 2a278dea1..379350c80 100644 --- a/Command/ImportFeed.hs +++ b/Command/ImportFeed.hs @@ -196,7 +196,7 @@ performDownload opts cache todownload = case location todownload of Just link -> do let videourl = Quvi.linkUrl link checkknown videourl $ - rundownload videourl ("." ++ Quvi.linkSuffix link) $ \f -> + rundownload videourl ("." ++ fromMaybe "m" (Quvi.linkSuffix link)) $ \f -> maybeToList <$> addUrlFileQuvi (relaxedOpt opts) quviurl videourl f #else return False diff --git a/Utility/Quvi.hs b/Utility/Quvi.hs index 0669e7351..4dc15fe92 100644 --- a/Utility/Quvi.hs +++ b/Utility/Quvi.hs @@ -30,7 +30,7 @@ data Page = Page } deriving (Show) data Link = Link - { linkSuffix :: String + { linkSuffix :: Maybe String , linkUrl :: URLString } deriving (Show) @@ -43,7 +43,7 @@ instance FromJSON Page where instance FromJSON Link where parseJSON (Object v) = Link - <$> v .: "file_suffix" + <$> v .:? "file_suffix" <*> v .: "url" parseJSON _ = mzero @@ -53,7 +53,7 @@ parseEnum s = Page <$> get "QUVI_MEDIA_PROPERTY_TITLE" <*> ((:[]) <$> ( Link - <$> get "QUVI_MEDIA_STREAM_PROPERTY_CONTAINER" + <$> Just <$> (get "QUVI_MEDIA_STREAM_PROPERTY_CONTAINER") <*> get "QUVI_MEDIA_STREAM_PROPERTY_URL" ) ) diff --git a/debian/changelog b/debian/changelog index fc7fcd46c..e677334df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,9 @@ git-annex (5.20150421) UNRELEASED; urgency=medium Closes: #698559 (fsck can still need to write to the repository if it find problems, but a successful fsck can be done read-only) + * Improve quvi 0.4 output parsing to handle cases wher there is no known + filename extension. This is currently the case when using quvi with + youtube. In this case, the extension ".m" will be used. * Dropped support for older versions of yesod, warp, and dbus than the ones in Debian Jessie. * Switch from the obsolete dataenc library for base64 encoding to sandi. -- cgit v1.2.3 From d1c76795790313c4036e6684886bb8ac03c6b8eb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 May 2015 13:42:45 -0400 Subject: prep release --- debian/changelog | 4 ++-- git-annex.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index e677334df..f03d64b28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -git-annex (5.20150421) UNRELEASED; urgency=medium +git-annex (5.20150508) unstable; urgency=medium * Improve behavior when a git-annex command is told to operate on a file that doesn't exist. It will now continue to other @@ -48,7 +48,7 @@ git-annex (5.20150421) UNRELEASED; urgency=medium * Windows: Roll back to an older version of rsync from cygwin. The newer version has some dependency on a newer ssh from cygwin. - -- Joey Hess Tue, 21 Apr 2015 15:54:10 -0400 + -- Joey Hess Fri, 08 May 2015 13:42:30 -0400 git-annex (5.20150420) unstable; urgency=medium diff --git a/git-annex.cabal b/git-annex.cabal index 03331eb79..36b67d045 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20150421 +Version: 5.20150508 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From 9254113316b8ca6285748a6dc96111130a065ce0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 May 2015 15:05:48 -0400 Subject: seems that webapp ssh password ssh-agent hack is broken on windows after recent ssh changes --- debian/changelog | 2 ++ doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index f03d64b28..71818dcc3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,6 +45,8 @@ git-annex (5.20150508) unstable; urgency=medium available on more architectures in Devian unstable. * Windows: Remove cygwin ssh, the newer version of which has stopped honoring the setting of HOME. Instead, copy msysgit's ssh into PATH. + Note that setting up a remote ssh server using password authentication + is known to be broken in this release on Windows. * Windows: Roll back to an older version of rsync from cygwin. The newer version has some dependency on a newer ssh from cygwin. diff --git a/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn b/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn new file mode 100644 index 000000000..e734e007b --- /dev/null +++ b/doc/bugs/windows_ssh_webapp_password_entry_broken.mdwn @@ -0,0 +1,5 @@ +Recent changes to ssh on Windows have broken the webapps's support for +entering a password when adding a ssh remote. + +Using ssh on windows with an existing remote does work. So as a workaround, +set up a passwordless ssh key that can log into the ssh server. --[[Joey]] -- cgit v1.2.3 From 21b14af6904123d5c5cc1c575aee7203f65d7800 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 10 May 2015 15:54:58 -0400 Subject: more FlexibleContexts --- Command/Log.hs | 4 ++++ debian/changelog | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'debian/changelog') diff --git a/Command/Log.hs b/Command/Log.hs index e1438ba15..671c9d674 100644 --- a/Command/Log.hs +++ b/Command/Log.hs @@ -176,7 +176,11 @@ parseRaw l = go $ words l parseTimeStamp :: String -> POSIXTime parseTimeStamp = utcTimeToPOSIXSeconds . fromMaybe (error "bad timestamp") . +#if MIN_VERSION_time(1,5,0) + parseTimeM True defaultTimeLocale "%s" +#else parseTime defaultTimeLocale "%s" +#endif showTimeStamp :: TimeZone -> POSIXTime -> String showTimeStamp zone = show . utcToLocalTime zone . posixSecondsToUTCTime diff --git a/debian/changelog b/debian/changelog index 71818dcc3..c901df0f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (5.20150509) UNRELEASED; urgency=medium + + * Now builds cleanly using ghc 7.10 (as well as ghc back to 7.6). + + -- Joey Hess Sun, 10 May 2015 15:45:48 -0400 + git-annex (5.20150508) unstable; urgency=medium * Improve behavior when a git-annex command is told to operate -- cgit v1.2.3 From 560301841e5f29243b72faadc44138e860fa0490 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 May 2015 12:09:02 -0400 Subject: cutting a point release, will be a cabal-only update --- debian/changelog | 6 ++++-- git-annex.cabal | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index c901df0f6..cd7ade7b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ -git-annex (5.20150509) UNRELEASED; urgency=medium +git-annex (5.20150508.1) unstable; urgency=medium * Now builds cleanly using ghc 7.10 (as well as ghc back to 7.6). + * Imrovements to the git-annex-standalone.deb build process. + (Thanks, Yaroslav Halchenko) - -- Joey Hess Sun, 10 May 2015 15:45:48 -0400 + -- Joey Hess Mon, 11 May 2015 12:08:58 -0400 git-annex (5.20150508) unstable; urgency=medium diff --git a/git-annex.cabal b/git-annex.cabal index e07ffd685..fe4a547a4 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20150508 +Version: 5.20150508.1 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess -- cgit v1.2.3 From 0b0b0ca095dfe50e81fc32781142ef2e18baeb41 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 May 2015 12:57:47 -0400 Subject: import: Refuse to import files that are within the work tree, as that does not make sense and could cause data loss. --- Command/Import.hs | 5 +++++ debian/changelog | 7 +++++++ .../Data_loss_when_doing___96__git_annex_import_--force__96__.mdwn | 3 +++ 3 files changed, 15 insertions(+) (limited to 'debian/changelog') diff --git a/Command/Import.hs b/Command/Import.hs index eb21faea2..fffa301ec 100644 --- a/Command/Import.hs +++ b/Command/Import.hs @@ -9,6 +9,7 @@ module Command.Import where import Common.Annex import Command +import qualified Git import qualified Annex import qualified Command.Add import Utility.CopyFile @@ -62,6 +63,10 @@ getDuplicateMode = go . catMaybes <$> mapM getflag [minBound..maxBound] seek :: CommandSeek seek ps = do mode <- getDuplicateMode + repopath <- liftIO . absPath =<< fromRepo Git.repoPath + inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath ps + unless (null inrepops) $ do + error $ "cannot import files from inside the working tree (use git annex add instead): " ++ unwords inrepops withPathContents (start mode) ps start :: DuplicateMode -> (FilePath, FilePath) -> CommandStart diff --git a/debian/changelog b/debian/changelog index cd7ade7b7..58921d5a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +git-annex (5.20150508.2) UNRELEASED; urgency=medium + + * import: Refuse to import files that are within the work tree, as that + does not make sense and could cause data loss. + + -- Joey Hess Mon, 11 May 2015 12:45:06 -0400 + git-annex (5.20150508.1) unstable; urgency=medium * Now builds cleanly using ghc 7.10 (as well as ghc back to 7.6). diff --git a/doc/bugs/Data_loss_when_doing___96__git_annex_import_--force__96__.mdwn b/doc/bugs/Data_loss_when_doing___96__git_annex_import_--force__96__.mdwn index 8c61ba8d5..60e04fc14 100644 --- a/doc/bugs/Data_loss_when_doing___96__git_annex_import_--force__96__.mdwn +++ b/doc/bugs/Data_loss_when_doing___96__git_annex_import_--force__96__.mdwn @@ -57,3 +57,6 @@ drwx------ 55 jkt jkt 8.0K May 8 13:54 .. drwxr-xr-x 8 jkt jkt 119 May 8 13:55 .git """]] ...and the file is gone :(. + +> You should use `git annex add` in this case, not import. +> I've made import refuse to run in this case. [[done]] --[[Joey]] -- cgit v1.2.3 From c5632ca783d2ebb6e793aa4f643ed3936df09c8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 May 2015 13:00:06 -0400 Subject: drop: Now supports --all, --unused, and --key. --- Command/Drop.hs | 27 ++++++++++++++++++--------- debian/changelog | 1 + doc/git-annex-drop.mdwn | 15 +++++++++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) (limited to 'debian/changelog') diff --git a/Command/Drop.hs b/Command/Drop.hs index a3ac87633..698dd7bad 100644 --- a/Command/Drop.hs +++ b/Command/Drop.hs @@ -27,7 +27,7 @@ cmd = [withOptions (dropOptions) $ command "drop" paramPaths seek SectionCommon "indicate content of files not currently wanted"] dropOptions :: [Option] -dropOptions = dropFromOption : annexedMatchingOptions ++ [autoOption] +dropOptions = dropFromOption : annexedMatchingOptions ++ [autoOption] ++ keyOptions dropFromOption :: Option dropFromOption = fieldOption ['f'] "from" paramRemote "drop content from a remote" @@ -36,23 +36,32 @@ seek :: CommandSeek seek ps = do from <- getOptionField dropFromOption Remote.byNameWithUUID auto <- getOptionFlag autoOption - withFilesInGit (whenAnnexed $ start auto from) ps + withKeyOptions auto + (startKeys auto from) + (withFilesInGit $ whenAnnexed $ start auto from) + ps start :: Bool -> Maybe Remote -> FilePath -> Key -> CommandStart -start auto from file key = checkDropAuto auto from file key $ \numcopies -> +start auto from file key = start' auto from key (Just file) + +start' :: Bool -> Maybe Remote -> Key -> AssociatedFile -> CommandStart +start' auto from key afile = checkDropAuto auto from afile key $ \numcopies -> stopUnless want $ case from of - Nothing -> startLocal (Just file) numcopies key Nothing + Nothing -> startLocal afile numcopies key Nothing Just remote -> do u <- getUUID if Remote.uuid remote == u - then startLocal (Just file) numcopies key Nothing - else startRemote (Just file) numcopies key remote + then startLocal afile numcopies key Nothing + else startRemote afile numcopies key remote where want - | auto = wantDrop False (Remote.uuid <$> from) (Just key) (Just file) + | auto = wantDrop False (Remote.uuid <$> from) (Just key) afile | otherwise = return True +startKeys :: Bool -> Maybe Remote -> Key -> CommandStart +startKeys auto from key = start' auto from key Nothing + startLocal :: AssociatedFile -> NumCopies -> Key -> Maybe Remote -> CommandStart startLocal afile numcopies key knownpresentremote = stopUnless (inAnnex key) $ do showStart' "drop" key afile @@ -154,8 +163,8 @@ requiredContent = do {- In auto mode, only runs the action if there are enough - copies on other semitrusted repositories. -} -checkDropAuto :: Bool -> Maybe Remote -> FilePath -> Key -> (NumCopies -> CommandStart) -> CommandStart -checkDropAuto auto mremote file key a = go =<< getFileNumCopies file +checkDropAuto :: Bool -> Maybe Remote -> AssociatedFile -> Key -> (NumCopies -> CommandStart) -> CommandStart +checkDropAuto auto mremote afile key a = go =<< maybe getNumCopies getFileNumCopies afile where go numcopies | auto = do diff --git a/debian/changelog b/debian/changelog index 58921d5a9..6b3dfb38d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ git-annex (5.20150508.2) UNRELEASED; urgency=medium * import: Refuse to import files that are within the work tree, as that does not make sense and could cause data loss. + * drop: Now supports --all, --unused, and --key. -- Joey Hess Mon, 11 May 2015 12:45:06 -0400 diff --git a/doc/git-annex-drop.mdwn b/doc/git-annex-drop.mdwn index 3fd13467c..c19a716e9 100644 --- a/doc/git-annex-drop.mdwn +++ b/doc/git-annex-drop.mdwn @@ -35,6 +35,21 @@ safe to do so. the last repository that is storing their content. Data loss can result from using this option. +* `--all` + + Rather than specifying a filename or path to drop, this option can be + used to drop all available versions of all files. + + This is the default behavior when running git-annex drop in a bare repository. + +* `--unused` + + Drop files found by last run of git-annex unused. + +* `--key=keyname` + + Use this option to drop a specified key. + * file matching options The [[git-annex-matching-options]](1) -- cgit v1.2.3 From 5cd9e10cde3c06ecc6a97f5f60a9def22f959bd2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 May 2015 13:02:22 -0400 Subject: note about git annex drop behavior change in bare repo --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian/changelog') diff --git a/debian/changelog b/debian/changelog index 6b3dfb38d..5057e9dab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ git-annex (5.20150508.2) UNRELEASED; urgency=medium * import: Refuse to import files that are within the work tree, as that does not make sense and could cause data loss. * drop: Now supports --all, --unused, and --key. + * drop: Now defaults to --all when run in a bare repository. + (Previously, did nothing when run in a bare repository.) -- Joey Hess Mon, 11 May 2015 12:45:06 -0400 -- cgit v1.2.3