Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-collect-garbage: translate to C++ #522

Merged
merged 1 commit into from
Apr 22, 2015

Conversation

lucabrunox
Copy link
Contributor

No description provided.

@Fuuzetsu
Copy link
Member

Reasoning? Speed?

@shlevy
Copy link
Member

shlevy commented Apr 22, 2015

#341

@Fuuzetsu
Copy link
Member

Cool

if (link.find("link") != string::npos) {
printMsg(lvlInfo, format("removing old generations of profile %1%") % path);

runProgramSimple(settings.nixBinDir + "/nix-env", Strings{"-p", path, "--delete-generations", gen, dryRun ? "--dry-run" : ""});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than calling nix-env, it would be cleaner to factor out opDeleteGenerations() from nix-env.cc into a library function and call it directly. IMHO that's one of the main benefits of rewriting in C++ (being able to call APIs directly rather than going through command line invocations).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not yet confident with doing this, can we accept this in the while as a 1:1 translation?

edolstra added a commit that referenced this pull request Apr 22, 2015
nix-collect-garbage: translate to C++
@edolstra edolstra merged commit 4bbcfaf into NixOS:master Apr 22, 2015
@edolstra edolstra mentioned this pull request Aug 10, 2016
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants