From: Avery Pennarun Date: Mon, 30 May 2011 00:50:25 +0000 (-0400) Subject: Merge branch 'master' into meta X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=56dd4712e7d66a8623ec7b85753469f9500c6003;p=packages%2Fb%2Fbup.git Merge branch 'master' into meta * master: (27 commits) t/test.sh: 'ls' on NetBSD sets -A by default as root; work around it. README: add a list of binary packages README: rework the title hierarchy Clarify the message when the BUP_DIR doesn't exist. Refactor: unify ls/ftp-ls code ftp/ls: Adjust documentation ls: include hidden files when explicitly requested ftp: implement ls -s (show hashes) ftp/ls: columnate output attached to a tty, else don't ftp: don't output trailing line for 'ls' ftp: output a newline on EOF when on a tty config: more config stuff to config/ subdir, call it from Makefile. cmd/{split,save}: support any compression level using the new -# feature. options.py: add support for '-#' style compression options. Add documentation for compression levels Add test case for compression level Add compression level options to bup save and bup split Make zlib compression level a parameter for Client Make zlib compression level a parameter of git.PackWriter Use is_superuser() rather than checking euid directly ... Conflicts: lib/bup/metadata.py --- 56dd4712e7d66a8623ec7b85753469f9500c6003 diff --cc lib/bup/_helpers.c index 2e7c6bf,a0656cc..5956f5b --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@@ -759,45 -760,11 +760,45 @@@ static PyObject *bup_utimensat(PyObjec #endif /* defined(_ATFILE_SOURCE) || _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L */ - + #endif /* HAVE_UTIMENSAT */ -#ifdef linux /* and likely others */ +static PyObject *stat_struct_to_py(const struct stat *st) +{ + /* Enforce the current timespec nanosecond range expectations. */ + if (st->st_atim.tv_nsec < 0 || st->st_atim.tv_nsec > 999999999) + { + PyErr_SetString(PyExc_ValueError, "invalid atime timespec nanoseconds"); + return NULL; + } + if (st->st_mtim.tv_nsec < 0 || st->st_mtim.tv_nsec > 999999999) + { + PyErr_SetString(PyExc_ValueError, "invalid mtime timespec nanoseconds"); + return NULL; + } + if (st->st_ctim.tv_nsec < 0 || st->st_ctim.tv_nsec > 999999999) + { + PyErr_SetString(PyExc_ValueError, "invalid ctime timespec nanoseconds"); + return NULL; + } + + return Py_BuildValue("kkkkkkkk(Ll)(Ll)(Ll)", + (unsigned long) st->st_mode, + (unsigned long) st->st_ino, + (unsigned long) st->st_dev, + (unsigned long) st->st_nlink, + (unsigned long) st->st_uid, + (unsigned long) st->st_gid, + (unsigned long) st->st_rdev, + (unsigned long) st->st_size, + (long long) st->st_atime, + (long) st->st_atim.tv_nsec, + (long long) st->st_mtime, + (long) st->st_mtim.tv_nsec, + (long long) st->st_ctime, + (long) st->st_ctim.tv_nsec); +} + -#define HAVE_BUP_STAT 1 static PyObject *bup_stat(PyObject *self, PyObject *args) { int rc; diff --cc lib/bup/metadata.py index aecf740,981ad09..46d04b9 --- a/lib/bup/metadata.py +++ b/lib/bup/metadata.py @@@ -6,10 -6,10 +6,10 @@@ # Public License as described in the bup LICENSE file. import errno, os, sys, stat, pwd, grp, struct, re from cStringIO import StringIO -from bup import vint +from bup import vint, xstat from bup.drecurse import recursive_dirlist - from bup.helpers import add_error, mkdirp, log - from bup.xstat import utime, lutime + from bup.helpers import add_error, mkdirp, log, is_superuser -from bup.xstat import utime, lutime, lstat, FSTime ++from bup.xstat import utime, lutime, lstat import bup._helpers as _helpers try: