Hi,

> On 30 Mar 2015, at 15:07, Eelco Dolstra <eelco.dols...@logicblox.com> wrote:
> 
> We could add an option to suppress creating a new generation if nothing has 
> changed.

I read some code and I have a suggestion - tell me if I’m missing something 
obvious, because this looks really simple.

In createGeneration we already look at the existing generations
https://github.com/NixOS/nix/blob/master/src/nix-env/profiles.cc#L77 
<https://github.com/NixOS/nix/blob/master/src/nix-env/profiles.cc#L77>

Looking at the generation links, I can see this in my profiles directory:

lrwxr-xr-x   1 ctheune  wheel    60B Mar 17 17:15 default-30-link -> 
/nix/store/ywgj0k27h2c6ly7l40afbqxncis858c1-user-environment
lrwxr-xr-x   1 ctheune  wheel    60B Mar 17 17:16 default-31-link -> 
/nix/store/ywgj0k27h2c6ly7l40afbqxncis858c1-user-environment
lrwxr-xr-x   1 ctheune  wheel    60B Mar 17 17:16 default-32-link -> 
/nix/store/ywgj0k27h2c6ly7l40afbqxncis858c1-user-environment

So. How about adapting createGeneration to not create a new generation if it 
targets the same environment as the previous one? Maybe with an option?

Would this be the right point to change this? Am I missing something? Looks 
quite simple to me (minus my C++ writing abilities being basically nonexisting).

If this path looks OK to you then I’d be happy to bash my head against the C++ 
to learn something.

Christian

—
Christian Theune · c...@flyingcircus.io · +49 345 219401 0
Flying Circus Internet Operations GmbH · http://flyingcircus.io
Forsterstraße 29 · 06112 Halle (Saale) · Deutschland
HR Stendal HRB 21169 · Geschäftsführer: Christian. Theune, Christian. Zagrodnick

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to