diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2023-04-01 10:58:04 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2023-04-01 10:58:04 -0700 |
commit | 57e3c6111bdbc34a0d1e2d2de9359128013309f5 (patch) | |
tree | 8c676f61ed742b7ea3435a6e88b5688fd7bbec69 | |
parent | fc207dd075b58942fee82192bfa5678f57c5ee20 (diff) |
Commit Debian 3.0 (quilt) metadatadebian/10.20230126-3archive/debian/10.20230126-3
[dgit (10.7) quilt-fixup]
-rw-r--r-- | debian/patches/debian-changes | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes index 4eba9f9baf..0d806345f0 100644 --- a/debian/patches/debian-changes +++ b/debian/patches/debian-changes @@ -49,3 +49,123 @@ A single combined diff, containing all the changes, follows. License: BSD-2-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions +--- git-annex-10.20230126.orig/Remote/External.hs ++++ git-annex-10.20230126/Remote/External.hs +@@ -377,19 +377,27 @@ handleRequest external req mp responseha + handleRequest' st external req mp responsehandler + + handleRequestKey :: External -> (SafeKey -> Request) -> Key -> Maybe MeterUpdate -> ResponseHandler a -> Annex a +-handleRequestKey external mkreq k mp responsehandler = case mkSafeKey k of +- Right sk -> handleRequest external (mkreq sk) mp responsehandler ++handleRequestKey external mkreq k mp responsehandler = ++ withSafeKey k $ \sk -> handleRequest external (mkreq sk) mp responsehandler ++ ++withSafeKey :: Key -> (SafeKey -> Annex a) -> Annex a ++withSafeKey k a = case mkSafeKey k of ++ Right sk -> a sk + Left e -> giveup e + + {- Export location is first sent in an EXPORT message before + - the main request. This is done because the ExportLocation can + - contain spaces etc. -} + handleRequestExport :: External -> ExportLocation -> (SafeKey -> Request) -> Key -> Maybe MeterUpdate -> ResponseHandler a -> Annex a +-handleRequestExport external loc mkreq k mp responsehandler = do +- withExternalState external $ \st -> do +- checkPrepared st external +- sendMessage st (EXPORT loc) +- handleRequestKey external mkreq k mp responsehandler ++handleRequestExport external loc mkreq k mp responsehandler = ++ withSafeKey k $ \sk -> ++ -- Both the EXPORT and subsequent request must be sent to the ++ -- same external process, so run both with the same external ++ -- state. ++ withExternalState external $ \st -> do ++ checkPrepared st external ++ sendMessage st (EXPORT loc) ++ handleRequest' st external (mkreq sk) mp responsehandler + + handleRequest' :: ExternalState -> External -> Request -> Maybe MeterUpdate -> ResponseHandler a -> Annex a + handleRequest' st external req mp responsehandler +--- git-annex-10.20230126.orig/Remote/External/Types.hs ++++ git-annex-10.20230126/Remote/External/Types.hs +@@ -415,7 +415,7 @@ newtype JobId = JobId Integer + deriving (Eq, Ord, Show) + + supportedProtocolVersions :: [ProtocolVersion] +-supportedProtocolVersions = [1] ++supportedProtocolVersions = [1, 2] + + instance Proto.Serializable JobId where + serialize (JobId n) = show n +--- git-annex-10.20230126.orig/doc/design/external_special_remote_protocol.mdwn ++++ git-annex-10.20230126/doc/design/external_special_remote_protocol.mdwn +@@ -39,7 +39,7 @@ empty, but the separating spaces are sti + The special remote is responsible for sending the first message, indicating + the version of the protocol it is using. + +- VERSION 1 ++ VERSION 2 + + Recent versions of git-annex respond with a message indicating + protocol extensions that it supports. Older versions of +@@ -271,7 +271,7 @@ These messages may be sent by the specia + handling a request. + + * `VERSION Int` +- Supported protocol version. Current version is 1. Must be sent first ++ Supported protocol version. Current version is 2. Must be sent first + thing at startup, as until it sees this git-annex does not know how to + talk with the special remote program! + (git-annex does not send a reply to this message, but may give up if it +@@ -428,6 +428,18 @@ remote. + git-annex will not talk to it any further. If the program receives + an ERROR from git-annex, it can exit with its own ERROR. + ++## protocol versions ++ ++Currently git-annex supports `VERSION 1` and `VERSION 2`. ++The two protocol versions are actually identical. ++ ++Old versions of git-annex that supported only `VERSION 1` ++had a bug in their implementation of the ++part of the protocol documented in the [[export_and_import_appendix]]. ++The bug could result in ontent being exported to the wrong file. ++External special remotes that implement that should use `VERSION 2` to ++avoid talking to the buggy old version of git-annex. ++ + ## extensions + + These protocol extensions are currently supported. +--- git-annex-10.20230126.orig/doc/special_remotes/external/example.sh ++++ git-annex-10.20230126/doc/special_remotes/external/example.sh +@@ -150,7 +150,7 @@ doremove () { + } + + # This has to come first, to get the protocol started. +-echo VERSION 1 ++echo VERSION 2 + + while read line; do + set -- $line +--- git-annex-10.20230126.orig/doc/special_remotes/external/git-annex-remote-ipfs ++++ git-annex-10.20230126/doc/special_remotes/external/git-annex-remote-ipfs +@@ -54,7 +54,7 @@ getaddrs () { + } + + # This has to come first, to get the protocol started. +-echo VERSION 1 ++echo VERSION 2 + + while read line; do + set -- $line +--- git-annex-10.20230126.orig/doc/special_remotes/external/git-annex-remote-torrent ++++ git-annex-10.20230126/doc/special_remotes/external/git-annex-remote-torrent +@@ -100,7 +100,7 @@ downloadtorrent () { + } + + # This has to come first, to get the protocol started. +-echo VERSION 1 ++echo VERSION 2 + + while read line; do + set -- $line |