Группа :: Разработка/Прочее
Пакет: etckeeper
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: etckeeper-0.50-alt5.M51.1.patch
Скачать
Скачать
.gear/merge | 1 +
.gear/rules | 2 +
.../tags/845e995d0ed5be4dd72d01ace21e529ba73567f2 | 23 ++
.gear/tags/list | 1 +
Makefile | 18 +-
apt.conf | 7 +-
debian/changelog | 9 +
debian/copyright | 2 +-
debian/cron.daily | 2 +-
debian/po/vi.po | 50 ++---
debian/prerm | 4 +-
etckeeper | 17 +-
etckeeper-origin.README | 33 +++
etckeeper-origin.conf | 1 +
etckeeper.8 | 6 +-
etckeeper.conf | 2 +-
etckeeper.spec | 224 +++++++++++++++-----
list-installed.d/50list-installed | 2 +-
pacman-g2.hook | 4 +-
post-install.d/50vcs-commit | 2 +-
post-install.d/90etckeeper-origin | 58 +++++
pre-commit.d/20warn-problem-files | 2 +-
pre-install.d/10packagelist | 5 +-
yum-etckeeper.py | 4 +-
24 files changed, 344 insertions(+), 135 deletions(-)
diff --git a/.gear/merge b/.gear/merge
new file mode 100644
index 0000000..e297d4d
--- /dev/null
+++ b/.gear/merge
@@ -0,0 +1 @@
+merge: upstream master
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..4fcfd99
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,2 @@
+tar: @version@:.
+diff: @version@:. .
diff --git a/.gear/tags/845e995d0ed5be4dd72d01ace21e529ba73567f2 b/.gear/tags/845e995d0ed5be4dd72d01ace21e529ba73567f2
new file mode 100644
index 0000000..7c166b8
--- /dev/null
+++ b/.gear/tags/845e995d0ed5be4dd72d01ace21e529ba73567f2
@@ -0,0 +1,23 @@
+object 351d3da2862ae71199d1342e3a78c50a3df967d1
+type commit
+tag 0.50
+tagger Joey Hess <joey@kitenet.net> 1287614155 -0400
+
+tagging version 0.50
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.10 (GNU/Linux)
+
+iQIVAwUATL9uy8kQ2SIlEuPHAQglRw/+PYNd8R3Nj5XiZqsoEPwHRQkfSXzZsAeb
+e7PSf6D/9YUNRRDzjo4Yg9e7onqZm3prPGxb3A9LyubYqURnOfwUp51bdFIEZjRb
+Ja05bdFFVYgFR5uI/BobuMxnVdT+s8SNNzovd4XU+7ixuKHd2rc08moPTFzWyP0b
+2qB8u/wsMSU6fkkOYJkcbfs6/MJKC3HzjFWOhHPJjhzogeat+dzOsk0CQ00dQ0DB
+4rJbtUzX7g8vBdy434J0j8q9iqP4dzvCcGgXh4QPYeD7WqEglmBiCc0w1InCa8ql
+iJvsRZtFMo79fUu/meAY0XsJ9XB5UW7M9Qg6jTFxoh/2JWLdyYRA9fY7XJXgv4A5
+6Gw2M6P4PTZZNBgo1PPvl5Q0bFNqeITzDylpozFZ3O2cKB5kWFglVeKSiRhmjbRQ
+eqpplYliyewZIDjGv2KPTqH7pGtWE8QojHnyuFIDvOcsXWN4wMb7Z1cU2siQrjPR
+iYmPrlMJRl1/FbyHZW+CfkcPm1cUUPPmk89jx7CQlWYBCzmDVldrB0OwCEKmLUvs
+YlTokah8hYcXMu9XIAavXKxmW8V30/PDc/vtt0yKlNpiAKeAgRyTvz5npspZA1wa
+EzH/4sA8em7NiaehThgiSrhkXmM9cC3pOcfFgEQQvDG8Bi4yg0vGNTTqzGJntgrL
+emHUGut/B+E=
+=bo2i
+-----END PGP SIGNATURE-----
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..ba8ee0e
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+845e995d0ed5be4dd72d01ace21e529ba73567f2 0.50
diff --git a/Makefile b/Makefile
index 38cc49b..9e941e2 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,11 @@
CONFFILE=etckeeper.conf
include $(CONFFILE)
+ORIGINCONFFILE=etckeeper-origin.conf
+
DESTDIR?=
prefix=/usr
-sbindir=${prefix}/sbin
+bindir=${prefix}/bin
etcdir=/etc
mandir=${prefix}/share/man
vardir=/var
@@ -14,18 +16,19 @@ INSTALL=install
INSTALL_EXE=${INSTALL} -D
INSTALL_DATA=${INSTALL} -m 0644 -D
-build: etckeeper.spec
+build:
-./etckeeper-bzr/__init__.py build || echo "** bzr support not built"
install:
mkdir -p $(DESTDIR)$(etcdir)/etckeeper/ $(DESTDIR)$(vardir)/cache/etckeeper/
cp -dR *.d $(DESTDIR)$(etcdir)/etckeeper/
$(INSTALL_DATA) $(CONFFILE) $(DESTDIR)$(etcdir)/etckeeper/etckeeper.conf
- $(INSTALL_EXE) etckeeper $(DESTDIR)$(sbindir)/etckeeper
+ $(INSTALL_DATA) $(ORIGINCONFFILE) $(DESTDIR)$(etcdir)/etckeeper/$(ORIGINCONFFILE)
+ $(INSTALL_EXE) etckeeper $(DESTDIR)$(bindir)/etckeeper
$(INSTALL_DATA) etckeeper.8 $(DESTDIR)$(mandir)/man8/etckeeper.8
$(INSTALL_DATA) bash_completion $(DESTDIR)$(etcdir)/bash_completion.d/etckeeper
ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),apt)
- $(INSTALL_DATA) apt.conf $(DESTDIR)$(etcdir)/apt/apt.conf.d/05etckeeper
+ $(INSTALL_DATA) apt.conf $(DESTDIR)$(etcdir)/apt/apt.conf.d/etckeeper.conf
mkdir -p $(DESTDIR)$(etcdir)/cruft/filters-unex
$(INSTALL_DATA) cruft_filter $(DESTDIR)$(etcdir)/cruft/filters-unex/etckeeper
endif
@@ -39,11 +42,6 @@ endif
-./etckeeper-bzr/__init__.py install --root=$(DESTDIR) || echo "** bzr support not installed"
echo "** installation successful"
-clean: etckeeper.spec
+clean:
rm -rf build
-etckeeper.spec:
- sed -i~ "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)/" etckeeper.spec
- rm -f etckeeper.spec~
-
-.PHONY: etckeeper.spec
diff --git a/apt.conf b/apt.conf
index 30ac586..f2bda8a 100644
--- a/apt.conf
+++ b/apt.conf
@@ -1,5 +1,2 @@
-DPkg::Pre-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper pre-install; fi"; };
-DPkg::Post-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper post-install; fi"; };
-
-RPM::Pre-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper pre-install; fi"; };
-RPM::Post-Invoke { "if [ -x /usr/sbin/etckeeper ]; then etckeeper post-install; fi"; };
+RPM::Pre-Install-Pkgs { "xargs| (if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi)"; };
+RPM::Post-Invoke { "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi"; };
diff --git a/debian/changelog b/debian/changelog
index 932214c..432ad79 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+etckeeper (0.51) UNRELEASED; urgency=low
+
+ * Updated Vietnamese translation of debconf templates. Closes: #601921
+ * Improve rpm version change detection.
+ * Move etckeeper out of sbin, to avoid needing to work around broken
+ root PATH settings in eg, crontab. Closes: #602438
+
+ -- Joey Hess <joeyh@debian.org> Sat, 30 Oct 2010 23:53:51 -0400
+
etckeeper (0.50) unstable; urgency=low
* Add Danish translation of debconf templates. Closes: #597768
diff --git a/debian/copyright b/debian/copyright
index 36a8d76..5f5233a 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,5 +1,5 @@
Files: *
-Copyright: б╘ 2007-2008 Joey Hess <joey@kitenet.net>
+Copyright: б╘ 2007-2010 Joey Hess <joey@kitenet.net>
License: GPL-2+
The full text of the GPL is distributed as doc/GPL in etckeeper's source,
and is distributed in /usr/share/common-licenses/GPL-2 on Debian systems.
diff --git a/debian/cron.daily b/debian/cron.daily
old mode 100644
new mode 100755
index e83b570..91e2ed4
--- a/debian/cron.daily
+++ b/debian/cron.daily
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
-if [ -x /usr/sbin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
+if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
. /etc/etckeeper/etckeeper.conf
if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
# avoid autocommit if an install run is in progress
diff --git a/debian/po/vi.po b/debian/po/vi.po
index 5d92440..4a75241 100644
--- a/debian/po/vi.po
+++ b/debian/po/vi.po
@@ -1,76 +1,54 @@
# Vietnamese translation for ETC Keeper.
-# Copyright б╘ 2007 Free Software Foundation, Inc.
-# Clytie Siddall <clytie@riverland.net.au>, 2007
+# Copyright б╘ 2010 Free Software Foundation, Inc.
+# Clytie Siddall <clytie@riverland.net.au>, 2007-2010.
#
msgid ""
msgstr ""
-"Project-Id-Version: etckeeper 0.3\n"
+"Project-Id-Version: etckeeper 0.50\n"
"Report-Msgid-Bugs-To: etckeeper@packages.debian.org\n"
"POT-Creation-Date: 2009-05-06 14:41-0400\n"
-"PO-Revision-Date: 2007-12-21 22:43+1030\n"
+"PO-Revision-Date: 2010-10-31 13:59+1030\n"
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: LocFactoryEditor 1.7b1\n"
+"X-Generator: LocFactoryEditor 1.8\n"
+#: ../templates:2001
#. Type: error
#. Description
-#: ../templates:2001
msgid "Commit failed"
msgstr "LА╩≈i ghi chц╘p"
+#: ../templates:2001
#. Type: error
#. Description
-#: ../templates:2001
-#, fuzzy
#| msgid "An attempt to commit /etc changes to git failed."
msgid "An attempt to commit /etc changes to ${VCS} failed."
-msgstr "GА╨╥p lА╩≈i khi thА╩╜ ghi vц═o git cц║c thay д▒А╩∙i trong б╚ /etc б╩."
+msgstr "GА╨╥p lА╩≈i khi thА╩╜ ghi chц╘p vц═o ${VCS} cц║c thay д▒А╩∙i trong б╚ /etc б╩."
+#: ../templates:2001
#. Type: error
#. Description
-#: ../templates:2001
msgid ""
"You may manually resolve the issues with the uncommitted changes before "
"continuing."
msgstr ""
-"BА╨║n vА╨╚n cцЁ thА╩┐ tА╩╠ giА╨ёi quyА╨©t cц║c vА╨╔n д▒А╩│ vА╩│ cц║c thay д▒А╩∙i chф╟a ghi chц╘p, trф╟А╩⌡c "
-"khi tiА╨©p tА╩╔c."
+"BА╨║n cе╘ng cцЁ thА╩┐ tА╩╠ giА╨ёi quyА╨©t vА╨╔n д▒А╩│ vА╩│ cц║c thay д▒А╩∙i chф╟a ghi chц╘p, trф╟А╩⌡c khi tiА╨©p tА╩╔c."
+#: ../templates:3001
#. Type: boolean
#. Description
-#: ../templates:3001
msgid "Remove etckeeper ${VCS} repository and associated files?"
-msgstr ""
+msgstr "GА╩║ bА╩▐ kho lф╟u ${VCS} etckeeper vц═ cц║c tА╨╜p tin tф╟ф║ng А╩╘ng ?"
+#: ../templates:3001
#. Type: boolean
#. Description
-#: ../templates:3001
msgid ""
"Etckeeper is being purged from the system, and was used to store /etc in a "
"${VCS} repository. If you choose to remove the repository, this will DESTROY "
"all history etckeeper has recorded for /etc."
-msgstr ""
-
-#, fuzzy
-#~| msgid "Commit changed files in /etc to git?"
-#~ msgid "Commit changed files in /etc to ${VCS}?"
-#~ msgstr "Ghi vц═o git cц║c tА╨╜p tin bА╩▀ thay д▒А╩∙i trong б╚ /etc б╩ khц╢ng?"
-
-#, fuzzy
-#~| msgid ""
-#~| "The /etc directory contains uncommitted files or other changes. It's "
-#~| "best for all files in /etc to be committed to git before running APT. "
-#~| "Added and changed files listed below can be committed automatically:"
-#~ msgid ""
-#~ "The /etc directory contains uncommitted files or other changes. It's best "
-#~ "for all files in /etc to be committed to ${VCS} before running APT. Added "
-#~ "and changed files listed below can be committed automatically:"
-#~ msgstr ""
-#~ "Thф╟ mА╩╔c б╚ /etc б╩ chА╩╘a cц║c tА╨╜p tin hay thay д▒А╩∙i khц║c mц═ chф╟a ghi chц╘p. TА╩▒t "
-#~ "nhА╨╔t nА╨©u mА╩█i tА╨╜p tin trong б╚ /etc б╩ д▒ф╟А╩ёc ghi chц╘p, trф╟А╩⌡c khi chА╨║y APT. CцЁ "
-#~ "thА╩┐ tА╩╠ д▒А╩≥ng ghi chц╘p cц║c tА╨╜p tin д▒ф╟А╩ёc thц╙m vц═ bА╩▀ thay д▒А╩∙i trong danh sц║ch "
-#~ "bц╙n dф╟А╩⌡i:"
+msgstr "GцЁi etckeeper д▒ang bА╩▀ tА╨╘y khА╩▐i hА╩┤ thА╩▒ng: nцЁ tА╩╚ng д▒ф╟А╩ёc sА╩╜ dА╩╔ng д▒А╩┐ lф╟u trА╩╞ б╚ /etc б╩ vц═o mА╩≥t kho ${VCS}. SА╩╠ chА╩█n gА╩║ bА╩▐ kho lф╟u nц═y thц╛ HА╩╕Y toц═n bА╩≥ lА╩▀ch sА╩╜ д▒ф╟А╩ёc etckeeper giА╩╞ д▒А╩▒i vА╩⌡i б╚ /etc б╩."
diff --git a/debian/prerm b/debian/prerm
index 806053a..e13f086 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -13,7 +13,7 @@ if [ "$1" = remove ]; then
if [ -d /etc/etckeeper/uninit.d ]; then
cp -a /etc/etckeeper/uninit.d /var/cache/etckeeper/stash
fi
- if [ -x /usr/sbin/etckeeper ]; then
- cp -a /usr/sbin/etckeeper /var/cache/etckeeper/stash
+ if [ -x /usr/bin/etckeeper ]; then
+ cp -a /usr/bin/etckeeper /var/cache/etckeeper/stash
fi
fi
diff --git a/etckeeper b/etckeeper
index 483e16e..43f7013 100755
--- a/etckeeper
+++ b/etckeeper
@@ -4,6 +4,7 @@ set -e
if [ -z "$ETCKEEPER_CONF_DIR" ]; then
ETCKEEPER_CONF_DIR=/etc/etckeeper
fi
+export ETCKEEPER_CONF_DIR
conf="$ETCKEEPER_CONF_DIR/etckeeper.conf"
@@ -84,15 +85,11 @@ fi
cd "$ETCKEEPER_DIR"
export ETCKEEPER_DIR
-lsscripts() {
- perl -e '
- $dir=shift;
- print join "\n", grep { ! -d $_ && -x $_ }
- grep /^\Q$dir\/\E[-a-zA-Z0-9]+$/,
- glob "$dir/*";
- ' "$1"
-}
-
-for script in $(lsscripts "$ETCKEEPER_CONF_DIR/$command.d"); do
+for script in $ETCKEEPER_CONF_DIR/$command.d/*; do
+ [ -x "$script" ] || continue
+ [ ! -d "$script" ] || continue
+ echo "$script" | grep -E "^$ETCKEEPER_CONF_DIR/$command.d/[-a-zA-Z0-9]+$" >/dev/null 2>&1 || continue
+ # Don't run *.rpm* and *~ scripts
+ [ "${script%.rpm*}" = "$script" -a "${script%\~}" = "$script" ] || continue
"$script" "$@"
done
diff --git a/etckeeper-origin.README b/etckeeper-origin.README
new file mode 100644
index 0000000..ab65dfc
--- /dev/null
+++ b/etckeeper-origin.README
@@ -0,0 +1,33 @@
+This is etckeeper-origin, git-based (feel free to add your favorite
+VCS support), rpm-oriented addon to etckeeper.
+
+What it does: after installing/uninstalling/upgrading and committing
+changes to /etc it find *.rpmnew files and moves to "origin" branch
+(configurable in /etc/etckeeper/etckeeper-origin.conf). I.e., it moves
+foo.conf.rpmnew in "master" branch to foo.conf in "origin" branch to
+unclutter working branch and let you do some like "git diff origin
+master -- foo.conf".
+
+How to create "origin" branch:
+
+a) Manual, at system installation:
+ /etc# apt-get install etckeeper
+ /etc# etckeeper init
+ /etc# git status
+ /etc# git commit -m "Initial commit"
+ /etc# git checkout -b origin
+ /etc# git checkout master
+
+b) Semi-automatic: If at launch of etckeeper-origin (from post-install
+ hook) there is no "origin" branch, it will be created from current
+ master. That way, only newly appeared original configuration files
+ will be committed in "origin" branch.
+
+c) You may, of course, write your own tricky script that extract all
+original configuration files from noarch/binary rpm files and commit
+it in "origin", but in such case, dont forget to drop me are copy.
+
+
+Send bugreports to https://bugzilla.altlinux.org
+
+WBR, <evg@altlinux.org>
diff --git a/etckeeper-origin.conf b/etckeeper-origin.conf
new file mode 100644
index 0000000..0999584
--- /dev/null
+++ b/etckeeper-origin.conf
@@ -0,0 +1 @@
+ORIGIN=origin
diff --git a/etckeeper.8 b/etckeeper.8
index a49c4b6..6d328e4 100644
--- a/etckeeper.8
+++ b/etckeeper.8
@@ -29,14 +29,14 @@ This is called as a pre-commit hook. It stores metadata and does sanity
checks.
.TP
.B pre-install
-This is called by apt's DPkg::Pre-Install-Pkgs hook, or by equivalent hooks
+This is called by apt's RPM::Pre-Install-Pkgs hook, or by equivilant hooks
of other package managers. It allows committing any uncommitted changes before
packages are installed, upgraded, etc.
.TP
.B post-install
-This is called by apt's DPkg::Post-Invoke hook, or by equivalent hooks
+This is called by apt's RPM::Post-Invoke hook, or by equivilant hooks
of other package managers. It commits changes made by packages into the
-repository. (You can also call this by hand after running dpkg by hand.)
+repository. (You can also call this by hand after running apt/rpm by hand.)
.TP
.B unclean
This returns true if the directory contains uncommitted changes.
diff --git a/etckeeper.conf b/etckeeper.conf
index be8934d..2e546db 100644
--- a/etckeeper.conf
+++ b/etckeeper.conf
@@ -31,4 +31,4 @@ HIGHLEVEL_PACKAGE_MANAGER=apt
# The low-level package manager that's being used.
# (dpkg, rpm, pacman-g2, etc)
-LOWLEVEL_PACKAGE_MANAGER=dpkg
+LOWLEVEL_PACKAGE_MANAGER=rpm
diff --git a/etckeeper.spec b/etckeeper.spec
index 81b6842..eeeae74 100644
--- a/etckeeper.spec
+++ b/etckeeper.spec
@@ -1,75 +1,185 @@
+%define _unpackaged_files_terminate_build 1
+
Name: etckeeper
Version: 0.50
-Release: 4%{?dist}
-Summary: store /etc in git, mercurial, bzr or darcs
+Release: alt5.M51.1
-Group: System Tools
-License: GPLv2
-URL: http://kitenet.net/~joey/code/etckeeper/
-Source0: http://ftp.debian.org/debian/pool/main/e/etckeeper/%{name}_%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Summary: Etckeeper help to keep your /etc directory in VCS repository
+License: GPL2+
+Group: Development/Other
+Url: http://kitenet.net/~joey/code/etckeeper/
+Source: %name-%version.tar
+Patch: %name-%version-%release.patch
+BuildArch: noarch
+AutoReq: yes,noshell
+Requires: coreutils diffutils findutils git-core grep sh
-Requires: git >= 1.6.1-1
-Obsoletes: etckeeper = snapshot, yum-etckeeper
+Packager: Evgenii Terechkov <evg@altlinux.org>
%description
-The etckeeper program is a tool to let /etc be stored in a git,
-mercurial, bzr or darcs repository. It hooks into yum to automatically
-commit changes made to /etc during package upgrades. It tracks 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.
-
-%prep
-%setup -q -n %{name}
-%{__perl} -pi -e '
- s|HIGHLEVEL_PACKAGE_MANAGER=apt|HIGHLEVEL_PACKAGE_MANAGER=yum|;
- s|LOWLEVEL_PACKAGE_MANAGER=dpkg|LOWLEVEL_PACKAGE_MANAGER=rpm|;
- ' %{_builddir}/%{name}/etckeeper.conf
+etckeeper is a collection of tools to let /etc be stored in a VCS
+repository. It hooks into apt/yum/packman/etc to automatically commit
+changes made to /etc during package upgrades. It's quite modular and
+configurable, while also being simple to use if you understand the
+basics of working with VCS.
+%package origin
+Summary: Helper to store original configs from rpm files in separate git branch
+Group: Development/Other
+Requires: %name = %version-%release
-%build
-make %{?_smp_mflags}
+%description origin
+etckeeper-origin is helper to store original configs from rpm files in
+separate git branch
+%prep
+%setup
+%patch -p1
+%build
%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-install -D debian/cron.daily $RPM_BUILD_ROOT/etc/cron.daily/etckeeper
+make install DESTDIR=%buildroot
+install -D debian/cron.daily %buildroot%_sysconfdir/cron.daily/%name
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+# We dont want bzr now:
+rm -rf %buildroot%_libdir/python*
+# There is no cruft package for ALT:
+rm -rf %buildroot%_sysconfdir/cruft
%post
-%{_sbindir}/etckeeper init -d /etc/
-mkdir -p %{_var}/cache/etckeeper
+if [ -e %_sysconfdir/.git/hooks/pre-commit ] && egrep '^(/us[rb]/s?bin/)?%name' %_sysconfdir/.git/hooks/pre-commit >/dev/null 2>&1; then
+ echo "Replacing path to etckeeper in %_sysconfdir/.git/hooks/pre-commit"
+ sed -i 's!^/usr/sbin/etckeeper!etckeeper!;s!^/usr/bin/etckeeper!etckeeper!;s!^/usb/sbin/etckeeper!etckeeper!' %_sysconfdir/.git/hooks/pre-commit
+fi
%files
-%defattr(-,root,root,-)
-%doc GPL INSTALL TODO README
-%{_sbindir}/*
-%{_mandir}/*
-# this isn't very clever and its a manual process update.
-# but it works
-%config(noreplace) /etc/yum/pluginconf.d/etckeeper.conf
-%config(noreplace) /etc/etckeeper/etckeeper.conf
-/etc/etckeeper/*.d/*
-/etc/cron.daily/etckeeper
-/etc/bash_completion.d/etckeeper
-%{_prefix}/lib/*
+%_bindir/%name
+%_sysconfdir/%name
+%config(noreplace) %_sysconfdir/%name/%name.conf
+%exclude %_sysconfdir/%name/%name-origin.conf
+%exclude %_sysconfdir/%name/post-install.d/90%name-origin
+%_sysconfdir/apt/apt.conf.d/%name.conf
+%_man8dir/%{name}.*
+%_sysconfdir/bash_completion.d/%name
+%_cachedir/%name
+%_sysconfdir/cron.daily/%name
+%doc README TODO
+
+%files origin
+%config(noreplace) %_sysconfdir/%name/%name-origin.conf
+%attr(755,root,root) %_sysconfdir/%name/post-install.d/90%name-origin
+%doc etckeeper-origin.README
%changelog
-* Fri Feb 27 2009 Jimmy Tang <jtang@tchpc.tcd.ie> - 0.33-4
-- fix up initial install to make directory in /var/cache/etckeeper
-- install the etckeeper daily cron job
-- define some config files that shouldn't be replaced, should the hooks
-in commit.d, init.d etc... saved and not blown away? if so they can
-defined as config files. etckeeper should record the changes anyway.
-
-* Wed Feb 25 2009 Jimmy Tang <jtang@tchpc.tcd.ie> - 0.32-1
-- yum etckeeper plugin is now apart of this package
-
-* Tue Feb 24 2009 Jimmy Tang <jtang@tchpc.tcd.ie> - 0.31-1
-- initial package
+* Wed Dec 08 2010 Vladimir V. Kamarzin <vvk@altlinux.org> 0.50-alt5.M51.1
+- Rebuild for 5.1
+
+* Tue Dec 7 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt6
+- Workaround for #24678
+
+* Wed Dec 1 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt5.1
+- Fixup postin script
+
+* Wed Dec 1 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt5
+- git-20101201 (workaround for #24479)
+
+* Thu Nov 11 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt4
+- etckeeper-origin
+
+* Sun Nov 7 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt3
+- Futher filter out alt-specific hardlinked files complains
+
+* Mon Oct 25 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt2
+- Drop useless /etc/skel* complains
+
+* Sun Oct 24 2010 Terechkov Evgenii <evg@altlinux.org> 0.50-alt1
+- 0.50
+
+* Tue Sep 14 2010 Terechkov Evgenii <evg@altlinux.org> 0.49-alt1
+- 0.49
+
+* Sat Jul 17 2010 Terechkov Evgenii <evg@altlinux.ru> 0.48-alt1
+- 0.48
+
+* Mon May 31 2010 Terechkov Evgenii <evg@altlinux.ru> 0.47-alt1
+- 0.47
+
+* Mon May 17 2010 Terechkov Evgenii <evg@altlinux.ru> 0.46-alt1
+- 0.46
+
+* Fri Apr 16 2010 Terechkov Evgenii <evg@altlinux.ru> 0.45-alt1
+- 0.45
+
+* Thu Apr 15 2010 Terechkov Evgenii <evg@altlinux.ru> 0.44-alt1
+- 0.44
+
+* Fri Feb 19 2010 Terechkov Evgenii <evg@altlinux.ru> 0.43-alt1
+- 0.43
+
+* Fri Oct 2 2009 Terechkov Evgenii <evg@altlinux.ru> 0.41-alt2
+- Package list generation fixed
+
+* Sun Sep 27 2009 Terechkov Evgenii <evg@altlinux.ru> 0.41-alt1
+- 0.41
+
+* Thu Aug 27 2009 Terechkov Evgenii <evg@altlinux.ru> 0.40-alt1
+- 0.40
+
+* Thu Jul 9 2009 Terechkov Evgenii <evg@altlinux.ru> 0.38-alt1
+- 0.38
+
+* Sat Jul 4 2009 Terechkov Evgenii <evg@altlinux.ru> 0.37-alt2
+- Document ETCKEEPER_CONF_DIR in man page (ALT #20587)
+- Description updated
+
+* Tue Jun 9 2009 Terechkov Evgenii <evg@altlinux.ru> 0.37-alt1
+- 0.37
+
+* Sun May 17 2009 Terechkov Evgenii <evg@altlinux.ru> 0.36-alt1
+- 0.36
+
+* Thu May 14 2009 Terechkov Evgenii <evg@altlinux.ru> 0.35-alt2
+- Typo fixed (ALT #20038)
+- Dont require perl anymore
+- Dont build bzr plugin (requires python)
+
+* Thu May 7 2009 Terechkov Evgenii <evg@altlinux.ru> 0.35-alt1
+- 0.35
+
+* Thu Apr 16 2009 Terechkov Evgenii <evg@altlinux.ru> 0.34-alt4
+- Upgrade from etckeeper < 0.34-alt2 fixed (ALT #19638)
+
+* Thu Apr 2 2009 Terechkov Evgenii <evg@altlinux.ru> 0.34-alt3
+- Paths in precommit hook fixed
+
+* Wed Apr 1 2009 Terechkov Evgenii <evg@altlinux.ru> 0.34-alt2
+- Cron paths fixed
+
+* Sat Mar 21 2009 Terechkov Evgenii <evg@altlinux.ru> 0.34-alt1
+- 0.34
+
+* Sun Feb 8 2009 Terechkov Evgenii <evg@altlinux.ru> 0.27-alt1.1
+- Stupid typo in apt conf fixed
+
+* Sun Feb 8 2009 Terechkov Evgenii <evg@altlinux.ru> 0.27-alt1
+- 0.27
+
+* Sat Sep 20 2008 Terechkov Evgenii <evg@altlinux.ru> 0.21-alt1
+- 0.21
+
+* Sat Jul 19 2008 Terechkov Evgenii <evg@altlinux.ru> 0.20-alt1
+- 0.20
+- Patch updated (obsoleted code removed, package list support for RPM added)
+- Obsoleted fix removed from spec
+
+* Sat Mar 22 2008 Terechkov Evgenii <evg@altlinux.ru> 0.12-alt1
+- 0.12
+
+* Sun Feb 10 2008 Terechkov Evgenii <evg@altlinux.ru> 0.10-alt2
+- Unneeded patches removed
+
+* Sat Feb 9 2008 Terechkov Evgenii <evg@altlinux.ru> 0.10-alt1
+- 0.10
+
+* Wed Jan 2 2008 Terechkov Evgenii <evg@altlinux.ru> 0.6-alt0
+- Initial build for ALT Linux Sisyphus
diff --git a/list-installed.d/50list-installed b/list-installed.d/50list-installed
index 177a6c2..f3f4eed 100755
--- a/list-installed.d/50list-installed
+++ b/list-installed.d/50list-installed
@@ -6,5 +6,5 @@ if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \
egrep '(ok installed|ok config-files)' | cut -f2,3
elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
- rpm -qa --queryformat "%{name} %{version} %{arch}\n" | sort
+ rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
fi
diff --git a/pacman-g2.hook b/pacman-g2.hook
index bd93d73..ac2e099 100644
--- a/pacman-g2.hook
+++ b/pacman-g2.hook
@@ -1,13 +1,13 @@
#!/bin/sh
pre_sysupgrade() {
- if [ -x /usr/sbin/etckeeper ]; then
+ if [ -x /usr/bin/etckeeper ]; then
etckeeper pre-install
fi
}
post_sysupgrade() {
- if [ -x /usr/sbin/etckeeper ]; then
+ if [ -x /usr/bin/etckeeper ]; then
etckeeper post-install
fi
}
diff --git a/post-install.d/50vcs-commit b/post-install.d/50vcs-commit
index 7710c4a..b658f33 100755
--- a/post-install.d/50vcs-commit
+++ b/post-install.d/50vcs-commit
@@ -19,5 +19,5 @@ if etckeeper unclean; then
fi
if [ -e $pl.pre-install ]; then
- rm -f $pl.pre-install
+ rm -f $pl.pre-install ||: # rm -f return 1 in file exist, but permission denied
fi
diff --git a/post-install.d/90etckeeper-origin b/post-install.d/90etckeeper-origin
new file mode 100755
index 0000000..a642c6f
--- /dev/null
+++ b/post-install.d/90etckeeper-origin
@@ -0,0 +1,58 @@
+#!/bin/sh
+set -e
+
+# cache directory
+CD=/var/cache/etckeeper
+
+# Get config
+conf="$ETCKEEPER_CONF_DIR/etckeeper-origin.conf"
+
+if [ -e $conf ]; then
+ . $conf
+fi
+if [ -z "$ORIGIN" ]; then
+ ORIGIN=origin
+fi
+CDO="$CD/$ORIGIN"
+
+if [ -z "$ETCKEEPER_DIR" ]; then
+ echo "etckeeper-origin cant work without ETCKEEPER_DIR variable, exiting..." >&2
+ exit 1
+fi
+
+
+# Check that rpmnew files exists and all changes already committed
+FILES=`find $ETCKEEPER_DIR -name '*.rpmnew'`
+if [ -z "$FILES" ]; then
+ exit 0
+fi
+
+if etckeeper unclean; then
+ echo "etckeeper-origin cant work with uncommitted changes, exiting..." >&2
+ exit 1
+fi
+
+# Make temporary copy of rpmnew files
+mkdir -p $CDO # it is possible to override CD in conf
+rsync -am --del --include='*.rpmnew' -f 'hide,! */' $ETCKEEPER_DIR/ $CDO/
+for i in `find $CDO -type f`;do mv $i ${i/.rpmnew/};done
+
+# Main work
+BRANCH=`git branch |grep -E '^\*'|head -1|cut -d' ' -f2`
+if git branch|grep -F $ORIGIN >/dev/null 2>&1; then
+ git checkout -q $ORIGIN
+else
+ git checkout -q -b $ORIGIN
+fi
+rsync -am $CDO/ $ETCKEEPER_DIR/
+
+if etckeeper unclean; then
+ if etckeeper commit "Saving new original config files"; then
+ git checkout -q $BRANCH
+ for i in "$FILES";do rm -f $i;done # Remove rpmnew from master
+ rm -rf $CDO
+ else
+ echo "error: etckeeper failed to commit changes in /etc using $VCS"
+ exit 1
+ fi
+fi
diff --git a/pre-commit.d/20warn-problem-files b/pre-commit.d/20warn-problem-files
index 3e9e476..e0a6064 100755
--- a/pre-commit.d/20warn-problem-files
+++ b/pre-commit.d/20warn-problem-files
@@ -2,7 +2,7 @@
set -e
exclude_internal () {
- grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/'
+ grep -Ev '/\(.git\|.hg\|.bzr\|_darcs\)/|^services$|^hosts$|^localtime$|^resolv.conf$|^skel[/.]|^host.conf$|^nsswitch.conf$'
}
if [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then
diff --git a/pre-install.d/10packagelist b/pre-install.d/10packagelist
index e5fefa8..b4473c2 100755
--- a/pre-install.d/10packagelist
+++ b/pre-install.d/10packagelist
@@ -1,4 +1,5 @@
#!/bin/sh
# This list will be later used when committing.
-mkdir -p /var/cache/etckeeper/
-etckeeper list-installed > /var/cache/etckeeper/packagelist.pre-install
+list=/var/cache/etckeeper/packagelist.pre-install
+mkdir -p "`dirname $list`" 2>/dev/null && touch $list 2>/dev/null || exit 0 # for non-root usage
+etckeeper list-installed > $list
diff --git a/yum-etckeeper.py b/yum-etckeeper.py
index 7a0394b..bdf9773 100644
--- a/yum-etckeeper.py
+++ b/yum-etckeeper.py
@@ -25,12 +25,12 @@ plugin_type = (TYPE_CORE,)
def pretrans_hook(conduit):
conduit.info(2, 'etckeeper: pre transaction commit')
- servicecmd = conduit.confString('main', 'servicecmd', '/usr/sbin/etckeeper')
+ servicecmd = conduit.confString('main', 'servicecmd', '/usr/bin/etckeeper')
command = '%s %s' % (servicecmd, " pre-install")
os.system(command)
def posttrans_hook(conduit):
conduit.info(2, 'etckeeper: post transaction commit')
- servicecmd = conduit.confString('main', 'servicecmd', '/usr/sbin/etckeeper')
+ servicecmd = conduit.confString('main', 'servicecmd', '/usr/bin/etckeeper')
command = '%s %s' % (servicecmd, "post-install")
os.system(command)