Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
91d2e8d5
Commit
91d2e8d5
authored
3 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
Error -> UsageError
parent
8d97030b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libstore/profiles.cc
+2
-2
2 additions, 2 deletions
src/libstore/profiles.cc
with
2 additions
and
2 deletions
src/libstore/profiles.cc
+
2
−
2
View file @
91d2e8d5
...
@@ -212,14 +212,14 @@ void deleteGenerationsOlderThan(const Path & profile, time_t t, bool dryRun)
...
@@ -212,14 +212,14 @@ void deleteGenerationsOlderThan(const Path & profile, time_t t, bool dryRun)
void
deleteGenerationsOlderThan
(
const
Path
&
profile
,
const
string
&
timeSpec
,
bool
dryRun
)
void
deleteGenerationsOlderThan
(
const
Path
&
profile
,
const
string
&
timeSpec
,
bool
dryRun
)
{
{
if
(
timeSpec
.
empty
()
||
timeSpec
[
timeSpec
.
size
()
-
1
]
!=
'd'
)
if
(
timeSpec
.
empty
()
||
timeSpec
[
timeSpec
.
size
()
-
1
]
!=
'd'
)
throw
Error
(
"invalid number of days specifier '%1%', expected something like '14d'"
,
timeSpec
);
throw
Usage
Error
(
"invalid number of days specifier '%1%', expected something like '14d'"
,
timeSpec
);
time_t
curTime
=
time
(
0
);
time_t
curTime
=
time
(
0
);
string
strDays
=
string
(
timeSpec
,
0
,
timeSpec
.
size
()
-
1
);
string
strDays
=
string
(
timeSpec
,
0
,
timeSpec
.
size
()
-
1
);
auto
days
=
string2Int
<
int
>
(
strDays
);
auto
days
=
string2Int
<
int
>
(
strDays
);
if
(
!
days
||
*
days
<
1
)
if
(
!
days
||
*
days
<
1
)
throw
Error
(
"invalid number of days specifier '%1%'"
,
timeSpec
);
throw
Usage
Error
(
"invalid number of days specifier '%1%'"
,
timeSpec
);
time_t
oldTime
=
curTime
-
*
days
*
24
*
3600
;
time_t
oldTime
=
curTime
-
*
days
*
24
*
3600
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment