Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai3
tools
tabacco
Commits
0e4bde8a
Commit
0e4bde8a
authored
Nov 22, 2021
by
ale
Browse files
Only use --repository-file with restic >= 0.11
parent
d8932a2e
Pipeline
#24122
passed with stages
in 2 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
repository_restic.go
View file @
0e4bde8a
...
...
@@ -37,20 +37,17 @@ type resticRepository struct {
func
(
r
*
resticRepository
)
resticCmd
(
cmd
string
)
string
{
args
:=
[]
string
{
r
.
bin
,
cmd
}
if
r
.
repositoryFile
!=
""
{
// Work around https://github.com/restic/restic/issues/3104
// ("restic init" does not respect --repository-file in Restic
// versions prior to 0.12).
if
cmd
==
"init"
&&
r
.
version
.
LessThan
(
resticFixedIssue3104Version
)
{
args
=
append
(
args
,
"--repo"
,
r
.
uri
)
}
else
{
args
=
append
(
args
,
"--repository-file"
,
r
.
repositoryFile
)
}
// Work around https://github.com/restic/restic/issues/3104
// ("restic init" does not respect --repository-file in Restic
// versions prior to 0.12).
if
r
.
version
.
LessThan
(
resticRepositoryFileVersion
)
||
(
cmd
==
"init"
&&
r
.
version
.
LessThan
(
resticFixedIssue3104Version
))
{
args
=
append
(
args
,
"--repo"
,
r
.
uri
)
}
else
{
args
=
append
(
args
,
"--repository-file"
,
r
.
repositoryFile
)
}
if
r
.
passwordFile
!=
""
{
args
=
append
(
args
,
"--password-file"
,
r
.
passwordFile
)
}
args
=
append
(
args
,
"--password-file"
,
r
.
passwordFile
)
return
strings
.
Join
(
args
,
" "
)
}
...
...
@@ -71,6 +68,7 @@ var (
resticVersionRx
=
regexp
.
MustCompile
(
`^restic ([0-9.]+)`
)
resticMinGoodVersion
=
version
.
Must
(
version
.
NewVersion
(
"0.9"
))
resticRepositoryFileVersion
=
version
.
Must
(
version
.
NewVersion
(
"0.11"
))
resticFixedIssue3104Version
=
version
.
Must
(
version
.
NewVersion
(
"0.12"
))
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment