aboutsummaryrefslogtreecommitdiff
path: root/src/nix-env/names.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-09-10 13:32:08 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-09-10 13:32:08 +0000
commitdcc433de47d4bf4a27fe63bc8996e946164ae885 (patch)
tree0d27a8f0433094144b7cdab591726f2ec288d937 /src/nix-env/names.cc
parentc16be6ac92b86981e8e4bb6703e694b675a28b0d (diff)
* Operation `--delete-generations' to delete generations of a
profile. Arguments are either generation number, or `old' to delete all non-current generations. Typical use: $ nix-env --delete-generations old $ nix-collect-garbage * istringstream -> string2Int.
Diffstat (limited to 'src/nix-env/names.cc')
-rw-r--r--src/nix-env/names.cc12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/nix-env/names.cc b/src/nix-env/names.cc
index c6054d6c1..93bcfda24 100644
--- a/src/nix-env/names.cc
+++ b/src/nix-env/names.cc
@@ -56,20 +56,10 @@ static string nextComponent(string::const_iterator & p,
}
-#include <fstream>
-
-static bool parseInt(const string & s, int & n)
-{
- istringstream st(s);
- st >> n;
- return !st.fail();
-}
-
-
static bool componentsLT(const string & c1, const string & c2)
{
int n1, n2;
- bool c1Num = parseInt(c1, n1), c2Num = parseInt(c2, n2);
+ bool c1Num = string2Int(c1, n1), c2Num = string2Int(c2, n2);
if (c1Num && c2Num) return n1 < n2;
else if (c1 == "" && c2Num) return true;