Make appendToName do the right thing

I.e. append a suffix *before* the version, rather than after.  So we
get "sqlite-interactive-3.8.0.2" instead of
"sqlite-3.8.0.2-interactive".  The latter is broken since nix-env just
sees it the suffix as part of the version, so "nix-env -u" will
happily upgrade "sqlite-3.8.0.2-interactive" to "sqlite-3.9".
This commit is contained in:
Eelco Dolstra 2014-03-10 15:01:56 +01:00
parent 1fe2a68224
commit e167cf9f21
2 changed files with 13 additions and 13 deletions

View file

@ -31,11 +31,10 @@ rec {
updateName = updater: drv: drv // {name = updater (drv.name);}; updateName = updater: drv: drv // {name = updater (drv.name);};
/* Append a suffix to the name of a package. !!! the suffix should /* Append a suffix to the name of a package (before the version
really be appended *before* the version, at least most of the part). */
time. appendToName = suffix: updateName (name:
*/ let x = builtins.parseDrvName name; in "${x.name}-${suffix}-${x.version}");
appendToName = suffix: updateName (name: "${name}-${suffix}");
/* Apply a function to each derivation and only to derivations in an attrset /* Apply a function to each derivation and only to derivations in an attrset

View file

@ -1004,7 +1004,8 @@ let
g500-control = callPackage ../tools/misc/g500-control { }; g500-control = callPackage ../tools/misc/g500-control { };
gawk = lowPrio (callPackage ../tools/text/gawk { }); gawk = callPackage ../tools/text/gawk { };
gawkInteractive = appendToName "interactive" gawkInteractive = appendToName "interactive"
(gawk.override { readlineSupport = true; }); (gawk.override { readlineSupport = true; });
@ -1583,9 +1584,9 @@ let
pam = if stdenv.isLinux then pam else null; pam = if stdenv.isLinux then pam else null;
}; };
openssh_hpn = lowPrio (pkgs.appendToName "hpn" (openssh.override { hpnSupport = true; })); openssh_hpn = pkgs.appendToName "with-hpn" (openssh.override { hpnSupport = true; });
openssh_with_kerberos = lowPrio (pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; })); openssh_with_kerberos = pkgs.appendToName "with-kerberos" (openssh.override { withKerberos = true; });
opensp = callPackage ../tools/text/sgml/opensp { }; opensp = callPackage ../tools/text/sgml/opensp { };
@ -2802,12 +2803,12 @@ let
jdkdistro = installjdk: pluginSupport: jdkdistro = installjdk: pluginSupport:
assert supportsJDK; assert supportsJDK;
(if pluginSupport then appendToName "plugin" else x: x) (if pluginSupport then appendToName "with-plugin" else x: x)
(callPackage ../development/compilers/jdk/jdk6-linux.nix { }); (callPackage ../development/compilers/jdk/jdk6-linux.nix { });
oraclejdk7distro = installjdk: pluginSupport: oraclejdk7distro = installjdk: pluginSupport:
assert supportsJDK; assert supportsJDK;
(if pluginSupport then appendToName "plugin" else x: x) (if pluginSupport then appendToName "with-plugin" else x: x)
(callPackage ../development/compilers/jdk/jdk7-linux.nix { inherit installjdk; }); (callPackage ../development/compilers/jdk/jdk7-linux.nix { inherit installjdk; });
jikes = callPackage ../development/compilers/jikes { }; jikes = callPackage ../development/compilers/jikes { };
@ -8447,7 +8448,7 @@ let
guiSupport = false; # use mercurialFull to get hgk GUI guiSupport = false; # use mercurialFull to get hgk GUI
}; };
mercurialFull = lowPrio (appendToName "full" (pkgs.mercurial.override { guiSupport = true; })); mercurialFull = appendToName "full" (pkgs.mercurial.override { guiSupport = true; });
merkaartor = callPackage ../applications/misc/merkaartor { }; merkaartor = callPackage ../applications/misc/merkaartor { };
@ -8931,11 +8932,11 @@ let
sasl = cyrus_sasl; sasl = cyrus_sasl;
}; };
subversionClient = lowPrio (appendToName "client" (subversion.override { subversionClient = appendToName "client" (subversion.override {
bdbSupport = false; bdbSupport = false;
perlBindings = true; perlBindings = true;
pythonBindings = true; pythonBindings = true;
})); });
surf = callPackage ../applications/misc/surf { surf = callPackage ../applications/misc/surf {
libsoup = gnome.libsoup; libsoup = gnome.libsoup;