Permalink
Commits on Mar 24, 2011
Commits on Mar 21, 2011
  1. tgit.py: provoke ENOTDIR rather than EACCES in test_check_repo_or_die().

    Replace the objects/pack directory with an empty file to provoke an
    ENOTDIR error from stat('objects/pack/.').
    
    Previously the code changed the permissions of the test directory to
    0000 in order to provoke an error other than ENOENT (i.e. EACCES), but
    that doesn't work when the tests are run as root or fakeroot.
    
    (As Gabriel Filion pointed out, the chmod of the testdir is no
    longer necessary, so I removed it and squashed that into this patch.
    -- apenwarr)
    
    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    rlbdv committed with apenwarr Mar 21, 2011
  2. Add initial .dir-locals.el to set emacs sh/python/c mode defaults.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with apenwarr Mar 21, 2011
  3. test-meta.sh: use cp -a instead of make install to create the test tree.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with apenwarr Mar 21, 2011
  4. test-meta.sh: change indentation to 4 spaces and fix if/for formatting.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with apenwarr Mar 21, 2011
  5. test-meta.sh: use $foo rather than ${foo} where possible.

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with apenwarr Mar 21, 2011
  6. tmetadata.py: call helpers.unlink() rather than unlink().

    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with apenwarr Mar 21, 2011
Commits on Mar 20, 2011
  1. cmd/xstat: don't report mtime/atime for symlinks if we don't have_ns_…

    …timestamps.
    
    We can't set the atime/mtime on a symlink anyway if we don't
    have_ns_timestamps, which means the values are meaningless.  Report them as
    0 in order to avoid triggering a unit test failure.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  2. test-meta.sh: remove a bashism, and don't delete dirs on exit.

    It's really annoying to have it wiping out directories that you want to
    examine after a failed test.  And "set -o pipefail" is not available in the
    version of bash on MacOS 10.4.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  3. metadata.py: be careful with the umask() when restoring symlinks.

    On MacOS, the umask affects symlink permissions, although not in any sort of
    useful way that I can see.  Still, getting the permissions wrong breaks the
    unit tests, so let's be careful about it.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  4. Get rid of some python syntax not compatible with python 2.4.

    Mostly this is 'x if b else y' crap, which I hate anyway.
    
    This makes 'make test' *almost* pass on my MacOS 10.4 system (with upgrade
    to python 2.4 from fink).
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  5. xstat: FSTime.from_stat_time() was completely wrong.

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  6. tmetadata: the "non existent group name" test didn't make any sense.

    There's certainly no reason to expect the file's uid/gid would have changed
    after a call that's supposed to fail.  It was passing by pure luck on Linux,
    which doesn't have a sticky gid bit causing the newly created file to have
    a gid != os.getgid().  But on MacOS, the file was originally created with a
    gid != os.getgid(), and so restoring its numeric id restored that, and then
    the test failed.
    
    The test is still kind of pointless; it doesn't actually test anything
    useful, like (for example) automatic fallback to restoring by numeric gid if
    the groupname can't be found.  In fact, looking at the code, it doesn't seem
    like it *would* fall back, which is a bug.  But I'm not going to fix that
    right now.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  7. metadata.py: don't mknod regular files.

    This fails on MacOS.  Just use open() instead.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  8. A bunch of IOError->OSError conversions.

    Some of our replacement functions were throwing IOError when the function
    they replaced would throw OSError.  This was particularly noticeable with
    utime() on MacOS, since it caused a unit test failure.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  9. tmetadata.py: don't call subprocesses for trivial operations.

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  10. metadata: don't die if Linux attr (not xattr) support is missing.

    We don't need an import warning for this one, since linuxattr support is
    always available on linux, and never available elsewhere, since it's in
    _helpers.c and there are no special python modules to install.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  11. metadata: ignore old incompatible python-xattr module; we need python…

    …-pyxattr.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  12. metadata: recover politely if xattr/acl support is missing.

    ...previously we'd just crash, which is definitely not polite.
    
    metadata.py now prints warning on import if these features are missing.
    That's probably overly obnoxious, especially on systems that don't support
    those types of metadata at all.  Is there a way to determine whether a
    kernel *should* support that type of metadata, so we can warn only if so?
    
    (Obviously if the kernel doesn't support, say, xattrs, there's no point
    warning that bup doesn't support them, because no files will be using them
    anyway.  Hmm...)
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  13. metadata/xstat: fix a bunch of CodingStyle issues.

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 20, 2011
  14. Merge branch 'maint'

    * maint:
      Makefile: Fix 'clean' rule
    
    Conflicts:
    	Makefile
    apenwarr committed Mar 20, 2011
  15. Don't accidentally pass atime/ctime/mtime through from_stat_time() tw…

    …ice.
    
    Don't accidentally pass atime/ctime/mtime through
    FSTime.from_stat_time() twice in the xstat stat_result.from_stat_rep()
    static method when _have_ns_fs_timestamps is false.
    
    Signed-off-by: Rob Browning <rlb@defaultvalue.org>
    rlbdv committed with apenwarr Mar 14, 2011
  16. Makefile: Fix 'clean' rule

    In commit 1df0bdd, I introduced a problem in the make file: the
    chmod operation that gives back some permissions on
    lib/bup/t/pybuptest.tmp dies if this directory does not exist.
    
    pybuptest.tmp is only created when running the tests.
    
    when the chmod dies, the clean rule stops, thus not completing the
    cleanup, so we must make sure this operation is not fatal if the
    directory doesn't exist.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with apenwarr Mar 11, 2011
  17. Allow chown to uid:0 to succeed.

    The test case assumed that it was not possible to set uid:0 on a file,
    which is to say that the current user is not a member of group
    0. That's an environmental assumption which is not universal (I am a
    counterexample).
    
    Modified lib/bup/t/tmetadata.py
    Dickon Reed committed with apenwarr Mar 18, 2011
Commits on Mar 11, 2011
  1. Fix more gcc type punning errors introduced by the metadata changes.

    Whatever, let's use 0 and 1 instead of Py_True and Py_False.
    
    _helpers.c: In function ‘bup_set_linux_file_attr’:
    _helpers.c:683: warning: dereferencing type-punned pointer will break
    strict-aliasing rules
    _helpers.c:683: warning: dereferencing type-punned pointer will break
    strict-aliasing rules
    _helpers.c: In function ‘bup_utimensat’:
    _helpers.c:758: warning: dereferencing type-punned pointer will break
    strict-aliasing rules
    _helpers.c:758: warning: dereferencing type-punned pointer will break
    strict-aliasing rules
    _helpers.c: In function ‘init_helpers’:
    _helpers.c:940: warning: dereferencing type-punned pointer will break
    strict-aliasing rules
    _helpers.c:941: warning: dereferencing type-punned pointer will break
    strict-aliasing rules
    error: command 'gcc' failed with exit status 1
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 11, 2011
  2. Merge branch 'maint'

    * maint:
      _helpers.c: fix a "type punning" warning from gcc.
      Add a test for previous octal/string filemode fix.
    apenwarr committed Mar 11, 2011
  3. _helpers.c: fix a "type punning" warning from gcc.

    _helpers.c: In function ‘bloom_contains’:
    _helpers.c:260: warning: dereferencing type-punned pointer will break strict-aliasing rules
    
    Whatever, let's use 1 instead of the apparently problematic Py_True.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 11, 2011
Commits on Mar 10, 2011
  1. Add a test for previous octal/string filemode fix.

    Apparently nothing was testing symlink behaviour; add a basic test for
    symlink save/restore.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    apenwarr committed Mar 10, 2011
  2. Merge branch 'maint'

    * maint:
      Use debug1() when reporting paths skipped
      Save was using a quoted instead of octal gitmode.
      Verify permissions in check_repo_or_die()
    
    Conflicts:
    	Makefile
    	lib/bup/git.py
    apenwarr committed Mar 10, 2011
  3. Use debug1() when reporting paths skipped

    Skipping paths during indexing is a normal event not indicative of any
    problems, so need not be reported in normal operation.
    
    Signed-off-by: Aneurin Price <aneurin.price@gmail.com>
    Aneurin committed with apenwarr Mar 9, 2011
  4. Save was using a quoted instead of octal gitmode.

    This bugged in an assert on python 2.7 for me, and I believe was
    incorrect but functional behavior.
    
    Signed-off-by: Brandon Low <lostlogic@lostlogicx.com>
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    Brandon Low committed with apenwarr Mar 7, 2011
  5. Verify permissions in check_repo_or_die()

    Currently, if one doesn't have read or access permission up to
    repo('objects/pack'), bup exits with the following error:
    
    error: repo() is not a bup/git repository
    
    (with repo() replaced with the actual path).
    
    This is misleading, since there is possibly really a repository there
    but the user can't access it.
    
    Make git.check_repo_or_die() verify that the current user has the
    permission to access repo('objects/pack'), and if not, output a
    meaningful error message.
    
    As a bonus, we get an error if the bup_dir path is not a directory.
    
    Signed-off-by: Gabriel Filion <lelutin@gmail.com>
    lelutin committed with apenwarr Mar 10, 2011
  6. t/tmetadata.py: fix a typo st_uid -> st_gid.

    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    eduardok committed with apenwarr Mar 10, 2011
  7. Add python-pyxattr as a dependency to the README

    Signed-off-by: Zoran Zaric <zz@zoranzaric.de>
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    zoranzaric committed with apenwarr Mar 2, 2011
  8. Use debug1() when reporting paths skipped

    Skipping paths during indexing is a normal event not indicative of any
    problems, so need not be reported in normal operation.
    
    Signed-off-by: Aneurin Price <aneurin.price@gmail.com>
    Aneurin committed with apenwarr Mar 9, 2011