!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 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 [ \ ] ^ _ ` 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 { | } ~                                                            None*2468  An exampleA class of Bs insterspersed with Cs. It is used when converting the cabal dependencies to debian, where the "around" type is the binary package name and the "between" type is the version number.Minimum implementation is a method to return the leftmost B, and another to return the following (C,B) pairs. Its unfortunate to require lists in the implementation, a fold function would be better (though I find implementing such folds to be a pain in the you-know-what.)oThe class provides implementations of three folds, each of which exposes slightly different views of the data.       None?Apply a filter to the version numbers of the changelog entries.-Filter out versions newer than the given one. *Find the log entry with the given version.    None*+24  None+246 Describes a mapping from cabal package name and version to debian package names. For example, versions of the cabal QuickCheck package less than 2 are mapped to "quickcheck1", while version 2 or greater is mapped to "quickcheck2".>The Debian name given to versions older than the oldest split.Each pair is The version where the split occurs, and the name to use for versions greater than or equal to that version. This list assumed to be in (must be kept in) ascending version number order. `The base of a debian binary package name, the string that appears between "libghc-" and "-dev".fCreate a version split database that assigns a single debian package name base to all cabal versions.?Split the version range and give the older packages a new name.ABrute force implementation - I'm assuming this is not a huge map.Given a version split database, turn the debian version requirements into a debian package name base that ought to satisfy them.         Safe-Inferred*This function belongs in Cabal, see http:/hackage.haskell.orgtrachackage ticket/935.NoneHM$Memoized version of newestAvailable'FLook up the newest version of a deb available in the given changeroot.kGeneral function to build a command line option that reads most of the possible values for CompilerFlavor.  !"#  !"#None*MkFind out what version, if any, of a cabal library is built into the newest version of haskell compiler hc in environment root. For GHC this is done by looking at what virtual packages debian package provides. I have modified the ghcjs packaging to generate the required virtual packages in the Provides line. For other compilers it maybe be unimplemented.$bOk, lets see if we can infer the built in packages from the Provides field returned by apt-cache.$ !"% !" !"$ !"%None234M%>Read and parse the status file for installed debian packages: varlibdpkgstatus*YWrite a file which we might still be reading from in order to compute the text argument.+PCompute the new file contents from the old. If f returns Nothing do not write..Create a map from pathname to the names of the packages that contains that pathname using the contents of the debian package info directory varlibdpkginfo./:Given a path, return the name of the package that owns it.5EFrom Darcs.Utils - set the working directory and run an IO operation.6'Get directory contents minus dot files.:=If the current value of getL x is Nothing, replace it with f.? Version of &? that first clamps its argument to the acceptable range (0-3).@YSet a lens value. (This is a version of Data.Lens.Lazy.~= that returns () instead of b.)ASet b if it currently isNothing and the argument isJust, that is 1. Nothing happens if the argument isNothing 2. Nothing happens if the current value isJustBWModify a value. (This is a version of Data.Lens.Lazy.%= that returns () instead of a.)CInsert an element into a (Set b)DInsert an element into a  (Map b c)EInsert an element into a (Map b (Set c))+#$%&'()*+,'(-./0123456789:;<=>?@ABCDEFGHI)*'#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI'$#%&'()*+,-./0123456789:;<=>?@ABCDEFGHI+#$%&'()*+,'(-./0123456789:;<=>?@ABCDEFGHI)*None+24)J/Official Debian license types as described in  Xhttps://www.debian.org/doc/packaging-manuals/copyright-format/1.0/#license-specification.KA license name associated with the subsequent text of the License: field or in a Files paragraph of the same debian/copyright file, or in a License: paragraph.L'Zope Public License 1.0, 1.1, 2.0, 2.1.Mzlib/libpng license.NSW3C Software License For more information, consult the W3C Intellectual Rights FAQ.OQ Public License 1.0.PPython license 2.0.Q0erl license (use "GPL-1+ or Artistic-1" instead)RMozilla Public License 1.1.S1LaTeX Project Public License 1.0, 1.1, 1.2, 1.3c.TGNU Free Documentation License, with no Front-Cover or Back-Cover Texts or Invariant Sections. Use the same version numbers as GFDL.UGNU Free Documentation License 1.0, 1.1, 1.2, or 1.3. Use GFDL-NIV instead if there are no Front-Cover or Back-Cover Texts or Invariant Sections.VVGNU Lesser General Public License 2.1, 3.0, or GNU Library General Public License 2.0.W)GNU General Public License 1.0, 2.0, 3.0.XThe Expat license.Y"The Eiffel Forum License 1.0, 2.0.ZIBM Common Public License.[0Common Development and Distribution License 1.0.\*Creative Commons Zero 1.0 Universal. Omit  Universal6 from the license version when forming the short name.]VCreative Commons Attribution Non-Commercial No Derivatives license 1.0, 2.0, 2.5, 3.0.^SCreative Commons Attribution Non-Commercial Share Alike license 1.0, 2.0, 2.5, 3.0._GCreative Commons Attribution Non-Commercial license 1.0, 2.0, 2.5, 3.0.`GCreative Commons Attribution No Derivatives license 1.0, 2.0, 2.5, 3.0.aDCreative Commons Attribution Share Alike license 1.0, 2.0, 2.5, 3.0.b8Creative Commons Attribution license 1.0, 2.0, 2.5, 3.0.cJInternet Software Consortium, sometimes also known as the OpenBSD License.d9Berkeley software distribution license, 4-clause version.e9Berkeley software distribution license, 3-clause version.f9Berkeley software distribution license, 2-clause version.gArtistic license 1.0, 2.0.hApache license 1.0, 2.0.i^No license required for any purpose; the work is not subject to copyright in any jurisdiction.q6The architectures for which a binary deb can be built.r"The list of suitable architecturess-The package can be built for any architecturet(The package is architecture independenctThe version number of the installed debhelper package is the highest acceptable value for compat in a debian/control file. If the package doesn't explicitly set an (acceptable) compat value we can use the value returned by this function, assuming debhelper is installed."Assumes debian-policy is installedTTurn the uploaders field of a cabal package into a list of RFC2822 NameAddr values.2Parse a string containing a single NameAddr value.3I think we need an actual parser for license names.WJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~+,-./012OJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~O~{}|uzyxwvqtsrnpojmlkJihgfedcba`_^]\[ZYXWVUTSRQPONMLK(Jihgfedcba`_^]\[ZYXWVUTSRQPONMLKjmlknpoqtsruzyxwv{}|~+,-./012 None+&Package interrelationship information.LThis is used to construct the value for DEB_CABAL_PACKAGE in the rules fileVThe source package of a haskell library (add prefix haskell- to source package name.)/The source package (not a binary deb actually.)cA package that holds the package's data files and any executables not assigned to other packages.TA package related to a particular executable, perhaps but not necessarily a server.The libghc-foo-doc package.The libghc-foo-prof package.The libghc-foo-dev package.This type represents a section of the control file other than the first, which in turn represent one of the binary packages or debs produced by this debianization.HThe different types of binary debs we can produce from a haskell package3 Ihttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Package4 Nhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Architecture5 Khttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Essential6 Mhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description7 Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10189:;<=>?@AB3C4DE567 89:;<=>?@A B3C4DE567 None+:Field will be copied to the upload control (.changes) file8Field will be copied to the source packgae control files8Field will be copied to the binary packgae control filesvUser defined fields. Parse the line "XBS-Comment: I stand between the candle and the star." to get XField (fromList BS) Comment, " I stand between the candle and the star."This type represents the debian/control file, which is the core of the source package debianization. It includes the information that goes in the first, or source, section, and then a list of the succeeding binary package sections.F Hhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-SourceG Lhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-MaintainerH Lhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Changed-ByI Khttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-UploadersJ Shttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-DM-Upload-AllowedK Jhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-PriorityL Ihttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-SectionM Shttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-VersionN Jhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-HomepageO Lhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-VCS-fieldsP Bhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7QMThe binary debs. This should be a map, but we may need to preserve the order6RFGHIJKLMNOPSTUVWQ$$ RFGHIJKLMNOPSTUVWQ None+24EMDescription of the machine readable debian/copyright file. A special case is used to represeent the old style free format file - if the value is equal to newCopyrightDescription except for the field _summaryComment, the text in _summaryComment is the copyright file..Try to read a CopyrightDescription from a file*XYZ[&& XYZ[ None+The name of the executable file!where to find it, default is distbuild execName/where to put it, default is usrbin execName!name to give installed executable.Information about the server we are packaging. !Host on which the server will run tPort on which the server will run. Obviously, this must assign each and every server package to a different port. FA comment that will be inserted to explain how the file was generated "start-stop-daemon --retry argument 5Extra flags to pass to the server via the init script)The hint to install the server executable0Information about the web site we are packaging.The domain name assigned to the server. An apache configuration will be generated to redirect requests from this domain to hostname:portApache ServerAdmin parameter"The hint to install the server job+A redundant data type, too lazy to expunge."nThis record supplies information about the task we want done - debianization, validataion, help message, etc.$=Run with progress messages at the given level of verboseness.%YDon't write any files or create any directories, just explain what would have been done.&RFail if the debianization already present doesn't match the one we are going to generate closely enough that it is safe to debianize during the run of dpkg-buildpackage, when Setup configure is run. Specifically, the version number in the top changelog entry must match, and the sets of package names in the control file must match.')What to do - Usage, Debianize or Substvar*%The output of the debootstrap command+0An environment with build dependencies installed,,An environment where we have built a package/(Create a directory in the binary package0GInstall a cabal executable into the binary package at an exact location12Install a cabal executable into the binary package23Create a file with the given text at the given path35DHInstallTo somewhere relative to DataDir (see above)4AInstall a build file into the binary package at an exact location5,Install a build file into the binary package6,Create a symbolic link in the binary package7Bits and pieces of information about the mapping from cabal package names and versions to debian package names and versions. In essence, an 7 value represents a package's debianization. The lenses in this module are used to get and set the values hidden in this Atoms value. Many of the values should be left alone to be set when the debianization is finalized.9(Do not produce a libghc-foo-doc package.:)Do not produce a libghc-foo-prof package.;eIf present, Do not put the version dependencies on the prof packages that we put on the dev packages.<If present, don't generate the << dependency when we see a cabal equals dependency. (The implementation of this was somehow lost.)=The build directory used by cabal, typically dist/build when building manually or dist-ghc/build when building using GHC and haskell-devscripts. This value is used to locate files produced by cabal so we can move them into the deb. Note that the --builddir option of runhaskell Setup appends the "/build" to the value it receives, so, yes, try not to get confused. FIXME: make this FilePath or Maybe FilePath> Directory containing the build environment for which the debianization will be generated. This determines which compiler will be available, which in turn determines which basic libraries can be provided by the compiler. By default all the paths in EnvSet are "/".?HInformation regarding mode of operation - verbosity, dry-run, usage, etc@Mapping from cabal package name and version to debian source package name. This allows different ranges of cabal versions to map to different debian source package names.A'The parsed contents of the control fileBName to give to the debian source package. If not supplied the name is constructed from the cabal package name. Note that DebianNameMap could encode this information if we already knew the cabal package name, but we can't assume that.CIf given, use this name for the base of the debian binary packages - the string between 'libghc-' and '-dev'. Normally this is derived from the hackage package name.DPSpecify the revision string to use when converting the cabal version to debian.ESpecify the exact debian version of the resulting package, including epoch. One use case is to work around the the "buildN" versions that are often uploaded to the debian and ubuntu repositories. Say the latest cabal version of transformers is 0.3.0.0, but the debian repository contains version 0.3.0.0-1build3, we need to specify debVersion="0.3.0.0-1build3" or the version we produce will look older than the one already available upstream.FHValue for the maintainer field in the control file. Note that the cabal maintainer field can have multiple addresses, but debian only one. If this is not explicitly set, it is obtained from the cabal file, and if it is not there then from the environment. As a last resort, there is a hard coded string in here somewhere.GFlags to pass to Cabal function finalizePackageDescription, this can be used to control the flags in the cabal file. It can be supplied to the cabal-debian binary using the --flags option.H Write debiansourceformatIWrite debian/watchJCPut this text into a file with the given name in the debianization.KpThe header of the debian/rules file. The remainder is assembled from DebRulesFragment values in the atom list.LA Fragment of debian/rulesMA warning to be reported laterNName of a package that will get left-over data files and executables. If there are more than one, each package will get those files.OBThe text for the X-Description field of the Source package stanza.PGThe changelog, first entry contains the source package name and versionQxEach element is a comment to be added to the changelog, where the element's text elements are the lines of the comment.RLets cabal-debian know that a package it might expect to exist actually does not, so omit all uses in resulting debianization.SFMap a cabal Extra-Library name to a debian binary package name, e.g. 6ExtraLibMapping extraLibMap "cryptopp" "libcrypto-dev"8 adds a build dependency *and* a regular dependency on  libcrypto-dev to any package that has cryptopp! in its cabal Extra-Library list.TCMap a cabal Build-Tool name to a debian binary package name, e.g. 'ExecMapping "trhsx" "haskell-hsx-utils" adds a build dependency on haskell-hsx-utils to any package that has trhsx in its cabal build-tool list.UXSpecify epoch numbers for the debian package generated from a cabal package. Example: EpochMapping (PackageName HTTP) 1.V'Supply some info about a cabal package.WpThe debhelper compatibility level, from debian/compat. , copyright_ :: Maybe (Either CopyrightDescription Text)X!Copyright and license informationYPHave Apache configure a site using PACKAGE, DOMAIN, LOGDIR, and APACHECONFIGFILEZ6Add a stanza of a logrotate file to the binary package[,Script to run after install, should contain  DEBHELPER line before exit 0\+Script to run after remove, should contain  DEBHELPER line before exit 0]-Script to run before install, should contain  DEBHELPER line before exit 0^,Script to run before remove, should contain  DEBHELPER line before exit 0_0Set the Architecture field of the source package`.Set the Architecture field of a binary packagea,Set the Priority field of the source packageb*Set the Priority field of a binary packagec+Set the Section field of the source packaged)Set the Section field of a binary packagef(Add an init.d file to the binary packageg2Create a binary package to hold a cabal executablehCLike DHExecutable, but configure the executable as a server processi7Like DHServer, but configure the server as a web serverj2Configure the executable to do incremental backupskLimited version of Depends, put a dependency on the dev library package. The only reason to use this is because we don't yet know the name of the dev library package.l1The result of reading a cabal configuration file.m8Which compilers should we generate library packages for?n=Whether this packaging is created by the Debian Haskell GroupoiLook for --buildenvdir in the command line arguments to get the changeroot path, use "/" if not present.s-Set how much progress messages get generated.tKDon't write anything, just output a description of what would have happeneducMake sure the version number and package names of the supplied and generated debianizations match.vlDebianize, SubstVars, or Usage. I'm no longer sure what SubstVars does, but someone may still be using it.wFObsolete record containing verbosity, dryRun, validate, and debAction.xUnusedy<The build directory. This can be set by an argument to the Setup script. When Setup is run manually it is just dist, when it is run by dpkg-buildpackage4 the compiler name is appended, so it is typically dist-ghcO. Cabal-debian needs the correct value of buildDir to find the build results.|>Map from cabal Extra-Lib names to debian binary package names.}?Map from cabal Build-Tool names to debian binary package names.~:Cabal flag assignments to use when loading the cabal file.#The result of loading a .cabal fileMap from cabal version number ranges to debian package names. This is a result of the fact that only one version of a debian package can be installed at a given time, while multiple versions of a cabal package can.7Map of Debian epoch numbers assigned to cabal packages.+Create a package to hold a cabal executableCreate a package for a serverCreate a package for a website*Create a package for a timed backup scriptCreate an apache configuration file with the given (domain, logdir, filetext). This is called when expanding the result of the website lens above.List if packages that should be omitted from any dependency list - e.g. a profiling package missing due to use of noProfilingPackage lens elsewhere.LOverride the package name used to hold left over data files and executables.GOverride the debian source package name constructed from the cabal name=Override the default base of the debian binary package names.URevision string used in constructing the debian verison number from the cabal versionSExact debian version number, overrides the version generated from the cabal version0No longer sure what the purpose of this lens is.YDo not put the version dependencies on the prof packages that we put on the dev packages.|Set this to filter any less-than dependencies out of the generated debian dependencies. (Not sure if this is implemented.)&Set this to omit the prof library deb.%Set this to omit the doc library deb.)Set this to apply offical Debian settings-The copyright information from the cabal file5The architectures supported by this source package - Any, All), or some list of specific architectures.Extra install dependencies for the devel library. Redundant with depends, but kept for backwards compatibility. Also, I think maybe this is or was needed because it can be set before the exact name of the library package is known.The beginning of the rules file&Additional fragments of the rules fileMap of debian/postinst scriptsMap of  debian/postrm scriptsMap of debian/preinst scriptsMap of  debian/prerm scriptsThe  debian/compat7 file, contains the minimum compatible version of the  debhelperW package. If not given the version number of the installed debhelper package is used.The debian/source/format file.the  debian/watch filethe debian/changelog fileHComment entries for the latest changelog entry (DebLogComments [[Text]])The debian/control9 file. Many of the following lenses access parts of the SourceDebDescription.6Add a stanza to the binary package's logrotate script."Access the set of new style atoms. Create an etcTinit.d file in the package FIXME: change signature to BinPkgName -> Lens Atoms TextCreate a file in the debianization. This is used to implement the file lens above. FIXME: change signature to BinPkgName -> Lens Atoms (Set (FilePath, Text))      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn.6543210/-()*+,op"#$%&'!      qrstuvwxyz{|}~L     ! "#$%&'()*+,-.6543210/7789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None 7 7None *246=HKM7Build the Debian package name for a given package type.Function that applies the mapping from cabal names to debian names based on version numbers. If a version split happens at v, this will return the ltName if < v, and the geName if the relation is >= v.Build a debian package name from a cabal package name and a debian package type. Unfortunately, this does not enforce the correspondence between the PackageType value and the name type, so it can return nonsense like (SrcPkgName "libghc-debian-dev").Map all versions of Cabal package pname to Debian package dname. Not really a debian package name, but the name of a cabal package that maps to the debian package name we want. (Should this be a SrcPkgName?)JMap versions less than ver of Cabal Package pname to Debian package ltname/Replace any existing mapping of the cabal name pname with the debian name dnamea. (Use case: to change the debian package name so it differs from the package provided by ghc.) \]^_`a \`_^]aNoneUpdate the Atoms value in the DebT state with some details about the debian repository - special cases for how some cabal packages are mapped to debian package names.None+bNot exported - Ihttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-PackageLens onto one of several < values of which we have specific knowledge how to package.:Lens into the description field of a BinaryDebDescription. Khttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Essential Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10n relations :: BinPkgName -> Lens Atoms B.PackageRelations relations b = B.relations . binaryDebDescription b-The Depends: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.100The Recommends: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10.The Suggests: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.101The Pre-Depends: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10,The Breaks: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10/The Conflicts: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10.The Provides: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10.The Replaces: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.101THe Built-Using: relations for each binary deb - Ehttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.6.10sMaintainer field. Overrides any value found in the cabal file, or in the DEBIANMAINTAINER environment variable. Lhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Maintainer/The architectures supported by a binary packageThe source package priority - Jhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-PriorityQMap of the binary package priorities (FIXME: redundant with BinaryDebDescription)*The source package's section assignment - Ihttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-SectionVMap of the binary deb section assignments (FIXME: redundant with BinaryDebDescription) Hhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source Lhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Changed-By Khttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Uploaders Obsolete - Shttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-DM-Upload-AllowedThe Standards-Version field of the debian/control file - Shttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version Jhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-HomepageVersion control system field - Lhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-VCS-fieldsUser defined fields - Bhttp://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7 Phttp://www.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps Phttp://www.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps Phttp://www.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps Phttp://www.debian.org/doc/debian-policy/ch-relationships.html#s-sourcebinarydeps bXstuvwxy|}~Xstv~}|ywux bNoneCreate equals dependencies. For each pair (A, B), use dpkg-query to find out B's version number, version B. Then write a rule into P's .substvar that makes P require that that exact version of A, and another that makes P conflict with any older version of A.TAdd a debian binary package to the debianization containing a cabal executable file.jAdd a debian binary package to the debianization containing a cabal executable file set up to be a server.lAdd a debian binary package to the debianization containing a cabal executable file set up to be a web site.qAdd a debian binary package to the debianization containing a cabal executable file set up to be a backup script.c+The Cabal package has one synopsis and one description field for the entire package, while in a Debian package there is a description field (of which the first line is synopsis) in each binary package. So the cabal description forms the base of the debian description, each of which is amended.diA configuration file for the logrotate facility, installed via a line in debianFiles. FIXME - use Atoms6Build a suitable value for the head of the rules file.efcdghefcdghNone24EM?Turn the Debianization into a list of files, making sure the text associated with each path is unique. Assumes that finalizeDebianization has already been called. (Yes, I'm considering building one into the other, but it is handy to look at the Debianization produced by finalizeDebianization in the unit tests.)i:Assemble all the links by package and output one file eachjklmnopqirstuvwxyz{|}~jklmnopqirstuvwxyz{|}~None+24M BTry to input a file and if successful add it to the debianization.2Look for a field and apply a function to its value4Construct a file path from the debian directory and a relative path, read its contents and add the result to the debianization. This may mean using a specialized parser from the debian package (e.g. parseChangeLog), and some files (like control) are ignored here, though I don't recall why at the moment.%Read a line from a debian .links file'Read a line from a debian .install file$Read a line from a debian .dirs file'Run the package's configuration script.+Try to compute a string for the the debian  Maintainer:= field using, in this order 1. the Debian Haskell Group, /pkg-haskell-maintainers@lists.alioth.debian.org, if --official is set 2. the maintainer explicitly specified using "Debian.Debianize.Monad.maintainer" 3. the maintainer field of the cabal package, but only if --official is not set, 4. the value returned by getDebianMaintainer, which looks in several environment variables, 5. the signature from the latest entry in debian/changelog, 6. the Debian Haskell Group, /pkg-haskell-maintainers@lists.alioth.debian.orgCompute the Cabal data directory for a Linux install from a Cabal package description. This needs to match the path cabal assigns to datadir in the distbuildkautogen/Paths_packagename.hs module, or perhaps the path in the cabal_debian_datadir environment variable.None2EMqExpand the contents of the .substvars file for a library package. Each cabal package corresponds to a directory  name- version , either in usr lib or in usrlibhaskell-packagesghc/lib. In that directory is a compiler subdirectory such as ghc-6.8.2. In the ghc subdirectory is one or two library files of the form libHS name- version .a and libHS name- versiong_p.a. We can determine the debian package names by running dpkg -S on these names, or examining the varlibdpkgxinfo/*.list files. From these we can determine the source package name, and from that the documentation package name.fDebian packages don't have per binary package build dependencies, so we just gather them all up here.oGiven a control file and a DebType, look for the binary deb with the corresponding suffix and return its name.BThe type of deb we want to write substvars for - Dev, Prof, or Doc NonemRead a value out of the CABALDEBIAN environment variable which is the result of applying show to a [String].Insert a value for CABALDEBIAN into the environment that the withEnvironment* functions above will find and use. E.g. putEnvironmentFlags ["--dry-run", "--validate"] (debianize defaultFlags) Options that modify other atoms.,Process a --executable command line argument  NoneEMIn cabal a self dependency probably means the library is needed while building the executables. In debian it would mean that the package needs an earlier version of itself to build, so we use this to filter such dependencies out.fDebian packages don't have per binary package build dependencies, so we just gather them all up here.The documentation dependencies for a package include the documentation package for any libraries which are build dependencies, so we have access to all the cross references.The Debian build dependencies for a package include the profiling libraries and the documentation packages, used for creating cross references. Also the packages associated with extra libraries.Turn a cabal dependency into debian dependencies. The result needs to correspond to a single debian package to be installed, so we will return just an OrRelation.If a package is bundled with the compiler we make the compiler a substitute for that package. If we were to specify the virtual package (e.g. libghc-base-dev) we would have to make sure not to specify a version number.return and of ors of relNone24M #Given an Atoms value, get any additional configuration information from the environment, read the cabal package description and possibly the debian/changelog file, then generate and return the new debianization (along with the data directory computed from the cabal package description.)0Do some light IO and call finalizeDebianization.!Now that we know the build and data directories, we can expand some atoms into sets of simpler atoms which can eventually be turned into the files of the debianization. The original atoms are not removed from the list because they may contribute to the debianization in other ways, so be careful not to do this twice, this function is not idempotent. (Exported for use in unit tests.) FIXME: we should be able to run this without a PackageDescription, change paramter type to Maybe PackageDescription and propagate down thru codeCompute the final values of the BinaryDebDescription record description fields from the cabal descriptions and the values that have already been set.Combine various bits of information to produce the debian version which will be used for the debian package. If the override parameter is provided this exact version will be used, but an error will be thrown if that version is unusably old - i.e. older than the cabal version of the package. Otherwise, the cabal version is combined with the given epoch number and revision string to create a version.lReturn the Debian epoch number assigned to the given cabal package - the 1 in version numbers like 1:3.5-2.Compute and return the debian source package name, based on the sourcePackageName if it was specified, and constructed from the cabal name otherwise.Make sure there is a changelog entry with the version number and source package name implied by the debianization. This means either adding an entry or modifying the latest entry (if its version number is the exact one in our debianization.)Convert the extraLibs field of the cabal build info into debian binary package names and make them dependendencies of the debian devel package (if there is one.)@Applies a few settings to official packages (unless already set)<Add the library paragraphs for a particular compiler flavor.^This is the standard value for the Description field of a binary package control file stanza.TMake sure all data and executable files are assigned to at least one binary package and make sure all binary packages are in the package list in the source deb description. If there are left over files, assign them to the packages returned by the utilsPackageNames lens, and make sure those packages are in the source deb description. Safe-InferredMPretty print a list of hunks.'Pretty print a hunk of adjacent changes9Pretty print a single change (e.g. a line of a text file) Safe-InferredDo a grouped diff and then turn it into a list of hunks, where each hunk is a grouped diff with at most N elements of common context around each one.Group the elements whose adjacent pairs satisfy the predicate. Differs from groupBy because the predicate does not have to define a total ordering.None*24EMRun the script in debian/Debianize.hs2 with the given command line arguments. Returns True if the script exists and succeeds. In this case it may be assumed that a debianization was created (or updated) in the debian subdirectory of the current directory. In this way we can include a script in a package to produce a customized debianization more sophisticated than the one that would be produced by the cabal-debian executable. An example is included in the debian subdirectory of this library.Depending on the options in atomsC, either validate, describe, or write the generated debianization.%Write the files of the debianization d to ./debian|Return a string describing the debianization - a list of file names and their contents in a somewhat human readable format. WCompare the old and new debianizations, returning a string describing the differences. BMake sure the new debianization matches the existing debianization in several ways - specifically, version number, and the names of the source and binary packages. Some debian packages come with a skeleton debianization that needs to be filled in, this can be used to make sure the debianization we produce is usable.        NoneD%./5@ABCDEJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  '  5%./@ABCDE !"#$%&'())*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                     ! " # $ % % & ' ( ) ) * + , - . / 0 1 2 3 4 5 6 6 7 8 9 : ; ; < = > ? @ A B C D E F G H I 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 p q r s t u v w x y z { | } ~                                                                              (    ! " # $  % & ' ( ) * + , -  . / 0  1 2 3 4 5 6 7 8 9 : ;  < = > ? @ A B C DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrDEFGHstuvwxyz{|}~lqDEFGHv{yDEFGH{cabal-debian-4.19.1Debian.Debianize.InterspersedDebian.Debianize.ChangelogDebian.Debianize.VersionSplitsDistribution.Version.Invert Debian.GHCDebian.Debianize.BundledDebian.Debianize.Prelude Debian.Policy+Debian.Debianize.Types.BinaryDebDescription+Debian.Debianize.Types.SourceDebDescription+Debian.Debianize.Types.CopyrightDescriptionDebian.Debianize.Types.AtomsDebian.Debianize.MonadDebian.Debianize.DebianNameDebian.Debianize.DetailsDebian.Debianize.TypesDebian.Debianize.GoodiesDebian.Debianize.FilesDebian.Debianize.InputDebian.Debianize.SubstVarsDebian.Debianize.Options"Debian.Debianize.BuildDependenciesDebian.Debianize.FinalizeData.Algorithm.Diff.PrettyData.Algorithm.Diff.ContextDebian.Debianize.OutputDebian.OrphansDebian.Debianize Interspersedleftmostpairs foldTriples foldInverted foldArounds foldBetweens filterEntriesdropFutureEntriesfindChangelogEntrymergeChangelogEntries VersionSplitsDebBase unDebBase makePackage insertSplitpackageRangesFromVersionSplitsdebianFromCabalcabalFromDebian'cabalFromDebiandoSplitsinvertVersionRangeinvertVersionIntervalswithCompilerVersionnewestAvailablenewestAvailableCompilerIdcompilerIdFromDebianVersioncompilerFlavorOptionbuiltInaptCacheShowPkgaptCacheProvidesaptCacheDependsaptCacheConflicts aptVersionsDebMapcurry3buildDebVersionMap!strip stripWith strictReadF replaceFile modifyFilediffFileremoveIfExists dpkgFileMap debOfFilecond readFile' readFileMaybeshowDeps showDeps'withCurrentDirectorygetDirectoryContents' setMapMaybezipMaps foldEmptymaybeLindent maybeReadread'modifyMintToVerbosity'~=~?=%=+=++=+++= listElemLens maybeLens fromEmpty fromSingletonLicense OtherLicenseZopeZlibW3CQPLPythonPerlMPLLPPLGFDL_NIVGFDLLGPLGPLExpatEFLCPLCDDLCC0 CC_BY_NC_ND CC_BY_NC_SACC_BY_NCCC_BY_NDCC_BY_SACC_BYISC BSD_4_Clause BSD_3_Clause BSD_2_ClauseArtisticApache Public_DomainAreaNonFreeContribMainSection AreaSection MainSectionPackageArchitecturesNamesAnyAllPackagePriorityExtraOptionalStandard ImportantRequired SourceFormatQuilt3Native3StandardsVersiondatabaseDirectoryapacheLogDirectoryapacheErrorLogapacheAccessLogserverLogDirectory serverAppLogserverAccessLogappLogBaseNameerrorLogBaseNameaccessLogBaseNamedebianPackageVersiongetDebhelperCompatLevelgetDebianStandardsVersionparseStandardsVersionreadSourceFormat readPriorityparsePackageArchitectures readSectiongetDebianMaintainerhaskellMaintainerparseUploadersparseMaintainerfromCabalLicensetoCabalLicense readLicensePackageRelations PackageTypeCabal HaskellSourceSource UtilitiesExec Documentation Profiling DevelopmentBinaryDebDescriptionnewBinaryDebDescriptionnewPackageRelationspackage packageType architecture binarySectionbinaryPriority essential description relationsdepends recommendssuggests preDependsbreaks conflictsprovidesreplaces builtUsing XFieldDestCSBXFieldVersionControlSpecVCSSvnVCSMtnVCSHgVCSGitVCSDarcsVCSCvsVCSBzrVCSArch VCSBrowserSourceDebDescriptionnewSourceDebDescriptionnewSourceDebDescription'source maintainer changedBy uploadersdmUploadAllowedprioritysectionstandardsVersionhomepage vcsFieldsxFields buildDependsbuildConflictsbuildDependsIndepbuildConflictsIndep xDescriptionbinaryPackagesFilesOrLicenseDescriptionLicenseDescription_license_commentFilesDescription _filesPattern_filesCopyright _filesLicense _filesCommentCopyrightDescription_format _upstreamName_upstreamContact_source _disclaimer_summaryComment_summaryLicense_summaryCopyright_filesAndLicensesnewCopyrightDescriptionreadCopyrightDescriptionparseCopyrightDescriptionformat upstreamNameupstreamContact disclaimersummaryCommentsummaryLicensesummaryCopyrightfilesAndLicenses filesPatternfilesCopyright filesLicense filesCommentlicensecomment InstallFileexecName sourceDirdestDirdestNameServerhostnameport headerMessageretry serverFlags installFileSitedomain serverAdminserver PackageInfo cabalNamedevDebprofDebdocDebDebTypeDocProfDev DebActionSubstVar DebianizeUsageFlags verbosity_dryRun_ validate_ debAction_EnvSetcleanOSdependOSbuildOSAtoms'Atom InstallDirInstallCabalExecToInstallCabalExecFile InstallData InstallToInstallLinkAtomsnoDocumentationLibrary_noProfilingLibrary_omitProfVersionDeps_ omitLTDeps_ buildDir_ buildEnv_flags_debianNameMap_control_sourcePackageName_overrideDebianNameBase_ revision_ debVersion_maintainerOld_cabalFlagAssignments_ sourceFormat_watch_intermediateFiles_ rulesHead_rulesFragments_warning_utilsPackageNameBase_ xDescription_ changelog_ comments_missingDependencies_ extraLibMap_execMap_ epochMap_ packageInfo_compat_ copyright_ apacheSite_logrotateStanza_ postInst_postRm_preInst_preRm_sourceArchitecture_binaryArchitectures_sourcePriority_binaryPriorities_sourceSection_binarySections_atomSet_ installInit_ executable_ serverInfo_website_backups_ extraDevDeps_packageDescription_compilerFlavors_ official_newAtoms makeAtoms defaultFlags showAtoms verbositydryRunvalidate debActionflagswarningbuildDirbuildEnv setBuildEnv extraLibMapexecMapcabalFlagAssignmentspackageDescription debianNameMapepochMap executable serverInfowebsitebackups apacheSitemissingDependenciesutilsPackageNameBasesourcePackageNameoverrideDebianNameBaserevision debVersion packageInfoomitProfVersionDeps omitLTDepsnoProfilingLibrarynoDocumentationLibraryofficial copyrightsourceArchitectures extraDevDeps rulesHeadrulesFragmentspostInstpostRmpreInstpreRmcompat sourceFormatwatch changelogcommentscontrollogrotateStanzaatomSetlinkinstall installTo installDatafileinstallCabalExecinstallCabalExecTo installDir installInitintermediateFilescompilerFlavorsDebMDebTexecDebTevalDebTrunDebTexecDebMevalDebMrunDebM debianNamedebianNameBase mkPkgName mkPkgName'mapCabal splitCabal remapCabaldebianDefaultAtomsdebianDescriptionbinaryArchitecturessourcePriority sourceSectiontightDependencyFixup doExecutabledoServer doWebsite doBackupsdescribeoldClckwrksSiteFlagsoldClckwrksServerFlags watchAtom siteAtoms serverAtoms backupAtoms execAtoms makeRulesHeaddebianizationFileMapinputDebianizationinputDebianizationFileinputChangeLoginputCabalizationinputCabalization'inputMaintainerdataDir substvars compileArgscompileEnvironmentArgscompileCommandlineArgswithEnvironmentArgsputEnvironmentArgsoptionsdebianBuildDepsdebianBuildDepsIndep debianizationfinalizeDebianization' prettyDiff prettyHunk prettyChange contextDiffgroupsrunDebianizeScriptdoDebianizeActionwriteDebianizationdescribeDebianizationcompareDebianizationvalidateDebianizationSplits_splits_test1_test2$fInterspersedSplitsDouble[] dropPrefix $fPrettyPP $fPrettyPP0 $fPrettyPP1 $fPrettyPP2 $fPrettyPP3 $fPrettyPP4$fOrdPackageDescription$fOrdExecutable oldestPackagesplits)$fInterspersedVersionSplitsDebBaseVersion$fShowVersionSplitsnewestAvailable'$fMemoizableCompilerFlavornewestAvailableCompilerdebName$fMemoizableBinPkgNamebuiltIn' takeBetweenCabal-1.18.1.3Distribution.VerbosityintToVerbosityremoveFileIfExistsremoveDirectoryIfExistsinvalidLicense$fPrettyLicense_package _architecture _essential _description _relations_depends _recommends _suggests _preDepends_breaks _conflicts _provides _replaces _builtUsing _packageType_binarySection_binaryPriority _maintainer _changedBy _uploaders_dmUploadAllowed _priority_section_standardsVersion _homepage _vcsFields_xFields_binaryPackages _buildDepends_buildConflicts_buildDependsIndep_buildConflictsIndep _xDescriptionparseFilesOrLicense toControlFile toParagraph Dependency_ ExtraLibsPkgConfigDepends BuildTools BuildDependsdebianBaseNamebinaryDebDescriptiondebianDescriptionBaseserverLogrotate' showCommand translate fileAtoms fileAtoms'linksFilesTsourceFormatFiles watchFile intermediatesinstallsdirsinit logrotate postinstFiles postrmFiles preinstFiles prermFilesrules controlFile relFieldsdepFieldfindMap inputAtomsreadLink readInstallreadDir autoreconfinputSourceDebDescriptionparseSourceDebDescriptionparseBinaryDebDescription stripFieldrelsyesinputAtomsFromDirectory nothingIfcabalToCopyrightDescriptionallBuildDependsdebNameFromType substvars'libPaths packageInfo'unboxDependencydebDepscabalDependencies filterMissingexecutableOptionanyreladdDep parseDepsflagListselfDependencydocDependenciesbuildDependencies dependencies doBundled canonicalRelsRel'unRelOrunOrAndunAndadaptaptFileanyrel'debianVersion'debianVersion''convert'finalizeDebianization debianVersion debianEpochfinalizeSourceNamefinalizeChangelogaddExtraLibDependenciescheckOfficialSettings librarySpecsdescmakeUtilsPackagefinalizeMaintainerfinalizeControlofficialSettings putBuildDepscabalExecBinaryPackagebinaryPackageRelationsdocSpecsParagraph librarySpec expandAtoms