On Sun, Aug 03, 2008 at 12:05:48PM +0200, Pjotr Prins wrote:
> Quite a few packages have duplications of version numbers hard-coded.
> One way to prevent that is defining a variable 'version'. It would
> even be easier if we could get the version from the fetchurl (with the
> name of the package) as the URL often gets changed first, when
> updating a package.
> 
> Would be a nice to have.
How would it look like ?

# name can be "", in this case it will be taken from the url as well
let makeName url name = 
  if name == "" then __getNameAndVersionFromURL url
  else name ++ "-" ++ __getVersionFromURL url
; in
addName attr = attr // { name = makeName attr.src.url ( lib.getAttr [ "name" ] 
"" attr ); }

?

Marc
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to