[darcs-users] [patch141] Include the exact package versions darcs was compiled

Eric Kow kowey at darcs.net
Mon Jan 18 09:29:32 UTC 2010

Applied, thanks!  This bundle dumps a list of package versions at the end of
exact-version, which is a very good thing.

I was pleasantly surprised to find out that this still preserves the property
that darcs --exact-version is a working context file, so you can still do
  darcs --exact-version > /tmp/ctx
  darcs get --lazy http://darcs.net --context /tmp/ctx
to get the bug reporter's darcs.

Also note that this brings us a step closer to http://bugs.darcs.net/issue849
being resolved.  It would still be good to dump the flags in there.

Fix our version mechanism to make non-clean rebuilds pick up right version.
Thanks to Reinier for reviewing the hard part of this bundle (a
different patch)

Include the exact package versions darcs was compiled with in --exact-version.

>      ,"version = \"" ++ version ++ " (" ++ state ++ ")\""
> +    ,"builddeps = " ++ (show $ formatdeps (packageDeps lbi))
>      ,"context = " ++ case ctx of
>                         Just x -> show x
>                         Nothing -> show "context not available"

> +  where formatdeps = unlines . map formatone
> +        formatone p = case packageName p of PackageName n -> n ++ "-" ++ showVersion (packageVersion p)

This looks fine to me.  Just dumps a string like
  builddeps = "HTTP-4000.0.8\narray-\nbase-\nbytestring-\ncontainers-\ndirectory-\nfilepath-\nhashed-storage-0.4.5\nhaskeline-\nhtml-\nmmap-0.4.1\nmtl-\nnetwork-\nold-time-\nparsec-\nprocess-\nrandom-\nregex-compat-0.92\nterminfo-\ntext-0.4\nunix-\nzlib-\n"
in Version

Note the use of show on a String so we get things like the newlines.

> hunk ./src/darcs.hs 68
>      ["--exact-version"] -> do
>                putStrLn $ "darcs compiled on "++__DATE__++", at "++__TIME__
>                putStrLn context
> +              putStrLn $ "Compiled with:\n"
> +              putStr builddeps

No surprises there.

Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100118/f5d77c6b/attachment.pgp>

More information about the darcs-users mailing list