BackupPC-users

Re: [BackupPC-users] Round-tripping config.pl between hand-coding and the web interface

2011-09-09 08:32:29
Subject: Re: [BackupPC-users] Round-tripping config.pl between hand-coding and the web interface
From: Holger Parplies <wbppc AT parplies DOT de>
To: hansbkk AT gmail DOT com
Date: Fri, 9 Sep 2011 14:30:25 +0200
Hi,

hansbkk AT gmail DOT com wrote on 2011-09-09 12:03:38 +0700 [[BackupPC-users] 
Round-tripping config.pl between hand-coding and the web interface]:
> [...]
> On Fri, Sep 9, 2011 at 3:57 AM, Bowie Bailey <Bowie_Bailey AT buc DOT com> 
> wrote:
> > Just a note that a comma at the end of the last element in an array or
> > hash is perfectly fine in Perl.
> >
> > This is also a correct example:
> >
> > $Conf{RsyncShareName} = [
> >  '/cygdrive/c',
> > ];
> 
> Perhaps someone implemented the
> 
> last item,
> ''
>  ];
> 
> syntax because the web admin script strips that ending comma out.

perhaps someone implemented it because they were stupid?

A comma at the end of a Perl list without following elements is a *purely
cosmetic* thing. If you want one there, fine, put it there.

A gratuitous empty string element at the end of a Perl list is a *functional
difference*. There just *might* be places where the code handling it silently
thinks "idiot, that's nonsense" and ignores it. There *might* be other places
where the code doesn't notice, because the value never gets used. In the case
you stumbled over it did *exactly* the right thing: give you trouble.
Configuration errors are not supposed to go unnoticed, because nobody can tell
whether they are important or not. Just imagine your most important data share
simply being silently ignored because of a typing error in the share name.

Your backup really did not finish without errors. It could not, because what
you actually requested was unfulfillable.

In the rare cases where the '' thing works, it is a *kludge*, not a solution.
The *solution* would be to *patch the code* to retain the comma at the end of
a list.

You seem to prefer kludges over solutions. That's fine. Just don't advocate
them on the list. In fact, don't even present them here without at least a
prominent notice to the fact that they are no more than ugly kludges. *We*
will suffer the consequences of people using kludges, not you. In fact, you
just gave the best example yourself: someone else presented a kludge
somewhere, you incorrectly copied it, had problems, and came to us for help.

All of that said, the '' thing does *not even really qualify* as a kludge -
the end of the list still has no comma. It's just plain nonsense.

My guess is that someone had meant to add a further value, needed to check
some references, got interrupted, and forgot to complete the task. *Luckily*,
BackupPC will remind him by failing the backup.

> It also removes
> 
> # comments
> 
> within a given variable's code block, but not those maintained between
> variables.

If you can come up with an implementation that can retain the comments within
the block, I'm sure Craig will happily accept the patch. I'll just say I don't
think it can be done (correctly, that is, not some kludge that only works half
of the time - I shouldn't normally have to explicitly state that) without
reimplementing the Perl parser.

I believe, using both the BackupPC web GUI and a text editor to modify your
configuration files is not officially supported. You do that at your own risk
and shouldn't complain about problems it causes.

Regards,
Holger

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/