make LTS branch pre-releases
[cabal.git] / Cabal-syntax / src / Distribution / PackageDescription / Quirks.hs
blob61b831354cdad315b61ae516baa142e238ac66b9
1 {-# LANGUAGE OverloadedStrings #-}
2 {-# LANGUAGE RankNTypes #-}
4 -- |
5 --
6 -- @since 2.2.0.0
7 module Distribution.PackageDescription.Quirks (patchQuirks) where
9 import Distribution.Compat.Prelude
10 import Distribution.Utils.MD5
11 import GHC.Fingerprint (Fingerprint (..))
12 import Prelude ()
14 import qualified Data.ByteString as BS
15 import qualified Data.Map as Map
17 -- | Patch legacy @.cabal@ file contents to allow parsec parser to accept
18 -- all of Hackage.
20 -- Bool part of the result tells whether the output is modified.
22 -- @since 2.2.0.0
23 patchQuirks :: BS.ByteString -> (Bool, BS.ByteString)
24 patchQuirks bs = case Map.lookup (BS.take 256 bs, md5 bs) patches of
25 Nothing -> (False, bs)
26 Just (post, f)
27 | post /= md5 output -> (False, bs)
28 | otherwise -> (True, output)
29 where
30 output = f bs
32 -- | 'patches' contains first 256 bytes, pre- and post-fingerprints and a patch function.
33 patches :: Map.Map (BS.ByteString, Fingerprint) (Fingerprint, BS.ByteString -> BS.ByteString)
34 patches =
35 Map.fromList
36 -- http://hackage.haskell.org/package/unicode-transforms-0.3.3
37 -- other-modules: .
38 -- ReadP assumed dot is empty line
39 [ mk
40 "-- This file has been generated from package.yaml by hpack version 0.17.0.\n--\n-- see: https://github.com/sol/hpack\n\nname: unicode-transforms\nversion: 0.3.3\nsynopsis: Unicode normalization\ndescription: Fast Unic"
41 (Fingerprint 15958160436627155571 10318709190730872881)
42 (Fingerprint 11008465475756725834 13815629925116264363)
43 (bsRemove " other-modules:\n .\n") -- TODO: remove trailing \n to test structural-diff
44 -- http://hackage.haskell.org/package/DSTM-0.1.2
45 -- http://hackage.haskell.org/package/DSTM-0.1.1
46 -- http://hackage.haskell.org/package/DSTM-0.1
47 -- Other Modules: no dash
48 -- ReadP parsed as section
49 , mk
50 "Name: DSTM\nVersion: 0.1.2\nCopyright: (c) 2010, Frank Kupke\nLicense: LGPL\nLicense-File: LICENSE\nAuthor: Frank Kupke\nMaintainer: frk@informatik.uni-kiel.de\nCabal-Version: >= 1.2.3\nStability: provisional\nSynopsis: A framework for using STM within distributed "
51 (Fingerprint 6919263071548559054 9050746360708965827)
52 (Fingerprint 17015177514298962556 11943164891661867280)
53 (bsReplace "Other modules:" "-- ")
54 , mk
55 "Name: DSTM\nVersion: 0.1.1\nCopyright: (c) 2010, Frank Kupke\nLicense: LGPL\nLicense-File: LICENSE\nAuthor: Frank Kupke\nMaintainer: frk@informatik.uni-kiel.de\nCabal-Version: >= 1.2.3\nStability: provisional\nSynopsis: A framework for using STM within distributed "
56 (Fingerprint 17313105789069667153 9610429408495338584)
57 (Fingerprint 17250946493484671738 17629939328766863497)
58 (bsReplace "Other modules:" "-- ")
59 , mk
60 "Name: DSTM\nVersion: 0.1\nCopyright: (c) 2010, Frank Kupke\nLicense: LGPL\nLicense-File: LICENSE\nAuthor: Frank Kupke\nMaintainer: frk@informatik.uni-kiel.de\nCabal-Version: >= 1.2.3\nStability: provisional\nSynopsis: A framework for using STM within distributed sy"
61 (Fingerprint 10502599650530614586 16424112934471063115)
62 (Fingerprint 13562014713536696107 17899511905611879358)
63 (bsReplace "Other modules:" "-- ")
64 , -- http://hackage.haskell.org/package/control-monad-exception-mtl-0.10.3
66 "name: control-monad-exception-mtl\nversion: 0.10.3\nCabal-Version: >= 1.10\nbuild-type: Simple\nlicense: PublicDomain\nauthor: Pepe Iborra\nmaintainer: pepeiborra@gmail.com\nhomepage: http://pepeiborra.github.com/control-monad-exception\nsynopsis: MTL instances f"
67 (Fingerprint 18274748422558568404 4043538769550834851)
68 (Fingerprint 11395257416101232635 4303318131190196308)
69 (bsReplace " default- extensions:" "unknown-section")
70 , -- http://hackage.haskell.org/package/vacuum-opengl-0.0
71 -- \DEL character
73 "Name: vacuum-opengl\nVersion: 0.0\nSynopsis: Visualize live Haskell data structures using vacuum, graphviz and OpenGL.\nDescription: \DELVisualize live Haskell data structures using vacuum, graphviz and OpenGL.\n "
74 (Fingerprint 5946760521961682577 16933361639326309422)
75 (Fingerprint 14034745101467101555 14024175957788447824)
76 (bsRemove "\DEL")
77 , mk
78 "Name: vacuum-opengl\nVersion: 0.0.1\nSynopsis: Visualize live Haskell data structures using vacuum, graphviz and OpenGL.\nDescription: \DELVisualize live Haskell data structures using vacuum, graphviz and OpenGL.\n "
79 (Fingerprint 10790950110330119503 1309560249972452700)
80 (Fingerprint 1565743557025952928 13645502325715033593)
81 (bsRemove "\DEL")
82 , -- http://hackage.haskell.org/package/ixset-1.0.4
83 -- {- comments -}
85 "Name: ixset\nVersion: 1.0.4\nSynopsis: Efficient relational queries on Haskell sets.\nDescription:\n Create and query sets that are indexed by multiple indices.\nLicense: BSD3\nLicense-file: COPYING\nAut"
86 (Fingerprint 11886092342440414185 4150518943472101551)
87 (Fingerprint 5731367240051983879 17473925006273577821)
88 (bsRemoveStarting "{-")
89 , -- : after section
90 -- http://hackage.haskell.org/package/ds-kanren
92 "name: ds-kanren\nversion: 0.2.0.0\nsynopsis: A subset of the miniKanren language\ndescription:\n ds-kanren is an implementation of the <http://minikanren.org miniKanren> language.\n .\n == What's in ds-kanren?\n .\n ['dis"
93 (Fingerprint 2804006762382336875 9677726932108735838)
94 (Fingerprint 9830506174094917897 12812107316777006473)
95 (bsReplace "Test-Suite test-unify:" "Test-Suite \"test-unify:\"" . bsReplace "Test-Suite test-list-ops:" "Test-Suite \"test-list-ops:\"")
96 , mk
97 "name: ds-kanren\nversion: 0.2.0.1\nsynopsis: A subset of the miniKanren language\ndescription:\n ds-kanren is an implementation of the <http://minikanren.org miniKanren> language.\n\nlicense: MIT\nlicense-file: "
98 (Fingerprint 9130259649220396193 2155671144384738932)
99 (Fingerprint 1847988234352024240 4597789823227580457)
100 (bsReplace "Test-Suite test-unify:" "Test-Suite \"test-unify:\"" . bsReplace "Test-Suite test-list-ops:" "Test-Suite \"test-list-ops:\"")
101 , mk
102 "name: metric\nversion: 0.1.4\nsynopsis: Metric spaces.\nlicense: MIT\nlicense-file: LICENSE\nauthor: Vikram Verma\nmaintainer: me@vikramverma.com\ncategory: Data\nbuild-type:"
103 (Fingerprint 6150019278861565482 3066802658031228162)
104 (Fingerprint 9124826020564520548 15629704249829132420)
105 (bsReplace "test-suite metric-tests:" "test-suite \"metric-tests:\"")
106 , mk
107 "name: metric\nversion: 0.2.0\nsynopsis: Metric spaces.\nlicense: MIT\nlicense-file: LICENSE\nauthor: Vikram Verma\nmaintainer: me@vikramverma.com\ncategory: Data\nbuild-type:"
108 (Fingerprint 4639805967994715694 7859317050376284551)
109 (Fingerprint 5566222290622325231 873197212916959151)
110 (bsReplace "test-suite metric-tests:" "test-suite \"metric-tests:\"")
111 , mk
112 "name: phasechange\ncategory: Data\nversion: 0.1\nauthor: G\195\161bor Lehel\nmaintainer: G\195\161bor Lehel <illissius@gmail.com>\nhomepage: http://github.com/glehel/phasechange\ncopyright: Copyright (C) 2012 G\195\161bor Lehel\nlicense: "
113 (Fingerprint 10546509771395401582 245508422312751943)
114 (Fingerprint 5169853482576003304 7247091607933993833)
115 (bsReplace "impl(ghc >= 7.4):" "erroneous-section" . bsReplace "impl(ghc >= 7.6):" "erroneous-section")
116 , mk
117 "Name: smartword\nSynopsis: Web based flash card for Word Smart I and II vocabularies\nVersion: 0.0.0.5\nHomepage: http://kyagrd.dyndns.org/~kyagrd/project/smartword/\nCategory: Web,Education\nLicense: "
118 (Fingerprint 7803544783533485151 10807347873998191750)
119 (Fingerprint 1665635316718752601 16212378357991151549)
120 (bsReplace "build depends:" "--")
121 , mk
122 "name: shelltestrunner\n-- sync with README.md, ANNOUNCE:\nversion: 1.3\ncategory: Testing\nsynopsis: A tool for testing command-line programs.\ndescription:\n shelltestrunner is a cross-platform tool for testing command-line\n program"
123 (Fingerprint 4403237110790078829 15392625961066653722)
124 (Fingerprint 10218887328390239431 4644205837817510221)
125 (bsReplace "other modules:" "--")
126 , -- &&!
127 -- http://hackage.haskell.org/package/hblas-0.3.0.0
129 "-- Initial hblas.cabal generated by cabal init. For further \n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP) \n-- "
130 (Fingerprint 8570120150072467041 18315524331351505945)
131 (Fingerprint 10838007242302656005 16026440017674974175)
132 (bsReplace "&&!" "&& !")
133 , mk
134 "-- Initial hblas.cabal generated by cabal init. For further \n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP) \n-- "
135 (Fingerprint 5262875856214215155 10846626274067555320)
136 (Fingerprint 3022954285783401045 13395975869915955260)
137 (bsReplace "&&!" "&& !")
138 , mk
139 "-- Initial hblas.cabal generated by cabal init. For further \n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP) \n-- "
140 (Fingerprint 54222628930951453 5526514916844166577)
141 (Fingerprint 1749630806887010665 8607076506606977549)
142 (bsReplace "&&!" "&& !")
143 , mk
144 "-- Initial hblas.cabal generated by cabal init. For further\n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP)\n-- fo"
145 (Fingerprint 6817250511240350300 15278852712000783849)
146 (Fingerprint 15757717081429529536 15542551865099640223)
147 (bsReplace "&&!" "&& !")
148 , mk
149 "-- Initial hblas.cabal generated by cabal init. For further\n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP)\n-- fo"
150 (Fingerprint 8310050400349211976 201317952074418615)
151 (Fingerprint 10283381191257209624 4231947623042413334)
152 (bsReplace "&&!" "&& !")
153 , mk
154 "-- Initial hblas.cabal generated by cabal init. For further\n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP)\n-- fo"
155 (Fingerprint 7010988292906098371 11591884496857936132)
156 (Fingerprint 6158672440010710301 6419743768695725095)
157 (bsReplace "&&!" "&& !")
158 , mk
159 "-- Initial hblas.cabal generated by cabal init. For further\r\n-- documentation, see http://haskell.org/cabal/users-guide/\r\n\r\n-- The name of the package.\r\nname: hblas\r\n\r\n-- The package version. See the Haskell package versioning policy (PVP)"
160 (Fingerprint 2076850805659055833 16615160726215879467)
161 (Fingerprint 10634706281258477722 5285812379517916984)
162 (bsReplace "&&!" "&& !")
163 , mk
164 "-- Initial hblas.cabal generated by cabal init. For further\r\n-- documentation, see http://haskell.org/cabal/users-guide/\r\n\r\n-- The name of the package.\r\nname: hblas\r\n\r\n-- The package version. See the Haskell package versioning policy (PVP)"
165 (Fingerprint 11850020631622781099 11956481969231030830)
166 (Fingerprint 13702868780337762025 13383526367149067158)
167 (bsReplace "&&!" "&& !")
168 , mk
169 "-- Initial hblas.cabal generated by cabal init. For further\n-- documentation, see http://haskell.org/cabal/users-guide/\n\n-- The name of the package.\nname: hblas\n\n-- The package version. See the Haskell package versioning policy (PVP)\n-- fo"
170 (Fingerprint 13690322768477779172 19704059263540994)
171 (Fingerprint 11189374824645442376 8363528115442591078)
172 (bsReplace "&&!" "&& !")
173 , -- flag used, but not defined
175 "name: brainheck\nversion: 0.1.0.2\nsynopsis: Brainh*ck interpreter in haskell\ndescription: Brainh*ck interpreter written in haskell and taking advantage of many prominent libraries\nhomepage: https://gi"
176 (Fingerprint 6910727116443152200 15401634478524888973)
177 (Fingerprint 16551412117098094368 16260377389127603629)
178 (bsReplace "flag(llvm-fast)" "False")
179 , mk
180 "name: brainheck\r\nversion: 0.1.0.2\r\nx-revision: 1\r\nsynopsis: Brainh*ck interpreter in haskell\r\ndescription: Brainh*ck interpreter written in haskell and taking advantage of many prominent libraries\r\nhomepage: "
181 (Fingerprint 14320987921316832277 10031098243571536929)
182 (Fingerprint 7959395602414037224 13279941216182213050)
183 (bsReplace "flag(llvm-fast)" "False")
184 , mk
185 "name: brainheck\r\nversion: 0.1.0.2\r\nx-revision: 2\r\nsynopsis: Brainh*ck interpreter in haskell\r\ndescription: Brainh*ck interpreter written in haskell and taking advantage of many prominent libraries\r\nhomepage: "
186 (Fingerprint 3809078390223299128 10796026010775813741)
187 (Fingerprint 1127231189459220796 12088367524333209349)
188 (bsReplace "flag(llvm-fast)" "False")
189 , mk
190 "name: brainheck\r\nversion: 0.1.0.2\r\nx-revision: 3\r\nsynopsis: Brainh*ck interpreter in haskell\r\ndescription: Brainh*ck interpreter written in haskell and taking advantage of many prominent libraries\r\nhomepage: "
191 (Fingerprint 13860013038089410950 12479824176801390651)
192 (Fingerprint 4687484721703340391 8013395164515771785)
193 (bsReplace "flag(llvm-fast)" "False")
194 , mk
195 "name: wordchoice\nversion: 0.1.0.1\nsynopsis: Get word counts and distributions\ndescription: A command line tool to compute the word distribution from various types of document, converting to text with pandoc.\nho"
196 (Fingerprint 16215911397419608203 15594928482155652475)
197 (Fingerprint 15120681510314491047 2666192399775157359)
198 (bsReplace "flag(llvm-fast)" "False")
199 , mk
200 "name: wordchoice\r\nversion: 0.1.0.1\r\nx-revision: 1\r\nsynopsis: Get word counts and distributions\r\ndescription: A command line tool to compute the word distribution from various types of document, converting to te"
201 (Fingerprint 16593139224723441188 4052919014346212001)
202 (Fingerprint 3577381082410411593 11481899387780544641)
203 (bsReplace "flag(llvm-fast)" "False")
204 , mk
205 "name: wordchoice\nversion: 0.1.0.2\nsynopsis: Get word counts and distributions\ndescription: A command line tool to compute the word distribution from various types of document, converting to text with pandoc.\nho"
206 (Fingerprint 9321301260802539374 1316392715016096607)
207 (Fingerprint 3784628652257760949 12662640594755291035)
208 (bsReplace "flag(llvm-fast)" "False")
209 , mk
210 "name: wordchoice\r\nversion: 0.1.0.2\r\nx-revision: 1\r\nsynopsis: Get word counts and distributions\r\ndescription: A command line tool to compute the word distribution from various types of document, converting to te"
211 (Fingerprint 2546901804824433337 2059732715322561176)
212 (Fingerprint 8082068680348326500 615008613291421947)
213 (bsReplace "flag(llvm-fast)" "False")
214 , mk
215 "name: wordchoice\nversion: 0.1.0.3\nsynopsis: Get word counts and distributions\ndescription: A command line tool to compute the word distribution from various types of document, converting to text with pandoc.\nho"
216 (Fingerprint 2282380737467965407 12457554753171662424)
217 (Fingerprint 17324757216926991616 17172911843227482125)
218 (bsReplace "flag(llvm-fast)" "False")
219 , mk
220 "name: wordchoice\r\nversion: 0.1.0.3\r\nx-revision: 1\r\nsynopsis: Get word counts and distributions\r\ndescription: A command line tool to compute the word distribution from various types of document, converting to te"
221 (Fingerprint 12907988890480595481 11078473638628359710)
222 (Fingerprint 13246185333368731848 4663060731847518614)
223 (bsReplace "flag(llvm-fast)" "False")
224 , mk
225 "name: hw-prim-bits\nversion: 0.1.0.0\nsynopsis: Primitive support for bit manipulation\ndescription: Please see README.md\nhomepage: https://github.com/githubuser/hw-prim-bits#readme\nlicense: "
226 (Fingerprint 12386777729082870356 17414156731912743711)
227 (Fingerprint 3452290353395041602 14102887112483033720)
228 (bsReplace "flag(sse42)" "False")
229 , mk
230 "name: hw-prim-bits\nversion: 0.1.0.1\nsynopsis: Primitive support for bit manipulation\ndescription: Please see README.md\nhomepage: https://github.com/githubuser/hw-prim-bits#readme\nlicen"
231 (Fingerprint 6870520675313101180 14553457351296240636)
232 (Fingerprint 12481021059537696455 14711088786769892762)
233 (bsReplace "flag(sse42)" "False")
234 , -- leading zeros in version digits
235 -- https://github.com/haskell-infra/hackage-trustees/issues/128
236 -- https://github.com/haskell/cabal/issues/5092
237 -- https://github.com/haskell/cabal/issues/5138
239 "name: Sit\nversion: 0.2017.02.26\nbuild-type: Simple\ncabal-version: >= 1.8\nlicense: OtherLicense\nlicense-file: LICENSE\nauthor: Anonymous\nmaintainer: Anonymous\nhomepage: NONE\ncategory: Dependent"
240 (Fingerprint 8458530898096910998 3228538743646501413)
241 (Fingerprint 14470502514907936793 17514354054641875371)
242 (bsReplace "0.2017.02.26" "0.2017.2.26")
243 , mk
244 "name: Sit\nversion: 0.2017.05.01\nbuild-type: Simple\ncabal-version: >= 1.8\nlicense: OtherLicense\nlicense-file: LICENSE\nauthor: Andreas Abel <andreas.abel@gu.se>\nmaintainer: Andreas Abel <andreas.abel@gu.se>\n"
245 (Fingerprint 1450130849535097473 11742099607098860444)
246 (Fingerprint 16679762943850814021 4253724355613883542)
247 (bsReplace "0.2017.05.01" "0.2017.5.1")
248 , mk
249 "name: Sit\nversion: 0.2017.05.02\nbuild-type: Simple\ncabal-version: >= 1.8\nlicense: OtherLicense\nlicense-file: LICENSE\nauthor: Andreas Abel <andreas.abel@gu.se>\nmaintainer: Andreas Abel <andreas.abel@gu.se>\n"
250 (Fingerprint 297248532398492441 17322625167861324800)
251 (Fingerprint 634812045126693280 1755581866539318862)
252 (bsReplace "0.2017.05.02" "0.2017.5.2")
253 , mk
254 "name: Sit\nversion: 0.2017.5.02\nx-revision: 1\n-- x-revision:1 see https://github.com/haskell-infra/hackage-trustees/issues/128\nbuild-type: Simple\ncabal-version: >= 1.8\nlicense: OtherLicense\nlicense-file: LICENSE\nauthor: "
255 (Fingerprint 3697869560530373941 3942982281026987312)
256 (Fingerprint 14344526114710295386 16386400353475114712)
257 (bsReplace "0.2017.5.02" "0.2017.5.2")
258 , mk
259 "name: MiniAgda\nversion: 0.2017.02.18\nbuild-type: Simple\ncabal-version: >= 1.22\nlicense: OtherLicense\nlicense-file: LICENSE\nauthor: Andreas Abel and Karl Mehltretter\nmaintainer: Andreas Abel <andreas.abel@i"
260 (Fingerprint 17167128953451088679 4300350537748753465)
261 (Fingerprint 12402236925293025673 7715084875284020606)
262 (bsReplace "0.2017.02.18" "0.2017.2.18")
263 , mk
264 "cabal-version:\n 2.0\nname:\n fast-downward\nversion:\n 0.1.0.0\nbuild-type:\n Simple\nsynopsis:\n Solve classical planning problems (STRIPS/SAS+) using Haskell & Fast Downward.\ndescription:\n @fast-downward@ is a library for modelling classical planning probl"
265 (Fingerprint 11256076039027887363 6867903407496243216)
266 (Fingerprint 12159816716813155434 5278015399212299853)
267 (bsReplace "1.2.03.0" "1.2.3.0")
268 , mk
269 "cabal-version:\r\n 2.0\r\nname:\r\n fast-downward\r\nversion:\r\n 0.1.0.0\r\nx-revision: \r\n 1\r\nbuild-type:\r\n Simple\r\nsynopsis:\r\n Solve classical planning problems (STRIPS/SAS+) using Haskell & Fast Downward.\r\ndescription:\r\n @fast-downward@ is a library for mode"
270 (Fingerprint 9216193973149680231 893446343655828508)
271 (Fingerprint 10020169545407746427 1828336750379510675)
272 (bsReplace "1.2.03.0" "1.2.3.0")
273 , mk
274 "cabal-version:\n 2.0\nname:\n fast-downward\nversion:\n 0.1.0.1\nbuild-type:\n Simple\nsynopsis:\n Solve classical planning problems (STRIPS/SAS+) using Haskell & Fast Downward.\ndescription:\n @fast-downward@ is a library for modelling classical planning probl"
275 (Fingerprint 9899886602574848632 5980433644983783334)
276 (Fingerprint 12007469255857289958 8321466548645225439)
277 (bsReplace "1.2.03.0" "1.2.3.0")
278 , mk
279 "cabal-version:\n 2.0\nname:\n fast-downward\nversion:\n 0.1.1.0\nbuild-type:\n Simple\nsynopsis:\n Solve classical planning problems (STRIPS/SAS+) using Haskell & Fast Downward.\ndescription:\n @fast-downward@ is a library for modelling classical planning probl"
280 (Fingerprint 12694656661460787751 1902242956706735615)
281 (Fingerprint 15433152131513403849 2284712791516353264)
282 (bsReplace "1.2.03.0" "1.2.3.0")
283 , -- 9 digits limit
285 "Name: SGplus\nVersion: 1.1\nSynopsis: (updated) Small geometry library for dealing with vectors and collision detection\nLicense: BSD3\nLicense-file: LICENSE\nAuthor: Neil Brown\nMaintainer: "
286 (Fingerprint 17735649550442248029 11493772714725351354)
287 (Fingerprint 9565458801063261772 15955773698774721052)
288 (bsReplace "1000000000" "100000000")
289 , mk
290 "-- Initial control-dotdotdot.cabal generated by cabal init. For further \n-- documentation, see http://haskell.org/cabal/users-guide/\n\nname: control-dotdotdot\nversion: 0.1.0.1\nsynopsis: Haskell operator\n "
291 (Fingerprint 1514257173776509942 7756050823377346485)
292 (Fingerprint 14082092642045505999 18415918653404121035)
293 (bsReplace "9223372036854775807" "5")
294 , mk
295 "name: data-foldapp\r\nversion: 0.1.1.0\r\nsynopsis: Fold function applications. Framework for variadic functions.\r\ndescription: Fold function applications. Framework for variadic functions.\r\nhomepage: ht"
296 (Fingerprint 4511234156311243251 11701153011544112556)
297 (Fingerprint 11820542702491924189 4902231447612406724)
298 (bsReplace "9223372036854775807" "999" . bsReplace "9223372036854775807" "999")
299 , mk
300 "-- Initial data-list-zigzag.cabal generated by cabal init. For further \r\n-- documentation, see http://haskell.org/cabal/users-guide/\r\n\r\nname: data-list-zigzag\r\nversion: 0.1.1.1\r\nsynopsis: A list but with a balanced en"
301 (Fingerprint 12475837388692175691 18053834261188158945)
302 (Fingerprint 16279938253437334942 15753349540193002309)
303 (bsReplace "9223372036854775807" "999")
304 , -- Not UTF8
306 "Name: nat\nVersion: 0.1\nDescription: Implementation of natural numbers and integers by a binary\n representation. The implementation is supposed to be lazy and\n "
307 (Fingerprint 9222512268705577108 13085311382746579495)
308 (Fingerprint 17468921266614378430 13221316288008291892)
309 (bsReplace "\xf6" "\xc3\xb6")
310 , -- cabal-version: 2
312 "name: streaming-bracketed\nversion: 0.1.0.0\nsynopsis: A resource management decorator for \"streaming\". \ndescription: This package provides a decorator for the Stream type from\n the \"st"
313 (Fingerprint 14670044663153191927 1427497586294143829)
314 (Fingerprint 9233007756654759985 6571998449003682006)
315 (bsReplace "cabal-version: 2" "cabal-version: 2.0")
316 , mk
317 "name: streaming-bracketed\nversion: 0.1.0.1\nsynopsis: A resource management decorator for \"streaming\". \ndescription: This package provides a decorator for the Stream type from\n \"stream"
318 (Fingerprint 7298738862909203815 10141693276062967842)
319 (Fingerprint 1349949738792220441 3593683359695349293)
320 (bsReplace "cabal-version: 2" "cabal-version: 2.0")
321 , mk
322 "name: zsyntax\nversion: 0.2.0.0\ndescription: An automated theorem prover for Zsyntax, a\n logical calculus for molecular biology inspired by linear logic,\n that can be used to automatically verify biological\n"
323 (Fingerprint 17812331267506881875 3005293725141563863)
324 (Fingerprint 3445957263137759540 12472369104312474458)
325 (bsReplace "cabal-version: 2" "cabal-version: 2.0")
326 , -- Empty filepath in not license-file or data-dir
327 -- These have hs-source-dirs: ""
329 "\nname: wai-middleware-hmac-client\nversion: 0.1.0.1\nlicense: BSD3\nlicense-file: LICENSE\nauthor: Christopher Reichert\nmaintainer: creichert07@gmail.com\ncopyright: (c) 2015, Christo"
330 (Fingerprint 3112606538775065787 11984607507024462091)
331 (Fingerprint 6916432989977230500 6621389616675138128)
332 (bsReplace "\"\"" ".")
333 , mk
334 "\nname: wai-middleware-hmac-client\nversion: 0.1.0.2\nlicense: BSD3\nlicense-file: LICENSE\nauthor: Christopher Reichert\nmaintainer: creichert07@gmail.com\ncopyright: (c) 2015, Christo"
335 (Fingerprint 12566783342663020458 17562089389615949789)
336 (Fingerprint 15745683452603944938 10556498036622072844)
337 (bsReplace "\"\"" ".")
338 , -- absolute license-file
340 "name: reheat\nversion: 0.1.4\ncabal-version: >=1.8\nbuild-type: Simple\nlicense: GPL\nlicense-file: /home/palo/dev/haskell-workspace/playground/reheat/gpl-3.0.txt\ncopyright: GPL\nmaintainer: Ingolf Wagner <palipalo9@gmail.com>\nstability: experimental\nhomepage: h"
341 (Fingerprint 9155400339287317061 14812953666990892802)
342 (Fingerprint 7687053346032173923 15384472501136606592)
343 (bsReplace "/home/palo/dev/haskell-workspace/playground/reheat/gpl-3.0.txt" "")
344 , mk
345 "name: reheat\nversion: 0.1.5\ncabal-version: >=1.8\nbuild-type: Simple\nlicense: GPL\nlicense-file: /home/palo/dev/haskell-workspace/playground/reheat/gpl-3.0.txt\ncopyright: GPL\nmaintainer: Ingolf Wagner <palipalo9@gmail.com>\nstability: experimental\nhomepage: h"
346 (Fingerprint 2984391146441073709 11728234882049907993)
347 (Fingerprint 12058479081855347701 14017937756688869826)
348 (bsReplace "/home/palo/dev/haskell-workspace/playground/reheat/gpl-3.0.txt" "")
350 where
351 mk a b c d = ((a, b), (c, d))
353 -- | Helper to create entries in patches
354 _makePatchKey :: FilePath -> (BS.ByteString -> BS.ByteString) -> IO ()
355 _makePatchKey fp transform = do
356 contents <- BS.readFile fp
357 let output = transform contents
358 let Fingerprint hi lo = md5 contents
359 let Fingerprint hi' lo' = md5 output
360 putStrLn
361 $ showString " , mk "
362 . shows (BS.take 256 contents)
363 . showString "\n (Fingerprint "
364 . shows hi
365 . showString " "
366 . shows lo
367 . showString ")\n (Fingerprint "
368 . shows hi'
369 . showString " "
370 . shows lo'
371 . showString ")"
372 $ ""
374 -------------------------------------------------------------------------------
375 -- Patch helpers
376 -------------------------------------------------------------------------------
378 bsRemove
379 :: BS.ByteString
380 -- ^ needle
381 -> BS.ByteString
382 -> BS.ByteString
383 bsRemove needle haystack = case BS.breakSubstring needle haystack of
384 (h, t) -> BS.append h (BS.drop (BS.length needle) t)
386 bsReplace
387 :: BS.ByteString
388 -- ^ needle
389 -> BS.ByteString
390 -- ^ replacement
391 -> BS.ByteString
392 -> BS.ByteString
393 bsReplace needle repl haystack = case BS.breakSubstring needle haystack of
394 (h, t)
395 | not (BS.null t) -> BS.append h (BS.append repl (BS.drop (BS.length needle) t))
396 | otherwise -> haystack
398 bsRemoveStarting
399 :: BS.ByteString
400 -- ^ needle
401 -> BS.ByteString
402 -> BS.ByteString
403 bsRemoveStarting needle haystack = case BS.breakSubstring needle haystack of
404 (h, _) -> h