forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
darcs-2.8.4-issue2364-part-2.patch
52 lines (40 loc) · 1.75 KB
/
darcs-2.8.4-issue2364-part-2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Tue May 13 22:07:19 FET 2014 Sergei Trofimovich <[email protected]>
* resolve issue2364: don't break list of 'bad sources'
This time the bug manifested on a simple operation:
$ darcs record -a -m "something"
Attempt to write a patch resulted in something like:
Failed to record patch 'hello'
HINT: I could not reach the following repositories:
http://repetae.net/repos/jhc
/home/st/.darcs/cache
/home/st/.cache/darcs
/home/st/dev/darcs/jhc
If you're not using them, you should probably delete
The sequence should be the following:
1. store patch to inventory/foo
2. try to store to a writable cache (say, ~/.darcs/cache/patches)
3. fail to write
4. filter out bad caches
5. try again
6. copy from cache to patches/
Due to missing NOINLINE step 4. led to
all caches treated as writable, thus step 5
failed without a chance for patch to
go to 'patches/'.
As a side-effect building darcs with -O0 produced seemingly working darcs.
Reported-by: Ivan Miljenovic
diff -rN -u old-darcs.net/src/Darcs/Util/Global.hs new-darcs.net/src/Darcs/Util/Global.hs
--- old-darcs.net/src/Darcs/Global.hs 2014-05-13 22:23:29.897329750 +0300
+++ new-darcs.net/src/Darcs/Global.hs 2014-05-13 22:23:29.979329754 +0300
@@ -135,7 +135,7 @@
_badSourcesList :: IORef [String]
_badSourcesList = unsafePerformIO $ newIORef []
-{- NOINLINE _badSourcesList -}
+{-# NOINLINE _badSourcesList #-}
addBadSource :: String -> IO ()
@@ -154,7 +154,7 @@
_reachableSourcesList :: IORef [String]
_reachableSourcesList = unsafePerformIO $ newIORef []
-{- NOINLINE _reachableSourcesList -}
+{-# NOINLINE _reachableSourcesList #-}
addReachableSource :: String -> IO ()