]> git.michaelhowe.org Git - packages/b/bup.git/log
packages/b/bup.git
15 years agodocument debian packaging
Jon Dowland [Mon, 10 May 2010 13:02:29 +0000 (14:02 +0100)]
document debian packaging

15 years agoremove myself from Uploaders:
Jon Dowland [Wed, 5 May 2010 10:53:29 +0000 (11:53 +0100)]
remove myself from Uploaders:

15 years agoset myself rather than collab-maint as maintainer.
Jon Dowland [Wed, 5 May 2010 10:50:06 +0000 (11:50 +0100)]
set myself rather than collab-maint as maintainer.

It seems setting collab-maint as Maintainer: for collaboratively-maintained
packages is not the done thing.

15 years agoversion the bup-common dep
Jon Dowland [Wed, 5 May 2010 10:49:48 +0000 (11:49 +0100)]
version the bup-common dep

15 years agocorrect bup version (new tag)
Jon Dowland [Wed, 5 May 2010 10:27:15 +0000 (11:27 +0100)]
correct bup version (new tag)

15 years agoMerge remote branch 'upstream/master' into debian
Jon Dowland [Tue, 4 May 2010 13:41:37 +0000 (14:41 +0100)]
Merge remote branch 'upstream/master' into debian

15 years agocode clarity: one-letter var carried for too long
Gabriel Filion [Fri, 30 Apr 2010 05:53:13 +0000 (01:53 -0400)]
code clarity: one-letter var carried for too long

In split-cmd.py, the "w" variable is first seen on line 55 and is kept
around until line 96. Variables that are sparsely used in a medium
distance in the code should have a name that carries more sense when
read on its own.

Change "w" into "pack_writer" to better identify the purpose of the
variable.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
15 years agoAvoid len as a variable name
Gabriel Filion [Fri, 30 Apr 2010 05:53:12 +0000 (01:53 -0400)]
Avoid len as a variable name

As discussed earlier on the mailing list, the "len" builtin is used very
often, and using "len" as a variable name can get confusing.

Change all occurrences of "len" as a variable to "sz" to keep it short
and meaningful.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
15 years agoadjust version to reflect tracking git
Jon Dowland [Thu, 29 Apr 2010 09:23:10 +0000 (10:23 +0100)]
adjust version to reflect tracking git

15 years agoMerge branch 'master' into debian
Jon Dowland [Thu, 29 Apr 2010 09:10:29 +0000 (10:10 +0100)]
Merge branch 'master' into debian

Conflicts:
Documentation/bup-fuse.1.md

15 years agoadjust .md files to make lexgrog happy
Jon Dowland [Wed, 28 Apr 2010 14:41:05 +0000 (15:41 +0100)]
adjust .md files to make lexgrog happy

the whatis(1) tool cannot parse the bup manpages, because there
are two words before the '-' separator. This patch joins the words
using another '-', in the same fashion as git, to overcome this
limitation.

Before:

$ whatis bup fuse
bup (1)              - Backup program using rolling checksums and git file fo...
fuse: nothing appropriate.
$ whatis bup-fuse
bup-fuse: nothing appropriate.

After:

$ whatis bup-fuse
bup-fuse (1)         - mount a bup repository as a filesystem

Signed-off-by: Jon Dowland <jmtd@debian.org>
15 years agoDocumentation: some placeholders are lost
Gabriel Filion [Wed, 28 Apr 2010 17:12:05 +0000 (13:12 -0400)]
Documentation: some placeholders are lost

Some pieces of text in the documentation files use the <...> syntax to
mark named placeholders. However, the conversion done by pandoc from
Markdown to makefile makes some of these placeholders disappear.

The affected elements are those that contain only characters that could
be valid for an e-mail address or a URL, but are not supposed to be one
of both. Also, elements inside `...`-style code blocks are unaffected.

Fix this situation by escaping the < and > characters where the tags
disappear.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
15 years agoadd -o/--allow-other to bup-fuse
Jon Dowland [Wed, 28 Apr 2010 13:50:30 +0000 (14:50 +0100)]
add -o/--allow-other to bup-fuse

Setting the fuse option allow_other will fail if user_allow_other
is not set in fuse.conf.  Add toggle -o/--allow-other to bup-fuse
(disabled by default).

Signed-off-by: Jon Dowland <jmtd@debian.org>
15 years agoadd -o/--allow-other argument for bup-fuse
Jon Dowland [Wed, 28 Apr 2010 13:41:44 +0000 (14:41 +0100)]
add -o/--allow-other argument for bup-fuse

Do not attempt to set the fuse option "allow_other" by default, which
will fail on some systems if "user_allow_other" is not set in fuse.conf.

Instead, add an argument '-o/--allow-other' to optionally turn this
feature on.

15 years agofix moving bup manpage
Jon Dowland [Wed, 28 Apr 2010 13:16:56 +0000 (14:16 +0100)]
fix moving bup manpage

15 years agoget rid of an mkdir in debian/rules
Jon Dowland [Wed, 28 Apr 2010 13:08:12 +0000 (14:08 +0100)]
get rid of an mkdir in debian/rules

15 years agoreplace test files with ones made up of bup code
Jon Dowland [Wed, 28 Apr 2010 12:58:54 +0000 (08:58 -0400)]
replace test files with ones made up of bup code

This is needed to avoid possible questions about licensing in the source
data file.

15 years agoadjust .md files to make lexgrog happy
Jon Dowland [Wed, 28 Apr 2010 12:43:14 +0000 (13:43 +0100)]
adjust .md files to make lexgrog happy

15 years agoupdate copyright for test files
Jon Dowland [Wed, 28 Apr 2010 11:43:40 +0000 (12:43 +0100)]
update copyright for test files

15 years agoreplace test files with ones made up of bup code
Jon Dowland [Wed, 28 Apr 2010 11:42:00 +0000 (12:42 +0100)]
replace test files with ones made up of bup code

15 years agoupdate copyright file with more license holders
Jon Dowland [Wed, 28 Apr 2010 11:31:16 +0000 (12:31 +0100)]
update copyright file with more license holders

15 years agoupdate copyright file with more license holders
Jon Dowland [Wed, 28 Apr 2010 11:27:36 +0000 (12:27 +0100)]
update copyright file with more license holders

15 years agoupdate copyright file with more license holders
Jon Dowland [Wed, 28 Apr 2010 11:22:07 +0000 (12:22 +0100)]
update copyright file with more license holders

15 years agorelease to experimental
Jon Dowland [Wed, 28 Apr 2010 11:08:37 +0000 (12:08 +0100)]
release to experimental

15 years agoMerge branch 'debian-common' into debian
Jon Dowland [Wed, 28 Apr 2010 11:06:13 +0000 (12:06 +0100)]
Merge branch 'debian-common' into debian

15 years agoremove allow_other option (disabled by default in Debian)
Jon Dowland [Wed, 28 Apr 2010 10:43:28 +0000 (11:43 +0100)]
remove allow_other option (disabled by default in Debian)

15 years agoadd python-fuse dependency
Jon Dowland [Wed, 28 Apr 2010 10:31:08 +0000 (11:31 +0100)]
add python-fuse dependency

15 years agoadd bup.links
Jon Dowland [Wed, 28 Apr 2010 10:21:44 +0000 (11:21 +0100)]
add bup.links

15 years agotweak git dependency
Jon Dowland [Wed, 28 Apr 2010 09:43:12 +0000 (10:43 +0100)]
tweak git dependency

15 years agosome mkdirs in debian/rules
Jon Dowland [Wed, 28 Apr 2010 09:42:13 +0000 (10:42 +0100)]
some mkdirs in debian/rules

15 years agoMerge branch 'debian' into debian-common
Jon Dowland [Tue, 27 Apr 2010 18:59:09 +0000 (19:59 +0100)]
Merge branch 'debian' into debian-common

Conflicts:
debian/control
debian/rules

15 years agoupdate to 0.14-1
Jon Dowland [Tue, 27 Apr 2010 18:40:31 +0000 (19:40 +0100)]
update to 0.14-1

15 years agoMerge commit 'bup-0.14' into debian
Jon Dowland [Tue, 27 Apr 2010 18:37:19 +0000 (19:37 +0100)]
Merge commit 'bup-0.14' into debian

15 years agoanother change for bup/bup-common
Jon Dowland [Tue, 27 Apr 2010 18:35:23 +0000 (19:35 +0100)]
another change for bup/bup-common

15 years agogit log --format= isn't in older git, but git log --pretty=format: is.
Avery Pennarun [Tue, 27 Apr 2010 00:11:00 +0000 (20:11 -0400)]
git log --format= isn't in older git, but git log --pretty=format: is.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
15 years agobup-fuse: friendliness when python-fuse not found
Gabriel Filion [Sat, 24 Apr 2010 20:33:31 +0000 (16:33 -0400)]
bup-fuse: friendliness when python-fuse not found

When used with the Python "fuse" module not installed on the system, the
bup-fuse command exits with an error.

To avoid confusing (or frustrating?) users, print a friendlier error
message that better describes what happens.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
15 years agocmd/version, etc: fix version number detection stuff.
Avery Pennarun [Sat, 24 Apr 2010 21:10:02 +0000 (17:10 -0400)]
cmd/version, etc: fix version number detection stuff.

Gabriel Filion pointed out that bup's version number (which we added to the
man pages automatically) was not detected when you used a bup tarball
generated from 'git archive' (or more likely, you let GitHub call 'git
archive' for you).  That makes sense, since our version detection was based
on having a .git directory around, which the tarball doesn't.

Instead, let's create a .gitattributes file and have it auto-substitute some
version information during 'git archive'.  Of course, if we actually *do*
have a .git directory, continue to use that.

While we're here, add a new 'bup version' command and alias "bup --version"
and "bup -V" to call it, since those options are pretty standard.

15 years agovfs: take advantage of bup chunking to make file seeking faster.
Avery Pennarun [Fri, 23 Apr 2010 23:18:10 +0000 (19:18 -0400)]
vfs: take advantage of bup chunking to make file seeking faster.

If you have a huge file, you can now seek around inside it (eg. in 'bup
fuse') without having to read its entire contents.  Calculating the file
size is also really fast now.

This makes a bup fuse-mounted filesystem much more useful for real-time
access.  For example, I was able to connect to an sqlite3 database and have
it work at a reasonable speed.  (Obviously, since 'bup fuse' is written in
python and doesn't currently support threading, the speed could still be
improved, but at least it's no longer godawful.)

15 years agogit.CatPipe: more resilience against weird errors.
Avery Pennarun [Fri, 23 Apr 2010 21:25:39 +0000 (17:25 -0400)]
git.CatPipe: more resilience against weird errors.

Notably, MemoryErrors thrown because the file we're trying to load into
memory is too big to load all at once.  Now the MemoryError gets thrown, but
the main program is potentially able to recover from it because CatPipe at
least doesn't get into an inconsistent state.

Also we can recover nicely if some lamer kills our git-cat-file subprocess.

The AutoFlushIter we were using for this purpose turns out to not have been
good enough, and it's never been used anywhere but in CatPipe, so I've
revised it further and renamed it to git.AbortableIter.

15 years agocmd/ftp: 'ls' command should print filenames in columns.
Avery Pennarun [Fri, 23 Apr 2010 20:33:10 +0000 (16:33 -0400)]
cmd/ftp: 'ls' command should print filenames in columns.

We use the columnate() function from main.py for this, now moved into
helpers.py.

15 years agocmd/ftp: if 'get' command returns an error, print it first.
Avery Pennarun [Fri, 23 Apr 2010 20:32:31 +0000 (16:32 -0400)]
cmd/ftp: if 'get' command returns an error, print it first.

Previously we would print "Saving 'filename'" even if we were about to
report that 'filename' doesn't exist or is the wrong file type.

15 years agovfs: cache file sizes in the Node object.
Avery Pennarun [Fri, 23 Apr 2010 20:21:35 +0000 (16:21 -0400)]
vfs: cache file sizes in the Node object.

Since the filesystem is read only, there's no reason to recalculate the file
size every time someone asks :)

15 years agocmd/fuse: add missing Stat entries to appease older versions of python-fuse.
Avery Pennarun [Fri, 23 Apr 2010 20:19:50 +0000 (16:19 -0400)]
cmd/fuse: add missing Stat entries to appease older versions of python-fuse.

python-fuse 0.2-pre3-4ubuntu1 didn't work, now it does.
python-fuse 0.2-pre3-9 on Debian did work, still does.

15 years agocmd/save: when a file is chunked, mangle its name from * to *.bup
Avery Pennarun [Fri, 23 Apr 2010 19:39:24 +0000 (15:39 -0400)]
cmd/save: when a file is chunked, mangle its name from * to *.bup

Files that are already named *.bup are renamed to *.bup.bupl, so that we can
just always drop either .bup or .bupl from a filename if it's there, and the
result will be the original filename.

Also updated lib/bup/vfs.py to demangle the names appropriately, and treat
git trees named *.bup as real chunked files (ie. by joining them back
together).

15 years agoFirst draft of a DESIGN document.
Avery Pennarun [Wed, 14 Apr 2010 13:48:11 +0000 (09:48 -0400)]
First draft of a DESIGN document.

15 years agoadjust debhelper b-d versioning
Jon Dowland [Fri, 9 Apr 2010 22:35:22 +0000 (23:35 +0100)]
adjust debhelper b-d versioning

15 years agomore depends
Jon Dowland [Thu, 8 Apr 2010 22:58:39 +0000 (23:58 +0100)]
more depends

15 years agomore depends
Jon Dowland [Thu, 8 Apr 2010 22:58:29 +0000 (23:58 +0100)]
more depends

15 years agomove usr/bin/bup around
Jon Dowland [Thu, 8 Apr 2010 22:57:13 +0000 (23:57 +0100)]
move usr/bin/bup around

15 years agooverride dh_auto_install
Jon Dowland [Thu, 8 Apr 2010 22:49:26 +0000 (23:49 +0100)]
override dh_auto_install

15 years agoREADME: add some suggestions from the LWN article.
Avery Pennarun [Wed, 7 Apr 2010 02:53:42 +0000 (22:53 -0400)]
README: add some suggestions from the LWN article.

The article itself was here:
https://lwn.net/Articles/380983/

15 years agoREADME: fix some capitalization and whitespace errors.
Avery Pennarun [Wed, 7 Apr 2010 02:53:15 +0000 (22:53 -0400)]
README: fix some capitalization and whitespace errors.

15 years agoremove some junk from debian/rules
Jon Dowland [Tue, 6 Apr 2010 21:42:12 +0000 (22:42 +0100)]
remove some junk from debian/rules

15 years agoremove some junk from debian/rules
Jon Dowland [Tue, 6 Apr 2010 21:42:12 +0000 (22:42 +0100)]
remove some junk from debian/rules

15 years agoMerge branch 'debian' into debian-common
Jon Dowland [Tue, 6 Apr 2010 21:28:24 +0000 (22:28 +0100)]
Merge branch 'debian' into debian-common

Conflicts:
debian/control

15 years agorecommends: par2
Jon Dowland [Tue, 6 Apr 2010 21:28:03 +0000 (22:28 +0100)]
recommends: par2

15 years agobup-common is arch: all
Jon Dowland [Tue, 6 Apr 2010 21:25:01 +0000 (22:25 +0100)]
bup-common is arch: all

15 years agobegin introducing bup-common
Jon Dowland [Tue, 6 Apr 2010 21:24:48 +0000 (22:24 +0100)]
begin introducing bup-common

15 years agob-p: python-dev
Jon Dowland [Tue, 6 Apr 2010 21:18:12 +0000 (22:18 +0100)]
b-p: python-dev

15 years agoadd pandoc to build-depends
Jon Dowland [Tue, 6 Apr 2010 21:03:14 +0000 (22:03 +0100)]
add pandoc to build-depends

15 years agoadjust initial upstream version
Jon Dowland [Tue, 6 Apr 2010 20:47:26 +0000 (21:47 +0100)]
adjust initial upstream version

15 years agoMerge branch 'master' into debian
Jon Dowland [Tue, 6 Apr 2010 20:46:58 +0000 (21:46 +0100)]
Merge branch 'master' into debian

15 years agodoc: bup-split should mention bup-join (not git-join)
Kirill Smelkov [Fri, 2 Apr 2010 06:30:26 +0000 (10:30 +0400)]
doc: bup-split should mention bup-join (not git-join)

15 years agoMerge branch 'master' of /tmp/bup
Avery Pennarun [Thu, 1 Apr 2010 23:36:02 +0000 (19:36 -0400)]
Merge branch 'master' of /tmp/bup

* 'master' of /tmp/bup:
  Add a 'make install' target.

15 years agoAdd a 'make install' target.
Avery Pennarun [Thu, 1 Apr 2010 23:34:03 +0000 (19:34 -0400)]
Add a 'make install' target.

Also change main.py to search around in appropriate places for the installed
library files.  By default, if your bup is in /usr/bin/bup, it'll look in
/usr/lib/bup.  (It drops two words off the end of the filename and adds
/lib/bup to the end.)

This also makes the Debian packager at
http://git.debian.org/collab-maint/bup
actually produce a usable package.

15 years agocmd/fsck: correctly catch nonzero return codes of 'par2 create'.
Avery Pennarun [Thu, 1 Apr 2010 19:43:05 +0000 (15:43 -0400)]
cmd/fsck: correctly catch nonzero return codes of 'par2 create'.

Oops; we weren't checking the return value like we should.  Reported by
Sitaram Chamarty.

15 years agohelpers.log(): run sys.stdout.flush() first.
Avery Pennarun [Thu, 1 Apr 2010 18:58:00 +0000 (14:58 -0400)]
helpers.log(): run sys.stdout.flush() first.

It's annoying when your log messages come out before stdout messages do.
But it's equally annoying (and inefficient) to have to flush every time you
print something.  This seems like a nice compromise.

15 years agoGet rid of a sha-related DeprecationWarning in python 2.6.
Avery Pennarun [Thu, 1 Apr 2010 18:48:10 +0000 (14:48 -0400)]
Get rid of a sha-related DeprecationWarning in python 2.6.

hashlib is only available in python 2.5 or higher, but the 'sha' module
produces a DeprecationWarning in python 2.6 or higher.  We want to support
python 2.4 and above without any stupid warnings, so let's try using
hashlib.  If it fails, switch to the old sha module.

15 years agoupdate debian/control with a different Maintainer field
Jon Dowland [Thu, 1 Apr 2010 09:23:50 +0000 (10:23 +0100)]
update debian/control with a different Maintainer field

15 years agoupdate debian/copyright with full name of maintainer
Jon Dowland [Thu, 1 Apr 2010 09:23:35 +0000 (10:23 +0100)]
update debian/copyright with full name of maintainer

15 years agofill out debian/changelog
Jon Dowland [Thu, 1 Apr 2010 09:13:49 +0000 (10:13 +0100)]
fill out debian/changelog

15 years agofill out debian/copyright
Jon Dowland [Thu, 1 Apr 2010 09:13:26 +0000 (10:13 +0100)]
fill out debian/copyright

15 years agofill in control
Jon Dowland [Thu, 1 Apr 2010 09:10:44 +0000 (10:10 +0100)]
fill in control

15 years agofill in README.source
Jon Dowland [Thu, 1 Apr 2010 09:08:58 +0000 (10:08 +0100)]
fill in README.source

15 years agoremove dh_make *ex files, except menu.ex
Jon Dowland [Thu, 1 Apr 2010 09:08:08 +0000 (10:08 +0100)]
remove dh_make *ex files, except menu.ex
fill in the menu file

15 years agoimport initial dh_make output
Jon Dowland [Thu, 1 Apr 2010 09:06:18 +0000 (10:06 +0100)]
import initial dh_make output

15 years agoAdd support for a global --bup-dir or -d argument.
Rob Browning [Thu, 25 Mar 2010 07:23:57 +0000 (00:23 -0700)]
Add support for a global --bup-dir or -d argument.

When a "--bup-dir DIR" or "-d DIR" argument is provided, act as if
BUP_DIR=DIR is set in the environment.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
15 years agoAdd support for global command-line options (before any subcmd).
Rob Browning [Thu, 25 Mar 2010 07:23:56 +0000 (00:23 -0700)]
Add support for global command-line options (before any subcmd).

Process global arguments via getopt before handling a subcmd, and add
initial support for a global --help (or -?) option.

Also support --help for subcmds by noticing and translating

  git ... subcmd --help ...

into

  git ... help subcmd ...

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
15 years agocmd/help-cmd.py: Use BUP_MAIN_EXE to invoke the correct bup.
Rob Browning [Thu, 25 Mar 2010 07:23:55 +0000 (00:23 -0700)]
cmd/help-cmd.py: Use BUP_MAIN_EXE to invoke the correct bup.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
15 years agoAdd a LICENSE file to reflect that bup is licensed under the LGPLv2.
Avery Pennarun [Tue, 23 Mar 2010 18:13:48 +0000 (14:13 -0400)]
Add a LICENSE file to reflect that bup is licensed under the LGPLv2.

15 years agoserver: only suggest a max of one pack per receive-objects cycle.
Avery Pennarun [Sun, 21 Mar 2010 20:48:23 +0000 (16:48 -0400)]
server: only suggest a max of one pack per receive-objects cycle.

Since the client only handles one at a time and forgets the others anyway,
suggesting others is a bit of a waste of time... and because of the cheating
way we figure out which index to suggest when using a midx, suggesting packs
is more expensive than it should be anyway.

The "correct" fix in the long term will be to make the client accept
multiple suggestions at once, plus make midx files a little smarter about
figuring out which pack is the one that needs to be suggested.  But in the
meantime, this makes things a little nicer: there are fewer confusing log
messages from the server, and a lot less disk grinding related to looking
into which pack to suggest, followed by finding out that we've already
suggested that pack anyway.

15 years agorbackup-cmd: we can now backup a *remote* machine to a *local* server.
Avery Pennarun [Sun, 21 Mar 2010 04:41:52 +0000 (00:41 -0400)]
rbackup-cmd: we can now backup a *remote* machine to a *local* server.

The -r option to split and save allowed you to backup from a local machine
to a remote server, but that doesn't always work; sometimes the machine you
want to backup is out on the Internet, and the backup repo is safe behind a
firewall.  In that case, you can ssh *out* from the secure backup machine to
the public server, but not vice versa, and you were out of luck.  Some
people have apparently been doing this:

    ssh publicserver tar -c / | bup split -n publicserver

(ie. running tar remotely, piped to a local bup split) but that isn't
efficient, because it sends *all* the data from the remote server over the
network before deduplicating it locally.  Now you can do instead:

    bup rbackup publicserver index -vux /
    bup rbackup publicserver save -n publicserver /

And get all the usual advantages of 'bup save -r', except the server runs
locally and the client runs remotely.

15 years agoclient: Extract 'bup server' connection code into its own module.
Avery Pennarun [Sun, 21 Mar 2010 03:03:53 +0000 (23:03 -0400)]
client: Extract 'bup server' connection code into its own module.

The screwball function we use to let us run 'bup xxx' on a remote server
after correctly setting the PATH variable is about to become useful for more
than just 'bup server'.

15 years agooptions: allow user to specify an alternative to getopt.gnu_getopt.
Avery Pennarun [Sun, 21 Mar 2010 04:36:31 +0000 (00:36 -0400)]
options: allow user to specify an alternative to getopt.gnu_getopt.

The most likely alternative is getopt.getopt, which doesn't rearrange
arguments.  That would mean "-a foo -p" is considered as the option "-a"
followed by the non-option arguments ['foo', '-p'].

The non-gnu behaviour is annoying most of the time, but can be useful when
you're receiving command lines that you want to pass verbatim to someone
else.

15 years agosave/index/drecurse: correct handling for fifos and nonexistent paths.
Avery Pennarun [Sun, 21 Mar 2010 05:47:24 +0000 (01:47 -0400)]
save/index/drecurse: correct handling for fifos and nonexistent paths.

When indexing a fifo, you can try to open it (for security reasons) but it
has to be O_NDELAY just in case the fifo doesn't have anyone on the other
end; otherwise indexing can freeze.

In index.reduce_paths(), we weren't reporting ENOENT for reasons I can no
longer remember, but I think they must have been wrong.  Obviously if
someone specifies a nonexistent path on the command line, we should barf
rather than silently not back it up.

Add some unit tests to catch both cases.

15 years agosave-cmd: exit nonzero if any errors were encountered.
Avery Pennarun [Sun, 21 Mar 2010 05:24:31 +0000 (01:24 -0400)]
save-cmd: exit nonzero if any errors were encountered.

Somehow I forgot to do this before.

15 years agomain: when printing help, don't mix stdout/stderr.
Avery Pennarun [Sun, 21 Mar 2010 04:57:23 +0000 (00:57 -0400)]
main: when printing help, don't mix stdout/stderr.

15 years agomain.py: don't leak a file descriptor.
Avery Pennarun [Sun, 21 Mar 2010 04:34:21 +0000 (00:34 -0400)]
main.py: don't leak a file descriptor.

subprocess.Popen() is a little weird about when it closes the file
descriptors you give it.  In this case, we have to dup() it because if
stderr=2 (the default) and stdout=2 (because fix_stderr), it'll close fd 2.
But if we dup it first, it *won't* close the dup, because stdout!=stderr.
So we have to dup it, but then we have to close it ourselves.

This was apparently harmless (it just resulted in an extra fd#3 getting
passed around to subprocesses as a clone of fd#2) but it was still wrong.

15 years agocmd/index-cmd.py: How it pains me to have to explicitly close() stuff
Lukasz Kosewski [Mon, 15 Mar 2010 03:20:08 +0000 (23:20 -0400)]
cmd/index-cmd.py:  How it pains me to have to explicitly close() stuff

If we don't explicitly close() the wr reader object while running
update-index, the corresponding writer object won't be able to unlink
its temporary file under Cygwin.

15 years agolib/bup/index.py: mmap.mmap() objects need to be closed() for Win32.
Lukasz Kosewski [Mon, 15 Mar 2010 03:17:42 +0000 (23:17 -0400)]
lib/bup/index.py:  mmap.mmap() objects need to be closed() for Win32.

Not *entirely* sure why this is the case, but it appears through some
refcounting weirdness, just setting the mmap variables to None in
index.Readers doesn't cause the mmap to be freed under Cygwin, though
I can't find any reason why this would be the case.

Naturally, this caused all sort of pain when we attempt to unlink
an mmaped file created while running bup index --check -u.

Fix the issue by explicitly .close()ing the mmap in Reader.close().

15 years agoPackIdxList.refresh(): remember to exclude old midx files.
Avery Pennarun [Sun, 14 Mar 2010 06:59:45 +0000 (01:59 -0500)]
PackIdxList.refresh(): remember to exclude old midx files.

Previously, if you called refresh(), it would fail to consider
the contents of already-loaded .midx files as already-loaded.  That means
it would load all the constituent .idx files, so you'd actually lose all the
advantages of the .midx after the first refresh().

Thus, the midx optimization mainly worked before you filled up your first
pack (about 1GB of data saved) or until you got an index suggestion.  This
explains why backups would slow down significantly after running for a
while.

Also, get rid of the stupid forget_packs option; just automatically prune
the packs that aren't relevant after the refresh.  This avoids the
possibility of weird behaviour if you set forget_packs incorrectly (which we
did).

15 years agobup.client: fix freeze when suggest-index after finishing a full pack.
Avery Pennarun [Sun, 14 Mar 2010 07:50:05 +0000 (03:50 -0400)]
bup.client: fix freeze when suggest-index after finishing a full pack.

It was just rare enough to be hard to find: if you write an entire pack full
of stuff (1GB or more) and *then* trigger a suggest-index, the client would
freeze because it would send a send-index command without actually
suspending the receive-pack first.

The whole Client/PackWriter separation is pretty gross, so it's not terribly
surprising this would happen.

Add a unit test to detect this case if it ever happens in the future, for
what it's worth.

15 years agohashsplit: no need to import bup.git.
Avery Pennarun [Sun, 14 Mar 2010 07:39:08 +0000 (03:39 -0400)]
hashsplit: no need to import bup.git.

15 years agomain: even more fixes for signal handling.
Avery Pennarun [Sun, 14 Mar 2010 05:55:08 +0000 (00:55 -0500)]
main: even more fixes for signal handling.

If the child doesn't die after the first SIGINT and the user presses ctrl-c
one more time, the main bup process would die instead of forwarding it on to
the child.  That's no good; we actually have to loop forwarding signals
until the child is really good and dead.

And if the child refuses to die, well, he's the one with the bug, not
main.py.  So main.py should stay alive too in the name of not losing track
of things.

15 years agoclient/server: correctly handle case where receive-objects had 0 objects.
Avery Pennarun [Sun, 14 Mar 2010 05:15:29 +0000 (00:15 -0500)]
client/server: correctly handle case where receive-objects had 0 objects.

Previously we'd throw a (probably harmless other than ugly output)
exception in this case.

15 years agosave-cmd: oops, left in some code that was forcing progress output.
Avery Pennarun [Sun, 14 Mar 2010 05:05:44 +0000 (00:05 -0500)]
save-cmd: oops, left in some code that was forcing progress output.

15 years agocmd/{index,save}: handle ctrl-c without printing a big exception trace.
Avery Pennarun [Sat, 13 Mar 2010 01:40:46 +0000 (20:40 -0500)]
cmd/{index,save}: handle ctrl-c without printing a big exception trace.

It's not very exciting to look at a whole stack trace just because someone
hit ctrl-c, especially since that's designed to work fine.  Trim it down in
that case.

15 years agogit.PackWriter: avoid pack corruption if interrupted by a signal.
Avery Pennarun [Fri, 12 Mar 2010 23:46:40 +0000 (18:46 -0500)]
git.PackWriter: avoid pack corruption if interrupted by a signal.

PackWriter tries to "finish" a half-written pack in its destructor if
interrupted.  To do this, it flushes the stream, seeks back to the beginning
to update the sha1sum and object count, then runs git-index-pack on it to
create the .idx file.

However, sometimes if you were unlucky, you'd interrupt PackWriter partway
through writing an object to the pack.  If only half an object exists at the
end, it would have the wrong header and thus come out as corrupt when
index-pack would run.

Since our objects are meant to be small anyway, just make sure we write
everything all in one file.write() operation.  The files themselves are
buffered, so this wouldn't survive a surprise termination of the whole
unix process, but we wouldn't run index-pack in that case anyway, so it
doesn't matter.

Now when I press ctrl-c in 'bup save', it consistently writes the half-saved
objects as it should.

15 years agoCorrectly pass along SIGINT to child processes.
Avery Pennarun [Fri, 12 Mar 2010 23:05:54 +0000 (18:05 -0500)]
Correctly pass along SIGINT to child processes.

Ever since we introduced bup newliner, signal handling has been a little
screwy.  The problem is that ctrl-c is passed to *all* processes in the
process group, not just the parent, so everybody would start terminating at
the same time, with very messy results.

Two results were particularly annoying: git.PackWriter()'s destructor
wouldn't always get called (so half-finished packs would be lost instead of
kept so we don't need to backup the same stuff next time) and bup-newliner
would exit, so the stdout/stderr of a process that *did* try to clean up
would be lost, usually resulting in EPIPE, which killed the proces while
attempting to clean up.

The fix is simple: when starting a long-running subprocess, give it its own
session by calling os.setsid().  That way ctrl-c is only sent to the
toplevel 'bup' process, who can forward it as it should.

Next, fix bup's signal forwarding to actually forward the same signal as it
received, instead of always using SIGTERM.

15 years agohashsplit: use posix_fadvise(DONTNEED) when available.
Avery Pennarun [Fri, 12 Mar 2010 22:18:20 +0000 (17:18 -0500)]
hashsplit: use posix_fadvise(DONTNEED) when available.

When reading through large disk images to back them up, we'll only end up
reading the data once, but it still takes up space in the kernel's disk
cache.  If you're backing up a whole disk full of stuff, that's bad news for
anything else running on your system, which will rapidly have its stuff
dumped out of cache to store a bunch of stuff bup will never look at again.

The posix_fadvise() call actually lets us tell the kernel we won't be using
this data anymore, thus greatly reducing our hit on the disk cache.

Theoretically it improves things, anyway.  I haven't been able to come up
with a really scientific way to test it, since of course *bup's* performance
is expected to be the same either way (we're only throwing away stuff we're
done using).  It really does throw things out of cache, though, so the rest
follows logically at least.