24      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~        !"#$%&'()*+,-./0123$portablealphaDavid Fox <dsf@seereason.com>456789:;<=>?@ABCDEFGHIJKLMNOPQR456789:;<=>?@ABCDEFGHIJKLMR4876556789<;::;<=>?@ABCDEFGHIJKLM>?@ABCDEFGHIJKLMR STUVWXYZ[ STUVWXYZ[ SUTVVTUVWXXYZZ[[ \]EWe have to do this wackiness because ~ is less than the empty string ^:Convert a string to a debian version number. May throw an D 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? _`aASplit 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.    +The function we want to pass a FilePath to &The text that the file should contain  The function's return value         4If the URI type could be read and showed this wouldn't be necessary. b<Parse the text returned when a directory is listed by a web < server. This is currently only known to work with Apache. 2 NOTE: there is a second copy of this function in D Extra:Extra.Net. Please update both locations if you make changes. cdef3ghijklmnopqrstuvwxyz{|}~ A package'9s subsection is only evident in its control information, C packages from different subsections all reside in the same index. ;A section of a repository such as main, contrib, non-free, > restricted. The indexes for a section are located below the  distribution directory. AThe types of architecture that a package can have, either Source & or some type of binary architecture. CA distribution (aka release) name. This type is expected to refer D to a subdirectory of the dists directory which is at the top level  of a repository.  !"#$% !"#$% !"#$% !"#$%&>This is a name given to a combination of parts of one or more 8 releases that can be specified by a sources.list file. '()*+,-./01<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: ABreak 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. 234(parseSourceLine -- parses a source line L the argument must be a non-empty, valid source line with comments stripped  see: 3 56&'()*+,-./0123456.0/)*+,-&'(123456&'('()*+,-*+,-.0//0123456788 filepath is a simple wrapper function  that parses filepath using pControl 99  sourceName handle -  sourceName" is only used for error reporting :parseControlFromString  sourceName text -  sourceName" is only used for error reporting ;; fieldName paragraph looks up a @ in a B.  N.B.$ trailing and leading whitespace is not stripped. <?Strip the trailing and leading space and tab characters from a  string. Folded whitespace is not unfolded. This should probably - be moved to someplace more general purpose. =>@NOTE: we do not strip the leading or trailing whitespace in the  name or value ?@ABCDEFGHIJKLM6Move selected fields to the beginning of a paragraph. N6Run a command and parse its output as a control file. O'look up the md5sum file in a paragraph % Tries several different variations:  MD5Sum:  Md5Sum:  MD5sum: 789:;<=>?@ABCDEFGHIJKLMNOCDEAB>@?789:;<=FGHIJKLMNO789:;<=89:;<=>@??@ABBCDEDEFGHIJKLMNO PQRSTDA parser for debian control file. This parser handles control files D that end without a newline as well as ones that have several blank D lines at the end. It is very liberal and does not attempt validate E the fields in any way. All trailing, leading, and folded whitespace ' is preserved in the field values. See <. AWe are liberal in that we allow *any* field to have folded white A space, even though the specific restricts that to a few fields. We go with the assumption that ' blank lines' mean lines that < consist of entirely of zero or more whitespace characters. 789:;<=>?@ABCDEFGHIJKLMPQRSTCDEAB>@?RQSP789:;<=TFGHIJKLMPQRST UVWXYUVWXYWXYUVUVVWXY ZZZZ V[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-withMethod - run |methodPath| bracketed with  openMethod/'closeMethod. |f| gets the open handle. EwhichMethodBinary - find the method executable associated with a URI  throws an exception on failure )fetch a single item, show console output  see also: getLastModified =[\]^_`abcdefghijklmnopqrstuvwxyz{|}~B[\]^_`abcdehlkjim~}|wsqponxyz{xyz{tuvxrgf;[ \]^_`abcde\]^_`abcdefghlkjiijklm~}|wsqponxyz{xyz{tuvxrnopqrstuvwxyz{|}~ $,A changelog is a series of ChangeLogEntries 6An entry in the list of files generated by the build. AA file generated by dpkg-buildpackage describing the result of a  package build >The full pathname of the directory holding the .changes file. 4The package name parsed from the .changes file name 6The version number parsed from the .changes file name ,The Distribution field of the .changes file 4The architecture parsed from the .changes file name "The contents of the .changes file 4The value of the Changes field of the .changes file (The parsed value of the Files attribute DShow just the top line of a changelog entry (for debugging output.) ;Parse a Debian Changelog and return a lazy list of entries LParse a single changelog entry, returning the entry and the remaining text. >Parse the changelog information that shows up in the .changes 1 file, i.e. a changelog entry with no signature. $$#  . parse a debian relation (i.e. the value of a : Depends field). Return a parsec error or a value of type   ;Check if a version number satisfies a version requirement.   *, applied to a predicate p and a ByteString xs, 0 returns the longest prefix (possibly empty) of xs of elements that  satisfy p. findIndexOrEnd4 is a variant of findIndex, that returns the length < of the string if no element is found, rather than Nothing. The " function takes a predicate and a  ByteString and : returns the index of the first element in the ByteString  satisfying the predicate.      789:;<=>?@ABCDEFGHIJKLMCDEAB>@?789:;<=FGHIJKLM!789:;<=>?@ABCDEFGHIJKLMPQRST!CDEAB>@?RQSP789:;<=TFGHIJKLM3function-type for a function that downloads a file A The timestamp is optional. If the local file is as new or newer 4 than the remote copy, the download may be skipped. 9A good choice might be a partially parameterized call to   BPackage indexes on the server are uncompressed or compressed with F gzip or bzip2. We do not know what will exist on the server until we D actually look. This type is used to mark the compression status of  what was actually found. #update - similar to apt-get update +function that will do actually downloading 7download indexes to the directory (must already exist) binary architecture sources.list -(basename of index file, compression status) #download possibly compressed files < NOTE: index uri must not include the .bz2 or .gz extension 'function that will do the actual fetch ;remote URI of package index, without .bz2 or .gz extension ?name to save downloaded file as, without .bz2 or .gz extension 7(downloaded file name + extension, compression status) :examine a DebSource line, and calculate for each section: + - the URI to the uncompressed index file > - the basename that apt-get would name the downloaded index : FIXME: ExactPath dist will fail with error at runtime :( which binary architecture line from sources.list ;(remote uri, local name, deb source for just this section)  return a tuple for the section + - the URI to the uncompressed index file < - the basename that apt-get uses for the downloaded index , FIXME: support for Release and Release.gpg do we want Packages or Sources ,The binary architecture to use for Packages 'base URI as it appears in sources.list 8the release (e.g., unstable, testing, stable, sid, etc) +the section (main, contrib, non-free, etc) 6(uri to index file, basename for the downloaded file) (Parse a possibly compressed index file. )parse an index possibly compressed file 3A release file contains a list of indexes (Packages/Sources). Each E Package or Source index may appear multiple times because it may be A compressed several different ways. This function will return an B assoc list where the key is the name of the uncompressed package C index name and the value is the list of (file, compression) which  decompress to the key. =The release file contains the checksums for the uncompressed C package indexes, even if the uncompressed package indexes are not D stored on the server. This function returns the list of files that  actually exist. A release file 4make a FileTuple for a file found on the local disk  returns  if the file does not exist. Dfind the Contents-* files. These are not listed in the Release file Kcreate a map of (package name, extracted field) from a list of index files BNOTE: we could merge all the files into a single control and then D 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 A once. However, I am not sure that property is actually occuring ' anyway. So, this should be revisited. Gcreate a map of (package name, max version) from a single control file 4extract the version number from a control paragraph bcompare two sources.list and find all the packages in the second that trump packages in the first  see also: |trumpedMap| )function for downloading package indexes =cache directory to store index files in (must already exist) binary architecture sources.list a sources.list b 9a map of trumped package names to (version a, version b) #calculate all the trumped packages package map a package map b (trumped packages (version a, version b) create  trumped /- XML element and children from a trumped Map ESpecifies build dependencies that should be ignored during the build I decision. If the pair is (BINARY, Nothing) it means the binary package I BINARY should always be ignored when deciding whether to build. If the J pair is (BINARY, Just SOURCE) it means that binary package BINARY should < be ignored when deiciding whether to build package SOURCE. @This type describes the build dependencies of a source package. /Turn a list of eithers into an either of lists  copied from Extra.Either VReturn 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   Rhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-sourcecontrolfiles ,Remove any dependencies that are designated "relaxed" by relaxInfo. >Given an ordering function representing the dependencies on a D list of packages, return a triple: One ready package, the packages B that depend on the ready package directly or indirectly, and all  the other packages. Remove any packages which can',t be built given that a package has failed. @Given a list of packages, sort them according to their apparant 3 build dependencies so that the first element doesn't depend on any  of the other packages. =Build a graph with the list of packages as its nodes and the " build dependencies as its edges. BThis is a nice start. It ignores circular build depends and takes ! a pretty simplistic approach to  build depends. However, I 3 think this should work pretty nicely in practice. 8Return the dependency info for a list of control files. @One example of how to tie the below functions together. In this  case fp5 is the path to a directory that contains a bunch of C checked out source packages. The code will automatically look for  debian/4control. It returns a list with the packages in the  order they should be built.  !"#$%&'()*+,-./01!portablealphaDavid Fox <dsf@seereason.com>239List the packages bundled with this version of the given ? compiler. If the answer is not known, return the empty list. 4=Determine whether a specific version of a Haskell package is B bundled with into this particular version of the given compiler. 56789:;<=>?@A7Some dependencies are libraries, some are executables. B2345AB2345AB"portablealphaDavid Fox <dsf@seereason.com>+CDEFGHIJKLMNOinfo from the .cabal file command line flags PQ.Each cabal package corresponds to a directory  name>-<version,  either in usr lib or in usrlibhaskell-packagesghc6/lib. A In that directory is a compiler subdirectory such as ghc-6.8.2. A In the ghc subdirectory is one or two library files of the form  libHS *name>-<version>.a and libHS<name>-<version_p.a. We can @ determine the debian package names by running dpkg -S on these  names, or examining the varlibdpkginfo/*.list files. From ? these we can determine the source package name, and from that ! the documentation package name. info from the .cabal file compiler details  The debian/ control file %The list of installed cabal packages /The type of deb we want to write substvars for R5Write a file which we might still be reading from in % order to compute the text argument. STU;Given a path, return the name of the package that owns it. VW whether to forcibly create file info from the .cabal file command line yflags compiler details #directory in which to create files XYZ[\]^Debian packages don'.t have per binary package build dependencies, % so we just gather them all up here. _`abcdefghijklcartesianProduct [[1,2,3], [4,5],[6]] -> [[1,4,6],[1,5,6],[2,4,6],[2,5,6],[3,4,6],[3,5,6]] mCConvert from license to RPM-friendly description. The strings are 6 taken from TagsCheck.py in the rpmlint distribution. OO#portablealphaDavid Fox <dsf@seereason.com>nnnG creates a map from a package name to all the versions of that package , NOTE: Provides are not included in the map 9 NOTE: the sort order is random -- this is perhaps a bug  see also:     5 finds packages that Provide other packages and adds A them to the PackageNameMap. They will be adde to the end of the " list, so that real packages have 'higher priority' than virtual  packages. 6 NOTE: Does not check for duplication or multiple use      > returns all the packages that satisfy the specified relation  TODO: Add architecture check          (  Fconflicting packages and relations that require non-existant packages !TODO addProvides -- see DQL.Exec  JAS: deal with Provides0 (can a package provide more than one package?) !"#$%&'()*+,/earliestInconsistency does what it sounds like  the ' reverse as'3 is because the vars are order high to low, but we B want to find the lowest numbered (aka, eariest) inconsistency ?? -./01bj - backjumping labeler =If the node already has a conflict set, then leave it alone. BOtherwise, the conflictset for the node is the combination of the &conflict sets of its direct children. 23+  opq !"#$%&'()*+,-./0123( !"#$%&'()*+, -. /0123(   !"#$%&'()*+,-./0123$rstuvwxyz{|}~rsturstu%&'()*+,-./01234567899:;<<=>?@@ABCDEFGHHIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopbd`q r s t u v w x x y z { | } ~                   +                              `bd        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLLMNOPQRSTUVWXYZ[\]^_`abacddee%fghijklmnopqrsqrtqruqrvqrwqrxqryqrzqr{qr|qr}qr~qrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqrqr                          pq      !"#$%&'()*+,-./012345!6!7!8!9!:!;!<!=!>!?!@!A!B!C!D!E!F"G"G"H"I"J"K"L"M"N"O"P"Q"R"S"T"U"V"W"X"Y"Z"["\"]"^"_"`"a"b"c"d"e"f"g"h"i"j""k"l"m"n"o#pqrs$t$u$-$v$w$x$y$z${$|$}$~$$$$`$$$$$$$ debian-3.47Debian.Version.CommonDebian.Extra.Files Debian.Time Debian.URIDebian.ReleaseDebian.SourcesDebian.Control.CommonDebian.Control.StringDebian.Control.PrettyPrint Debian.DebDebian.Apt.MethodsDebian.ChangesDebian.Relation.CommonDebian.Relation.StringDebian.Control.ByteStringDebian.ControlDebian.Apt.Index Debian.ReportDebian.GenBuildDepsDebian.Util.FakeChangesDebian.Apt.PackageDebian.Apt.Dependencies!Distribution.Package.Debian.SetupDebian.Version.InternalDebian.Version.StringDebian.Version.ByteStringTest.SourcesListDebian.Version Test.Changes Test.VersionsDebian.Relation.ByteStringDebian.Relation#Distribution.Package.Debian.BundledDistribution.Package.Debian Distribution.Package.Debian.MainTest.Dependencies DebianVersionParseDebianVersionparseDebianVersionparseDVevrepochversionrevisionbuildDebianVersionwithTemporaryFilerfc822DateFormatepochTimeToUTCTimeformatTimeRFC822parseTimeRFC822getCurrentLocalRFC822Time URIString uriToString' fileFromURIfileFromURIStrict dirFromURI SubSectionsectionsubSectionNameSectionArchBinarySource ReleaseNamerelNameparseReleaseName releaseName'archName sectionName sectionName'sectionNameOfSubSection SliceName sliceName DebSource sourceType sourceUri sourceDist SourceTypeDebSrcDeb quoteWords stripLine sourceLinesparseSourceLineparseSourceLine'parseSourcesListControlFunctionsparseControlFromFileparseControlFromHandle parseControllookupPstripWSasStringField'CommentField Paragraph' ParagraphControl'Control unControl mergeControls fieldValue removeField prependFields appendFields renameField modifyField raiseFieldsparseControlFromCmd md5sumField ControlParserpControlToTexttotext ppControl ppParagraphppFieldfieldsFetchCallbackslogCBstatusCB uriStartCB uriDoneCB uriFailureCBgeneralFailureCBauthorizationRequiredCBmediaFailureCBdebugCB ConfigItemHeaderCommand MediaChangedAuthorizationCredentials Configuration URIAcquireStatus MediaFailureAuthorizationRequiredGeneralFailure URIFailuremessageURIDonefilenamehashesimsHitURIStarturisize lastModified resumePointLogMsg CapabilitiessingleInstancepreScanpipeline sendConfig needsCleanup localOnlyDriveMediaPasswordUserSiteMessage withMethodURIwithMethodPathwhichMethodPath recvStatus sendCommand openMethod closeMethod simpleFetchfetchemptyFetchCallbackscliFetchCallbacksgetLastModifiedChangeLogEntry WhiteSpaceEntry logPackage logVersionlogDists logUrgency logCommentslogWhologDateChangedFileSpecchangedFileMD5sumchangedFileSHA1sumchangedFileSHA256sumchangedFileSizechangedFileSectionchangedFilePrioritychangedFileName ChangesFileChanges changeDir changePackage changeVersion changeRelease changeArch changeInfo changeEntry changeFileschangesFileNameprettyChangesFile prettyChanges prettyEntryparseLog parseEntry parseChanges VersionReqSGRGREEEQLTESLTArchitectureReq ArchExceptArchOnlyParseRelationsparseRelationsRelationRel OrRelation AndRelation RelationsPkgNamecheckVersionReq RelParser pRelations packParagraph packField formatControlformatParagraph formatField FileTupleSizeFetcher CheckSumsmd5sumsha1sha256 Compression UncompressedGZBZ2updatecontrolFromIndexcontrolFromIndex' findIndexesindexesInReleasetupleFromFilePathfindContentsFilesmakePackageMap packageMapextractVersiontrumped trumpedMap trumpedXML BuildableInfo CycleInfodepPairs readyTriples allBlocked RelaxInfoDepInfo BinPkgName SrcPkgNamebuildDependencies relaxDeps buildable failPackage orderSource compareSourcegenDepsgetSourceOrder fakeChangesPackageNameMappackageNameMap addProvides findProvideslookupPackageByRelLabeler ConflictSetCSPpnm relations depFunction conflictspackageVersionStateComplete MissingDep Remainingcomplete controlCSPtestCSPdepFpackageVersionParagraphconflict conflict'mkTreelabelinitTreemapTreefoldTree zipTreesWithpruneleavesinhTree distrTree mkSearchTreeearliestInconsistency isConflict solutionssearchbtbjunionCScombine DebActionUpdateDebianizationSubstVar DebianizeUsageDebTypeDocProfDevFlags rpmPrefix rpmCompilerrpmConfigurationsFlags rpmHaddockrpmHelp debLibProfrpmNamerpmOptimisation rpmRelease rpmSplitObjs debOutputDir rpmVerbosity rpmVersion debMaintainer debAction emptyFlagsoptionsflagList printHelp parseArgsFound SimulatedunFoundNumeric NonNumericordercompareNonNumericcompareMaybeNonNumeric parseEpochparseNonNumeric parseNumericwebServerDirectoryContents cmdOutputcmdOutputStricttoLazytoStrictnetwork-2.2.1.7 Network.URIfragmentquerypath authorityscheme unreservedreserved escapeStringparseabsoluteURInormalizePathSegmentsnormalizeEscape normalizeCase relativeFrom relativeTononStrictRelativeTounEscapeStringescapeURIString escapeURICharisUnescapedInURIisAllowedInURI uriToString isUnreserved isReserved isIPv4address isIPv6address isAbsoluteURIisRelativeReferenceisURIReferenceisURIparseAbsoluteURIparseRelativeReferenceparseURIReferenceparseURInullURI uriFragmenturiQueryuriPath uriAuthority uriSchemeURIuriPort uriRegName uriUserInfoURIAuth parseSection parseSection'testQuoteWordstestSourcesListtestSourcesListParsesourcesListTests pParagraphpFieldpCommentfcharfwsfchar_fwspBlanksHashesmd5 MethodHandle capabilitieslogMsgstatusuriStarturiDone uriFailuregeneralFailureauthorizationRequired mediaFailure uriAcquire configurationauthorizationCredentials mediaChanged parseStatus formatCommandparseTrueFalse parseHeader sendMethodrecvboolon showHeader pOrRelation pRelation pMaybeVerReq pMaybeArch pArchExcept pArchOnlys3s4s1s2test3test4test1test2 changesTests implicit1 implicit2 implicit3 implicit4 implicit5 implicit6 implicit7epoch1epoch2epoch3version1version2version3 revision1 revision2 revision3 revision4compareVorder1order2dash1dash2zero1 versionTestsParserunParserResultEmptyFailOkpKeypValue _takeWhile2baseGHC.List takeWhilebreak2span2findIndex2OrEnd _findIndex2 Data.List findIndexw2cc2wm2rr2m _pSucceed_pFail<|>satisfypChar_trypEOF pTakeWhile2 pTakeWhile _pSkipWhilepManynotEmptypMany1 pSkipMany _pSkipMany1parse fetchIndex indexURIscalcPath groupIndexes filterExistsuncompressedName Data.MaybeNothing concatEithers buildGraphorassocFilesdscdebstardiffErrorVersionMismatchMalformedDebFilename UnknownFiles TooManyDiffs TooManyTars TooManyDscsNoDebs getVersion getSource getMaintainer getArches getBinArch mkFileLine unzipEithers debNameSplit loadFiles getUploader singletonBundled bundledWith isBundledbuiltIns ghc6BuiltIns ghc6BuiltIns' ghc6ProvidesextractBaseNameinstalledVersionsvghc683BuiltInsghc682BuiltInsghc681BuiltInsghc661BuiltIns ghc66BuiltIns isLibrary docPrefix PackageInfolibDir cabalName cabalVersiondevDebprofDebdocDebDebMapparsePackageId'buildDebVersionMapsimplePackageDescriptiondebian autoreconf substvars replaceFilelibPaths packageInfo debOfFiletakePackageNameupdateDebianizationgetDebianMaintainer cdbsRuleslist controlUpdate mergeDepscontroldebianDependencieschangelogUpdate changelog unPackageNamedebianSourcePackageNamedebianProfilingPackageNamedebianDevelPackageNamedebianVersionNumberprofilingDependenciesdevelDependenciesdocDependenciesdebianRelationsdebianDocumentationPackageNamecartesianProduct showLicensemain sidPackages gutsyPackagestestmkCSPparseCommaListmapSndpackageApackageBpackageCpackageDpackageEpackageFpackageGpackageHpackageIpackageJpackageKdependsmissing1ors1 provides1 provides2dependencyTests