Initialize _file in MetaStoreReader before open

So that __del__() will work properly if open fails.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
save-cmd.py: don't test for meta index via access()

Instead just try to open the metadata index and catch any EACCES.
There may be an issue with access on Cygwin
(http://bugs.python.org/issue2528), and even if not, this approach
removes a potential race between access() and open().

Thanks to Mark J Hewitt <mjh@idnet.com> for reporting the problem and
helping track down the cause.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Ignore empty lines in --exclude-rx-from files

Thanks to Daniel Hahler Daniel Hahler <git@thequod.de> for suggesting
the change.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
parse_excludes: drop empty --exclude-from paths

Empty paths shouldn't match during drecurse, but there's no point in
including them.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
format-subst.pl: check for subcommand failure

Thanks to karl.richter722@gmail.com for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
test-meta.sh: use user's uid/gid, not 0

Cygwin does not fully support uid and gid of 0. Instead, use the
current user's ids to avoid portability problems. Since this test is
not run for ordinary users, the result is the same.

Signed-off-by: Patrick Rouleau <prouleau72@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Avoid uid/gid 0 metadata tests when ids don't exist

Cygwin may not have a 0 uid/gid, so skip the relevant tests whenever
it doesn't.

We have to explicitly exclude the gid 0 from other_group, because
/etc/group may define a group named root with the same id as
Administrators. We cannot use "root" instead of 0, because root may
not be defined.

Cygwin users: If you want to define the root group, add this line
at the begining of /etc/group:
  root:S-1-5-32-544:0:

Signed-off-by: Patrick Rouleau <prouleau72@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>