summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Utility/Metered.hs10
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/aria2c_display_broken_in_git-annex/comment_1_770e1d657bba2a3f5782eac2e8bdca57._comment14
-rw-r--r--doc/bugs/bittorrent_special_url_double-encoding.mdwn2
4 files changed, 23 insertions, 4 deletions
diff --git a/Utility/Metered.hs b/Utility/Metered.hs
index 84694b26b..7d6e71cdd 100644
--- a/Utility/Metered.hs
+++ b/Utility/Metered.hs
@@ -1,6 +1,6 @@
{- Metered IO
-
- - Copyright 2012, 2013 Joey Hess <id@joeyh.name>
+ - Copyright 2012-2105 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
@@ -17,6 +17,7 @@ import System.IO.Unsafe
import Foreign.Storable (Storable(sizeOf))
import System.Posix.Types
import Data.Int
+import Data.Bits.Utils
{- An action that can be run repeatedly, updating it on the bytes processed.
-
@@ -163,12 +164,13 @@ commandMeter progressparser meterupdate cmd params = liftIO $ catchBoolIO $
p = proc cmd (toCommand params)
feedprogress prev buf h = do
- s <- hGetSomeString h 80
- if null s
+ b <- S.hGetSome h 80
+ if S.null b
then return True
else do
- putStr s
+ S.hPut stdout b
hFlush stdout
+ let s = w82s (S.unpack b)
let (mbytes, buf') = progressparser (buf++s)
case mbytes of
Nothing -> feedprogress prev buf' h
diff --git a/debian/changelog b/debian/changelog
index f47ae7f44..f763ecac2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ git-annex (5.20150206) UNRELEASED; urgency=medium
* Improve race recovery code when committing to git-annex branch.
* addurl: Avoid crash if quvi is not installed, when git-annex was
built with process-1.2
+ * bittorrent: Fix mojibake introduced in parsing arai2c progress output.
-- Joey Hess <id@joeyh.name> Fri, 06 Feb 2015 13:57:08 -0400
diff --git a/doc/bugs/aria2c_display_broken_in_git-annex/comment_1_770e1d657bba2a3f5782eac2e8bdca57._comment b/doc/bugs/aria2c_display_broken_in_git-annex/comment_1_770e1d657bba2a3f5782eac2e8bdca57._comment
new file mode 100644
index 000000000..2fe9bf475
--- /dev/null
+++ b/doc/bugs/aria2c_display_broken_in_git-annex/comment_1_770e1d657bba2a3f5782eac2e8bdca57._comment
@@ -0,0 +1,14 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2015-02-10T16:11:09Z"
+ content="""
+This is because aria2c detects it's not outputting to a terminal, so it
+stops using \r for progress displays. You can get the same effect by piping
+aria2c to less. There does not seem to be any switch to force console-style
+output.
+
+The only solution would be the complexity of making git-annex use a pty
+internally, or just not showing aria2c progress output (or not intercepting
+it for metering).
+"""]]
diff --git a/doc/bugs/bittorrent_special_url_double-encoding.mdwn b/doc/bugs/bittorrent_special_url_double-encoding.mdwn
index 1665e1ed7..ebbf76a34 100644
--- a/doc/bugs/bittorrent_special_url_double-encoding.mdwn
+++ b/doc/bugs/bittorrent_special_url_double-encoding.mdwn
@@ -173,3 +173,5 @@ LC_ALL=
"""]]
Previous similar UTF-8 bug: [[forget_corrupts_non-ascii_chars]]. Looks similar. --[[anarcat]]
+
+> [[fixed|done]] --[[Joey]]