This file is indexed.

/usr/share/doc/libghc-debian-doc/html/debian.txt is in libghc-debian-doc 3.89-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Modules for working with the Debian package system
--   
--   This library includes modules covering some basic data types defined
--   by the Debian policy manual - version numbers, control file syntax,
--   etc.
@package debian
@version 3.89


-- | There are old index files that have funky characters like 'ΓΈ' that are
--   not properly UTF8 encoded. As far as I can tell, these files are
--   otherwise plain ascii, so just naivelyinsert the character into the
--   output stream.
module Debian.UTF8
decode :: ByteString -> Text
readFile :: FilePath -> IO Text


-- | Domain independent functions used by the haskell-debian package.
module Debian.Extra.Files
withTemporaryFile :: MonadIO m => (FilePath -> m a) -> String -> m a

module Debian.Loc
__LOC__ :: Q Exp
mapExn :: (MonadCatch m, Exception e) => m a -> (e -> e) -> m a


-- | A constructor we can wrap around values to avoid any built in Pretty
--   instance - for example, instance Pretty [a].
--   
--   <ul>
--   <li>display is now prettyShow</li>
--   <li>display' is now prettyText</li>
--   <li>ppDisplay is now ppShow</li>
--   <li>ppDisplay' is now ppText</li>
--   </ul>
module Debian.Pretty

-- | This type is wrapped around values before we pretty print them so we
--   can write our own Pretty instances for common types without polluting
--   the name space of clients of this package with instances they don't
--   want.
newtype PP a
PP :: a -> PP a
[unPP] :: PP a -> a

-- | Pretty print a value with the <a>prettyNormal</a> level.
prettyShow :: Pretty a => a -> String
prettyText :: Pretty a => a -> Text
ppPrint :: Pretty (PP a) => a -> Doc
ppShow :: Pretty (PP a) => a -> String
ppText :: Pretty (PP a) => a -> Text
instance GHC.Base.Functor Debian.Pretty.PP
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Data.Text.Internal.Text)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP GHC.Base.String)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP a) => Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP (GHC.Base.Maybe a))


-- | A module for parsing, comparing, and (eventually) modifying debian
--   version numbers.
--   <a>http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version</a>
module Debian.Version.Common
data DebianVersion
prettyDebianVersion :: DebianVersion -> Doc
class ParseDebianVersion a
parseDebianVersion :: ParseDebianVersion a => a -> Either ParseError DebianVersion

-- | Convert a string to a debian version number. May throw an exception if
--   the string is unparsable -- but I am not sure if that can currently
--   happen. Are there any invalid version strings? Perhaps ones with
--   underscore, or something?
parseDebianVersion' :: ParseDebianVersion string => string -> DebianVersion

-- | Split a DebianVersion into its three components: epoch, version,
--   revision. It is not safe to use the parsed version number for this
--   because you will lose information, such as leading zeros.
evr :: DebianVersion -> (Maybe Int, String, Maybe String)
epoch :: DebianVersion -> Maybe Int
version :: DebianVersion -> String
revision :: DebianVersion -> Maybe String
buildDebianVersion :: Maybe Int -> String -> Maybe String -> DebianVersion
parseDV :: CharParser () (Found Int, NonNumeric, Found NonNumeric)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Version.Internal.DebianVersion)
instance GHC.Classes.Eq Debian.Version.Internal.DebianVersion
instance GHC.Classes.Ord Debian.Version.Internal.DebianVersion
instance GHC.Show.Show Debian.Version.Internal.DebianVersion
instance GHC.Classes.Eq Debian.Version.Internal.NonNumeric
instance GHC.Classes.Ord Debian.Version.Internal.NonNumeric
instance GHC.Classes.Eq Debian.Version.Internal.Numeric
instance GHC.Classes.Ord Debian.Version.Internal.Numeric

module Debian.Version.String
class ParseDebianVersion a
parseDebianVersion :: ParseDebianVersion a => a -> Either ParseError DebianVersion
instance Debian.Version.Common.ParseDebianVersion GHC.Base.String
instance GHC.Read.Read Debian.Version.Internal.DebianVersion

module Debian.Version.Text
class ParseDebianVersion a
parseDebianVersion :: ParseDebianVersion a => a -> Either ParseError DebianVersion
instance Debian.Version.Common.ParseDebianVersion Data.Text.Internal.Text

module Debian.Arch
data Arch
Source :: Arch
All :: Arch
Binary :: ArchOS -> ArchCPU -> Arch
data ArchOS
ArchOS :: String -> ArchOS
ArchOSAny :: ArchOS
data ArchCPU
ArchCPU :: String -> ArchCPU
ArchCPUAny :: ArchCPU
prettyArch :: Arch -> Doc
parseArch :: String -> Arch
instance Data.Data.Data Debian.Arch.Arch
instance GHC.Show.Show Debian.Arch.Arch
instance GHC.Read.Read Debian.Arch.Arch
instance GHC.Classes.Ord Debian.Arch.Arch
instance GHC.Classes.Eq Debian.Arch.Arch
instance Data.Data.Data Debian.Arch.ArchCPU
instance GHC.Show.Show Debian.Arch.ArchCPU
instance GHC.Read.Read Debian.Arch.ArchCPU
instance GHC.Classes.Ord Debian.Arch.ArchCPU
instance GHC.Classes.Eq Debian.Arch.ArchCPU
instance Data.Data.Data Debian.Arch.ArchOS
instance GHC.Show.Show Debian.Arch.ArchOS
instance GHC.Read.Read Debian.Arch.ArchOS
instance GHC.Classes.Ord Debian.Arch.ArchOS
instance GHC.Classes.Eq Debian.Arch.ArchOS

module Debian.Time
rfc822DateFormat' :: String
epochTimeToUTCTime :: EpochTime -> UTCTime
formatTimeRFC822 :: (FormatTime t) => t -> String
parseTimeRFC822 :: (ParseTime t) => String -> Maybe t
getCurrentLocalRFC822Time :: IO String

module Debian.URI

-- | A wrapper around a String containing a known parsable URI. Not
--   absolutely safe, because you could say read "URI' "bogus string"" ::
--   URI'. But enough to save me from myself.
data URI'

-- | Using the bogus Show instance of URI here. If it ever gets fixed this
--   will stop working. Worth noting that show will obscure any password
--   info embedded in the URI, so that's nice.
toURI' :: URI -> URI'
fromURI' :: URI' -> URI
readURI' :: String -> Maybe URI'
uriToString' :: URI -> String
fileFromURI :: URI -> IO (Either SomeException ByteString)
fileFromURIStrict :: URI -> IO (Either SomeException ByteString)
dirFromURI :: URI -> IO (Either SomeException [String])
instance GHC.Classes.Ord Debian.URI.URI'
instance GHC.Classes.Eq Debian.URI.URI'
instance GHC.Show.Show Debian.URI.URI'
instance GHC.Read.Read Debian.URI.URI'

module Debian.Release

-- | A distribution (aka release) name. This type is expected to refer to a
--   subdirectory of the dists directory which is at the top level of a
--   repository.
data ReleaseName
ReleaseName :: String -> ReleaseName
[relName] :: ReleaseName -> String
parseReleaseName :: String -> ReleaseName
releaseName' :: ReleaseName -> String

-- | A section of a repository such as main, contrib, non-free, restricted.
--   The indexes for a section are located below the distribution
--   directory.
newtype Section
Section :: String -> Section

-- | A package's subsection is only evident in its control information,
--   packages from different subsections all reside in the same index.
data SubSection
SubSection :: Section -> String -> SubSection
[section] :: SubSection -> Section
[subSectionName] :: SubSection -> String
sectionName :: SubSection -> String
sectionName' :: Section -> String
sectionNameOfSubSection :: SubSection -> String

-- | Parse the value that appears in the <tt>Section</tt> field of a
--   .changes file. (Does this need to be unesacped?)
parseSection :: String -> SubSection
parseSection' :: String -> Section
instance GHC.Classes.Ord Debian.Release.SubSection
instance GHC.Classes.Eq Debian.Release.SubSection
instance GHC.Show.Show Debian.Release.SubSection
instance GHC.Read.Read Debian.Release.SubSection
instance GHC.Classes.Ord Debian.Release.Section
instance GHC.Classes.Eq Debian.Release.Section
instance GHC.Show.Show Debian.Release.Section
instance GHC.Read.Read Debian.Release.Section
instance Data.Data.Data Debian.Release.ReleaseName
instance GHC.Show.Show Debian.Release.ReleaseName
instance GHC.Read.Read Debian.Release.ReleaseName
instance GHC.Classes.Ord Debian.Release.ReleaseName
instance GHC.Classes.Eq Debian.Release.ReleaseName

module Debian.Sources
data SourceType
Deb :: SourceType
DebSrc :: SourceType
data DebSource
DebSource :: SourceType -> URI -> Either String (ReleaseName, [Section]) -> DebSource
[sourceType] :: DebSource -> SourceType
[sourceUri] :: DebSource -> URI
[sourceDist] :: DebSource -> Either String (ReleaseName, [Section])

-- | This is a name given to a combination of parts of one or more releases
--   that can be specified by a sources.list file.
type SliceName = ReleaseName

-- | quoteWords - similar to words, but with special handling of
--   double-quotes and brackets.
--   
--   The handling double quotes and [] is supposed to match:
--   apt-0.6.44.2/apt-pkg/contrib/strutl.cc:ParseQuoteWord()
--   
--   The behaviour can be defined as:
--   
--   Break the string into space seperated words ignoring spaces that
--   appear between "" or []. Strip trailing and leading white space around
--   words. Strip out double quotes, but leave the square brackets intact.
quoteWords :: String -> [String]
stripLine :: String -> String
sourceLines :: String -> [String]

-- | parseSourceLine -- parses a source line the argument must be a
--   non-empty, valid source line with comments stripped see:
--   <a>sourceLines</a>
parseSourceLine :: String -> DebSource
parseSourceLine' :: String -> Maybe DebSource
parseSourcesList :: String -> [DebSource]
instance GHC.Show.Show Debian.Sources.DebSource
instance GHC.Classes.Ord Debian.Sources.DebSource
instance GHC.Classes.Eq Debian.Sources.DebSource
instance GHC.Show.Show Debian.Sources.SourceType
instance GHC.Classes.Ord Debian.Sources.SourceType
instance GHC.Classes.Eq Debian.Sources.SourceType
instance Text.PrettyPrint.HughesPJClass.Pretty Debian.Sources.SourceType
instance Text.PrettyPrint.HughesPJClass.Pretty Debian.Sources.DebSource
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP [Debian.Sources.DebSource])

module Debian.Control.Common
newtype Control' a
Control :: [Paragraph' a] -> Control' a
[unControl] :: Control' a -> [Paragraph' a]
newtype Paragraph' a
Paragraph :: [Field' a] -> Paragraph' a

-- | NOTE: we do not strip the leading or trailing whitespace in the name
--   or value
data Field' a
Field :: (a, a) -> Field' a

-- | Lines beginning with #
Comment :: a -> Field' a
class ControlFunctions a

-- | <a>parseControlFromFile</a> <tt>filepath</tt> is a simple wrapper
--   function that parses <tt>filepath</tt> using <tt>pControl</tt>
parseControlFromFile :: ControlFunctions a => FilePath -> IO (Either ParseError (Control' a))

-- | <a>parseControlFromHandle</a> <tt>sourceName</tt> <tt>handle</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControlFromHandle :: ControlFunctions a => String -> Handle -> IO (Either ParseError (Control' a))

-- | <tt>parseControlFromString</tt> <tt>sourceName</tt> <tt>text</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControl :: ControlFunctions a => String -> a -> (Either ParseError (Control' a))

-- | <a>lookupP</a> <tt>fieldName paragraph</tt> looks up a <a>Field</a> in
--   a <a>Paragraph</a>. <tt>N.B.</tt> trailing and leading whitespace is
--   <i>not</i> stripped.
lookupP :: ControlFunctions a => String -> (Paragraph' a) -> Maybe (Field' a)

-- | Strip the trailing and leading space and tab characters from a string.
--   Folded whitespace is <i>not</i> unfolded. This should probably be
--   moved to someplace more general purpose.
stripWS :: ControlFunctions a => a -> a

-- | Protect field value text so the parser doesn't split it into multiple
--   fields or paragraphs. This must modify all field text to enforce two
--   conditions: (1) All lines other than the initial one must begin with a
--   space or a tab, and (2) the trailing white space must not contain
--   newlines. This is called before pretty printing to prevent the parser
--   from misinterpreting field text as multiple fields or paragraphs.
protectFieldText :: ControlFunctions a => a -> a
asString :: ControlFunctions a => a -> String
mergeControls :: [Control' a] -> Control' a
fieldValue :: (ControlFunctions a) => String -> Paragraph' a -> Maybe a
removeField :: (Eq a) => a -> Paragraph' a -> Paragraph' a
prependFields :: [Field' a] -> Paragraph' a -> Paragraph' a
appendFields :: [Field' a] -> Paragraph' a -> Paragraph' a
renameField :: (Eq a) => a -> a -> Paragraph' a -> Paragraph' a
modifyField :: (Eq a) => a -> (a -> a) -> Paragraph' a -> Paragraph' a

-- | Move selected fields to the beginning of a paragraph.
raiseFields :: (Eq a) => (a -> Bool) -> Paragraph' a -> Paragraph' a

-- | Run a command and parse its output as a control file.
parseControlFromCmd :: ControlFunctions a => String -> IO (Either String (Control' a))

-- | look up the md5sum file in a paragraph Tries several different
--   variations: MD5Sum: Md5Sum: MD5sum:
md5sumField :: (ControlFunctions a) => Paragraph' a -> Maybe a

-- | This can usually be used as the implementation of protectFieldText
protectFieldText' :: (StringLike a, ListLike a Char) => ControlFunctions a => a -> a
instance GHC.Show.Show a => GHC.Show.Show (Debian.Control.Common.Control' a)
instance GHC.Read.Read a => GHC.Read.Read (Debian.Control.Common.Control' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Debian.Control.Common.Control' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Debian.Control.Common.Control' a)
instance GHC.Show.Show a => GHC.Show.Show (Debian.Control.Common.Paragraph' a)
instance GHC.Read.Read a => GHC.Read.Read (Debian.Control.Common.Paragraph' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Debian.Control.Common.Paragraph' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Debian.Control.Common.Paragraph' a)
instance GHC.Show.Show a => GHC.Show.Show (Debian.Control.Common.Field' a)
instance GHC.Read.Read a => GHC.Read.Read (Debian.Control.Common.Field' a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Debian.Control.Common.Field' a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Debian.Control.Common.Field' a)
instance (Debian.Control.Common.ControlFunctions a, Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP a)) => Text.PrettyPrint.HughesPJClass.Pretty (Debian.Control.Common.Control' a)
instance (Debian.Control.Common.ControlFunctions a, Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP a)) => Text.PrettyPrint.HughesPJClass.Pretty (Debian.Control.Common.Paragraph' a)
instance (Debian.Control.Common.ControlFunctions a, Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP a)) => Text.PrettyPrint.HughesPJClass.Pretty (Debian.Control.Common.Field' a)

module Debian.Control.String
newtype Control' a
Control :: [Paragraph' a] -> Control' a
newtype Paragraph' a
Paragraph :: [Field' a] -> Paragraph' a

-- | NOTE: we do not strip the leading or trailing whitespace in the name
--   or value
data Field' a
Field :: (a, a) -> Field' a

-- | Lines beginning with #
Comment :: a -> Field' a
type Control = Control' String
type Paragraph = Paragraph' String
type Field = Field' String
type ControlParser a = CharParser () a
class ControlFunctions a

-- | <a>parseControlFromFile</a> <tt>filepath</tt> is a simple wrapper
--   function that parses <tt>filepath</tt> using <tt>pControl</tt>
parseControlFromFile :: ControlFunctions a => FilePath -> IO (Either ParseError (Control' a))

-- | <a>parseControlFromHandle</a> <tt>sourceName</tt> <tt>handle</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControlFromHandle :: ControlFunctions a => String -> Handle -> IO (Either ParseError (Control' a))

-- | <tt>parseControlFromString</tt> <tt>sourceName</tt> <tt>text</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControl :: ControlFunctions a => String -> a -> (Either ParseError (Control' a))

-- | <a>lookupP</a> <tt>fieldName paragraph</tt> looks up a <a>Field</a> in
--   a <a>Paragraph</a>. <tt>N.B.</tt> trailing and leading whitespace is
--   <i>not</i> stripped.
lookupP :: ControlFunctions a => String -> (Paragraph' a) -> Maybe (Field' a)

-- | Strip the trailing and leading space and tab characters from a string.
--   Folded whitespace is <i>not</i> unfolded. This should probably be
--   moved to someplace more general purpose.
stripWS :: ControlFunctions a => a -> a

-- | Protect field value text so the parser doesn't split it into multiple
--   fields or paragraphs. This must modify all field text to enforce two
--   conditions: (1) All lines other than the initial one must begin with a
--   space or a tab, and (2) the trailing white space must not contain
--   newlines. This is called before pretty printing to prevent the parser
--   from misinterpreting field text as multiple fields or paragraphs.
protectFieldText :: ControlFunctions a => a -> a
asString :: ControlFunctions a => a -> String

-- | A parser for debian control file. This parser handles control files
--   that end without a newline as well as ones that have several blank
--   lines at the end. It is very liberal and does not attempt validate the
--   fields in any way. All trailing, leading, and folded whitespace is
--   preserved in the field values. See <a>stripWS</a>.
pControl :: ControlParser Control
mergeControls :: [Control' a] -> Control' a
fieldValue :: (ControlFunctions a) => String -> Paragraph' a -> Maybe a
removeField :: (Eq a) => a -> Paragraph' a -> Paragraph' a
prependFields :: [Field' a] -> Paragraph' a -> Paragraph' a
appendFields :: [Field' a] -> Paragraph' a -> Paragraph' a
renameField :: (Eq a) => a -> a -> Paragraph' a -> Paragraph' a
modifyField :: (Eq a) => a -> (a -> a) -> Paragraph' a -> Paragraph' a

-- | Move selected fields to the beginning of a paragraph.
raiseFields :: (Eq a) => (a -> Bool) -> Paragraph' a -> Paragraph' a
instance Debian.Control.Common.ControlFunctions GHC.Base.String

module Debian.Deb
fields :: (ControlFunctions a) => FilePath -> IO (Control' a)


-- | an interface for using the methods in <i>var</i>lib<i>apt</i>methods
module Debian.Apt.Methods

-- | withMethod - run |methodPath| bracketed with openMethod/closeMethod.
--   |f| gets the open handle.
withMethodPath :: FilePath -> (MethodHandle -> IO a) -> IO a
withMethodURI :: URI -> (MethodHandle -> IO a) -> IO a

-- | whichMethodBinary - find the method executable associated with a URI
--   throws an exception on failure
whichMethodPath :: URI -> IO (Maybe FilePath)
openMethod :: FilePath -> IO MethodHandle
closeMethod :: MethodHandle -> IO ExitCode
recvStatus :: MethodHandle -> IO Status
sendCommand :: MethodHandle -> Command -> IO ()
getLastModified :: FilePath -> IO (Maybe UTCTime)
simpleFetch :: [ConfigItem] -> URI -> FilePath -> Maybe UTCTime -> IO Bool

-- | fetch a single item, show console output see also: getLastModified
fetch :: FetchCallbacks -> [ConfigItem] -> URI -> FilePath -> Maybe UTCTime -> IO Bool
data FetchCallbacks
FetchCallbacks :: (Message -> IO ()) -> (URI -> Message -> IO ()) -> (URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> IO ()) -> (URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> Maybe FilePath -> Hashes -> Bool -> IO ()) -> (URI -> Message -> IO ()) -> (Message -> IO ()) -> (Site -> IO (Maybe (User, Password))) -> (Media -> Drive -> IO ()) -> (String -> IO ()) -> FetchCallbacks
[logCB] :: FetchCallbacks -> Message -> IO ()
[statusCB] :: FetchCallbacks -> URI -> Message -> IO ()
[uriStartCB] :: FetchCallbacks -> URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> IO ()
[uriDoneCB] :: FetchCallbacks -> URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> Maybe FilePath -> Hashes -> Bool -> IO ()
[uriFailureCB] :: FetchCallbacks -> URI -> Message -> IO ()
[generalFailureCB] :: FetchCallbacks -> Message -> IO ()
[authorizationRequiredCB] :: FetchCallbacks -> Site -> IO (Maybe (User, Password))
[mediaFailureCB] :: FetchCallbacks -> Media -> Drive -> IO ()
[debugCB] :: FetchCallbacks -> String -> IO ()

-- | set of callbacks which do nothing. suitable for non-interactive usage.
--   In the case authorization is required, no credentials will be supplied
--   and the download should abort.
emptyFetchCallbacks :: FetchCallbacks
cliFetchCallbacks :: FetchCallbacks
data Command
URIAcquire :: URI -> FilePath -> (Maybe UTCTime) -> Command
Configuration :: [ConfigItem] -> Command
AuthorizationCredentials :: Site -> User -> Password -> Command
MediaChanged :: Media -> (Maybe Bool) -> Command
data Status
Capabilities :: String -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Status
[version] :: Status -> String
[singleInstance] :: Status -> Bool
[preScan] :: Status -> Bool
[pipeline] :: Status -> Bool
[sendConfig] :: Status -> Bool
[needsCleanup] :: Status -> Bool
[localOnly] :: Status -> Bool
LogMsg :: Message -> Status
Status :: URI -> Message -> Status
URIStart :: URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> Status
[uri] :: Status -> URI
[size] :: Status -> Maybe Integer
[lastModified] :: Status -> Maybe UTCTime
[resumePoint] :: Status -> Maybe Integer
URIDone :: URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> Maybe FilePath -> Hashes -> Bool -> Status
[uri] :: Status -> URI
[size] :: Status -> Maybe Integer
[lastModified] :: Status -> Maybe UTCTime
[resumePoint] :: Status -> Maybe Integer
[filename] :: Status -> Maybe FilePath
[hashes] :: Status -> Hashes
[imsHit] :: Status -> Bool
URIFailure :: URI -> Message -> Status
[uri] :: Status -> URI
[message] :: Status -> Message
GeneralFailure :: Message -> Status
AuthorizationRequired :: Site -> Status
MediaFailure :: Media -> Drive -> Status
type Message = String
type Site = String
type User = String
type Password = String
type Media = String
type Drive = String
type Header = (String, String)
type ConfigItem = (String, String)
instance GHC.Classes.Eq Debian.Apt.Methods.Command
instance GHC.Show.Show Debian.Apt.Methods.Command
instance GHC.Classes.Eq Debian.Apt.Methods.Status
instance GHC.Show.Show Debian.Apt.Methods.Status
instance GHC.Classes.Eq Debian.Apt.Methods.Hashes
instance GHC.Show.Show Debian.Apt.Methods.Hashes

module Debian.Version.ByteString
class ParseDebianVersion a
parseDebianVersion :: ParseDebianVersion a => a -> Either ParseError DebianVersion
instance Debian.Version.Common.ParseDebianVersion Data.ByteString.Internal.ByteString


-- | A module for parsing, comparing, and (eventually) modifying debian
--   version numbers.
--   <a>http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version</a>
module Debian.Version
data DebianVersion
prettyDebianVersion :: DebianVersion -> Doc
parseDebianVersion :: ParseDebianVersion a => a -> Either ParseError DebianVersion

-- | Convert a string to a debian version number. May throw an exception if
--   the string is unparsable -- but I am not sure if that can currently
--   happen. Are there any invalid version strings? Perhaps ones with
--   underscore, or something?
parseDebianVersion' :: ParseDebianVersion string => string -> DebianVersion
epoch :: DebianVersion -> Maybe Int
version :: DebianVersion -> String
revision :: DebianVersion -> Maybe String
buildDebianVersion :: Maybe Int -> String -> Maybe String -> DebianVersion

-- | Split a DebianVersion into its three components: epoch, version,
--   revision. It is not safe to use the parsed version number for this
--   because you will lose information, such as leading zeros.
evr :: DebianVersion -> (Maybe Int, String, Maybe String)


-- | Changelog and changes file support.
module Debian.Changes

-- | A file generated by dpkg-buildpackage describing the result of a
--   package build
data ChangesFile
Changes :: FilePath -> String -> DebianVersion -> ReleaseName -> Arch -> Paragraph' Text -> ChangeLogEntry -> [ChangedFileSpec] -> ChangesFile

-- | The full pathname of the directory holding the .changes file.
[changeDir] :: ChangesFile -> FilePath

-- | The package name parsed from the .changes file name
[changePackage] :: ChangesFile -> String

-- | The version number parsed from the .changes file name
[changeVersion] :: ChangesFile -> DebianVersion

-- | The Distribution field of the .changes file
[changeRelease] :: ChangesFile -> ReleaseName

-- | The architecture parsed from the .changes file name
[changeArch] :: ChangesFile -> Arch

-- | The contents of the .changes file
[changeInfo] :: ChangesFile -> Paragraph' Text

-- | The value of the Changes field of the .changes file
[changeEntry] :: ChangesFile -> ChangeLogEntry

-- | The parsed value of the Files attribute
[changeFiles] :: ChangesFile -> [ChangedFileSpec]

-- | An entry in the list of files generated by the build.
data ChangedFileSpec
ChangedFileSpec :: String -> String -> String -> FileOffset -> SubSection -> String -> FilePath -> ChangedFileSpec
[changedFileMD5sum] :: ChangedFileSpec -> String
[changedFileSHA1sum] :: ChangedFileSpec -> String
[changedFileSHA256sum] :: ChangedFileSpec -> String
[changedFileSize] :: ChangedFileSpec -> FileOffset
[changedFileSection] :: ChangedFileSpec -> SubSection
[changedFilePriority] :: ChangedFileSpec -> String
[changedFileName] :: ChangedFileSpec -> FilePath
changesFileName :: ChangesFile -> String
newtype ChangeLog
ChangeLog :: [ChangeLogEntry] -> ChangeLog

-- | A changelog is a series of ChangeLogEntries
data ChangeLogEntry
Entry :: String -> DebianVersion -> [ReleaseName] -> String -> String -> String -> String -> ChangeLogEntry
[logPackage] :: ChangeLogEntry -> String
[logVersion] :: ChangeLogEntry -> DebianVersion
[logDists] :: ChangeLogEntry -> [ReleaseName]
[logUrgency] :: ChangeLogEntry -> String
[logComments] :: ChangeLogEntry -> String
[logWho] :: ChangeLogEntry -> String
[logDate] :: ChangeLogEntry -> String

-- | The parser here never returns this
WhiteSpace :: String -> ChangeLogEntry

-- | Parse the entries of a debian changelog and verify they are all valid.
parseChangeLog :: String -> ChangeLog

-- | Parse a Debian Changelog and return a lazy list of entries
parseEntries :: String -> [Either [String] ChangeLogEntry]

-- | Parse a single changelog entry, returning the entry and the remaining
--   text.
parseEntry :: String -> Either [String] (ChangeLogEntry, String)

-- | Parse the changelog information that shows up in the .changes file,
--   i.e. a changelog entry with no signature.
parseChanges :: Text -> Maybe ChangeLogEntry
instance GHC.Show.Show Debian.Changes.ChangeLog
instance GHC.Read.Read Debian.Changes.ChangeLog
instance GHC.Classes.Eq Debian.Changes.ChangeLog
instance GHC.Show.Show Debian.Changes.ChangesFile
instance GHC.Read.Read Debian.Changes.ChangesFile
instance GHC.Classes.Eq Debian.Changes.ChangesFile
instance GHC.Show.Show Debian.Changes.ChangeLogEntry
instance GHC.Read.Read Debian.Changes.ChangeLogEntry
instance GHC.Classes.Eq Debian.Changes.ChangeLogEntry
instance GHC.Show.Show Debian.Changes.ChangedFileSpec
instance GHC.Read.Read Debian.Changes.ChangedFileSpec
instance GHC.Classes.Eq Debian.Changes.ChangedFileSpec
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Changes.ChangesFile)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Changes.ChangedFileSpec)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Changes.ChangeLogEntry)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP [Debian.Changes.ChangeLogEntry])
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Changes.ChangeLog)

module Debian.Relation.Common
type Relations = AndRelation
type AndRelation = [OrRelation]
type OrRelation = [Relation]
data Relation
Rel :: BinPkgName -> (Maybe VersionReq) -> (Maybe ArchitectureReq) -> Relation
newtype SrcPkgName
SrcPkgName :: String -> SrcPkgName
[unSrcPkgName] :: SrcPkgName -> String
newtype BinPkgName
BinPkgName :: String -> BinPkgName
[unBinPkgName] :: BinPkgName -> String
class Pretty (PP a) => PkgName a
pkgNameFromString :: PkgName a => String -> a
class ParseRelations a

-- | <a>parseRelations</a> parse a debian relation (i.e. the value of a
--   Depends field). Return a parsec error or a value of type
--   <a>Relations</a>
parseRelations :: ParseRelations a => a -> Either ParseError Relations

-- | This needs to be indented for use in a control file: intercalate "n "
--   . lines . show
prettyRelations :: [[Relation]] -> Doc
prettyOrRelation :: [Relation] -> Doc
prettyRelation :: Relation -> Doc
data ArchitectureReq
ArchOnly :: (Set Arch) -> ArchitectureReq
ArchExcept :: (Set Arch) -> ArchitectureReq
prettyArchitectureReq :: ArchitectureReq -> Doc
data VersionReq
SLT :: DebianVersion -> VersionReq
LTE :: DebianVersion -> VersionReq
EEQ :: DebianVersion -> VersionReq
GRE :: DebianVersion -> VersionReq
SGR :: DebianVersion -> VersionReq
prettyVersionReq :: VersionReq -> Doc

-- | The sort order is based on version number first, then on the kind of
--   relation, sorting in the order

-- | Check if a version number satisfies a version requirement.
checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool

-- | Wrap <a>PP</a> around type synonyms that might overlap with the
--   `Pretty [a]` instance.
instance GHC.Show.Show Debian.Relation.Common.Relation
instance GHC.Read.Read Debian.Relation.Common.Relation
instance GHC.Classes.Eq Debian.Relation.Common.Relation
instance GHC.Show.Show Debian.Relation.Common.VersionReq
instance GHC.Read.Read Debian.Relation.Common.VersionReq
instance GHC.Classes.Eq Debian.Relation.Common.VersionReq
instance GHC.Show.Show Debian.Relation.Common.ArchitectureReq
instance GHC.Read.Read Debian.Relation.Common.ArchitectureReq
instance GHC.Classes.Ord Debian.Relation.Common.ArchitectureReq
instance GHC.Classes.Eq Debian.Relation.Common.ArchitectureReq
instance Data.Data.Data Debian.Relation.Common.BinPkgName
instance GHC.Classes.Ord Debian.Relation.Common.BinPkgName
instance GHC.Classes.Eq Debian.Relation.Common.BinPkgName
instance GHC.Show.Show Debian.Relation.Common.BinPkgName
instance GHC.Read.Read Debian.Relation.Common.BinPkgName
instance Data.Data.Data Debian.Relation.Common.SrcPkgName
instance GHC.Classes.Ord Debian.Relation.Common.SrcPkgName
instance GHC.Classes.Eq Debian.Relation.Common.SrcPkgName
instance GHC.Show.Show Debian.Relation.Common.SrcPkgName
instance GHC.Read.Read Debian.Relation.Common.SrcPkgName
instance Debian.Relation.Common.PkgName Debian.Relation.Common.BinPkgName
instance Debian.Relation.Common.PkgName Debian.Relation.Common.SrcPkgName
instance GHC.Classes.Ord Debian.Relation.Common.Relation
instance GHC.Classes.Ord Debian.Relation.Common.VersionReq
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.BinPkgName)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.SrcPkgName)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.Relations)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.OrRelation)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.Relation)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.VersionReq)
instance Text.PrettyPrint.HughesPJClass.Pretty (Debian.Pretty.PP Debian.Relation.Common.ArchitectureReq)


-- | A module for working with debian relationships
--   <a>http://www.debian.org/doc/debian-policy/ch-relationships.html</a>
module Debian.Relation.String
type AndRelation = [OrRelation]
type OrRelation = [Relation]
type Relations = AndRelation
data Relation
Rel :: BinPkgName -> (Maybe VersionReq) -> (Maybe ArchitectureReq) -> Relation
data ArchitectureReq
ArchOnly :: (Set Arch) -> ArchitectureReq
ArchExcept :: (Set Arch) -> ArchitectureReq
data VersionReq
SLT :: DebianVersion -> VersionReq
LTE :: DebianVersion -> VersionReq
EEQ :: DebianVersion -> VersionReq
GRE :: DebianVersion -> VersionReq
SGR :: DebianVersion -> VersionReq

-- | Check if a version number satisfies a version requirement.
checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool
type RelParser a = CharParser () a
class ParseRelations a

-- | <a>parseRelations</a> parse a debian relation (i.e. the value of a
--   Depends field). Return a parsec error or a value of type
--   <a>Relations</a>
parseRelations :: ParseRelations a => a -> Either ParseError Relations
pRelations :: RelParser Relations
instance Debian.Relation.Common.ParseRelations GHC.Base.String


-- | A module for working with debian relationships
--   <a>http://www.debian.org/doc/debian-policy/ch-relationships.html</a>
module Debian.Relation.Text
type AndRelation = [OrRelation]
type OrRelation = [Relation]
type Relations = AndRelation
data Relation
Rel :: BinPkgName -> (Maybe VersionReq) -> (Maybe ArchitectureReq) -> Relation
data ArchitectureReq
ArchOnly :: (Set Arch) -> ArchitectureReq
ArchExcept :: (Set Arch) -> ArchitectureReq
data VersionReq
SLT :: DebianVersion -> VersionReq
LTE :: DebianVersion -> VersionReq
EEQ :: DebianVersion -> VersionReq
GRE :: DebianVersion -> VersionReq
SGR :: DebianVersion -> VersionReq

-- | Check if a version number satisfies a version requirement.
checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool
type RelParser a = CharParser () a
class ParseRelations a

-- | <a>parseRelations</a> parse a debian relation (i.e. the value of a
--   Depends field). Return a parsec error or a value of type
--   <a>Relations</a>
parseRelations :: ParseRelations a => a -> Either ParseError Relations
instance Debian.Relation.Common.ParseRelations Data.Text.Internal.Text


-- | A module for working with debian relationships
--   <a>http://www.debian.org/doc/debian-policy/ch-relationships.html</a>
module Debian.Relation.ByteString
type AndRelation = [OrRelation]
type OrRelation = [Relation]
type Relations = AndRelation
data Relation
Rel :: BinPkgName -> (Maybe VersionReq) -> (Maybe ArchitectureReq) -> Relation
data ArchitectureReq
ArchOnly :: (Set Arch) -> ArchitectureReq
ArchExcept :: (Set Arch) -> ArchitectureReq
data VersionReq
SLT :: DebianVersion -> VersionReq
LTE :: DebianVersion -> VersionReq
EEQ :: DebianVersion -> VersionReq
GRE :: DebianVersion -> VersionReq
SGR :: DebianVersion -> VersionReq

-- | Check if a version number satisfies a version requirement.
checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool
type RelParser a = CharParser () a
class ParseRelations a

-- | <a>parseRelations</a> parse a debian relation (i.e. the value of a
--   Depends field). Return a parsec error or a value of type
--   <a>Relations</a>
parseRelations :: ParseRelations a => a -> Either ParseError Relations
instance Debian.Relation.Common.ParseRelations Data.ByteString.Internal.ByteString


-- | A module for working with debian relationships
--   <a>http://www.debian.org/doc/debian-policy/ch-relationships.html</a>
module Debian.Relation
class Pretty (PP a) => PkgName a
pkgNameFromString :: PkgName a => String -> a
newtype SrcPkgName
SrcPkgName :: String -> SrcPkgName
[unSrcPkgName] :: SrcPkgName -> String
newtype BinPkgName
BinPkgName :: String -> BinPkgName
[unBinPkgName] :: BinPkgName -> String
type Relations = AndRelation
type AndRelation = [OrRelation]
type OrRelation = [Relation]
data Relation
Rel :: BinPkgName -> (Maybe VersionReq) -> (Maybe ArchitectureReq) -> Relation
data ArchitectureReq
ArchOnly :: (Set Arch) -> ArchitectureReq
ArchExcept :: (Set Arch) -> ArchitectureReq
data Arch
Source :: Arch
All :: Arch
Binary :: ArchOS -> ArchCPU -> Arch
data ArchOS
ArchOS :: String -> ArchOS
ArchOSAny :: ArchOS
data ArchCPU
ArchCPU :: String -> ArchCPU
ArchCPUAny :: ArchCPU
data VersionReq
SLT :: DebianVersion -> VersionReq
LTE :: DebianVersion -> VersionReq
EEQ :: DebianVersion -> VersionReq
GRE :: DebianVersion -> VersionReq
SGR :: DebianVersion -> VersionReq

-- | Check if a version number satisfies a version requirement.
checkVersionReq :: Maybe VersionReq -> Maybe DebianVersion -> Bool
type RelParser a = CharParser () a
class ParseRelations a

-- | <a>parseRelations</a> parse a debian relation (i.e. the value of a
--   Depends field). Return a parsec error or a value of type
--   <a>Relations</a>
parseRelations :: ParseRelations a => a -> Either ParseError Relations

module Debian.Control.ByteString
newtype Control' a
Control :: [Paragraph' a] -> Control' a
[unControl] :: Control' a -> [Paragraph' a]
newtype Paragraph' a
Paragraph :: [Field' a] -> Paragraph' a

-- | NOTE: we do not strip the leading or trailing whitespace in the name
--   or value
data Field' a
Field :: (a, a) -> Field' a

-- | Lines beginning with #
Comment :: a -> Field' a
type Control = Control' ByteString
type Paragraph = Paragraph' ByteString
type Field = Field' ByteString
class ControlFunctions a

-- | <a>parseControlFromFile</a> <tt>filepath</tt> is a simple wrapper
--   function that parses <tt>filepath</tt> using <tt>pControl</tt>
parseControlFromFile :: ControlFunctions a => FilePath -> IO (Either ParseError (Control' a))

-- | <a>parseControlFromHandle</a> <tt>sourceName</tt> <tt>handle</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControlFromHandle :: ControlFunctions a => String -> Handle -> IO (Either ParseError (Control' a))

-- | <tt>parseControlFromString</tt> <tt>sourceName</tt> <tt>text</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControl :: ControlFunctions a => String -> a -> (Either ParseError (Control' a))

-- | <a>lookupP</a> <tt>fieldName paragraph</tt> looks up a <a>Field</a> in
--   a <a>Paragraph</a>. <tt>N.B.</tt> trailing and leading whitespace is
--   <i>not</i> stripped.
lookupP :: ControlFunctions a => String -> (Paragraph' a) -> Maybe (Field' a)

-- | Strip the trailing and leading space and tab characters from a string.
--   Folded whitespace is <i>not</i> unfolded. This should probably be
--   moved to someplace more general purpose.
stripWS :: ControlFunctions a => a -> a

-- | Protect field value text so the parser doesn't split it into multiple
--   fields or paragraphs. This must modify all field text to enforce two
--   conditions: (1) All lines other than the initial one must begin with a
--   space or a tab, and (2) the trailing white space must not contain
--   newlines. This is called before pretty printing to prevent the parser
--   from misinterpreting field text as multiple fields or paragraphs.
protectFieldText :: ControlFunctions a => a -> a
asString :: ControlFunctions a => a -> String
mergeControls :: [Control' a] -> Control' a
fieldValue :: (ControlFunctions a) => String -> Paragraph' a -> Maybe a
removeField :: (Eq a) => a -> Paragraph' a -> Paragraph' a
prependFields :: [Field' a] -> Paragraph' a -> Paragraph' a
appendFields :: [Field' a] -> Paragraph' a -> Paragraph' a
renameField :: (Eq a) => a -> a -> Paragraph' a -> Paragraph' a
modifyField :: (Eq a) => a -> (a -> a) -> Paragraph' a -> Paragraph' a

-- | Move selected fields to the beginning of a paragraph.
raiseFields :: (Eq a) => (a -> Bool) -> Paragraph' a -> Paragraph' a
instance GHC.Show.Show a => GHC.Show.Show (Debian.Control.ByteString.Result a)
instance Debian.Control.Common.ControlFunctions Data.ByteString.Internal.ByteString
instance GHC.Base.Functor (Debian.Control.ByteString.Parser state)
instance GHC.Base.Applicative (Debian.Control.ByteString.Parser state)
instance GHC.Base.Alternative (Debian.Control.ByteString.Parser state)
instance GHC.Base.Monad (Debian.Control.ByteString.Parser state)
instance GHC.Base.MonadPlus (Debian.Control.ByteString.Parser state)

module Debian.Control.Text
newtype Control' a
Control :: [Paragraph' a] -> Control' a
[unControl] :: Control' a -> [Paragraph' a]
newtype Paragraph' a
Paragraph :: [Field' a] -> Paragraph' a

-- | NOTE: we do not strip the leading or trailing whitespace in the name
--   or value
data Field' a
Field :: (a, a) -> Field' a

-- | Lines beginning with #
Comment :: a -> Field' a
type Control = Control' Text
type Paragraph = Paragraph' Text

-- | <tt>parseFromFile p filePath</tt> runs a string parser <tt>p</tt> on
--   the input read from <tt>filePath</tt> using <a>readFile</a>. Returns
--   either a <tt>ParseError</tt> (<a>Left</a>) or a value of type
--   <tt>a</tt> (<a>Right</a>).
--   
--   <pre>
--   main    = do{ result &lt;- parseFromFile numbers "digits.txt"
--               ; case result of
--                   Left err  -&gt; print err
--                   Right xs  -&gt; print (sum xs)
--               }
--   </pre>
type Field = Field' Text
class ControlFunctions a

-- | <a>parseControlFromFile</a> <tt>filepath</tt> is a simple wrapper
--   function that parses <tt>filepath</tt> using <tt>pControl</tt>
parseControlFromFile :: ControlFunctions a => FilePath -> IO (Either ParseError (Control' a))

-- | <a>parseControlFromHandle</a> <tt>sourceName</tt> <tt>handle</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControlFromHandle :: ControlFunctions a => String -> Handle -> IO (Either ParseError (Control' a))

-- | <tt>parseControlFromString</tt> <tt>sourceName</tt> <tt>text</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControl :: ControlFunctions a => String -> a -> (Either ParseError (Control' a))

-- | <a>lookupP</a> <tt>fieldName paragraph</tt> looks up a <a>Field</a> in
--   a <a>Paragraph</a>. <tt>N.B.</tt> trailing and leading whitespace is
--   <i>not</i> stripped.
lookupP :: ControlFunctions a => String -> (Paragraph' a) -> Maybe (Field' a)

-- | Strip the trailing and leading space and tab characters from a string.
--   Folded whitespace is <i>not</i> unfolded. This should probably be
--   moved to someplace more general purpose.
stripWS :: ControlFunctions a => a -> a

-- | Protect field value text so the parser doesn't split it into multiple
--   fields or paragraphs. This must modify all field text to enforce two
--   conditions: (1) All lines other than the initial one must begin with a
--   space or a tab, and (2) the trailing white space must not contain
--   newlines. This is called before pretty printing to prevent the parser
--   from misinterpreting field text as multiple fields or paragraphs.
protectFieldText :: ControlFunctions a => a -> a
asString :: ControlFunctions a => a -> String
mergeControls :: [Control' a] -> Control' a
fieldValue :: (ControlFunctions a) => String -> Paragraph' a -> Maybe a
removeField :: (Eq a) => a -> Paragraph' a -> Paragraph' a
prependFields :: [Field' a] -> Paragraph' a -> Paragraph' a
appendFields :: [Field' a] -> Paragraph' a -> Paragraph' a
renameField :: (Eq a) => a -> a -> Paragraph' a -> Paragraph' a
modifyField :: (Eq a) => a -> (a -> a) -> Paragraph' a -> Paragraph' a

-- | Move selected fields to the beginning of a paragraph.
raiseFields :: (Eq a) => (a -> Bool) -> Paragraph' a -> Paragraph' a
decodeControl :: Control -> Control
decodeParagraph :: Paragraph -> Paragraph
decodeField :: Field' ByteString -> Field' Text
instance Debian.Control.Common.ControlFunctions Data.Text.Internal.Text


-- | Access to things that Debian policy says should be in a valid control
--   file. The pure functions will not throw ControlFileError if they are
--   operating on a DebianControl value returned by validateDebianControl.
--   However, they might if they are created using unsafeDebianControl.
module Debian.Control.Policy

-- | Opaque (constructor not exported) type to hold a validated Debian
--   Control File
data DebianControl

-- | Validate and return a control file in an opaque wrapper. May throw a
--   ControlFileError. Currently we only verify that it has a Source field
--   in the first paragraph and one or more subsequent paragraphs each with
--   a Package field, and no syntax errors in the build dependencies
--   (though they may be absent.)
validateDebianControl :: MonadCatch m => Control' Text -> m (Either ControlFileError DebianControl)
unsafeDebianControl :: Control' Text -> DebianControl
parseDebianControlFromFile :: FilePath -> IO (Either ControlFileError DebianControl)
parseDebianControl :: MonadCatch m => String -> Text -> m (Either ControlFileError DebianControl)

-- | Errors that control files might throw, with source file name and line
--   number generated by template haskell.
data ControlFileError
NoParagraphs :: [Loc] -> ControlFileError
[locs] :: ControlFileError -> [Loc]
NoBinaryParagraphs :: [Loc] -> ControlFileError
[locs] :: ControlFileError -> [Loc]
MissingField :: [Loc] -> String -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[field] :: ControlFileError -> String
ParseRelationsError :: [Loc] -> ParseError -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[parseError] :: ControlFileError -> ParseError
ParseControlError :: [Loc] -> ParseError -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[parseError] :: ControlFileError -> ParseError
IOError :: [Loc] -> IOError -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[ioError] :: ControlFileError -> IOError

-- | Class of things that contain a validated Debian control file.
class HasDebianControl a
debianControl :: HasDebianControl a => a -> DebianControl
debianSourceParagraph :: HasDebianControl a => a -> Paragraph' Text
debianBinaryParagraphs :: HasDebianControl a => a -> [Paragraph' Text]
debianPackageParagraphs :: HasDebianControl a => a -> (Paragraph' Text, [Paragraph' Text])
debianPackageNames :: HasDebianControl a => a -> (SrcPkgName, [BinPkgName])
debianSourcePackageName :: HasDebianControl a => a -> SrcPkgName
debianBinaryPackageNames :: HasDebianControl a => a -> [BinPkgName]

-- | This could access fields we haven't validated, so it can return an
--   error. Additionally, the field might be absent, in which case it
--   returns Nothing.
debianRelations :: HasDebianControl a => String -> a -> Either ControlFileError (Maybe Relations)
debianBuildDeps :: HasDebianControl a => a -> Maybe Relations
debianBuildDepsIndep :: HasDebianControl a => a -> Maybe Relations
instance GHC.Show.Show Debian.Control.Policy.DebianControl
instance Debian.Control.Policy.HasDebianControl Debian.Control.Policy.DebianControl
instance Debian.Control.Policy.HasControl (Debian.Control.Common.Control' Data.Text.Internal.Text)
instance Debian.Control.Policy.HasControl Debian.Control.Policy.DebianControl
instance GHC.Show.Show Debian.Control.Policy.ControlFileError
instance GHC.Exception.Exception Debian.Control.Policy.ControlFileError
instance GHC.Classes.Eq Debian.Control.Policy.ControlFileError


-- | A module for working with Debian control files
--   <a>http://www.debian.org/doc/debian-policy/ch-controlfields.html</a>
module Debian.Control
newtype Control' a
Control :: [Paragraph' a] -> Control' a
[unControl] :: Control' a -> [Paragraph' a]
newtype Paragraph' a
Paragraph :: [Field' a] -> Paragraph' a

-- | NOTE: we do not strip the leading or trailing whitespace in the name
--   or value
data Field' a
Field :: (a, a) -> Field' a

-- | Lines beginning with #
Comment :: a -> Field' a
type Control = Control' String
type Paragraph = Paragraph' String
type Field = Field' String
type ControlParser a = CharParser () a
class ControlFunctions a

-- | <a>parseControlFromFile</a> <tt>filepath</tt> is a simple wrapper
--   function that parses <tt>filepath</tt> using <tt>pControl</tt>
parseControlFromFile :: ControlFunctions a => FilePath -> IO (Either ParseError (Control' a))

-- | <a>parseControlFromHandle</a> <tt>sourceName</tt> <tt>handle</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControlFromHandle :: ControlFunctions a => String -> Handle -> IO (Either ParseError (Control' a))

-- | <tt>parseControlFromString</tt> <tt>sourceName</tt> <tt>text</tt> -
--   <tt>sourceName</tt> is only used for error reporting
parseControl :: ControlFunctions a => String -> a -> (Either ParseError (Control' a))

-- | <a>lookupP</a> <tt>fieldName paragraph</tt> looks up a <a>Field</a> in
--   a <a>Paragraph</a>. <tt>N.B.</tt> trailing and leading whitespace is
--   <i>not</i> stripped.
lookupP :: ControlFunctions a => String -> (Paragraph' a) -> Maybe (Field' a)

-- | Strip the trailing and leading space and tab characters from a string.
--   Folded whitespace is <i>not</i> unfolded. This should probably be
--   moved to someplace more general purpose.
stripWS :: ControlFunctions a => a -> a

-- | Protect field value text so the parser doesn't split it into multiple
--   fields or paragraphs. This must modify all field text to enforce two
--   conditions: (1) All lines other than the initial one must begin with a
--   space or a tab, and (2) the trailing white space must not contain
--   newlines. This is called before pretty printing to prevent the parser
--   from misinterpreting field text as multiple fields or paragraphs.
protectFieldText :: ControlFunctions a => a -> a
asString :: ControlFunctions a => a -> String

-- | A parser for debian control file. This parser handles control files
--   that end without a newline as well as ones that have several blank
--   lines at the end. It is very liberal and does not attempt validate the
--   fields in any way. All trailing, leading, and folded whitespace is
--   preserved in the field values. See <a>stripWS</a>.
pControl :: ControlParser Control
mergeControls :: [Control' a] -> Control' a
fieldValue :: (ControlFunctions a) => String -> Paragraph' a -> Maybe a
removeField :: (Eq a) => a -> Paragraph' a -> Paragraph' a
prependFields :: [Field' a] -> Paragraph' a -> Paragraph' a
appendFields :: [Field' a] -> Paragraph' a -> Paragraph' a
renameField :: (Eq a) => a -> a -> Paragraph' a -> Paragraph' a
modifyField :: (Eq a) => a -> (a -> a) -> Paragraph' a -> Paragraph' a

-- | Move selected fields to the beginning of a paragraph.
raiseFields :: (Eq a) => (a -> Bool) -> Paragraph' a -> Paragraph' a
packParagraph :: Paragraph -> Paragraph
packField :: Field' String -> Field' Text
formatControl :: Control' Text -> [Text]
formatParagraph :: Paragraph' Text -> Text
formatField :: Field' Text -> Text

-- | Class of things that contain a validated Debian control file.
class HasDebianControl a
debianControl :: HasDebianControl a => a -> DebianControl

-- | Errors that control files might throw, with source file name and line
--   number generated by template haskell.
data ControlFileError
NoParagraphs :: [Loc] -> ControlFileError
[locs] :: ControlFileError -> [Loc]
NoBinaryParagraphs :: [Loc] -> ControlFileError
[locs] :: ControlFileError -> [Loc]
MissingField :: [Loc] -> String -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[field] :: ControlFileError -> String
ParseRelationsError :: [Loc] -> ParseError -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[parseError] :: ControlFileError -> ParseError
ParseControlError :: [Loc] -> ParseError -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[parseError] :: ControlFileError -> ParseError
IOError :: [Loc] -> IOError -> ControlFileError
[locs] :: ControlFileError -> [Loc]
[ioError] :: ControlFileError -> IOError
parseDebianControlFromFile :: FilePath -> IO (Either ControlFileError DebianControl)

-- | Validate and return a control file in an opaque wrapper. May throw a
--   ControlFileError. Currently we only verify that it has a Source field
--   in the first paragraph and one or more subsequent paragraphs each with
--   a Package field, and no syntax errors in the build dependencies
--   (though they may be absent.)
validateDebianControl :: MonadCatch m => Control' Text -> m (Either ControlFileError DebianControl)
unsafeDebianControl :: Control' Text -> DebianControl
debianSourceParagraph :: HasDebianControl a => a -> Paragraph' Text
debianBinaryParagraphs :: HasDebianControl a => a -> [Paragraph' Text]
debianPackageParagraphs :: HasDebianControl a => a -> (Paragraph' Text, [Paragraph' Text])
debianPackageNames :: HasDebianControl a => a -> (SrcPkgName, [BinPkgName])
debianSourcePackageName :: HasDebianControl a => a -> SrcPkgName
debianBinaryPackageNames :: HasDebianControl a => a -> [BinPkgName]

-- | This could access fields we haven't validated, so it can return an
--   error. Additionally, the field might be absent, in which case it
--   returns Nothing.
debianRelations :: HasDebianControl a => String -> a -> Either ControlFileError (Maybe Relations)
debianBuildDeps :: HasDebianControl a => a -> Maybe Relations
debianBuildDepsIndep :: HasDebianControl a => a -> Maybe Relations

module Debian.Apt.Index

-- | update - similar to apt-get update
update :: Fetcher -> FilePath -> String -> [DebSource] -> IO [Maybe (FilePath, Compression)]

-- | function-type for a function that downloads a file The timestamp is
--   optional. If the local file is as new or newer than the remote copy,
--   the download may be skipped.
--   
--   A good choice might be a partially parameterized call to <a>fetch</a>
type Fetcher = URI -> FilePath -> Maybe UTCTime -> IO Bool
data CheckSums
CheckSums :: Maybe String -> Maybe String -> Maybe String -> CheckSums
[md5sum] :: CheckSums -> Maybe String
[sha1] :: CheckSums -> Maybe String
[sha256] :: CheckSums -> Maybe String

-- | Package indexes on the server are uncompressed or compressed with gzip
--   or bzip2. We do not know what will exist on the server until we
--   actually look. This type is used to mark the compression status of
--   what was actually found.
data Compression
BZ2 :: Compression
GZ :: Compression
Uncompressed :: Compression
type FileTuple = (CheckSums, Size, FilePath)
type Size = Integer

-- | Parse a possibly compressed index file.
controlFromIndex :: Compression -> FilePath -> ByteString -> Either ParseError (Control' Text)

-- | parse an index possibly compressed file
controlFromIndex' :: Compression -> FilePath -> IO (Either ParseError (Control' Text))

-- | find the Contents-* files. These are not listed in the Release file
findContentsFiles :: (FilePath -> Bool) -> FilePath -> IO [FilePath]
findIndexes :: FilePath -> String -> [FileTuple] -> IO [(FileTuple, Compression)]
indexesInRelease :: (FilePath -> Bool) -> Control' Text -> [(CheckSums, Integer, FilePath)]

-- | make a FileTuple for a file found on the local disk returns
--   <a>Nothing</a> if the file does not exist.
tupleFromFilePath :: FilePath -> FilePath -> IO (Maybe FileTuple)
instance GHC.Classes.Eq Debian.Apt.Index.CheckSums
instance GHC.Show.Show Debian.Apt.Index.CheckSums
instance GHC.Read.Read Debian.Apt.Index.CheckSums
instance GHC.Enum.Bounded Debian.Apt.Index.Compression
instance GHC.Enum.Enum Debian.Apt.Index.Compression
instance GHC.Classes.Ord Debian.Apt.Index.Compression
instance GHC.Classes.Eq Debian.Apt.Index.Compression
instance GHC.Show.Show Debian.Apt.Index.Compression
instance GHC.Read.Read Debian.Apt.Index.Compression

module Debian.Report

-- | create a map of (package name, extracted field) from a list of index
--   files
--   
--   NOTE: we could merge all the files into a single control and then run
--   packageMap over that. We currently do it one control file at a time to
--   avoid having all the control files loaded in memory at once. However,
--   I am not sure that property is actually occuring anyway. So, this
--   should be revisited.
makePackageMap :: (Paragraph -> a) -> (a -> a -> a) -> [(FilePath, Compression)] -> IO (Map Text a)

-- | create a map of (package name, max version) from a single control file
packageMap :: (Paragraph -> a) -> (a -> a -> a) -> Control' Text -> Map Text a

-- | extract the version number from a control paragraph
extractVersion :: Paragraph -> Maybe DebianVersion

-- | compare two sources.list and find all the packages in the second that
--   trump packages in the first see also: |trumpedMap|
trumped :: Fetcher -> FilePath -> String -> [DebSource] -> [DebSource] -> IO (Map Text (DebianVersion, DebianVersion))

-- | calculate all the trumped packages
trumpedMap :: Map Text DebianVersion -> Map Text DebianVersion -> Map Text (DebianVersion, DebianVersion)

-- | create <a>/</a> XML element and children from a trumped Map
trumpedXML :: Map Text (DebianVersion, DebianVersion) -> CFilter Posn


-- | Figure out the dependency relation between debianized source
--   directories. The code to actually solve these dependency relations for
--   a particular set of binary packages is in Debian.Repo.Dependency.
module Debian.GenBuildDeps

-- | This type describes the build dependencies of a source package.
data DepInfo
DepInfo :: SrcPkgName -> Relations -> [BinPkgName] -> Set BinPkgName -> Set BinPkgName -> DepInfo

-- | source package name
[sourceName] :: DepInfo -> SrcPkgName

-- | dependency relations
[relations] :: DepInfo -> Relations

-- | binary dependency names (is this a function of relations?)
[binaryNames] :: DepInfo -> [BinPkgName]

-- | Set containing all binary package names mentioned in relations
[depSet] :: DepInfo -> Set BinPkgName

-- | Set containing binaryNames
[binSet] :: DepInfo -> Set BinPkgName

-- | source package name
sourceName' :: HasDebianControl control => control -> SrcPkgName

-- | dependency relations
relations' :: HasDebianControl control => control -> Relations

-- | binary dependency names (is this a function of relations?)
binaryNames' :: HasDebianControl control => control -> [BinPkgName]

-- | Return the dependency info for a source package with the given
--   dependency relaxation. |According to debian policy, only the first
--   paragraph in debian/control can be a source package
--   <a>http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-sourcecontrolfiles</a>
buildDependencies :: HasDebianControl control => control -> DepInfo

-- | Given a source package name and a binary package name, return False if
--   the binary package should be ignored hwen deciding whether to build
--   the source package. This is used to prevent build dependency cycles
--   from triggering unnecessary rebuilds. (This is a replacement for the
--   RelaxInfo type, which we temporarily rename OldRelaxInfo.)
type RelaxInfo = SrcPkgName -> BinPkgName -> Bool

-- | Remove any dependencies that are designated "relaxed" by relaxInfo.
relaxDeps :: RelaxInfo -> [DepInfo] -> [DepInfo]
data BuildableInfo a
BuildableInfo :: [ReadyTarget a] -> [a] -> BuildableInfo a
[readyTargets] :: BuildableInfo a -> [ReadyTarget a]
[allBlocked] :: BuildableInfo a -> [a]
CycleInfo :: [(a, a)] -> BuildableInfo a
[depPairs] :: BuildableInfo a -> [(a, a)]
data ReadyTarget a
ReadyTarget :: a -> [a] -> [a] -> ReadyTarget a

-- | Some target whose build dependencies are all satisfied
[ready] :: ReadyTarget a -> a

-- | The targets that are waiting for the ready target
[waiting] :: ReadyTarget a -> [a]

-- | The rest of the targets that need to be built
[other] :: ReadyTarget a -> [a]

-- | Given an ordering function representing the dependencies on a list of
--   packages, return a ReadyTarget triple: One ready package, the packages
--   that depend on the ready package directly or indirectly, and all the
--   other packages.
buildable :: (a -> DepInfo) -> [a] -> BuildableInfo a

-- | This is a nice start. It ignores circular build depends and takes a
--   pretty simplistic approach to <a>or</a> build depends. However, I
--   think this should work pretty nicely in practice.
compareSource :: DepInfo -> DepInfo -> Ordering

-- | Given a list of packages, sort them according to their apparant build
--   dependencies so that the first element doesn't depend on any of the
--   other packages.
orderSource :: (a -> a -> Ordering) -> [a] -> [a]

-- | Return the dependency info for a list of control files.
genDeps :: [FilePath] -> IO [DebianControl]

-- | Remove any packages which can't be built given that a package has
--   failed.
failPackage :: Eq a => (a -> a -> Ordering) -> a -> [a] -> ([a], [a])

-- | One example of how to tie the below functions together. In this case
--   <tt>fp</tt> is the path to a directory that contains a bunch of
--   checked out source packages. The code will automatically look for
--   debian/control. It returns a list with the packages in the order they
--   should be built.
getSourceOrder :: FilePath -> IO [SrcPkgName]
instance GHC.Show.Show Debian.GenBuildDeps.OldRelaxInfo
instance GHC.Show.Show Debian.GenBuildDeps.DepInfo
instance GHC.Classes.Eq Debian.GenBuildDeps.DepInfo

module Debian.Util.FakeChanges
fakeChanges :: [FilePath] -> IO (FilePath, String)
instance Data.Data.Data Debian.Util.FakeChanges.Error
instance GHC.Classes.Eq Debian.Util.FakeChanges.Error
instance GHC.Show.Show Debian.Util.FakeChanges.Error
instance GHC.Read.Read Debian.Util.FakeChanges.Error


-- | Functions for dealing with source and binary packages in an
--   abstract-way
module Debian.Apt.Package
type PackageNameMap a = Map BinPkgName [a]

-- | <a>packageNameMap</a> creates a map from a package name to all the
--   versions of that package NOTE: Provides are not included in the map
--   NOTE: the sort order is random -- this is perhaps a bug see also:
--   <a>addProvides</a>
packageNameMap :: (a -> BinPkgName) -> [a] -> PackageNameMap a

-- | <a>addProvides</a> finds packages that Provide other packages and adds
--   them to the PackageNameMap. They will be adde to the end of the list,
--   so that real packages have 'higher priority' than virtual packages.
--   NOTE: Does not check for duplication or multiple use
addProvides :: (p -> [BinPkgName]) -> [p] -> PackageNameMap p -> PackageNameMap p

-- | <a>findProvides</a>
findProvides :: (p -> [BinPkgName]) -> [p] -> [(BinPkgName, p)]

-- | <a>lookupPackageByRel</a> returns all the packages that satisfy the
--   specified relation TODO: Add architecture check
lookupPackageByRel :: PackageNameMap a -> (a -> (BinPkgName, DebianVersion)) -> Relation -> [a]

module Debian.Apt.Dependencies
data Status
Remaining :: AndRelation -> Status
MissingDep :: Relation -> Status
Complete :: Status
type State a = (Status, [a])
complete :: State a -> Bool
data CSP a
CSP :: PackageNameMap a -> Relations -> (a -> Relations) -> (a -> Relations) -> (a -> (BinPkgName, DebianVersion)) -> CSP a
[pnm] :: CSP a -> PackageNameMap a
[relations] :: CSP a -> Relations
[depFunction] :: CSP a -> (a -> Relations)
[conflicts] :: CSP a -> a -> Relations
[packageVersion] :: CSP a -> a -> (BinPkgName, DebianVersion)

-- | TODO addProvides -- see DQL.Exec
controlCSP :: Control -> Relations -> (Paragraph -> Relations) -> CSP Paragraph
testCSP :: FilePath -> (Paragraph -> Relations) -> String -> (CSP Paragraph -> IO a) -> IO a
depF :: Paragraph -> Relations
sidPackages :: [Char]
gutsyPackages :: [Char]
test :: FilePath -> String -> Labeler Paragraph -> IO ()
packageVersionParagraph :: Paragraph -> (BinPkgName, DebianVersion)
conflict :: CSP p -> p -> p -> Bool

-- | JAS: deal with <tt>Provides</tt> (can a package provide more than one
--   package?)
conflict' :: (BinPkgName, DebianVersion) -> Relation -> Bool
mkTree :: a -> [Tree a] -> Tree a
label :: Tree a -> a
initTree :: (a -> [a]) -> a -> Tree a
mapTree :: (a -> b) -> Tree a -> Tree b
foldTree :: (a -> [b] -> b) -> Tree a -> b
zipTreesWith :: (a -> b -> c) -> Tree a -> Tree b -> Tree c
prune :: (a -> Bool) -> Tree a -> Tree a
leaves :: Tree a -> [a]
inhTree :: (b -> a -> b) -> b -> Tree a -> Tree b
distrTree :: (a -> [b]) -> b -> Tree a -> Tree b
mkSearchTree :: CSP a -> Tree (State a)

-- | earliestInconsistency does what it sounds like the 'reverse as' is
--   because the vars are order high to low, but we want to find the lowest
--   numbered (aka, eariest) inconsistency ??
earliestInconsistency :: CSP a -> State a -> Maybe ((BinPkgName, DebianVersion), (BinPkgName, DebianVersion))

-- | conflicting packages and relations that require non-existant packages
type ConflictSet = ([(BinPkgName, DebianVersion)], [Relation])
isConflict :: ConflictSet -> Bool
solutions :: Tree (State a, ConflictSet) -> [State a]
type Labeler a = CSP a -> Tree (State a) -> Tree (State a, ConflictSet)
search :: Labeler a -> CSP a -> [State a]
bt :: Labeler a

-- | bj - backjumping labeler
--   
--   If the node already has a conflict set, then leave it alone.
--   
--   Otherwise, the conflictset for the node is the combination of the
--   conflict sets of its direct children.
bj :: CSP p -> Tree (State p, ConflictSet) -> Tree (State p, ConflictSet)
unionCS :: [ConflictSet] -> ConflictSet
combine :: CSP p -> [(State p, ConflictSet)] -> [ConflictSet] -> ConflictSet
instance GHC.Classes.Eq Debian.Apt.Dependencies.Status