--- Begin Message ---
Package: etckeeper
Version: 0.11
Severity: wishlist
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu hardy ubuntu-patch
The attached patch, which adds bzr support to etckeeper, has been provided
by Mark A. Hershberger at https://launchpad.net/bugs/189293 for Ubuntu.
Please consider taking it.
Thank you.
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/commit.d/10vcs-test
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/commit.d/10vcs-test
--- etckeeper-0.11/commit.d/10vcs-test 2008-01-04 22:22:33.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/commit.d/10vcs-test 2008-03-07
02:30:26.000000000 +0100
@@ -10,4 +10,6 @@
not_enabled_warning
elif [ "$VCS" = hg ] && [ ! -d .hg ]; then
not_enabled_warning
+elif [ "$VCS" = bzr ] && [ ! -d .bzr ]; then
+ not_enabled_warning
fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/commit.d/40bzr-rm
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/commit.d/40bzr-rm
--- etckeeper-0.11/commit.d/40bzr-rm 1970-01-01 01:00:00.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/commit.d/40bzr-rm 2008-03-07
02:29:49.000000000 +0100
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+TAB=" "
+
+if [ "$VCS" = bzr ] && [ -d .bzr ]; then
+ for file in $(bzr deleted); do
+ if [ ! -d "$file" ]; then
+ bzr rm --keep --quiet "$file"
+ fi
+ done
+fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/commit.d/45bzr-precommit
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/commit.d/45bzr-precommit
--- etckeeper-0.11/commit.d/45bzr-precommit 1970-01-01 01:00:00.000000000
+0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/commit.d/45bzr-precommit 2008-03-07
02:29:49.000000000 +0100
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+if [ "$VCS" = bzr ] && [ -d .bzr ]; then
+ etckeeper precommit .
+fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/commit.d/50vcs-commit
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/commit.d/50vcs-commit
--- etckeeper-0.11/commit.d/50vcs-commit 2008-01-15 19:13:08.000000000
+0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/commit.d/50vcs-commit 2008-03-07
02:29:49.000000000 +0100
@@ -15,4 +15,10 @@
else
hg commit $HG_COMMIT_OPTIONS
fi
+elif [ "$VCS" = bzr ] && [ -d .bzr ]; then
+ if [ -n "$message" ]; then
+ bzr commit $BZR_COMMIT_OPTIONS -m "$message"
+ else
+ bzr commit $BZR_COMMIT_OPTIONS
+ fi
fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/debian/changelog
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/debian/changelog
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/debian/control
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/debian/control
--- etckeeper-0.11/debian/control 2008-01-05 00:43:42.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/debian/control 2008-03-07
02:42:39.000000000 +0100
@@ -10,12 +11,13 @@
Package: etckeeper
Architecture: all
Section: admin
-Depends: metastore, git-core (>= 1:1.5.3.4) | mercurial, ${misc:Depends}
+Depends: metastore, git-core (>= 1:1.5.3.4) | mercurial | bzr (>= 1.0),
${misc:Depends}
Description: store /etc in git or mercurial
- The etckeeper program is a tool to let /etc be stored in a git or mercurial
- repository. It hooks into APT to automatically commit changes made to /etc
- during package upgrades. It uses 'metastore' to track file metadata that
- version control systems do not normally support, but that is important for
- /etc, such as the permissions of /etc/shadow. It's quite modular and
- configurable, while also being simple to use if you understand the basics of
+ The etckeeper program is a tool to let /etc be stored in a git,
+ mercurial, or bzr repository. It hooks into APT to automatically
+ commit changes made to /etc during package upgrades. It uses
+ 'metastore' to track file metadata that version control systems do
+ not normally support, but that is important for /etc, such as the
+ permissions of /etc/shadow. It's quite modular and configurable,
+ while also being simple to use if you understand the basics of
working with version control.
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/etckeeper
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/etckeeper
--- etckeeper-0.11/etckeeper 2008-01-15 19:50:56.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/etckeeper 2008-03-07 02:29:49.000000000
+0100
@@ -23,6 +23,9 @@
if [ ! -z "$HG_COMMIT_OPTIONS" ]; then
export HG_COMMIT_OPTIONS
fi
+if [ ! -z "$BZR_COMMIT_OPTIONS" ]; then
+ export BZR_COMMIT_OPTIONS
+fi
if [ ! -z "$HIGHLEVEL_PACKAGE_MANAGER" ]; then
export HIGHLEVEL_PACKAGE_MANAGER
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/etckeeper.1
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/etckeeper.1
--- etckeeper-0.11/etckeeper.1 2008-01-15 20:02:34.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/etckeeper.1 2008-03-07
02:29:49.000000000 +0100
@@ -1,22 +1,23 @@
.\" -*- nroff -*-
.TH ETCKEEPER 1 "" "" ""
.SH NAME
-etckeeper \- store /etc in git or mercurial
+etckeeper \- store /etc in git, mercurial, or bazaar
.SH SYNOPSIS
.B etckeeper command [-d directory]
.SH DESCRIPTION
-etckeeper manages /etc be stored in a git or mercurial repository. By
-default each of the commands operates on /etc, but a different directory
-can be specified to operate on a clone of the /etc repository located
-elsewhere.
+etckeeper manages /etc be stored in a git, mercurial, or bazaar
+repository. By default each of the commands operates on /etc, but a
+different directory can be specified to operate on a clone of the /etc
+repository located elsewhere.
.SH COMMANDS
.TP
.B init
-This is the only command you typically need to run by hand. It initialises
-and sets up a git or mercurial repository (depending on the VCS setting in
+This is the only command you typically need to run by hand. It
+initialises and sets up a git, mercurial, or bazaar repository
+(depending on the VCS setting in
/etc/etckeeper/etckeeper.conf). Typically this is run in /etc once
-when starting to use etckeeper on a machine. It can also be used to initialise
-a clone of the /etc repository located elsewhere.
+when starting to use etckeeper on a machine. It can also be used to
+initialise a clone of the /etc repository located elsewhere.
.TP
.B commit [message]
Commits changes in /etc to the repository. A commit message can be
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/etckeeper.conf
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/etckeeper.conf
--- etckeeper-0.11/etckeeper.conf 2008-01-07 19:33:31.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/etckeeper.conf 2008-03-07
02:42:14.000000000 +0100
@@ -1,6 +1,7 @@
# The VCS to use.
# VCS="hg"
VCS="git"
+# VCS="bzr"
# Options passed to git commit when run by etckeeper.
#GIT_COMMIT_OPTIONS=""
@@ -8,6 +9,9 @@
# Options passed to hg commit when run by etckeeper.
#HG_COMMIT_OPTIONS=""
+# Options passed to bzr commit when run by etckeeper.
+#BZR_COMMIT_OPTIONS=""
+
# The high-level package manager that's being used.
HIGHLEVEL_PACKAGE_MANAGER=apt
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/init.d/40vcs-init
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/init.d/40vcs-init
--- etckeeper-0.11/init.d/40vcs-init 2008-01-04 22:32:13.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/init.d/40vcs-init 2008-03-07
02:29:49.000000000 +0100
@@ -8,4 +8,6 @@
hg init
echo "[web]" > .hg/hgrc
echo "description = $(hostname) /etc repository" >> .hg/hgrc
+elif [ "$VCS" = bzr ] && [ ! -e .bzr ]; then
+ bzr init
fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/init.d/50vcs-ignore
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/init.d/50vcs-ignore
--- etckeeper-0.11/init.d/50vcs-ignore 2008-02-11 06:42:59.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/init.d/50vcs-ignore 2008-03-07
02:32:43.000000000 +0100
@@ -5,6 +5,8 @@
file=.gitignore
elif [ "$VCS" = hg ] && [ ! -e .hgignore ]; then
file=.hgignore
+elif [ "$VCS" = bzr ] && [ ! -e .bzrignore ]; then
+ file=.bzrignore
fi
if [ -z "$file" ] || [ -e "$file" ]; then
@@ -24,7 +26,7 @@
glob="$1"
case "$VCS" in
- git)
+ git|bzr)
echo "$glob" >> $file
;;
hg)
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/init.d/50vcs-perm
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/init.d/50vcs-perm
--- etckeeper-0.11/init.d/50vcs-perm 2008-01-04 23:11:58.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/init.d/50vcs-perm 2008-03-07
02:29:49.000000000 +0100
@@ -5,4 +5,6 @@
chmod 700 .git
elif [ "$VCS" = hg ]; then
chmod 700 .hg
+elif [ "$VCS" = bzr ]; then
+ chmod 700 .bzr
fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/init.d/70vcs-add
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/init.d/70vcs-add
--- etckeeper-0.11/init.d/70vcs-add 2008-01-04 23:16:28.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/init.d/70vcs-add 2008-03-07
02:29:49.000000000 +0100
@@ -9,4 +9,8 @@
if ! hg add .; then
echo "etckeeper warning: hg add failed" >&2
fi
+elif [ "$VCS" = bzr ]; then
+ if ! bzr add .; then
+ echo "etckeeper warning: bzr add failed" >&2
+ fi
fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/pre-commit.d/20warn-hardlinks
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/pre-commit.d/20warn-hardlinks
--- etckeeper-0.11/pre-commit.d/20warn-hardlinks 2008-01-04
23:28:04.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/pre-commit.d/20warn-hardlinks
2008-03-07 02:29:49.000000000 +0100
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-if [ "$VCS" = git ] || [ "$VCS" = hg ]; then
+if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then
hardlinks=$(find -type f -not -links 1 | grep -v /.git/) || true
if [ -n "$hardlinks" ]; then
echo "etckeeper warning: hardlinked files could cause problems
with $VCS:" >&2
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/pre-commit.d/20warn-special-file
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/pre-commit.d/20warn-special-file
--- etckeeper-0.11/pre-commit.d/20warn-special-file 2008-01-04
23:28:43.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/pre-commit.d/20warn-special-file
2008-03-07 02:34:21.000000000 +0100
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-if [ "$VCS" = git ] || [ "$VCS" = hg ]; then
+if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then
special=$(find -not -type d -not -type f -not -type l | grep -v /.git/)
|| true
if [ -n "$special" ]; then
echo "etckeeper warning: special files could cause problems
with $VCS:" >&2
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/pre-commit.d/30store-metadata
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/pre-commit.d/30store-metadata
--- etckeeper-0.11/pre-commit.d/30store-metadata 2008-01-05
00:31:39.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/pre-commit.d/30store-metadata
2008-03-07 02:29:49.000000000 +0100
@@ -1,7 +1,7 @@
#!/bin/sh
set -e
-if [ "$VCS" = git ] || [ "$VCS" = hg ]; then
+if [ "$VCS" = git ] || [ "$VCS" = hg ] || [ "$VCS" = bzr ]; then; then
# Make sure the file is not readable by others, since it can leak
# information about contents of non-readable directories in /etc.
umask 077
@@ -20,7 +20,7 @@
if [ "$VCS" = git ]; then
git add .metadata
fi
- # hg add not done, hg will automatically include the file
- # in the current commit
+ # hg and bzr add not done, they will automatically
+ # include the file in the current commit
fi
fi
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/pre-install.d/50uncommitted-changes
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/pre-install.d/50uncommitted-changes
--- etckeeper-0.11/pre-install.d/50uncommitted-changes 2008-01-15
20:01:49.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/pre-install.d/50uncommitted-changes
2008-03-07 02:36:03.000000000 +0100
@@ -6,9 +6,17 @@
git status
elif [ "$VCS" = hg ]; then
hg status
+ elif [ "$VCS" = bzr ]; then
+ bzr status
fi
}
if [ "$1" = "ask-debconf" ]; then
. /usr/share/debconf/confmodule
db_capb escape
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/README
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/README
--- etckeeper-0.11/README 2008-01-15 19:14:46.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/README 2008-03-07 02:29:49.000000000
+0100
@@ -1,10 +1,11 @@
-etckeeper is a collection of tools to let /etc be stored in a git or
-mercurial repository. It hooks into apt to automatically commit changes
-made to /etc during package upgrades. It uses [metastore][1] to track file
-metadata that git does not normally support, but that is important for
-/etc, such as the permissions of `/etc/shadow`. It's quite modular and
-configurable, while also being simple to use if you understand the basics
-of working with version control.
+etckeeper is a collection of tools to let /etc be stored in a git,
+mercurial, or bazaar repository. It hooks into apt to automatically
+commit changes made to /etc during package upgrades. It uses
+[metastore][1] to track file metadata that git does not normally
+support, but that is important for /etc, such as the permissions of
+`/etc/shadow`. It's quite modular and configurable, while also being
+simple to use if you understand the basics of working with version
+control.
[1]: http://david.hardeman.nu/software.php
@@ -20,7 +21,7 @@
Since git mushes all the files into packs under the .git directory, the
whole .git directory content needs to be kept secret. (Ditto for mercurial
-and .hg)
+and .hg as well as bazaar and .bzr)
Also, since revision control systems don't keep track of the mode of files
like the shadow file, it will check out world readable, before etckeeper
@@ -44,24 +45,26 @@
limitations that etckeeper has to work around. These include file metadata
storage, empty directories, and special files.
-git and mercurial have only limited tracking of file metadata, being able
-to track the executable bit, but not other permissions or owner info. So
-file metadata storage is handled by `metastore`. Among other chores,
-`etckeeper init` sets up a `pre-commit` hook that uses `metastore` to store
-metadata about file owners, permissions, and even extended attributes into
-a `/etc/.metadata` file. This metadata is stored in git along with
-everything else, and can be applied if the repo should need to be checked
-back out.
+Most VCS, including git, mercurial and bazaar have only limited
+tracking of file metadata, being able to track the executable bit, but
+not other permissions or owner info. So file metadata storage is
+handled by `metastore`. Among other chores, `etckeeper init` sets up a
+`pre-commit` hook that uses `metastore` to store metadata about file
+owners, permissions, and even extended attributes into a
+`/etc/.metadata` file. This metadata is stored in git along with
+everything else, and can be applied if the repo should need to be
+checked back out.
git and mercurial cannot track empty directories, but they can be
significant sometimes in /etc. So the `pre-commit` hook also stores
information that can be used to recreate the empty directories in a
`/etc/.etckeeper` file.
-git and mercurial don't support several special files that you _probably_
-won't have in /etc, such as unix sockets, named pipes, hardlinked files
-(but softlinks are fine), and device files. The `pre-commit` hook will warn
-if your /etc contains such special files.
+Most VCS, including git, mercurial, and bazaar don't support several
+special files that you _probably_ won't have in /etc, such as unix
+sockets, named pipes, hardlinked files (but softlinks are fine), and
+device files. The `pre-commit` hook will warn if your /etc contains
+such special files.
## tutorial
@@ -70,7 +73,7 @@
First, edit `/etc/etckeeper/etckeeper.conf` to select which version control
system to use. The default is git, and this tutorial assumes you're using
-it. Mercurial is similar.
+it. Mercurial and bazaar are similar.
The `etckeeper init` command initialises an /etc/.git/ repository. This
command is careful to never overwrite existing files or directories in
diff -Nru /tmp/BAN4GGoHzn/etckeeper-0.11/unclean.d/50test
/tmp/NMagD95C3l/etckeeper-0.11ubuntu1~blueyedppa1/unclean.d/50test
--- etckeeper-0.11/unclean.d/50test 2008-01-15 20:25:36.000000000 +0100
+++ etckeeper-0.11ubuntu1~blueyedppa1/unclean.d/50test 2008-03-07
02:29:49.000000000 +0100
@@ -5,4 +5,6 @@
[ -d .git ] && ! LANG=C git status 2>&1 | grep -q "working directory
clean"
elif [ "$VCS" = hg ]; then
[ -d .hg ] && ! hg status 2>&1 | wc -l | grep -q "^0$"
+elif [ "$VCS" = bzr ]; then
+ [ -d .bzr ] && ! bzr status 2>&1 | wc -l | grep -q "^0$"
fi
--- End Message ---