]> Frank Brehm's Git Trees - config/bruni/etc.git/commitdiff
saving uncommitted changes in /etc prior to emerge run
authorFrank Brehm <frank@brehm-online.com>
Wed, 14 Oct 2015 09:36:53 +0000 (11:36 +0200)
committerFrank Brehm <root@bruni.home.brehm-online.com>
Wed, 14 Oct 2015 09:36:53 +0000 (11:36 +0200)
cron.daily/etckeeper [new file with mode: 0755]
etckeeper/._cfg0000_etckeeper.conf [new file with mode: 0644]

diff --git a/cron.daily/etckeeper b/cron.daily/etckeeper
new file mode 100755 (executable)
index 0000000..5255691
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+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
+               lockfile=/var/cache/etckeeper/packagelist.pre-install
+               if [ -e "$lockfile" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then
+                       rm -f "$lockfile" # stale
+               fi
+               if [ ! -e "$lockfile" ]; then
+                       AVOID_SPECIAL_FILE_WARNING=1
+                       export AVOID_SPECIAL_FILE_WARNING
+                       if etckeeper unclean; then
+                               etckeeper commit "daily autocommit" >/dev/null
+                       fi
+               fi
+       fi
+fi
diff --git a/etckeeper/._cfg0000_etckeeper.conf b/etckeeper/._cfg0000_etckeeper.conf
new file mode 100644 (file)
index 0000000..c1da4bf
--- /dev/null
@@ -0,0 +1,44 @@
+# The VCS to use.
+#VCS="hg"
+VCS="git"
+#VCS="bzr"
+#VCS="darcs"
+
+# Options passed to git commit when run by etckeeper.
+GIT_COMMIT_OPTIONS=""
+
+# Options passed to hg commit when run by etckeeper.
+HG_COMMIT_OPTIONS=""
+
+# Options passed to bzr commit when run by etckeeper.
+BZR_COMMIT_OPTIONS=""
+
+# Options passed to darcs record when run by etckeeper.
+DARCS_COMMIT_OPTIONS="-a"
+
+# Uncomment to avoid etckeeper committing existing changes
+# to /etc automatically once per day.
+#AVOID_DAILY_AUTOCOMMITS=1
+
+# Uncomment the following to avoid special file warning
+# (the option is enabled automatically by cronjob regardless).
+#AVOID_SPECIAL_FILE_WARNING=1
+
+# Uncomment to avoid etckeeper committing existing changes to 
+# /etc before installation. It will cancel the installation,
+# so you can commit the changes by hand.
+#AVOID_COMMIT_BEFORE_INSTALL=1
+
+# The high-level package manager that's being used.
+# (apt, pacman-g2, yum, zypper etc)
+# For gentoo this is emerge
+HIGHLEVEL_PACKAGE_MANAGER=emerge
+
+# The low-level package manager that's being used.
+# (dpkg, rpm, pacman, pacman-g2, etc)
+# For gentoo this is qlist
+LOWLEVEL_PACKAGE_MANAGER=qlist
+
+# To push each commit to a remote, put the name of the remote here.
+# (eg, "origin" for git).
+PUSH_REMOTE=""