[Borgbackup] Some minor issues
Hans-Peter Jansen
hpj at urpla.net
Mon Jun 27 06:55:37 EDT 2016
On Samstag, 18. Juni 2016 19:59:39 Hans-Peter Jansen wrote:
> Hi Marian, hi Thomas,
>
> On Freitag, 17. Juni 2016 21:35:09 public at enkore.de wrote:
> > On 06/17/2016 07:31 PM, Hans-Peter Jansen wrote:
> > > The point is, if you run "borg create --stats" (without -v), it
> >
> > doesn't print
> >
> > > the stats, which is rather counter intuitive...
> >
> > Yeah, that'll be fixed in 1.1
> >
> > See current development log at
> > https://github.com/borgbackup/borg/blob/master/docs/changes.rst
> >
> > > BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
> >
> > This should only be needed once. Check if ~/.cache/borg/<repo i>/config
> > contains the correct path (the one you use to access the repository in
> > your scripts), and if that file has the correct permissions etc.
>
> Here's a patch proposal:
>
> --- a/src/borg/helpers.py
> +++ b/src/borg/helpers.py
> @@ -975,6 +975,25 @@ def yes(msg=None, false_msg=None, true_msg=None,
> default_msg=None,
> ofile = sys.stderr
> if default not in (True, False):
> raise ValueError("invalid default value, must be True or False")
> + # silent acceptance via environment:
> + # if a valid answer is given via environment
> + # and no env_msg is attached to this question
> + # print msg only, if a related {true,false}_msg is attached
> + # and return the related value
> + if env_var_override and not env_msg:
> + answer = os.environ.get(env_var_override)
> + if answer in truish:
> + if true_msg:
> + if msg:
> + print(msg, file=ofile)
> + print(true_msg, file=ofile)
> + return True
> + if answer in falsish:
> + if false_msg:
> + if msg:
> + print(msg, file=ofile)
> + print(false_msg, file=ofile)
> + return False
> if msg:
> print(msg, file=ofile, end='', flush=True)
> while True:
>
> Would something like that be acceptable?
Is that proposal too silly to be discussed?
Pete
More information about the Borgbackup
mailing list